[SEDA 2.1] Drop no more needed reply code list version
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 03 Mar 2017 10:19:15 +0100
changeset 2400 83e093bfa6b9
parent 2399 f9ce0269a69b
child 2401 317b5c7b3d49
[SEDA 2.1] Drop no more needed reply code list version it's not required anymore and doesn't apply to transfer request (To be confirmed by Baptiste)
cubicweb_seda/i18n/en.po
cubicweb_seda/i18n/fr.po
cubicweb_seda/migration/0.8.0_Any.py
cubicweb_seda/schema/seda2.py
cubicweb_seda/views/uicfg.py
cubicweb_seda/xsd.py
cubicweb_seda/xsd/seda-2.0-main.xsd
test/data/BV2.0_min.xml
test/test_html_generation.py
test/test_profile_generation.py
test/test_schema.py
--- a/cubicweb_seda/i18n/en.po	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/i18n/en.po	Fri Mar 03 10:19:15 2017 +0100
@@ -6793,20 +6793,6 @@
 msgid "seda_replaces_object"
 msgstr ""
 
-msgid "seda_reply_code_list_version"
-msgstr ""
-
-msgctxt "SEDAArchiveTransfer"
-msgid "seda_reply_code_list_version"
-msgstr ""
-
-msgid "seda_reply_code_list_version_object"
-msgstr ""
-
-msgctxt "ConceptScheme"
-msgid "seda_reply_code_list_version_object"
-msgstr ""
-
 msgid "seda_repository_archive_unit_pid"
 msgstr ""
 
--- a/cubicweb_seda/i18n/fr.po	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/i18n/fr.po	Fri Mar 03 10:19:15 2017 +0100
@@ -6814,20 +6814,6 @@
 msgid "seda_replaces_object"
 msgstr ""
 
-msgid "seda_reply_code_list_version"
-msgstr "codes de réponse"
-
-msgctxt "SEDAArchiveTransfer"
-msgid "seda_reply_code_list_version"
-msgstr ""
-
-msgid "seda_reply_code_list_version_object"
-msgstr ""
-
-msgctxt "ConceptScheme"
-msgid "seda_reply_code_list_version_object"
-msgstr ""
-
 msgid "seda_repository_archive_unit_pid"
 msgstr ""
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb_seda/migration/0.8.0_Any.py	Fri Mar 03 10:19:15 2017 +0100
@@ -0,0 +1,1 @@
+drop_relation_type('seda_reply_code_list_version')
--- a/cubicweb_seda/schema/seda2.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/schema/seda2.py	Fri Mar 03 10:19:15 2017 +0100
@@ -127,15 +127,6 @@
     inlined = True
     constraints = []
 
-class archive_transfer_reply_code_list_version(RelationDefinition):
-    name = 'seda_reply_code_list_version'
-    subject = 'SEDAArchiveTransfer'
-    object = 'ConceptScheme'
-    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'
--- a/cubicweb_seda/views/uicfg.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/views/uicfg.py	Fri Mar 03 10:19:15 2017 +0100
@@ -174,8 +174,6 @@
 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_reply_code_list_version', '*'), False)
-abaa.tag_subject_of(('*', 'seda_reply_code_list_version', '*'), 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_mime_type_code_list_version_from', '*'), False)
@@ -585,8 +583,6 @@
 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_reply_code_list_version', '*'), 'main', 'hidden')
-afs.tag_subject_of(('*', 'seda_reply_code_list_version', '*'), 'main', 'hidden')
 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_mime_type_code_list_version_from', '*'), 'main', 'hidden')
@@ -940,8 +936,6 @@
 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_reply_code_list_version', '*'), 'hidden')
-pvs.tag_subject_of(('*', 'seda_reply_code_list_version', '*'), '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_mime_type_code_list_version_from', '*'), 'hidden')
@@ -1116,7 +1110,6 @@
 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_reply_code_list_version', '*'), {'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_mime_type_code_list_version_from', '*'), {'novalue_label': ' '})
 rec.tag_subject_of(('*', 'seda_mime_type_code_list_version_to', '*'), {'novalue_label': '<no value specified>'})
--- a/cubicweb_seda/xsd.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/xsd.py	Fri Mar 03 10:19:15 2017 +0100
@@ -45,6 +45,7 @@
     'OtherDimensionsAbstract',
     'OtherCodeListAbstract',
     'AuthorizationReasonCodeListVersion',  # not for ArchiveTransfer
+    'ReplyCodeListVersion',  # not for ArchiveTransfer
     ('Content', 'Signature'),  # keep signature on ArchiveTransfer, skip it on content
 ])
 JUMP_ELEMENTS = set([
@@ -166,7 +167,6 @@
     'EncodingCodeListVersion': 'ConceptScheme',
     'MimeTypeCodeListVersion': 'ConceptScheme',
     'MessageDigestAlgorithmCodeListVersion': 'ConceptScheme',
-    'ReplyCodeListVersion': 'ConceptScheme',
 }
 
 
--- a/cubicweb_seda/xsd/seda-2.0-main.xsd	Thu Mar 02 18:20:56 2017 +0100
+++ b/cubicweb_seda/xsd/seda-2.0-main.xsd	Fri Mar 03 10:19:15 2017 +0100
@@ -49,7 +49,7 @@
     <!-- Reply Code list -->
     <xsd:group name="ReplyCodeListGroup">
         <xsd:sequence>
-            <xsd:element name="ReplyCodeListVersion" type="CodeType">
+            <xsd:element name="ReplyCodeListVersion" type="CodeType" minOccurs="0">
                 <xsd:annotation>
                     <xsd:documentation>Liste des codes de réponses à utiliser.</xsd:documentation>
                 </xsd:annotation>
--- a/test/data/BV2.0_min.xml	Thu Mar 02 18:20:56 2017 +0100
+++ b/test/data/BV2.0_min.xml	Fri Mar 03 10:19:15 2017 +0100
@@ -9,7 +9,6 @@
     <!-- <ArchivalAgreement>Note d'information relative au versement de la matrice cadastrale de -->
     <!--     l'année 2004 aux services départementaux d'archives DGP/SIAF/2015/</ArchivalAgreement> -->
     <CodeListVersions>
-        <ReplyCodeListVersion>ReplyCode</ReplyCodeListVersion>
         <MessageDigestAlgorithmCodeListVersion>{mda_scheme_url}</MessageDigestAlgorithmCodeListVersion>
         <FileFormatCodeListVersion>FileFormat</FileFormatCodeListVersion>
     </CodeListVersions>
--- a/test/test_html_generation.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/test/test_html_generation.py	Fri Mar 03 10:19:15 2017 +0100
@@ -100,7 +100,7 @@
             ]))
             # ensure jumped element children have proper parent
             clv = self.get_element(profile, 'CodeListVersions')
-            self.assertEqual(len(self.xpath(clv, 'div/h3[text()="ReplyCodeListVersion"]')), 1)
+            self.assertEqual(len(self.xpath(clv, 'div/h3[text()="MimeTypeCodeListVersion"]')), 1)
             # ensure KeywordType list handling
             ktype = self.get_element(profile, 'KeywordType')
             el_defs = self.element_values(ktype)
--- a/test/test_profile_generation.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/test/test_profile_generation.py	Fri Mar 03 10:19:15 2017 +0100
@@ -537,9 +537,8 @@
                                                   'type': 'xsd:token',
                                                   'minOccurs': '0'})
             # XXX also fix listSchemeURI ?
-            sample_clv = self.get_element(profile, 'ReplyCodeListVersion')
             self.assertXSDAttributes(
-                sample_clv,
+                mt_clv,
                 [{'name': 'listAgencyID', 'use': 'optional', 'type': 'xsd:token'},
                  {'name': 'listAgencyName', 'use': 'optional', 'type': 'xsd:string'},
                  {'name': 'listID', 'use': 'optional', 'type': 'xsd:token'},
--- a/test/test_schema.py	Thu Mar 02 18:20:56 2017 +0100
+++ b/test/test_schema.py	Fri Mar 03 10:19:15 2017 +0100
@@ -40,8 +40,7 @@
     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_reply_code_list_version=self.mt_scheme,
-                                    seda_message_digest_algorithm_code_list_version=self.enc_scheme)
+            bdo.container[0].cw_set(seda_message_digest_algorithm_code_list_version=self.enc_scheme)
             cnx.commit()
 
             bdo.cw_set(seda_algorithm=self.mt_concept)