Commit af664ece authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[ui] Move archive transfer management rules to their own tab

parent 807eec16d156
......@@ -509,14 +509,6 @@ msgstr ""
msgid "SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_access_rule.object"
msgid "SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_access_rule.object"
msgid "SEDAAccessRule"
msgstr ""
msgid "SEDAAccessRuleCodeListVersion"
msgstr ""
......@@ -690,14 +682,6 @@ msgstr ""
msgid "SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_appraisal_rule.object"
msgid "SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_appraisal_rule.object"
msgid "SEDAAppraisalRule"
msgstr ""
msgid "SEDAAppraisalRuleCodeListVersion"
msgstr ""
......@@ -829,14 +813,6 @@ msgstr ""
msgid "SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_classification_rule.object"
msgid "SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_classification_rule.object"
msgid "SEDAClassificationRule"
msgstr ""
msgid "SEDAClassificationRuleCodeListVersion"
msgstr ""
......@@ -1033,14 +1009,6 @@ msgstr ""
msgid "SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_dissemination_rule.object"
msgid "SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_dissemination_rule.object"
msgid "SEDADisseminationRule"
msgstr ""
msgid "SEDADisseminationRuleCodeListVersion"
msgstr ""
......@@ -1369,14 +1337,6 @@ msgstr ""
msgid "SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_need_authorization.object"
msgid "SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_need_authorization.object"
msgid "SEDANeedAuthorization"
msgstr ""
msgid "SEDANeedAuthorization_plural"
msgstr ""
......@@ -1683,14 +1643,6 @@ msgstr ""
msgid "SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_reuse_rule.object"
msgid "SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_reuse_rule.object"
msgid "SEDAReuseRule"
msgstr ""
msgid "SEDAReuseRuleCodeListVersion"
msgstr ""
......@@ -1921,14 +1873,6 @@ msgstr ""
msgid "SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_storage_rule.object"
msgid "SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_storage_rule.object"
msgid "SEDAStorageRule"
msgstr ""
msgid "SEDAStorageRuleCodeListVersion"
msgstr ""
......@@ -3076,14 +3020,6 @@ msgstr ""
msgid "add a SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_access_rule.object"
msgid "add a SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_access_rule.object"
msgid "add a SEDAAccessRule"
msgstr ""
msgid "add a SEDAAccessRuleCodeListVersion"
msgstr ""
......@@ -3206,14 +3142,6 @@ msgstr ""
msgid "add a SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_appraisal_rule.object"
msgid "add a SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_appraisal_rule.object"
msgid "add a SEDAAppraisalRule"
msgstr ""
msgid "add a SEDAAppraisalRuleCodeListVersion"
msgstr ""
......@@ -3312,14 +3240,6 @@ msgstr ""
msgid "add a SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_classification_rule.object"
msgid "add a SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_classification_rule.object"
msgid "add a SEDAClassificationRule"
msgstr ""
msgid "add a SEDAClassificationRuleCodeListVersion"
msgstr ""
......@@ -3450,14 +3370,6 @@ msgstr ""
msgid "add a SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_dissemination_rule.object"
msgid "add a SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_dissemination_rule.object"
msgid "add a SEDADisseminationRule"
msgstr ""
msgid "add a SEDADisseminationRuleCodeListVersion"
msgstr ""
......@@ -3675,14 +3587,6 @@ msgstr ""
msgid "add a SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_need_authorization.object"
msgid "add a SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_need_authorization.object"
msgid "add a SEDANeedAuthorization"
msgstr ""
msgid "add a SEDANeedReassessingAuthorization"
msgstr ""
......@@ -3923,14 +3827,6 @@ msgstr ""
msgid "add a SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_reuse_rule.object"
msgid "add a SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_reuse_rule.object"
msgid "add a SEDAReuseRule"
msgstr ""
msgid "add a SEDAReuseRuleCodeListVersion"
msgstr ""
......@@ -4104,14 +4000,6 @@ msgstr ""
msgid "add a SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_storage_rule.object"
msgid "add a SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_storage_rule.object"
msgid "add a SEDAStorageRule"
msgstr ""
msgid "add a SEDAStorageRuleCodeListVersion"
msgstr ""
......@@ -5548,6 +5436,9 @@ msgstr ""
msgid "seda_at_data_objects_tab"
msgstr ""
msgid "seda_at_management_tab"
msgstr ""
msgid "seda_attachment"
msgstr ""
......
......@@ -512,14 +512,6 @@ msgstr ""
msgid "SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_access_rule.object"
msgid "SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_access_rule.object"
msgid "SEDAAccessRule"
msgstr ""
msgid "SEDAAccessRuleCodeListVersion"
msgstr ""
......@@ -693,14 +685,6 @@ msgstr ""
msgid "SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_appraisal_rule.object"
msgid "SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_appraisal_rule.object"
msgid "SEDAAppraisalRule"
msgstr ""
msgid "SEDAAppraisalRuleCodeListVersion"
msgstr ""
......@@ -832,14 +816,6 @@ msgstr ""
msgid "SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_classification_rule.object"
msgid "SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_classification_rule.object"
msgid "SEDAClassificationRule"
msgstr ""
msgid "SEDAClassificationRuleCodeListVersion"
msgstr ""
......@@ -1036,14 +1012,6 @@ msgstr ""
msgid "SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_dissemination_rule.object"
msgid "SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_dissemination_rule.object"
msgid "SEDADisseminationRule"
msgstr ""
msgid "SEDADisseminationRuleCodeListVersion"
msgstr ""
......@@ -1372,14 +1340,6 @@ msgstr ""
msgid "SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_need_authorization.object"
msgid "SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_need_authorization.object"
msgid "SEDANeedAuthorization"
msgstr ""
msgid "SEDANeedAuthorization_plural"
msgstr ""
......@@ -1686,14 +1646,6 @@ msgstr ""
msgid "SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_reuse_rule.object"
msgid "SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_reuse_rule.object"
msgid "SEDAReuseRule"
msgstr ""
msgid "SEDAReuseRuleCodeListVersion"
msgstr ""
......@@ -1924,14 +1876,6 @@ msgstr ""
msgid "SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_storage_rule.object"
msgid "SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_storage_rule.object"
msgid "SEDAStorageRule"
msgstr ""
msgid "SEDAStorageRuleCodeListVersion"
msgstr ""
......@@ -3079,14 +3023,6 @@ msgstr ""
msgid "add a SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_access_rule.object"
msgid "add a SEDAAccessRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_access_rule.object"
msgid "add a SEDAAccessRule"
msgstr ""
msgid "add a SEDAAccessRuleCodeListVersion"
msgstr ""
......@@ -3209,14 +3145,6 @@ msgstr ""
msgid "add a SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_appraisal_rule.object"
msgid "add a SEDAAppraisalRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_appraisal_rule.object"
msgid "add a SEDAAppraisalRule"
msgstr ""
msgid "add a SEDAAppraisalRuleCodeListVersion"
msgstr ""
......@@ -3315,14 +3243,6 @@ msgstr ""
msgid "add a SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_classification_rule.object"
msgid "add a SEDAClassificationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_classification_rule.object"
msgid "add a SEDAClassificationRule"
msgstr ""
msgid "add a SEDAClassificationRuleCodeListVersion"
msgstr ""
......@@ -3453,14 +3373,6 @@ msgstr ""
msgid "add a SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_dissemination_rule.object"
msgid "add a SEDADisseminationRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_dissemination_rule.object"
msgid "add a SEDADisseminationRule"
msgstr ""
msgid "add a SEDADisseminationRuleCodeListVersion"
msgstr ""
......@@ -3678,14 +3590,6 @@ msgstr ""
msgid "add a SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_need_authorization.object"
msgid "add a SEDANeedAuthorization"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_need_authorization.object"
msgid "add a SEDANeedAuthorization"
msgstr ""
msgid "add a SEDANeedReassessingAuthorization"
msgstr ""
......@@ -3926,14 +3830,6 @@ msgstr ""
msgid "add a SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_reuse_rule.object"
msgid "add a SEDAReuseRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_reuse_rule.object"
msgid "add a SEDAReuseRule"
msgstr ""
msgid "add a SEDAReuseRuleCodeListVersion"
msgstr ""
......@@ -4107,14 +4003,6 @@ msgstr ""
msgid "add a SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAArchiveTransfer.seda_storage_rule.object"
msgid "add a SEDAStorageRule"
msgstr ""
msgctxt "inlined:SEDAManagement.seda_storage_rule.object"
msgid "add a SEDAStorageRule"
msgstr ""
msgid "add a SEDAStorageRuleCodeListVersion"
msgstr ""
......@@ -5551,6 +5439,9 @@ msgstr "vocabulaires (CodeListVersions)"
msgid "seda_at_data_objects_tab"
msgstr "objets-données"
msgid "seda_at_management_tab"
msgstr "gestion"
msgid "seda_attachment"
msgstr ""
......
......@@ -38,9 +38,18 @@ def rtags_from_xsd_element(etype, element_name):
"""Return primary view section and display control rtags, generated from information in the XSD
for the given element name.
"""
rtype_role_targets = ((rtype, role, path[-1][-2])
for rtype, role, path in XSDM_MAPPING.iter_rtype_role(element_name))
return rtags_from_rtype_role_targets(etype, rtype_role_targets)
def rtags_from_rtype_role_targets(etype, rtype_role_targets):
"""Return primary view section and display control rtags from a list of (`rtype`, `role`,
`target entity type`).
"""
ordered = []
rsection = cwuicfg.PrimaryViewSectionRelationTags(__module__=__name__)
for rtype, role, path in XSDM_MAPPING.iter_rtype_role(element_name):
for rtype, role, target in rtype_role_targets:
if role == 'subject':
# mandatory elements
relation = (etype, rtype, '*', role)
......@@ -48,7 +57,7 @@ def rtags_from_xsd_element(etype, element_name):
{'rvid': 'seda.reledit.simplelink'})
else:
relation = ('*', rtype, etype, role)
if path[-1][-2] in BASE_TYPES:
if target in BASE_TYPES:
vid = 'seda.reledit.text'
else:
vid = 'seda.reledit.complexlink'
......
......@@ -23,7 +23,8 @@ from cubicweb.view import EntityView
from cubicweb.web import formwidgets as fw
from cubicweb.web.views import tabs, uicfg, reledit
from cubes.seda.views import rtags_from_xsd_element, add_subobjects_button
from cubes.seda.views import (rtags_from_xsd_element, rtags_from_rtype_role_targets,
add_subobjects_button)
_ = unicode
......@@ -44,6 +45,7 @@ class ArchiveTransferTabbedPrimaryView(tabs.TabbedPrimaryView):
tabs = [
'main_tab',
_('seda_at_code_list_versions_tab'),
_('seda_at_management_tab'),
_('seda_at_data_objects_tab'),
_('seda_at_archive_units_tab'),
]
......@@ -57,6 +59,24 @@ class ArchiveTransferCodeListVersionsTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_xsd_element('SEDAArchiveTransfer', 'CodeListVersions')
class ArchiveTransferManagementTab(tabs.PrimaryTab):
"""Main tab for code list versions information of an archive transfert"""
__regid__ = 'seda_at_management_tab'
__select__ = tabs.PrimaryTab.__select__ & is_instance('SEDAArchiveTransfer')
rtype_role_targets = [
('seda_storage_rule', 'object', None),
('seda_appraisal_rule', 'object', None),
('seda_access_rule', 'object', None),
('seda_dissemination_rule', 'object', None),
('seda_reuse_rule', 'object', None),
('seda_classification_rule', 'object', None),
('seda_need_authorization', 'object', None),
]
rsection, display_ctrl = rtags_from_rtype_role_targets('SEDAArchiveTransfer',
rtype_role_targets)
class ArchiveTransferDataObjectsTab(tabs.TabsMixin, EntityView):
"""Main tab for data objects of an archive transfer."""
__regid__ = 'seda_at_data_objects_tab'
......
......@@ -630,19 +630,19 @@ afs.tag_object_of(('*', 'seda_physical_data_object', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_service_level', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_service_level', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_storage_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_storage_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_storage_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_appraisal_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_appraisal_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_appraisal_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_access_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_access_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_access_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_dissemination_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_dissemination_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_dissemination_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_reuse_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_reuse_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_reuse_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_classification_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_classification_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_classification_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_need_authorization', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_need_authorization', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_need_authorization', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_seq_classification_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_classification_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_classification_rule_prevent_inheritance', '*'), 'main', 'hidden')
......@@ -1004,6 +1004,20 @@ pvs.tag_subject_of(('*', 'seda_binary_data_object', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_binary_data_object', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_physical_data_object', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_physical_data_object', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_storage_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_storage_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_appraisal_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_appraisal_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_access_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_access_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_dissemination_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_dissemination_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_reuse_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_reuse_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_classification_rule', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_classification_rule', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_need_authorization', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_need_authorization', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_relationship', '*'), 'hidden')
pvs.tag_object_of(('*', 'seda_relationship', '*'), 'hidden')
pvs.tag_subject_of(('*', 'seda_width', '*'), 'hidden')
......
......@@ -32,6 +32,13 @@ RTYPES_IN_TAB = set((
'seda_binary_data_object',
'seda_physical_data_object',
'seda_relationship',
'seda_storage_rule',
'seda_appraisal_rule',
'seda_access_rule',
'seda_dissemination_rule',
'seda_reuse_rule',
'seda_classification_rule',
'seda_need_authorization',
))
for element_name in ('CodeListVersions', 'FormatIdentification', 'FileInfo', 'PhysicalDimensions'):
for rtype, role, path in XSDM_MAPPING.iter_rtype_role(element_name):
......
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