Commit 210bc490 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Migration to the major version plugin_dbui 0.6.0.2 and ExtJS 4.2.1.

parent c6b881ad
......@@ -16,8 +16,10 @@ uploads/
models/plugin_dbui.py
modules/plugin_dbui
static/docs/epydoc/
static/plugin_ace
static/plugin_dbui
static/plugin_extjs
static/plugin_mathjax
static/track-publication*.js
views/plugin_dbui
controllers/plugin_dbui.py
......@@ -2,7 +2,7 @@
"""
@auth.requires_login()
# @auth.requires_login()
def index():
# login procedure is active
......@@ -19,5 +19,4 @@ def index():
else:
session.role = ADMIN
return LOAD('plugin_dbui', 'index', vars=request.vars)
......@@ -19,6 +19,7 @@ def documentations():
di["epydoc_dbui"] = URL('static', 'plugin_dbui/docs/epydoc/index.html')
di["epydoc_track_publication"] = URL('static', 'docs/epydoc/index.html')
di["js_mathjax"] = URL('static', 'plugin_mathjax/docs/html/index.html')
di["jsduck_dbui"] = URL('static', 'plugin_dbui/docs/jsduck/index.html')
di["png_db"] = URL('static', 'docs/database.png')
return di
......
......@@ -96,11 +96,6 @@ def run():
selector = Selector(virtdb.harvester_selector,
exclude_fields=('mode', 'year_start', 'year_end'))
# download the result of the processing in a given format
iframe = selector.download()
if iframe:
return iframe
tool_class = get_harvester_tool(selector.controller)
if not tool_class:
return T('Select an harvester.')
......@@ -135,10 +130,6 @@ def run_all():
selector = Selector(virtdb.run_all_harvesters_selector,
exclude_fields=('mode', 'year_start', 'year_end'))
iframe = selector.download()
if iframe:
return iframe
query = None
for fieldname in ('id_teams', 'id_projects'):
if selector[fieldname]:
......
......@@ -23,18 +23,15 @@ def index():
# the selector fields year_start, year_end, id_lists are excluded
# from the selector query.
selector = Selector(virtdb.list_selector,
exclude_fields=('author', 'year_start', 'year_end', 'id_lists'),
extfield='format')
exclude_fields=('author',
'year_start',
'year_end',
'id_lists'))
# protection
if not selector.id_lists:
return MSG_NO_LIST
# download list as a file with a given format
iframe = selector.download()
if iframe:
return iframe
# retrieve the list data
list = db.lists[selector.id_lists]
......
......@@ -20,18 +20,14 @@ def index():
# the selector fields year_start, year_end, id_lists are excluded
# from the selector query.
selector = Selector(virtdb.metric_selector,
exclude_fields=('year_start', 'year_end', 'id_metrics'),
extfield='format')
exclude_fields=('year_start',
'year_end',
'id_metrics'))
# protection
if not selector.id_metrics:
return MSG_NO_METRIC
# download metric as a file with a given format
iframe = selector.download()
if iframe:
return iframe
# retrieve metric data
metric = db.metrics[selector.id_metrics]
......
......@@ -29,11 +29,6 @@ def check_validate():
# get user requirement
selector = Selector(virtdb.check_selector, exclude_fields=('mode'))
# download the result of the processing in a given format
iframe = selector.download()
if iframe:
return iframe
# extract the publication satisfying selector criteria
rows = selector.select(db.publications,
orderby=(db.projects.project, db.categories.code))
......
......@@ -154,6 +154,7 @@
'extract authors': 'extraire les auteurs',
'Fill': 'Remplir',
'Fill all fields': 'Remplir tous les champs',
'Filter': 'Filtrer',
'Filter cppm_authors': 'Filtrer les auteurs du CPPM',
'Filter diplomas': 'Filtrer les diplomes',
'Filter publications': 'Filtrer les publications',
......
......@@ -13,9 +13,9 @@ ID_USER, USER, DEF_USER = 2, 'user', 'liaisons, team leaders,...'
#
# connect to the database
#
try:
db = DAL(DB_MYSQL, migrate_enabled=MIGRATE, pool_size=10)
except:
raise HTTP(500, T("Can't access the MySQL database !!!"))
# try:
# db = DAL(DB_MYSQL, migrate_enabled=MIGRATE, pool_size=10)
# except:
# raise HTTP(500, T("Can't access the MySQL database !!!"))
# db = DAL('sqlite://storage.sqlite', migrate_enabled=MIGRATE)
db = DAL('sqlite://storage.sqlite', migrate_enabled=MIGRATE)
......@@ -88,7 +88,7 @@ virtdb.define_table('harvester_selector',
Field('id_teams', 'reference teams', label='Team'),
Field('id_projects', 'reference projects', label='Project'),
Field('controller', 'string', label='Harvest'),
Field('mode', 'string', default=MODE_LOAD_IN_DB),
Field('mode', 'string', default=MODE_DRY_RUN),
Field('format', 'string', default='html', label='Report format'))
virtdb.harvester_selector.format.requires = IS_IN_SET(['html', 'tex', 'pdf'])
......@@ -174,7 +174,7 @@ virtdb.define_table('run_all_harvesters_selector',
Field('year_end', 'integer'),
Field('id_teams', 'reference teams', label='Team'),
Field('id_projects', 'reference projects', label='Project'),
Field('mode', 'string', default=MODE_LOAD_IN_DB),
Field('mode', 'string', default=MODE_DRY_RUN),
Field('format', 'string', default='html', label='Report format'))
virtdb.run_all_harvesters_selector.format.requires = \
......
......@@ -10,6 +10,24 @@ if session.role != ADMIN:
fieldsModifier = dbui.FieldsModifier('check_selector')
fieldsModifier.configure_field('mode', hidden=True)
#
# cppm_authors
#
fieldsModifier = dbui.FieldsModifier('cppm_authors')
fieldsModifier.configure_field('authors', height=250)
#
# collaborations
#
fieldsModifier = dbui.FieldsModifier('collaborations')
fieldsModifier.configure_field('collaboration', xtype='textarea')
#
# harvesters
#
fieldsModifier = dbui.FieldsModifier('harvesters')
fieldsModifier.configure_field('collections', xtype='textarea')
#
# free harvest selector (merge)
#
......
......@@ -5,7 +5,8 @@
#
# add plugins to all forms
#
dbui.configure_forms(db, plugins=['pFormToolTip'])
dbui.configure_forms(db, plugins=['pFormToolTip'],
width=350)
#
# Relation between team and project in form and selectors
......@@ -48,7 +49,13 @@ for table in li:
slaveExtJS={'hidden': True})
#
# free harvester selector (linked comboboxes controller --> category)
# cppm_authors
#
formModifier = dbui.FormModifier('cppm_authors')
formModifier.configure(width=400)
#
# free harvester selector
#
formModifier = dbui.FormModifier('free_harvester_selector')
formModifier.hide_fields('ratio')
......@@ -75,38 +82,29 @@ formModifier.link_comboboxes(master=table['id_projects'],
formModifier = dbui.FormModifier('lists')
formModifier.merge_fields('list',
'definition',
title=T('General'),
flex=1)
title=T('General'))
formModifier.merge_fields('sections',
title=T('Sections'),
flex=1)
title=T('Sections'))
formModifier.merge_fields('section_level_1',
'section_level_2',
'section_level_3',
'section_level_4',
dbui.Spacer(height=159),
title=T('Sort by'),
flex=1)
title=T('Sort by'))
formModifier.merge_fields('axis_granularity_categories',
'axis_granularity_projects',
'axis_granularity_teams',
'axis_granularity_time',
dbui.Spacer(height=159),
title=T('Axes'),
flex=1)
title=T('Axes'))
formModifier.merge_fields('axis_label_converters',
title=T('Substitute'),
flex=1)
title=T('Substitute'))
formModifier.merge_fields('header_flag',
'footer_flag',
dbui.Spacer(height=212),
title=T('Header / Footer'),
flex=1)
title=T('Header / Footer'))
formModifier.set_mapper(dbui.map_tabpanel)
......@@ -114,8 +112,7 @@ formModifier.configure(buttonAlign='right',
labelWidth=100,
labelAlign='right',
width=450,
height=370,
defaults={'height': 310})
defaults={'maxHeight': 310})
#
# metrics (TabPanel)
......@@ -123,35 +120,26 @@ formModifier.configure(buttonAlign='right',
formModifier = dbui.FormModifier('metrics')
formModifier.merge_fields('metric',
'definition',
title=T('General'),
flex=1)
title=T('General'))
formModifier.merge_fields('axis_columns',
'axis_rows',
dbui.Spacer(height=30),
'conditions',
dbui.Spacer(height=120),
title=T('Count by'),
flex=1)
title=T('Count by'))
formModifier.merge_fields('axis_granularity_categories',
'axis_granularity_projects',
'axis_granularity_publishers',
'axis_granularity_teams',
'axis_granularity_time',
dbui.Spacer(height=159),
title=T('Axes'),
flex=1)
title=T('Axes'))
formModifier.merge_fields('axis_label_converters',
title=T('Substitute'),
flex=1)
title=T('Substitute'))
formModifier.merge_fields('header_flag',
'footer_flag',
dbui.Spacer(height=212),
title=T('Header / Footer'),
flex=1)
title=T('Header / Footer'))
formModifier.set_mapper(dbui.map_tabpanel)
......@@ -159,8 +147,7 @@ formModifier.configure(buttonAlign='right',
labelWidth=100,
labelAlign='right',
width=450,
height=370,
defaults={'height': 310})
defaults={'maxHeight': 310})
#
# publication (TabPanel)
#
......@@ -176,8 +163,7 @@ formModifier.merge_fields('title',
'submitted',
'preprint',
'publication_url',
title=T('Publication'),
flex=1)
title=T('Publication'))
formModifier.merge_fields('conference_title',
'conference_url',
......@@ -185,29 +171,21 @@ formModifier.merge_fields('conference_title',
'conference_town',
'id_countries',
'conference_speaker',
dbui.Spacer(height=170),
title=T('Conference'),
flex=1)
title=T('Conference'))
formModifier.merge_fields('report_numbers',
'id_reports',
dbui.Spacer(height=310),
title=T('Report'),
flex=1)
title=T('Report'))
formModifier.merge_fields('directors',
'universities',
'defense',
dbui.Spacer(height=285),
title=T('Thesis'),
flex=1)
title=T('Thesis'))
formModifier.merge_fields('book_isbn',
'book_issn',
'book_chapters',
dbui.Spacer(height=285),
title=T('Book'),
flex=1)
title=T('Book'))
formModifier.merge_fields('authors_cppm',
'id_authors_roles',
......@@ -215,9 +193,7 @@ formModifier.merge_fields('authors_cppm',
'id_projects',
'id_categories',
'id_status',
dbui.Spacer(height=220),
title='CPPM',
flex=1)
title='CPPM')
formModifier.set_mapper(dbui.map_tabpanel)
......@@ -225,5 +201,10 @@ formModifier.configure(buttonAlign='right',
labelWidth=100,
labelAlign='right',
width=400,
height=470,
defaults={'height': 410})
defaults={'maxHeight': 410})
#
# renderers
#
formModifier = dbui.FormModifier('renderers')
formModifier.configure(width=400)
......@@ -8,23 +8,20 @@
dbui.configure_grids(db, plugins=['pGridRowEditorConfirmDelete',
'pGridRowEditorContextMenu',
'pGridRowEditorDblClick',
'pGridExpertMenu'])
'pGridToolbar'])
#
# auth_xxx grid
#
gridModifier = dbui.GridModifier('auth_group')
gridModifier.configure_column('role', width=15)
gridModifier.set_rownumbering()
gridModifier = dbui.GridModifier('auth_membership')
gridModifier.configure_column('user_id', width=20)
gridModifier.set_rownumbering()
gridModifier = dbui.GridModifier('auth_user')
gridModifier.configure_column('first_name', width=30)
gridModifier.configure_column('last_name', width=30)
gridModifier.hide_columns('password')
gridModifier.set_rownumbering()
#
......@@ -32,14 +29,12 @@ gridModifier.set_rownumbering()
#
gridModifier = dbui.GridModifier('authors_role')
gridModifier.configure_column('role', width=75)
gridModifier.set_rownumbering()
#
# axes grid
#
gridModifier = dbui.GridModifier('axes')
gridModifier.configure_column('axis', width=15)
gridModifier.set_rownumbering()
#
# categories grid
......@@ -47,20 +42,12 @@ gridModifier.set_rownumbering()
gridModifier = dbui.GridModifier('categories')
gridModifier.configure_column('code', width=10)
gridModifier.configure_column('usual', width=10)
gridModifier.set_rownumbering()
#
# collaborations grid
#
gridModifier = dbui.GridModifier('collaborations')
gridModifier.set_rownumbering()
#
# controller grid
#
gridModifier = dbui.GridModifier('controllers')
gridModifier.configure_column('controller', width=15)
gridModifier.set_rownumbering()
#
# cppm_authors grid
......@@ -69,13 +56,13 @@ gridModifier = dbui.GridModifier('cppm_authors')
gridModifier.configure_column('year', width=10)
gridModifier.configure_column('id_teams', width=15)
gridModifier.configure_column('id_projects', width=15)
gridModifier.set_rownumbering()
gridModifier.append_filter(('year', '==', T('is equal to')), allowBlank=True)
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle= T('Filter'))
#
# harvesters grid
......@@ -86,7 +73,6 @@ gridModifier.configure_column('collections', width=300)
gridModifier.configure_column('max_records', width=70)
gridModifier.configure_column('ratio', width=40)
gridModifier.hide_columns('ratio')
gridModifier.set_rownumbering()
#
# lists grid
......@@ -108,7 +94,6 @@ gridModifier.hide_columns('section_level_1',
'axis_label_converters',
'header_flag',
'footer_flag')
gridModifier.set_rownumbering()
#
# metrics grid
......@@ -130,14 +115,12 @@ gridModifier.hide_columns('axis_granularity_categories',
'conditions',
'header_flag',
'footer_flag')
gridModifier.set_rownumbering()
#
# organisation grid
#
gridModifier = dbui.GridModifier('organisation')
gridModifier.configure_column('id_teams', width=30)
gridModifier.set_rownumbering()
#
# publications grid -- column template and filter
......@@ -167,7 +150,7 @@ tpl = ['<b>{PublicationsTitle}</b><br>',
'<tpl if="PublicationsDefense">, {PublicationsDefense}</tpl>']
gridModifier = dbui.GridModifier('publications')
gridModifier.append_plugins('pGridPaging', 'pGridExpertMenu', 'pGridMathJax')
gridModifier.configure(plugins=['pGridMathJax', 'pGridPaging'])
gridModifier.merge_columns('title',
'first_author',
'id_collaborations',
......@@ -202,8 +185,6 @@ gridModifier.hide_columns('id_authors_roles',
'publication_url',
'universities',)
gridModifier.set_rownumbering()
gridModifier.append_filter(('year', '==', T('is equal to')), allowBlank=True)
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
......@@ -222,7 +203,8 @@ gridModifier.append_filter(('id_status', '==', T('is equal to')))
gridModifier.append_filter(('id', '==', T('is equal to')), \
hidden=False, hideLabel=False, readOnly=False)
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle= T('Filter'))
#
# renderers grid
......@@ -231,7 +213,6 @@ gridModifier = dbui.GridModifier('renderers')
gridModifier.configure_column('renderer', width=40)
gridModifier.hide_columns('template',
'postprocessing')
gridModifier.set_rownumbering()
#
# sections grid
......@@ -240,10 +221,9 @@ gridModifier = dbui.GridModifier('sections')
gridModifier.hide_columns('conditions',
'sort_field',
'direction')
gridModifier.set_rownumbering()
#
# status grid
#
gridModifier = dbui.GridModifier('status')
gridModifier.configure_column('code', width=10)
gridModifier.set_rownumbering()
......@@ -2,6 +2,8 @@
""" widgets viewport
"""
ONE_HOUR = 3600000
#
# list of useful tables
# To be used to build the list of hidden tables which depend on
......@@ -89,11 +91,13 @@ helpNode.sort_children()
# report node
#
listLeaf = dbui.to_panelWithUrlSelector(virtdb.list_selector,
baseUrl=URL('lists', 'index'),
baseUrl=URL('lists', 'index'),
extField='format',
isMathJax=dbui.is_mathjax())
metricLeaf = dbui.to_panelWithUrlSelector(virtdb.metric_selector,
baseUrl=URL('metrics', 'index'))
baseUrl=URL('metrics', 'index'),
extField='format')
reportNode = dbui.Node(T('Reports'))
reportNode.add_child(T('lists'), listLeaf)
......@@ -112,14 +116,16 @@ if session.role in (ADMIN, USER):
freeLeaf = dbui.to_panelWithUrlSelector(virtdb.free_harvester_selector,
baseUrl=URL('harvest', 'free_run'),
selectorTitle='Fill all fields',
timeout=3600)
timeout=ONE_HOUR)
checkLeaf = dbui.to_panelWithUrlSelector(virtdb.check_selector,
baseUrl=URL('wizards', 'check_validate'))
baseUrl=URL('wizards', 'check_validate'),
extField='format')
harvesterLeaf = dbui.to_panelWithUrlSelector(virtdb.harvester_selector,
baseUrl=URL('harvest', 'run'),
timeout=3600)
extField='format',
timeout=ONE_HOUR)
marc12Leaf = dbui.to_panelWithUrlSelector(virtdb.marc12_selector,
selectorTitle='Fill all fields',
......@@ -127,7 +133,8 @@ if session.role in (ADMIN, USER):
runAllLeaf = dbui.to_panelWithUrlSelector(virtdb.run_all_harvesters_selector,
baseUrl=URL('harvest', 'run_all'),
timeout=3600)
extField='format',
timeout=ONE_HOUR)
wizardNode = dbui.Node(T('Wizards'))
......@@ -155,7 +162,7 @@ viewportModifier.add_node(helpNode, casNode, wizardNode, confNode, gridNode, rep
if "auth" in globals():
viewportModifier.append_plugins('pViewportLogin')
viewportModifier.configure(logged=False)
if session.role in (ADMIN, USER):
viewportModifier.configure(logged=True)
viewportModifier.default_node(T('Tables'), T('publications'))
......@@ -3,6 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.my-h2,
.my-h3,
.my-li,
.my-p,
.my-ul {font-family: Liberation Sherif, Sherif;
......@@ -10,11 +11,13 @@
list-style-type: none;}
.my-h2 {font-family: Liberation Sans, Sans;
font-size: 12px;
margin-bottom: 2ex;
margin-left: 3%;
margin-top: 3ex;}
.my-h3 {font-family: Liberation Sans, Sans;
font-size: 12px;
margin-left: 3%;
margin-top: 3ex;}
......@@ -73,7 +76,7 @@
<h3 class="my-h3 my-small-cap">Auteur</h3>
<ul class="my-ul">
<li class="my-li">Renaud Le Gac</li>
<ul>
</ul>
<h3 class="my-h3 my-small-cap">Contributeurs</h3>
......@@ -82,6 +85,6 @@
<a href="http://www.cecill.info/" target="_blank">CeCILL</a>.</p>