[PATCH 06 of 11 seda V2] [SEDA 2.1] Implement Acquisition information

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Mar 3 15:55:51 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1488533490 -3600
#      Fri Mar 03 10:31:30 2017 +0100
# Node ID d8be06a223519c1666d8d45f92833acf836b95e3
# Parent  b2cf743e278714a4bf5afff95ab797e409dc7ba3
[SEDA 2.1] Implement Acquisition information

diff --git a/cubicweb_seda/entities/generated.py b/cubicweb_seda/entities/generated.py
--- a/cubicweb_seda/entities/generated.py
+++ b/cubicweb_seda/entities/generated.py
@@ -116,10 +116,15 @@ class SEDAReuseRuleCodeListVersion(SEDAA
 class SEDAClassificationRuleCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAClassificationRuleCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
+class SEDAAcquisitionInformationCodeListVersion(SEDAAnyEntity):
+    __regid__ = 'SEDAAcquisitionInformationCodeListVersion'
+    fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
+    value_attr = None
+
 class SEDARelationshipCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDARelationshipCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
@@ -161,10 +166,15 @@ class SEDAArchiveUnit(SEDAAnyEntity):
 class SEDAServiceLevel(SEDAAnyEntity):
     __regid__ = 'SEDAServiceLevel'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality', 'service_level', 'user_annotation'])
     value_attr = 'service_level'
 
+class SEDAAcquisitionInformation(SEDAAnyEntity):
+    __regid__ = 'SEDAAcquisitionInformation'
+    fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
+    value_attr = None
+
 class SEDALegalStatus(SEDAAnyEntity):
     __regid__ = 'SEDALegalStatus'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
diff --git a/cubicweb_seda/hooks.py b/cubicweb_seda/hooks.py
--- a/cubicweb_seda/hooks.py
+++ b/cubicweb_seda/hooks.py
@@ -191,10 +191,11 @@ class SetDefaultCodeListVersionsOp(hook.
         # 'seda_compression_algorithm_code_list_version',
         # 'seda_classification_rule_code_list_version',
         # 'seda_reuse_rule_code_list_version',
         # 'seda_dissemination_rule_code_list_version',
         # 'seda_storage_rule_code_list_version',
+        # 'seda_acquisition_information_code_list_version',
     ]
 
     def precommit_event(self):
         transfer = self.transfer_eid
         cnx = self.cnx
diff --git a/cubicweb_seda/i18n/en.po b/cubicweb_seda/i18n/en.po
--- a/cubicweb_seda/i18n/en.po
+++ b/cubicweb_seda/i18n/en.po
@@ -123,10 +123,16 @@ msgid "New SEDAAccessRuleCodeListVersion
 msgstr ""
 
 msgid "New SEDAAcquiredDate"
 msgstr ""
 
+msgid "New SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "New SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
 msgid "New SEDAAddressee"
 msgstr ""
 
 msgid "New SEDAAltAccessRulePreventInheritance"
 msgstr ""
@@ -587,10 +593,26 @@ msgid "SEDAAcquiredDate"
 msgstr ""
 
 msgid "SEDAAcquiredDate_plural"
 msgstr ""
 
+msgid "SEDAAcquisitionInformation"
+msgstr ""
+
+msgctxt "inlined:SEDAArchiveTransfer.seda_acquisition_information_from.object"
+msgid "SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
+msgid "SEDAAcquisitionInformationCodeListVersion_plural"
+msgstr ""
+
+msgid "SEDAAcquisitionInformation_plural"
+msgstr ""
+
 msgid "SEDAAddressee"
 msgstr ""
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_addressee_from."
@@ -2016,10 +2038,22 @@ msgid "This SEDAAcquiredDate"
 msgstr ""
 
 msgid "This SEDAAcquiredDate:"
 msgstr ""
 
+msgid "This SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformation:"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformationCodeListVersion:"
+msgstr ""
+
 msgid "This SEDAAddressee"
 msgstr ""
 
 msgid "This SEDAAddressee:"
 msgstr ""
@@ -2876,10 +2910,20 @@ msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_acquired_date."
 "object"
 msgid "add a SEDAAcquiredDate"
 msgstr ""
 
+msgid "add a SEDAAcquisitionInformation"
+msgstr ""
+
+msgctxt "inlined:SEDAArchiveTransfer.seda_acquisition_information_from.object"
+msgid "add a SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "add a SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
 msgid "add a SEDAAddressee"
 msgstr ""
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_addressee_from."
@@ -3920,10 +3964,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "container"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "container"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "container"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "container"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
@@ -4917,10 +4969,66 @@ msgstr ""
 
 msgctxt "SEDASeqAltArchiveUnitArchiveUnitRefIdManagement"
 msgid "seda_acquired_date_object"
 msgstr ""
 
+msgid "seda_acquisition_information_code_list_version_from"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "seda_acquisition_information_code_list_version_from"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_from_object"
+msgstr ""
+
+msgctxt "SEDAArchiveTransfer"
+msgid "seda_acquisition_information_code_list_version_from_object"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_to"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "seda_acquisition_information_code_list_version_to"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_to_object"
+msgstr ""
+
+msgctxt "ConceptScheme"
+msgid "seda_acquisition_information_code_list_version_to_object"
+msgstr ""
+
+msgid "seda_acquisition_information_from"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformation"
+msgid "seda_acquisition_information_from"
+msgstr ""
+
+msgid "seda_acquisition_information_from_object"
+msgstr ""
+
+msgctxt "SEDAArchiveTransfer"
+msgid "seda_acquisition_information_from_object"
+msgstr ""
+
+msgid "seda_acquisition_information_to"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformation"
+msgid "seda_acquisition_information_to"
+msgstr ""
+
+msgid "seda_acquisition_information_to_object"
+msgstr ""
+
+msgctxt "Concept"
+msgid "seda_acquisition_information_to_object"
+msgstr ""
+
 msgid "seda_addressee_from"
 msgstr ""
 
 msgctxt "SEDAAddressee"
 msgid "seda_addressee_from"
@@ -7856,10 +7964,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "user_annotation"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "user_annotation"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "user_annotation"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "user_annotation"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
@@ -8371,10 +8487,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "user_cardinality"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "user_cardinality"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "user_cardinality"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "user_cardinality"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
diff --git a/cubicweb_seda/i18n/fr.po b/cubicweb_seda/i18n/fr.po
--- a/cubicweb_seda/i18n/fr.po
+++ b/cubicweb_seda/i18n/fr.po
@@ -130,10 +130,16 @@ msgid "New SEDAAccessRuleCodeListVersion
 msgstr ""
 
 msgid "New SEDAAcquiredDate"
 msgstr ""
 
+msgid "New SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "New SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
 msgid "New SEDAAddressee"
 msgstr "Nouveau destinataire pour action"
 
 msgid "New SEDAAltAccessRulePreventInheritance"
 msgstr ""
@@ -597,10 +603,26 @@ msgid "SEDAAcquiredDate"
 msgstr ""
 
 msgid "SEDAAcquiredDate_plural"
 msgstr ""
 
+msgid "SEDAAcquisitionInformation"
+msgstr ""
+
+msgctxt "inlined:SEDAArchiveTransfer.seda_acquisition_information_from.object"
+msgid "SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
+msgid "SEDAAcquisitionInformationCodeListVersion_plural"
+msgstr ""
+
+msgid "SEDAAcquisitionInformation_plural"
+msgstr ""
+
 msgid "SEDAAddressee"
 msgstr "Destinataire pour action"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_addressee_from."
@@ -2028,10 +2050,22 @@ msgid "This SEDAAcquiredDate"
 msgstr ""
 
 msgid "This SEDAAcquiredDate:"
 msgstr ""
 
+msgid "This SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformation:"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
+msgid "This SEDAAcquisitionInformationCodeListVersion:"
+msgstr ""
+
 msgid "This SEDAAddressee"
 msgstr "Ce destinataire pour action"
 
 msgid "This SEDAAddressee:"
 msgstr "Ce destinataire pour action :"
@@ -2890,10 +2924,20 @@ msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_acquired_date."
 "object"
 msgid "add a SEDAAcquiredDate"
 msgstr ""
 
+msgid "add a SEDAAcquisitionInformation"
+msgstr ""
+
+msgctxt "inlined:SEDAArchiveTransfer.seda_acquisition_information_from.object"
+msgid "add a SEDAAcquisitionInformation"
+msgstr ""
+
+msgid "add a SEDAAcquisitionInformationCodeListVersion"
+msgstr ""
+
 msgid "add a SEDAAddressee"
 msgstr "ajouter un destinataire pour action"
 
 msgctxt ""
 "inlined:SEDASeqAltArchiveUnitArchiveUnitRefIdManagement.seda_addressee_from."
@@ -3934,10 +3978,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "container"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "container"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "container"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "container"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
@@ -4938,10 +4990,66 @@ msgstr "date de numérisation"
 
 msgctxt "SEDASeqAltArchiveUnitArchiveUnitRefIdManagement"
 msgid "seda_acquired_date_object"
 msgstr ""
 
+msgid "seda_acquisition_information_code_list_version_from"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "seda_acquisition_information_code_list_version_from"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_from_object"
+msgstr "modalités d'entrée"
+
+msgctxt "SEDAArchiveTransfer"
+msgid "seda_acquisition_information_code_list_version_from_object"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_to"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "seda_acquisition_information_code_list_version_to"
+msgstr ""
+
+msgid "seda_acquisition_information_code_list_version_to_object"
+msgstr ""
+
+msgctxt "ConceptScheme"
+msgid "seda_acquisition_information_code_list_version_to_object"
+msgstr ""
+
+msgid "seda_acquisition_information_from"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformation"
+msgid "seda_acquisition_information_from"
+msgstr ""
+
+msgid "seda_acquisition_information_from_object"
+msgstr "modalité d'entrée"
+
+msgctxt "SEDAArchiveTransfer"
+msgid "seda_acquisition_information_from_object"
+msgstr ""
+
+msgid "seda_acquisition_information_to"
+msgstr "valeur"
+
+msgctxt "SEDAAcquisitionInformation"
+msgid "seda_acquisition_information_to"
+msgstr ""
+
+msgid "seda_acquisition_information_to_object"
+msgstr ""
+
+msgctxt "Concept"
+msgid "seda_acquisition_information_to_object"
+msgstr ""
+
 msgid "seda_addressee_from"
 msgstr ""
 
 msgctxt "SEDAAddressee"
 msgid "seda_addressee_from"
@@ -7883,10 +7991,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "user_annotation"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "user_annotation"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "user_annotation"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "user_annotation"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
@@ -8398,10 +8514,18 @@ msgstr ""
 
 msgctxt "SEDAAcquiredDate"
 msgid "user_cardinality"
 msgstr ""
 
+msgctxt "SEDAAcquisitionInformation"
+msgid "user_cardinality"
+msgstr ""
+
+msgctxt "SEDAAcquisitionInformationCodeListVersion"
+msgid "user_cardinality"
+msgstr ""
+
 msgctxt "SEDAAddressee"
 msgid "user_cardinality"
 msgstr ""
 
 msgctxt "SEDAAltAccessRulePreventInheritance"
diff --git a/cubicweb_seda/migration/0.8.0_Any.py b/cubicweb_seda/migration/0.8.0_Any.py
--- a/cubicweb_seda/migration/0.8.0_Any.py
+++ b/cubicweb_seda/migration/0.8.0_Any.py
@@ -3,10 +3,13 @@ from cubicweb_seda.dataimport import imp
 add_entity_type('SEDAMessageDigestAlgorithmCodeListVersion')
 drop_relation_type('seda_message_digest_algorithm_code_list_version')
 add_entity_type('SEDAFileFormatCodeListVersion')
 drop_relation_type('seda_file_format_code_list_version')
 
+add_entity_type('SEDAAcquisitionInformationCodeListVersion')
+add_entity_type('SEDAAcquisitionInformation')
+
 add_entity_type('SEDALegalStatus')
 
 sync_schema_props_perms('seda_algorithm')
 sync_schema_props_perms('seda_format_id_to')
 
diff --git a/cubicweb_seda/schema/seda2.py b/cubicweb_seda/schema/seda2.py
--- a/cubicweb_seda/schema/seda2.py
+++ b/cubicweb_seda/schema/seda2.py
@@ -415,10 +415,34 @@ class classification_rule_code_list_vers
     inlined = True
     constraints = []
 
 @seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
                       annotable=True)
+class SEDAAcquisitionInformationCodeListVersion(EntityType):
+    u""""""
+
+
+class archive_transfer_acquisition_information_code_list_version_from(RelationDefinition):
+    name = 'seda_acquisition_information_code_list_version_from'
+    subject = 'SEDAAcquisitionInformationCodeListVersion'
+    object = 'SEDAArchiveTransfer'
+    cardinality = '1?'
+    composite = fulltext_container = 'object'
+    inlined = True
+    constraints = []
+
+class acquisition_information_code_list_version_acquisition_information_code_list_version_to(RelationDefinition):
+    name = 'seda_acquisition_information_code_list_version_to'
+    subject = 'SEDAAcquisitionInformationCodeListVersion'
+    object = 'ConceptScheme'
+    cardinality = '?*'
+    composite = fulltext_container = None
+    inlined = True
+    constraints = []
+
+ at seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+                      annotable=True)
 class SEDARelationshipCodeListVersion(EntityType):
     u""""""
 
 
 class archive_transfer_relationship_code_list_version_from(RelationDefinition):
@@ -580,10 +604,34 @@ class archive_transfer_service_level(Rel
     inlined = True
     constraints = []
 
 @seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
                       annotable=True)
+class SEDAAcquisitionInformation(EntityType):
+    u""""""
+
+
+class archive_transfer_acquisition_information_from(RelationDefinition):
+    name = 'seda_acquisition_information_from'
+    subject = 'SEDAAcquisitionInformation'
+    object = 'SEDAArchiveTransfer'
+    cardinality = '1?'
+    composite = fulltext_container = 'object'
+    inlined = True
+    constraints = []
+
+class acquisition_information_acquisition_information_to(RelationDefinition):
+    name = 'seda_acquisition_information_to'
+    subject = 'SEDAAcquisitionInformation'
+    object = 'Concept'
+    cardinality = '?*'
+    composite = fulltext_container = None
+    inlined = True
+    constraints = [RQLConstraint('O in_scheme CS, EXISTS(CACLV seda_acquisition_information_code_list_version_from AT,        CACLV seda_acquisition_information_code_list_version_to CS,       S container AT) OR EXISTS(S container AU, AU is SEDAArchiveUnit, CS scheme_relation_type RT,            RT name "seda_acquisition_information_to")')]
+
+ at seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+                      annotable=True)
 class SEDALegalStatus(EntityType):
     u""""""
 
 
 class archive_transfer_legal_status_from(RelationDefinition):
diff --git a/cubicweb_seda/views/archivetransfer.py b/cubicweb_seda/views/archivetransfer.py
--- a/cubicweb_seda/views/archivetransfer.py
+++ b/cubicweb_seda/views/archivetransfer.py
@@ -37,10 +37,11 @@ at_ordered_fields = [
     ('seda_transfer_request_reply_identifier', 'object'),
     ('seda_comment', 'object'),
     ('seda_signature', 'object'),
     ('seda_archival_agreement', 'object'),
     ('seda_service_level', 'object'),
+    ('seda_acquisition_information_from', 'object'),
     ('seda_legal_status_from', 'object')]
 
 pvs = uicfg.primaryview_section
 pvdc = uicfg.primaryview_display_ctrl
 rec = uicfg.reledit_ctrl
diff --git a/cubicweb_seda/views/uicfg.py b/cubicweb_seda/views/uicfg.py
--- a/cubicweb_seda/views/uicfg.py
+++ b/cubicweb_seda/views/uicfg.py
@@ -74,10 +74,11 @@ ives['SEDAEvent'] = 'subobject'
 ives['SEDARelationship'] = 'subobject'
 ives['SEDATag'] = 'subobject'
 ives['SEDAAltStorageRulePreventInheritance'] = 'subobject'
 ives['SEDAWriter'] = 'subobject'
 ives['SEDAAccessRuleCodeListVersion'] = 'subobject'
+ives['SEDAAcquisitionInformationCodeListVersion'] = 'subobject'
 ives['SEDALegalStatus'] = 'subobject'
 ives['SEDADisseminationRule'] = 'subobject'
 ives['SEDAAddressee'] = 'subobject'
 ives['SEDAReferences'] = 'subobject'
 ives['SEDADataObjectVersionCodeListVersion'] = 'subobject'
@@ -94,10 +95,11 @@ ives['SEDAClassificationRuleCodeListVers
 ives['SEDARequires'] = 'subobject'
 ives['SEDAOriginatingSystemId'] = 'subobject'
 ives['SEDAVersion'] = 'subobject'
 ives['SEDAGpsLongitudeRef'] = 'subobject'
 ives['SEDASource'] = 'subobject'
+ives['SEDAAcquisitionInformation'] = 'subobject'
 ives['SEDAEndDate'] = 'subobject'
 ives['SEDACreatingOs'] = 'subobject'
 ives['SEDAAltRequiresArchiveUnitRefId'] = 'subobject'
 ives['SEDAWeight'] = 'subobject'
 ives['SEDAType'] = 'subobject'
@@ -223,10 +225,14 @@ abaa.tag_object_of(('*', 'seda_reuse_rul
 abaa.tag_subject_of(('*', 'seda_reuse_rule_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_classification_rule_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_classification_rule_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_classification_rule_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_classification_rule_code_list_version_to', '*'), False)
+abaa.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), False)
+abaa.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_relationship_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_relationship_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_relationship_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_relationship_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_binary_data_object', '*'), False)
@@ -245,10 +251,14 @@ abaa.tag_subject_of(('*', 'seda_compress
 abaa.tag_object_of(('*', 'seda_compressed', '*'), False)
 abaa.tag_subject_of(('*', 'seda_archive_unit', '*'), False)
 abaa.tag_object_of(('*', 'seda_archive_unit', '*'), False)
 abaa.tag_subject_of(('*', 'seda_service_level', '*'), False)
 abaa.tag_object_of(('*', 'seda_service_level', '*'), False)
+abaa.tag_subject_of(('*', 'seda_acquisition_information_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_acquisition_information_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_acquisition_information_to', '*'), False)
+abaa.tag_subject_of(('*', 'seda_acquisition_information_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_legal_status_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_legal_status_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_legal_status_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_legal_status_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_storage_rule', '*'), False)
@@ -546,10 +556,11 @@ affk.tag_subject_of(('*', 'seda_storage_
 affk.tag_subject_of(('*', 'seda_appraisal_rule_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_access_rule_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_dissemination_rule_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_reuse_rule_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_classification_rule_code_list_version_to', '*'), {'label': 'value'})
+affk.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_relationship_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'filename', '*'), {'widget': fw.TextInput({'size': 80})})
 affk.tag_subject_of(('*', 'compressed', '*'), {'allow_none': True})
 affk.tag_subject_of(('*', 'service_level', '*'), {'widget': fw.TextInput({'size': 80})})
 affk.tag_subject_of(('*', 'classification_owner', '*'), {'widget': fw.TextInput({'size': 80})})
@@ -642,10 +653,14 @@ afs.tag_object_of(('*', 'seda_reuse_rule
 afs.tag_subject_of(('*', 'seda_reuse_rule_code_list_version_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_classification_rule_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_classification_rule_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_classification_rule_code_list_version_to', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_classification_rule_code_list_version_to', '*'), 'main', 'attributes')
+afs.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), 'main', 'hidden')
+afs.tag_object_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), 'main', 'hidden')
+afs.tag_object_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), 'main', 'hidden')
+afs.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_relationship_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_relationship_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_relationship_code_list_version_to', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_relationship_code_list_version_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_binary_data_object', '*'), 'main', 'hidden')
@@ -664,10 +679,14 @@ afs.tag_subject_of(('*', 'seda_compresse
 afs.tag_object_of(('*', 'seda_compressed', '*'), 'main', 'inlined')
 afs.tag_subject_of(('*', 'seda_archive_unit', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_archive_unit', '*'), '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_acquisition_information_from', '*'), 'main', 'hidden')
+afs.tag_object_of(('*', 'seda_acquisition_information_from', '*'), 'main', 'inlined')
+afs.tag_object_of(('*', 'seda_acquisition_information_to', '*'), 'main', 'hidden')
+afs.tag_subject_of(('*', 'seda_acquisition_information_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_legal_status_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_legal_status_from', '*'), 'main', 'inlined')
 afs.tag_object_of(('*', 'seda_legal_status_to', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_legal_status_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_storage_rule', '*'), 'main', 'hidden')
@@ -991,10 +1010,13 @@ pvs.tag_subject_of(('*', 'seda_reuse_rul
 pvs.tag_object_of(('*', 'seda_reuse_rule_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_reuse_rule_code_list_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_classification_rule_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_classification_rule_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_classification_rule_code_list_version_to', '*'), 'hidden')
+pvs.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), 'hidden')
+pvs.tag_object_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), 'hidden')
+pvs.tag_object_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_relationship_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_relationship_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_relationship_code_list_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_binary_data_object', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_binary_data_object', '*'), 'hidden')
@@ -1003,10 +1025,11 @@ pvs.tag_object_of(('*', 'seda_physical_d
 pvs.tag_subject_of(('*', 'seda_relationship', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_relationship', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_data_object_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_archive_unit', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_archive_unit', '*'), 'hidden')
+pvs.tag_object_of(('*', 'seda_acquisition_information_to', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_legal_status_to', '*'), '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')
@@ -1156,20 +1179,24 @@ rec.tag_object_of(('*', 'seda_disseminat
 rec.tag_subject_of(('*', 'seda_dissemination_rule_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_reuse_rule_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_reuse_rule_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_classification_rule_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_classification_rule_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
+rec.tag_object_of(('*', 'seda_acquisition_information_code_list_version_from', '*'), {'novalue_label': ' '})
+rec.tag_subject_of(('*', 'seda_acquisition_information_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_relationship_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_relationship_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_subject_of(('*', 'filename', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_data_object_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_data_object_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_subject_of(('*', 'seda_alt_binary_data_object_attachment', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_subject_of(('*', 'compressed', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_compressed', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'service_level', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_service_level', '*'), {'novalue_label': ' '})
+rec.tag_object_of(('*', 'seda_acquisition_information_from', '*'), {'novalue_label': ' '})
+rec.tag_subject_of(('*', 'seda_acquisition_information_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_legal_status_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_legal_status_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_storage_rule', '*'), {'novalue_label': ' '})
 rec.tag_object_of(('*', 'seda_appraisal_rule', '*'), {'novalue_label': ' '})
 rec.tag_object_of(('*', 'seda_access_rule', '*'), {'novalue_label': ' '})
diff --git a/cubicweb_seda/xsd.py b/cubicweb_seda/xsd.py
--- a/cubicweb_seda/xsd.py
+++ b/cubicweb_seda/xsd.py
@@ -128,10 +128,11 @@ XSD2YAMS = {
     'TransferringAgency': 'AuthorityRecord',
 
     'type': 'Concept',  # Relationship
     'algorithm': 'Concept',
     'language': 'Concept',
+    'AcquisitionInformation': 'Concept',
     'DescriptionLevel': 'Concept',
     'ClassificationLevel': 'Concept',
     'FinalAction': 'Concept',
     'Encoding': 'Concept',
     'MimeType': 'Concept',
@@ -153,10 +154,11 @@ XSD2YAMS = {
     'Rule': 'Concept',
     'RefNonRuleId': 'Concept',
     'Type': 'Concept',
 
     'RelationshipCodeListVersion': 'ConceptScheme',
+    'AcquisitionInformationCodeListVersion': 'ConceptScheme',
     'AuthorizationReasonCodeListVersion': 'ConceptScheme',
     'ClassificationRuleCodeListVersion': 'ConceptScheme',
     'ReuseRuleCodeListVersion': 'ConceptScheme',
     'DisseminationRuleCodeListVersion': 'ConceptScheme',
     'AccessRuleCodeListVersion': 'ConceptScheme',
diff --git a/cubicweb_seda/xsd/seda-2.0-main.xsd b/cubicweb_seda/xsd/seda-2.0-main.xsd
--- a/cubicweb_seda/xsd/seda-2.0-main.xsd
+++ b/cubicweb_seda/xsd/seda-2.0-main.xsd
@@ -68,10 +68,15 @@
     <xsd:complexType name="CodeListVersionsType">
         <xsd:sequence>
             <xsd:group ref="TransportCodeListsGroup"/>
             <xsd:group ref="TechnicalCodeListsGroup"/>
             <xsd:group ref="ManagementCodeListsGroup"/>
+            <xsd:element name="AcquisitionInformationCodeListVersion" type="CodeType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de codes des modalités d'entrée.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
             <xsd:element name="AuthorizationReasonCodeListVersion" type="CodeType" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>Version de la liste de codes d'autorisation.</xsd:documentation>
                 </xsd:annotation>
             </xsd:element>
@@ -136,10 +141,15 @@
             <xsd:element name="ServiceLevel" type="IdentifierType" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>Niveau de service applicable aux unités d’archives.</xsd:documentation>
                 </xsd:annotation>
             </xsd:element>
+            <xsd:element name="AcquisitionInformation" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Modalités d'entrée des archives.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
             <xsd:element name="LegalStatus" type="LegalStatusType" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>Statut des archives échangées.</xsd:documentation>
                 </xsd:annotation>
             </xsd:element>
diff --git a/cubicweb_seda/xsd2yams.py b/cubicweb_seda/xsd2yams.py
--- a/cubicweb_seda/xsd2yams.py
+++ b/cubicweb_seda/xsd2yams.py
@@ -116,10 +116,17 @@ RDEF_CONSTRAINTS = {
         'O in_scheme CS, CS scheme_relation_type CR, CR name "seda_final_action", '
         'CS scheme_entity_type ET, ET name "{subjtype}"'),
     # - scheme defined as code list
     #   if you modify one of those, keep synchronized the SCHEME_FROM_CONTAINER map below
     #   and run "python -m tox -e make" to update the schema"
+    'seda_acquisition_information_to': (
+        'O in_scheme CS, '
+        'EXISTS(CACLV seda_acquisition_information_code_list_version_from AT, '
+        '       CACLV seda_acquisition_information_code_list_version_to CS,'
+        '       S container AT)'
+        ' OR EXISTS(S container AU, AU is SEDAArchiveUnit, CS scheme_relation_type RT, '
+        '           RT name "seda_acquisition_information_to")'),
     'seda_mime_type_to': (
         'O in_scheme CS, '
         'EXISTS(CACLV seda_mime_type_code_list_version_from AT, '
         '       CACLV seda_mime_type_code_list_version_to CS,'
         '       S container AT)'
@@ -216,10 +223,15 @@ for rule_type in RULE_TYPES:
 
 # Map RQL expression to retrieve matching concept scheme depending on the container type.
 # Client code (e.g. in `views/dataobject`) expect scheme to be mapped to the "CS" variable
 # and container's eid will be specified using a "container" query argument.
 SCHEME_FROM_CONTAINER = {
+    'seda_acquisition_information_to': {
+        'SEDAArchiveTransfer': ('CACLV seda_acquisition_information_code_list_version_from AT, '
+                                'CACLV seda_acquisition_information_code_list_version_to CS, '
+                                'AT eid %(container)s'),
+    },
     'seda_mime_type_to': {
         'SEDAArchiveTransfer': ('CACLV seda_mime_type_code_list_version_from AT, '
                                 'CACLV seda_mime_type_code_list_version_to CS, '
                                 'AT eid %(container)s'),
         'SEDAArchiveUnit': 'CS scheme_relation_type RT, RT name "seda_mime_type_to"',
diff --git a/test/test_xsd2yams.py b/test/test_xsd2yams.py
--- a/test/test_xsd2yams.py
+++ b/test/test_xsd2yams.py
@@ -267,10 +267,13 @@ class XSIterateTC(unittest.TestCase):
             ('ManagementMetadata', 'SEDAArchiveTransfer', [
                 ('id', [('seda_id', 'object', 'SEDAid'), ('id', 'subject', 'String')]),
                 ('ServiceLevel',
                  [('seda_service_level', 'object', 'SEDAServiceLevel'),
                   ('service_level', 'subject', 'String')]),
+                ('AcquisitionInformation',
+                 [('seda_acquisition_information_from', 'object', 'SEDAAcquisitionInformation'),
+                  ('seda_acquisition_information_to', 'subject', 'Concept')]),
                 ('LegalStatus',
                  [('seda_legal_status_from', 'object', 'SEDALegalStatus'),
                   ('seda_legal_status_to', 'subject', 'Concept')]),
                 ('StorageRule', [('seda_storage_rule', 'object', 'SEDAStorageRule')]),
                 ('AppraisalRule', [('seda_appraisal_rule', 'object', 'SEDAAppraisalRule')]),


More information about the saem-devel mailing list