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

[code gen] Avoid generation of duplicated uicfg rules

parent 657e8aea48d2
......@@ -229,44 +229,23 @@ afs.tag_object_of(('*', 'seda_seq_reuse_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_reuse_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_reuse_rule_prevent_inheritance', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_reuse_rule_prevent_inheritance', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_seq_dissemination_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_dissemination_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_dissemination_rule_prevent_inheritance', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_dissemination_rule_prevent_inheritance', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_seq_access_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_access_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_access_rule_prevent_inheritance', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_access_rule_prevent_inheritance', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_seq_appraisal_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_appraisal_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_appraisal_rule_prevent_inheritance', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_appraisal_rule_prevent_inheritance', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_final_action', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_seq_storage_rule_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_seq_storage_rule_rule', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_storage_rule_prevent_inheritance', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_storage_rule_prevent_inheritance', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_final_action', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_ref_non_rule_id', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_rule', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_archive_unit', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_archive_unit', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_archive_unit_archive_unit_ref_id', '*'), 'main', 'hidden')
......@@ -280,8 +259,6 @@ afs.tag_subject_of(('*', 'seda_management', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_management', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_content', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_content', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_archive_unit', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_archive_unit', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference_id', '*'), 'main', 'attributes')
......@@ -366,14 +343,10 @@ afs.tag_subject_of(('*', 'seda_received_date', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_received_date', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_registered_date', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_registered_date', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_start_date', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_start_date', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_end_date', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_end_date', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_event', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_event', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_signature', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_signature', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_gps', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_gps', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_gps_version_id', '*'), 'main', 'hidden')
......@@ -421,28 +394,18 @@ afs.tag_subject_of(('*', 'seda_references', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_references', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_references_archive_unit_ref_id', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_references_archive_unit_ref_id', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_repository_archive_unit_pid', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_repository_archive_unit_pid', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_repository_object_pid', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_repository_object_pid', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_is_part_of_archive_unit_ref_id', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_is_part_of_archive_unit_ref_id', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_requires_archive_unit_ref_id', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_requires_archive_unit_ref_id', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_replaces_archive_unit_ref_id', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_replaces_archive_unit_ref_id', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_is_version_of_archive_unit_ref_id', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_is_version_of_archive_unit_ref_id', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_data_object_reference', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_spatial', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_spatial', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_temporal', '*'), 'main', 'hidden')
......@@ -461,21 +424,8 @@ afs.tag_subject_of(('*', 'seda_custodial_history_item', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_custodial_history_item', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_custodial_history_file', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_custodial_history_file', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_reference_id', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_when', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_when', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_storage_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_storage_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_appraisal_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_appraisal_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_access_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_access_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_dissemination_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_dissemination_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_reuse_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_reuse_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_classification_rule', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_classification_rule', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_relationship', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_relationship', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_data_object_version_from', '*'), 'main', 'hidden')
......@@ -502,16 +452,8 @@ afs.tag_object_of(('*', 'seda_weight', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_number_of_page', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_number_of_page', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_unit', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_type_relationship', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_target', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_relationship', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_relationship', '*'), 'main', 'inlined')
afs.tag_object_of(('*', 'seda_alt_binary_data_object_attachment', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_alt_binary_data_object_attachment', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_compressed', '*'), 'main', 'hidden')
......@@ -539,8 +481,6 @@ afs.tag_subject_of(('*', 'seda_format_id_to', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_encoding_from', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_encoding_from', '*'), 'main', 'hidden')
afs.tag_subject_of(('*', 'seda_encoding_to', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_algorithm', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_algorithm', '*'), 'main', 'attributes')
afs.tag_subject_of(('*', 'seda_attachment', '*'), 'main', 'hidden')
afs.tag_object_of(('*', 'seda_attachment', '*'), 'main', 'inlined')
afs.tag_subject_of(('*', 'seda_uri', '*'), 'main', 'hidden')
......
......@@ -97,6 +97,9 @@ class UICFGGenerator(CodeGenerator):
yield mapping.etype
def autoform_section_for_rdef_mapping(self, mapping):
if ('afs', mapping.rtype) in self._processed:
return
self._processed.add(('afs', mapping.rtype))
if (mapping.rtype.endswith('code_list_version_from')
or mapping.rtype.endswith('code_list_version')
or mapping.rtype in RTYPES_IN_TAB):
......@@ -114,8 +117,8 @@ class UICFGGenerator(CodeGenerator):
def autoform_field_kwargs_for_e_type_mapping(self, mapping):
for rtype, target_etype in sorted(mapping.attributes.items()):
if target_etype == 'String' and rtype not in self._processed:
self._processed.add(rtype)
if target_etype == 'String' and ('affk', rtype) not in self._processed:
self._processed.add(('affk', rtype))
yield rtype, 'subject', {'widget': Code("fw.TextInput({'size': 80})")}
def autoform_field_kwargs_for_rdef_mapping(self, mapping):
......
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