[PATCH 04 of 11 seda V2] [SEDA 2.1] Make MessageDigestCodeListVersion optional

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


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1488533827 -3600
#      Fri Mar 03 10:37:07 2017 +0100
# Node ID ad791cf90bc2d03d186bbc78641eec811719d2f2
# Parent  317b5c7b3d49730164bbe9842d09b7d44bb39bd2
[SEDA 2.1] Make MessageDigestCodeListVersion optional

This includes some random reording in the uicfg (due to reordering of the
schema?).

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
@@ -56,10 +56,15 @@ class SEDARelatedTransferReference(SEDAA
 class SEDATransferRequestReplyIdentifier(SEDAAnyEntity):
     __regid__ = 'SEDATransferRequestReplyIdentifier'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
+class SEDAMessageDigestAlgorithmCodeListVersion(SEDAAnyEntity):
+    __regid__ = 'SEDAMessageDigestAlgorithmCodeListVersion'
+    fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
+    value_attr = None
+
 class SEDAMimeTypeCodeListVersion(SEDAAnyEntity):
     __regid__ = 'SEDAMimeTypeCodeListVersion'
     fetch_attrs, cw_fetch_order = fetch_config(['user_cardinality'])
     value_attr = None
 
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
@@ -354,10 +354,13 @@ msgid "New SEDALegalStatus"
 msgstr ""
 
 msgid "New SEDALength"
 msgstr ""
 
+msgid "New SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
 msgid "New SEDAMimeType"
 msgstr ""
 
 msgid "New SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -1292,10 +1295,16 @@ msgid "SEDALength"
 msgstr ""
 
 msgid "SEDALength_plural"
 msgstr ""
 
+msgid "SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
+msgid "SEDAMessageDigestAlgorithmCodeListVersion_plural"
+msgstr ""
+
 msgid "SEDAMimeType"
 msgstr ""
 
 msgid "SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -2460,10 +2469,16 @@ msgid "This SEDALength"
 msgstr ""
 
 msgid "This SEDALength:"
 msgstr ""
 
+msgid "This SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
+msgid "This SEDAMessageDigestAlgorithmCodeListVersion:"
+msgstr ""
+
 msgid "This SEDAMimeType"
 msgstr ""
 
 msgid "This SEDAMimeType:"
 msgstr ""
@@ -3326,10 +3341,13 @@ msgid "add a SEDALegalStatus"
 msgstr ""
 
 msgid "add a SEDALength"
 msgstr ""
 
+msgid "add a SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
 msgid "add a SEDAMimeType"
 msgstr ""
 
 msgid "add a SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -4188,10 +4206,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "container"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "container"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "container"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
@@ -6431,22 +6453,36 @@ msgid "seda_length_object"
 msgstr ""
 
 msgid "seda_management_tab"
 msgstr ""
 
-msgid "seda_message_digest_algorithm_code_list_version"
+msgid "seda_message_digest_algorithm_code_list_version_from"
+msgstr ""
+
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "seda_message_digest_algorithm_code_list_version_from"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_from_object"
 msgstr ""
 
 msgctxt "SEDAArchiveTransfer"
-msgid "seda_message_digest_algorithm_code_list_version"
-msgstr ""
-
-msgid "seda_message_digest_algorithm_code_list_version_object"
+msgid "seda_message_digest_algorithm_code_list_version_from_object"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_to"
+msgstr ""
+
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "seda_message_digest_algorithm_code_list_version_to"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_to_object"
 msgstr ""
 
 msgctxt "ConceptScheme"
-msgid "seda_message_digest_algorithm_code_list_version_object"
+msgid "seda_message_digest_algorithm_code_list_version_to_object"
 msgstr ""
 
 msgid "seda_mime_type_code_list_version_from"
 msgstr ""
 
@@ -8056,10 +8092,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "user_annotation"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "user_annotation"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "user_annotation"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
@@ -8559,10 +8599,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "user_cardinality"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "user_cardinality"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "user_cardinality"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
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
@@ -361,10 +361,13 @@ msgid "New SEDALegalStatus"
 msgstr ""
 
 msgid "New SEDALength"
 msgstr ""
 
+msgid "New SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
 msgid "New SEDAMimeType"
 msgstr ""
 
 msgid "New SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -1302,10 +1305,16 @@ msgid "SEDALength"
 msgstr ""
 
 msgid "SEDALength_plural"
 msgstr ""
 
+msgid "SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
+msgid "SEDAMessageDigestAlgorithmCodeListVersion_plural"
+msgstr ""
+
 msgid "SEDAMimeType"
 msgstr "type MIME"
 
 msgid "SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -2472,10 +2481,16 @@ msgid "This SEDALength"
 msgstr ""
 
 msgid "This SEDALength:"
 msgstr ""
 
+msgid "This SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
+msgid "This SEDAMessageDigestAlgorithmCodeListVersion:"
+msgstr ""
+
 msgid "This SEDAMimeType"
 msgstr ""
 
 msgid "This SEDAMimeType:"
 msgstr ""
@@ -3340,10 +3355,13 @@ msgid "add a SEDALegalStatus"
 msgstr ""
 
 msgid "add a SEDALength"
 msgstr ""
 
+msgid "add a SEDAMessageDigestAlgorithmCodeListVersion"
+msgstr ""
+
 msgid "add a SEDAMimeType"
 msgstr ""
 
 msgid "add a SEDAMimeTypeCodeListVersion"
 msgstr ""
@@ -4202,10 +4220,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "container"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "container"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "container"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
@@ -6452,22 +6474,36 @@ msgid "seda_length_object"
 msgstr ""
 
 msgid "seda_management_tab"
 msgstr "gestion"
 
-msgid "seda_message_digest_algorithm_code_list_version"
+msgid "seda_message_digest_algorithm_code_list_version_from"
+msgstr ""
+
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "seda_message_digest_algorithm_code_list_version_from"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_from_object"
 msgstr "algorithmes d'empreinte"
 
 msgctxt "SEDAArchiveTransfer"
-msgid "seda_message_digest_algorithm_code_list_version"
-msgstr ""
-
-msgid "seda_message_digest_algorithm_code_list_version_object"
+msgid "seda_message_digest_algorithm_code_list_version_from_object"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_to"
+msgstr ""
+
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "seda_message_digest_algorithm_code_list_version_to"
+msgstr ""
+
+msgid "seda_message_digest_algorithm_code_list_version_to_object"
 msgstr ""
 
 msgctxt "ConceptScheme"
-msgid "seda_message_digest_algorithm_code_list_version_object"
+msgid "seda_message_digest_algorithm_code_list_version_to_object"
 msgstr ""
 
 msgid "seda_mime_type_code_list_version_from"
 msgstr ""
 
@@ -8083,10 +8119,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "user_annotation"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "user_annotation"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "user_annotation"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
@@ -8586,10 +8626,14 @@ msgstr ""
 
 msgctxt "SEDALength"
 msgid "user_cardinality"
 msgstr ""
 
+msgctxt "SEDAMessageDigestAlgorithmCodeListVersion"
+msgid "user_cardinality"
+msgstr ""
+
 msgctxt "SEDAMimeType"
 msgid "user_cardinality"
 msgstr ""
 
 msgctxt "SEDAMimeTypeCodeListVersion"
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
@@ -1,9 +1,14 @@
 from cubicweb_seda.dataimport import import_seda_schemes, LCSV_FILES
 
+add_entity_type('SEDAMessageDigestAlgorithmCodeListVersion')
+drop_relation_type('seda_message_digest_algorithm_code_list_version')
+
 add_entity_type('SEDALegalStatus')
 
+sync_schema_props_perms('seda_algorithm')
+
 lcsv_files = [file_def for file_def in LCSV_FILES
               if file_def[-1] == 'legal_status.csv']
 import_seda_schemes(cnx, lcsv_files=lcsv_files)
 
 drop_relation_type('seda_reply_code_list_version')
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
@@ -125,13 +125,28 @@ class archive_transfer_transferring_agen
     cardinality = '?*'
     composite = fulltext_container = None
     inlined = True
     constraints = []
 
-class archive_transfer_message_digest_algorithm_code_list_version(RelationDefinition):
-    name = 'seda_message_digest_algorithm_code_list_version'
-    subject = 'SEDAArchiveTransfer'
+ at seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+                      annotable=True)
+class SEDAMessageDigestAlgorithmCodeListVersion(EntityType):
+    u""""""
+
+
+class archive_transfer_message_digest_algorithm_code_list_version_from(RelationDefinition):
+    name = 'seda_message_digest_algorithm_code_list_version_from'
+    subject = 'SEDAMessageDigestAlgorithmCodeListVersion'
+    object = 'SEDAArchiveTransfer'
+    cardinality = '1?'
+    composite = fulltext_container = 'object'
+    inlined = True
+    constraints = []
+
+class message_digest_algorithm_code_list_version_message_digest_algorithm_code_list_version_to(RelationDefinition):
+    name = 'seda_message_digest_algorithm_code_list_version_to'
+    subject = 'SEDAMessageDigestAlgorithmCodeListVersion'
     object = 'ConceptScheme'
     cardinality = '?*'
     composite = fulltext_container = None
     inlined = True
     constraints = []
@@ -750,11 +765,11 @@ class binary_data_object_algorithm(Relat
     subject = 'SEDABinaryDataObject'
     object = 'Concept'
     cardinality = '?*'
     composite = fulltext_container = None
     inlined = True
-    constraints = [RQLConstraint('O in_scheme CS, EXISTS(S container AT, AT seda_message_digest_algorithm_code_list_version CS) OR EXISTS(S container AU, AU is SEDAArchiveUnit,           CS scheme_relation_type RT, RT name "seda_algorithm",           CS scheme_entity_type ET, ET name "SEDABinaryDataObject")')]
+    constraints = [RQLConstraint('O in_scheme CS, EXISTS(S container AT, CACLV seda_message_digest_algorithm_code_list_version_from AT,        CACLV seda_message_digest_algorithm_code_list_version_to CS) OR EXISTS(S container AU, AU is SEDAArchiveUnit,           CS scheme_relation_type RT, RT name "seda_algorithm",           CS scheme_entity_type ET, ET name "SEDABinaryDataObject")')]
 
 class compressed_algorithm(RelationDefinition):
     name = 'seda_algorithm'
     subject = 'SEDACompressed'
     object = 'Concept'
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
@@ -22,53 +22,56 @@ ives = uicfg.indexview_etype_section
 ives['SEDALastModified'] = 'subobject'
 ives['SEDADataObjectVersion'] = 'subobject'
 ives['SEDAReplaces'] = 'subobject'
 ives['SEDAAltReferencesArchiveUnitRefId'] = 'subobject'
 ives['SEDACreatingOsVersion'] = 'subobject'
+ives['SEDARepositoryArchiveUnitPID'] = 'subobject'
 ives['SEDAKeywordReference'] = 'subobject'
 ives['SEDASignature'] = 'subobject'
-ives['SEDAFilePlanPosition'] = 'subobject'
+ives['SEDASpatial'] = 'subobject'
+ives['SEDAMessageDigestAlgorithmCodeListVersion'] = 'subobject'
 ives['SEDAFormatLitteral'] = 'subobject'
 ives['SEDADateCreatedByApplication'] = 'subobject'
 ives['SEDAFormatId'] = 'subobject'
 ives['SEDAOriginatingAgencyArchiveUnitIdentifier'] = 'subobject'
-ives['SEDAClassificationReassessingDate'] = 'subobject'
+ives['SEDAAltClassificationRulePreventInheritance'] = 'subobject'
 ives['SEDAGpsAltitudeRef'] = 'subobject'
 ives['SEDAAltIsVersionOfArchiveUnitRefId'] = 'subobject'
 ives['SEDAArchiveUnitRefId'] = 'subobject'
 ives['SEDAHeight'] = 'subobject'
 ives['SEDASentDate'] = 'subobject'
 ives['SEDAGpsLongitude'] = 'subobject'
 ives['SEDALanguage'] = 'subobject'
+ives['SEDAClassificationReassessingDate'] = 'subobject'
 ives['SEDAGpsLatitude'] = 'subobject'
 ives['SEDADiameter'] = 'subobject'
 ives['SEDACustodialHistoryFile'] = 'subobject'
 ives['SEDAStatus'] = 'subobject'
+ives['SEDASeqStorageRuleRule'] = 'subobject'
 ives['SEDAAltReplacesArchiveUnitRefId'] = 'subobject'
 ives['SEDArestrictionValue'] = 'subobject'
 ives['SEDASystemId'] = 'subobject'
 ives['SEDAEventType'] = 'subobject'
 ives['SEDAIsPartOf'] = 'subobject'
 ives['SEDAPreventInheritance'] = 'subobject'
 ives['SEDAAltArchiveUnitArchiveUnitRefId'] = 'subobject'
 ives['SEDAwhen'] = 'subobject'
 ives['SEDAKeywordType'] = 'subobject'
-ives['SEDAEventIdentifier'] = 'subobject'
+ives['SEDAGpsAltitude'] = 'subobject'
 ives['SEDAIsVersionOf'] = 'subobject'
 ives['SEDAArchivalAgreement'] = 'subobject'
 ives['SEDArestrictionEndDate'] = 'subobject'
-ives['SEDADisseminationRuleCodeListVersion'] = 'subobject'
+ives['SEDASeqAltArchiveUnitArchiveUnitRefIdManagement'] = 'subobject'
 ives['SEDATitle'] = 'subobject'
 ives['SEDAGpsDateStamp'] = 'subobject'
 ives['SEDAEncoding'] = 'subobject'
 ives['SEDACreatingApplicationVersion'] = 'subobject'
 ives['SEDATransactedDate'] = 'subobject'
-ives['SEDAAltRequiresArchiveUnitRefId'] = 'subobject'
+ives['SEDARepositoryObjectPID'] = 'subobject'
+ives['SEDARegisteredDate'] = 'subobject'
 ives['SEDANeedAuthorization'] = 'subobject'
-ives['SEDARepositoryObjectPID'] = 'subobject'
-ives['SEDASpatial'] = 'subobject'
-ives['SEDAVersion'] = 'subobject'
+ives['SEDAEvent'] = 'subobject'
 ives['SEDARelationship'] = 'subobject'
 ives['SEDATag'] = 'subobject'
 ives['SEDAAltStorageRulePreventInheritance'] = 'subobject'
 ives['SEDAWriter'] = 'subobject'
 ives['SEDAAccessRuleCodeListVersion'] = 'subobject'
@@ -79,26 +82,24 @@ ives['SEDAReferences'] = 'subobject'
 ives['SEDADataObjectVersionCodeListVersion'] = 'subobject'
 ives['SEDAAuthorizedAgent'] = 'subobject'
 ives['SEDACreatingApplicationName'] = 'subobject'
 ives['SEDAKeyword'] = 'subobject'
 ives['SEDADescription'] = 'subobject'
-ives['SEDARegisteredDate'] = 'subobject'
+ives['SEDAFilePlanPosition'] = 'subobject'
 ives['SEDAArchiveUnit'] = 'subobject'
-ives['SEDAAltAccessRulePreventInheritance'] = 'subobject'
+ives['SEDASeqAccessRuleRule'] = 'subobject'
 ives['SEDARefNonRuleId'] = 'subobject'
 ives['SEDAWidth'] = 'subobject'
-ives['SEDAAltDisseminationRulePreventInheritance'] = 'subobject'
+ives['SEDAClassificationRuleCodeListVersion'] = 'subobject'
 ives['SEDARequires'] = 'subobject'
-ives['SEDAStorageRuleCodeListVersion'] = 'subobject'
 ives['SEDAOriginatingSystemId'] = 'subobject'
-ives['SEDAAltClassificationRulePreventInheritance'] = 'subobject'
+ives['SEDAVersion'] = 'subobject'
 ives['SEDAGpsLongitudeRef'] = 'subobject'
 ives['SEDASource'] = 'subobject'
-ives['SEDARepositoryArchiveUnitPID'] = 'subobject'
 ives['SEDAEndDate'] = 'subobject'
 ives['SEDACreatingOs'] = 'subobject'
-ives['SEDAGpsAltitude'] = 'subobject'
+ives['SEDAAltRequiresArchiveUnitRefId'] = 'subobject'
 ives['SEDAWeight'] = 'subobject'
 ives['SEDAType'] = 'subobject'
 ives['SEDADocumentType'] = 'subobject'
 ives['SEDArestrictionRuleIdRef'] = 'subobject'
 ives['SEDAGpsLatitudeRef'] = 'subobject'
@@ -106,11 +107,11 @@ ives['SEDAComment'] = 'subobject'
 ives['SEDADescriptionLanguage'] = 'subobject'
 ives['SEDAAccessRule'] = 'subobject'
 ives['SEDACompressionAlgorithmCodeListVersion'] = 'subobject'
 ives['SEDATemporal'] = 'subobject'
 ives['SEDAPhysicalDataObject'] = 'subobject'
-ives['SEDASeqAltArchiveUnitArchiveUnitRefIdManagement'] = 'subobject'
+ives['SEDAStartDate'] = 'subobject'
 ives['SEDAThickness'] = 'subobject'
 ives['SEDAAltAppraisalRulePreventInheritance'] = 'subobject'
 ives['SEDASeqAppraisalRuleRule'] = 'subobject'
 ives['SEDAEncodingCodeListVersion'] = 'subobject'
 ives['SEDATransferRequestReplyIdentifier'] = 'subobject'
@@ -120,23 +121,25 @@ ives['SEDAUri'] = 'subobject'
 ives['SEDAEventDetail'] = 'subobject'
 ives['SEDAAppraisalRule'] = 'subobject'
 ives['SEDAReuseRuleCodeListVersion'] = 'subobject'
 ives['SEDAAcquiredDate'] = 'subobject'
 ives['SEDASeqReuseRuleRule'] = 'subobject'
+ives['SEDAServiceLevel'] = 'subobject'
 ives['SEDANumberOfPage'] = 'subobject'
 ives['SEDAAppraisalRuleCodeListVersion'] = 'subobject'
 ives['SEDAJuridictional'] = 'subobject'
 ives['SEDAReuseRule'] = 'subobject'
+ives['SEDACustodialHistoryItem'] = 'subobject'
 ives['SEDATransferringAgencyArchiveUnitIdentifier'] = 'subobject'
 ives['SEDALength'] = 'subobject'
 ives['SEDAArchivalAgencyArchiveUnitIdentifier'] = 'subobject'
 ives['SEDAOriginatingAgency'] = 'subobject'
 ives['SEDACreatedDate'] = 'subobject'
-ives['SEDACustodialHistoryItem'] = 'subobject'
-ives['SEDASeqStorageRuleRule'] = 'subobject'
+ives['SEDADisseminationRuleCodeListVersion'] = 'subobject'
+ives['SEDAAltAccessRulePreventInheritance'] = 'subobject'
 ives['SEDADepth'] = 'subobject'
-ives['SEDAStartDate'] = 'subobject'
+ives['SEDAEventIdentifier'] = 'subobject'
 ives['SEDAAltBinaryDataObjectAttachment'] = 'subobject'
 ives['SEDANeedReassessingAuthorization'] = 'subobject'
 ives['SEDAStorageRule'] = 'subobject'
 ives['SEDABinaryDataObject'] = 'subobject'
 ives['SEDAGpsVersionID'] = 'subobject'
@@ -144,20 +147,18 @@ ives['SEDASeqDisseminationRuleRule'] = '
 ives['SEDAAltReuseRulePreventInheritance'] = 'subobject'
 ives['SEDAClassificationRule'] = 'subobject'
 ives['SEDARelatedTransferReference'] = 'subobject'
 ives['SEDAAttachment'] = 'subobject'
 ives['SEDASeqClassificationRuleRule'] = 'subobject'
-ives['SEDASeqAccessRuleRule'] = 'subobject'
-ives['SEDAClassificationRuleCodeListVersion'] = 'subobject'
-ives['SEDAEvent'] = 'subobject'
+ives['SEDAStorageRuleCodeListVersion'] = 'subobject'
+ives['SEDASubmissionAgency'] = 'subobject'
 ives['SEDAMimeType'] = 'subobject'
 ives['SEDAReceivedDate'] = 'subobject'
-ives['SEDASubmissionAgency'] = 'subobject'
 ives['SEDAMimeTypeCodeListVersion'] = 'subobject'
 ives['SEDARecipient'] = 'subobject'
 ives['SEDADataObjectReference'] = 'subobject'
-ives['SEDAServiceLevel'] = 'subobject'
+ives['SEDAAltDisseminationRulePreventInheritance'] = 'subobject'
 ives['SEDAShape'] = 'subobject'
 ives['SEDAAltIsPartOfArchiveUnitRefId'] = 'subobject'
 
 
 abaa = uicfg.actionbox_appearsin_addmenu
@@ -173,12 +174,14 @@ abaa.tag_subject_of(('*', 'seda_transfer
 abaa.tag_object_of(('*', 'seda_transfer_request_reply_identifier', '*'), False)
 abaa.tag_object_of(('*', 'seda_archival_agency', '*'), False)
 abaa.tag_subject_of(('*', 'seda_archival_agency', '*'), False)
 abaa.tag_object_of(('*', 'seda_transferring_agency', '*'), False)
 abaa.tag_subject_of(('*', 'seda_transferring_agency', '*'), False)
-abaa.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), False)
-abaa.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), False)
+abaa.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), False)
+abaa.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), False)
+abaa.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_mime_type_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_mime_type_code_list_version_from', '*'), False)
 abaa.tag_object_of(('*', 'seda_mime_type_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_mime_type_code_list_version_to', '*'), False)
 abaa.tag_subject_of(('*', 'seda_encoding_code_list_version_from', '*'), False)
@@ -528,10 +531,11 @@ abaa.tag_object_of(('*', 'seda_repositor
 
 
 affk = uicfg.autoform_field_kwargs
 affk.tag_subject_of(('*', 'comment', '*'), {'widget': fw.TextInput({'size': 80})})
 affk.tag_subject_of(('*', 'archival_agreement', '*'), {'widget': fw.TextInput({'size': 80})})
+affk.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_mime_type_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_encoding_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_compression_algorithm_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_data_object_version_code_list_version_to', '*'), {'label': 'value'})
 affk.tag_subject_of(('*', 'seda_storage_rule_code_list_version_to', '*'), {'label': 'value'})
@@ -586,12 +590,14 @@ afs.tag_subject_of(('*', 'seda_transfer_
 afs.tag_object_of(('*', 'seda_transfer_request_reply_identifier', '*'), 'main', 'inlined')
 afs.tag_object_of(('*', 'seda_archival_agency', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_archival_agency', '*'), 'main', 'attributes')
 afs.tag_object_of(('*', 'seda_transferring_agency', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_transferring_agency', '*'), 'main', 'attributes')
-afs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), 'main', 'hidden')
-afs.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), 'main', 'hidden')
+afs.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), 'main', 'hidden')
+afs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), 'main', 'hidden')
+afs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), 'main', 'hidden')
+afs.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_mime_type_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_mime_type_code_list_version_from', '*'), 'main', 'hidden')
 afs.tag_object_of(('*', 'seda_mime_type_code_list_version_to', '*'), 'main', 'hidden')
 afs.tag_subject_of(('*', 'seda_mime_type_code_list_version_to', '*'), 'main', 'attributes')
 afs.tag_subject_of(('*', 'seda_encoding_code_list_version_from', '*'), 'main', 'hidden')
@@ -943,12 +949,13 @@ afs.tag_object_of(('*', 'seda_repository
 pvs = uicfg.primaryview_section
 pvs.tag_subject_of(('*', 'seda_related_transfer_reference', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_related_transfer_reference', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_archival_agency', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_transferring_agency', '*'), 'hidden')
-pvs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), 'hidden')
-pvs.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), 'hidden')
+pvs.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), 'hidden')
+pvs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), 'hidden')
+pvs.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_mime_type_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_mime_type_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_mime_type_code_list_version_to', '*'), 'hidden')
 pvs.tag_subject_of(('*', 'seda_encoding_code_list_version_from', '*'), 'hidden')
 pvs.tag_object_of(('*', 'seda_encoding_code_list_version_from', '*'), 'hidden')
@@ -1118,11 +1125,12 @@ rec.tag_object_of(('*', 'seda_signature'
 rec.tag_subject_of(('*', 'archival_agreement', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_archival_agreement', '*'), {'novalue_label': ' '})
 rec.tag_object_of(('*', 'seda_transfer_request_reply_identifier', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_archival_agency', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_subject_of(('*', 'seda_transferring_agency', '*'), {'novalue_label': '<no value specified>'})
-rec.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version', '*'), {'novalue_label': '<no value specified>'})
+rec.tag_object_of(('*', 'seda_message_digest_algorithm_code_list_version_from', '*'), {'novalue_label': ' '})
+rec.tag_subject_of(('*', 'seda_message_digest_algorithm_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_mime_type_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_mime_type_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_object_of(('*', 'seda_encoding_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_encoding_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
 rec.tag_subject_of(('*', 'seda_file_format_code_list_version', '*'), {'novalue_label': '<no value specified>'})
diff --git a/cubicweb_seda/xsd/seda-2.0-types.xsd b/cubicweb_seda/xsd/seda-2.0-types.xsd
--- a/cubicweb_seda/xsd/seda-2.0-types.xsd
+++ b/cubicweb_seda/xsd/seda-2.0-types.xsd
@@ -157,11 +157,11 @@
     </xsd:simpleType>
     
     <!-- Digest -->
     <xsd:group name="DigestAlgorithmCodeListGroup">
         <xsd:sequence>
-            <xsd:element name="MessageDigestAlgorithmCodeListVersion" type="CodeType">
+            <xsd:element name="MessageDigestAlgorithmCodeListVersion" type="CodeType" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>Liste de l'algorithme de hachage utilisé dans le message.</xsd:documentation>
                 </xsd:annotation>
             </xsd:element>
         </xsd:sequence>
diff --git a/cubicweb_seda/xsd2yams.py b/cubicweb_seda/xsd2yams.py
--- a/cubicweb_seda/xsd2yams.py
+++ b/cubicweb_seda/xsd2yams.py
@@ -143,11 +143,12 @@ RDEF_CONSTRAINTS = {
         'O in_scheme CS, CACLV seda_relationship_code_list_version_from AT, '
         'CACLV seda_relationship_code_list_version_to CS,'
         'S container AT'),
     ('SEDABinaryDataObject', 'seda_algorithm'): (
         'O in_scheme CS, '
-        'EXISTS(S container AT, AT seda_message_digest_algorithm_code_list_version CS) '
+        'EXISTS(S container AT, CACLV seda_message_digest_algorithm_code_list_version_from AT, '
+        '       CACLV seda_message_digest_algorithm_code_list_version_to CS) '
         'OR EXISTS(S container AU, AU is SEDAArchiveUnit, '
         '          CS scheme_relation_type RT, RT name "seda_algorithm", '
         '          CS scheme_entity_type ET, ET name "SEDABinaryDataObject")'),
     ('SEDACompressed', 'seda_algorithm'): (
         'O in_scheme CS, CACLV seda_compression_algorithm_code_list_version_from AT, '
@@ -240,11 +241,12 @@ SCHEME_FROM_CONTAINER = {
     'seda_type_relationship': {
         'SEDAArchiveTransfer': ('CACLV seda_relationship_code_list_version_to CS,'
                                 'AT eid %(container)s'),
     },
     ('SEDABinaryDataObject', 'seda_algorithm'): {
-        'SEDAArchiveTransfer': ('AT seda_message_digest_algorithm_code_list_version CS, '
+        'SEDAArchiveTransfer': ('CACLV seda_message_digest_algorithm_code_list_version_from AT, '
+                                'CACLV seda_message_digest_algorithm_code_list_version_to CS, '
                                 'AT eid %(container)s'),
         'SEDAArchiveUnit': ('CS scheme_relation_type RT, RT name "seda_algorithm", '
                             'CS scheme_entity_type ET, ET name "SEDABinaryDataObject"'),
     },
     ('SEDACompressed', 'seda_algorithm'): {
diff --git a/test/test_profile_generation.py b/test/test_profile_generation.py
--- a/test/test_profile_generation.py
+++ b/test/test_profile_generation.py
@@ -550,12 +550,14 @@ class SEDA2ExportTCMixIn(object):
     def test_seda2_concept(self):
         with self.admin_access.client_cnx() as cnx:
             create = cnx.create_entity
             scheme = create('ConceptScheme', title=u'Digest algorithm')
             some_concept = scheme.add_concept(label=u'md5 algorithm', language_code=u'en')
-            transfer = create('SEDAArchiveTransfer', title=u'test profile',
-                              seda_message_digest_algorithm_code_list_version=scheme)
+            transfer = create('SEDAArchiveTransfer', title=u'test profile')
+            cnx.create_entity('SEDAMessageDigestAlgorithmCodeListVersion',
+                              seda_message_digest_algorithm_code_list_version_from=transfer,
+                              seda_message_digest_algorithm_code_list_version_to=scheme)
             create('SEDABinaryDataObject', user_cardinality=u'0..n',
                    user_annotation=u'I am mandatory',
                    seda_binary_data_object=transfer,
                    seda_algorithm=some_concept)
 
@@ -622,12 +624,14 @@ class SEDAExportFuncTCMixIn(object):
         with self.admin_access.client_cnx() as cnx:
             create = cnx.create_entity
             scheme = create('ConceptScheme', title=u'Keyword Types')
             some_concept = scheme.add_concept(label=u'md5')
 
-            transfer = create('SEDAArchiveTransfer', title=u'test profile',
-                              seda_message_digest_algorithm_code_list_version=scheme)
+            transfer = create('SEDAArchiveTransfer', title=u'test profile')
+            cnx.create_entity('SEDAMessageDigestAlgorithmCodeListVersion',
+                              seda_message_digest_algorithm_code_list_version_from=transfer,
+                              seda_message_digest_algorithm_code_list_version_to=scheme)
             create('SEDAMimeTypeCodeListVersion', seda_mime_type_code_list_version_from=transfer,
                    seda_mime_type_code_list_version_to=scheme)
             access_rule = create('SEDAAccessRule', seda_access_rule=transfer)
             access_rule_seq = create('SEDASeqAccessRuleRule',
                                      reverse_seda_seq_access_rule_rule=access_rule)
diff --git a/test/test_schema.py b/test/test_schema.py
--- a/test/test_schema.py
+++ b/test/test_schema.py
@@ -38,11 +38,14 @@ class SchemaConceptConstraintsTC(CubicWe
             self.enc_concept = enc_concept.eid
 
     def test_code_lists_constraints_simple(self):
         with self.admin_access.client_cnx() as cnx:
             bdo = testutils.create_transfer_to_bdo(cnx)
-            bdo.container[0].cw_set(seda_message_digest_algorithm_code_list_version=self.enc_scheme)
+            transfer = bdo.container[0]
+            cnx.create_entity('SEDAMessageDigestAlgorithmCodeListVersion',
+                              seda_message_digest_algorithm_code_list_version_from=transfer,
+                              seda_message_digest_algorithm_code_list_version_to=self.enc_scheme)
             cnx.commit()
 
             bdo.cw_set(seda_algorithm=self.mt_concept)
             with self.assertRaises(ValidationError) as cm:
                 cnx.commit()
@@ -120,11 +123,14 @@ class SchemaConceptConstraintsTC(CubicWe
 
     def test_archive_transfer_digest_algorithm_constraint(self):
         with self.admin_access.client_cnx() as cnx:
             bdo = testutils.create_transfer_to_bdo(cnx)
             cnx.commit()  # commit first to get the container
-            bdo.container[0].cw_set(seda_message_digest_algorithm_code_list_version=self.enc_scheme)
+            transfer = bdo.container[0]
+            cnx.create_entity('SEDAMessageDigestAlgorithmCodeListVersion',
+                              seda_message_digest_algorithm_code_list_version_from=transfer,
+                              seda_message_digest_algorithm_code_list_version_to=self.enc_scheme)
             cnx.commit()
             self.assertDigestAlgorithmConcept(bdo)
 
     def test_component_archive_unit_digest_algorithm_constraint(self):
         with self.admin_access.client_cnx() as cnx:


More information about the saem-devel mailing list