Commit 9c2e82d2 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Move harvester actions from the node wizards to harvest.

parent 9ef67944
......@@ -267,7 +267,7 @@
'Group ID': 'Group ID',
'Group uniquely assigned to user %(id)s': 'Group uniquely assigned to user %(id)s',
'groups': 'groupes',
'Harvest': 'Harvest',
'Harvest': 'Moissonner',
'Harvester': 'Moissonneur',
'Harvester parameters not defined in the database.': 'Les paramètres du moissoneur ne sont pas définis dans la base de données.',
'Harvester took %s seconds': 'La moisson à durée %s secondes',
......
......@@ -3,7 +3,7 @@
"""
# helper function translating a tablename into the grid configuration
to_grid = lambda tablename: dbui.to_gridPanel(db[tablename])
to_grid = lambda tablename: dbui.to_gridPanel(db[tablename])
# short cuts
Node = dbui.Node
......@@ -17,7 +17,7 @@ PanelWithUrlSelector = dbui.to_panelWithUrlSelector
#-------------------------------------------------------------------------------
casNode = None
if "auth" in globals() and session.role == ADMIN:
casNode = Node(T('CAS'))
casNode.add_child(T('users'), to_grid('auth_user'))
......@@ -42,9 +42,9 @@ if session.role == ADMIN:
#-------------------------------------------------------------------------------
confHarvesterNode = None
if session.role in (ADMIN, USER):
confHarvesterNode = Node(T('Configure harvesters'))
confHarvesterNode.add_child(T('harvesters'), to_grid('harvesters'))
confHarvesterNode.add_child(T('relation harvesters / categories'), to_grid('controllers'))
confHarvesterNode.add_child(T("author's rescue list"), to_grid('my_authors'))
......@@ -58,13 +58,13 @@ confListNode = None
if session.role == ADMIN:
confListNode = Node(T('Configure lists'))
# NOTE: hide axes table which contains static data
# confListNode.add_child('axes', to_grid('axes'))
confListNode.add_child(T('renderers'), to_grid('renderers'))
confListNode.add_child(T('sections'), to_grid('sections'))
confListNode.add_child(T('lists'), to_grid('lists'))
#-------------------------------------------------------------------------------
#
# CONFIGURE METRICs
......@@ -76,7 +76,7 @@ if session.role == ADMIN:
confMetricNode = Node(T('Configure graphs and metrics'))
confMetricNode.add_child(T('graphs'), to_grid('graphs'))
confMetricNode.add_child(T('metrics'), to_grid('metrics'))
#-------------------------------------------------------------------------------
#
# DATA INSTITUT
......@@ -89,9 +89,9 @@ if session.role == ADMIN:
dataInstituteNode = Node(T('Data institute'))
dataInstituteNode.add_children(leaves, func=to_grid)
dataInstituteNode.add_child(T('Relation team / projects'), to_grid('organisation'))
#-------------------------------------------------------------------------------
#
# DATA PUBLICATIONS
......@@ -100,20 +100,59 @@ if session.role == ADMIN:
dataPublicationeNode = None
if session.role in (ADMIN, USER):
leaves = ('categories',
'collaborations',
leaves = ('categories',
'collaborations',
'countries',
'publications',
'publications',
'publishers',
'status')
if session.role == USER:
leaves = ('categories',
leaves = ('categories',
'publications')
dataPublicationeNode = Node(T('Data publications'))
dataPublicationeNode.add_children(leaves, func=to_grid)
#-------------------------------------------------------------------------------
#
# HARVESTER NODE
#
#-------------------------------------------------------------------------------
harvestNode = None
if session.role in (ADMIN, USER):
editLeaf = PanelWithUrlSelector(virtdb.edit_insert_selector,
baseUrl=URL('harvest', 'edit_insert'),
selectorTitle='Fill all fields')
freeLeaf = PanelWithUrlSelector(virtdb.free_harvester_selector,
baseUrl=URL('harvest', 'free_run'),
selectorTitle='Fill all fields',
timeout=ONE_HOUR)
harvesterLeaf = PanelWithUrlSelector(virtdb.harvester_selector,
baseUrl=URL('harvest', 'run'),
extField='format',
timeout=ONE_HOUR)
marc12Leaf = PanelWithUrlSelector(virtdb.marc12_selector,
selectorTitle='Fill all fields',
baseUrl=URL('harvest', 'insert_marcxml'))
runAllLeaf = PanelWithUrlSelector(virtdb.run_all_harvesters_selector,
baseUrl=URL('harvest', 'run_all'),
extField='format',
timeout=ONE_HOUR)
harvestNode = Node(T('Harvest'))
harvestNode.add_child(T('edit and insert'), editLeaf)
harvestNode.add_child(T('insert MARCXML'), marc12Leaf)
harvestNode.add_child(T('run a free harvester'), freeLeaf)
harvestNode.add_child(T('run a harvester'), harvesterLeaf)
harvestNode.add_child(T('run all harvesters'), runAllLeaf)
harvestNode.sort_children()
#-------------------------------------------------------------------------------
#
# HELP NODE
......@@ -141,7 +180,7 @@ helpNode.add_child(T('versions'), versionLeaf)
if session.role == ADMIN:
helpNode.add_child(T('documentations'), docLeaf)
helpNode.sort_children()
#-------------------------------------------------------------------------------
......@@ -154,19 +193,19 @@ loader = dict(autoLoad=True,
scripts=True,
url=URL('graphs', 'dashboard'))
dashBoardLeaf = Panel(loader=loader,
plugins=['pPanelLoaderException'],
dashBoardLeaf = Panel(loader=loader,
plugins=['pPanelLoaderException'],
autoScroll=True)
graphLeaf = PanelWithUrlSelector(virtdb.graph_selector,
graphLeaf = PanelWithUrlSelector(virtdb.graph_selector,
baseUrl=URL('graphs', 'index'))
listLeaf = PanelWithUrlSelector(virtdb.list_selector,
listLeaf = PanelWithUrlSelector(virtdb.list_selector,
baseUrl=URL('lists', 'index'),
extField='format',
plugins=['pMathJax'])
metricLeaf = PanelWithUrlSelector(virtdb.metric_selector,
metricLeaf = PanelWithUrlSelector(virtdb.metric_selector,
baseUrl=URL('metrics', 'index'),
extField='format')
......@@ -183,50 +222,22 @@ reportNode.add_child(T('graphs'), graphLeaf)
#-------------------------------------------------------------------------------
wizardNode = None
if session.role in (ADMIN, USER):
authorLeaf = PanelWithUrlSelector(virtdb.authors_selector,
authorLeaf = PanelWithUrlSelector(virtdb.authors_selector,
baseUrl=URL('wizards', 'extract_authors'))
editLeaf = PanelWithUrlSelector(virtdb.edit_insert_selector,
baseUrl=URL('harvest', 'edit_insert'),
selectorTitle='Fill all fields')
freeLeaf = PanelWithUrlSelector(virtdb.free_harvester_selector,
baseUrl=URL('harvest', 'free_run'),
selectorTitle='Fill all fields',
timeout=ONE_HOUR)
checkLeaf = PanelWithUrlSelector(virtdb.check_selector,
checkLeaf = PanelWithUrlSelector(virtdb.check_selector,
baseUrl=URL('wizards', 'check_validate'),
extField='format',
timeout=ONE_HOUR)
harvesterLeaf = PanelWithUrlSelector(virtdb.harvester_selector,
baseUrl=URL('harvest', 'run'),
extField='format',
timeout=ONE_HOUR)
marc12Leaf = PanelWithUrlSelector(virtdb.marc12_selector,
selectorTitle='Fill all fields',
baseUrl=URL('harvest', 'insert_marcxml'))
runAllLeaf = PanelWithUrlSelector(virtdb.run_all_harvesters_selector,
baseUrl=URL('harvest', 'run_all'),
extField='format',
timeout=ONE_HOUR)
wizardNode = Node(T('Wizards'))
wizardNode.add_child(T('edit and insert'), editLeaf)
wizardNode.add_child(T('insert MARCXML'), marc12Leaf)
wizardNode.add_child(T('run a free harvester'), freeLeaf)
wizardNode.add_child(T('extract authors'), authorLeaf)
wizardNode.add_child(T('run a harvester'), harvesterLeaf)
wizardNode.add_child(T('run all harvesters'), runAllLeaf)
if session.role == ADMIN:
wizardNode.add_child(T('check and validate'), checkLeaf)
else:
wizardNode.add_child(T('check'), checkLeaf)
wizardNode.sort_children()
#-------------------------------------------------------------------------------
......@@ -234,15 +245,16 @@ if session.role in (ADMIN, USER):
# VIEWPORT
#
#-------------------------------------------------------------------------------
nodes = [helpNode,
casNode,
nodes = [helpNode,
casNode,
wizardNode,
confAppNode,
confHarvesterNode,
confHarvesterNode,
confListNode,
confMetricNode,
dataInstituteNode,
dataPublicationeNode,
dataPublicationeNode,
harvestNode,
reportNode]
viewportModifier = dbui.ViewportModifier()
......@@ -252,12 +264,12 @@ viewportModifier.configure(tabTitleTpl="{1}")
# NOTE the session.auth only exit when the user is logged
if "auth" in globals():
viewportModifier.configure(logged=False,
viewportModifier.configure(logged=False,
plugins=['pViewportLogin'])
if session.role in (ADMIN, USER):
viewportModifier.configure(logged=True)
viewportModifier.default_node(T('Data publications'), T('publications'))
else:
viewportModifier.default_node(T('Reports'), T('dashboard'))
\ No newline at end of file
viewportModifier.default_node(T('Reports'), T('dashboard'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment