[profile gen] In SEDA 1.0, Appraisal is spelled AppraisalRule
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 07 Nov 2017 14:40:41 +0100
changeset 2873 9a89315814f7
parent 2872 1e715baea780
child 2874 301ca325d47e
[profile gen] In SEDA 1.0, Appraisal is spelled AppraisalRule Closes #17113836
cubicweb_seda/entities/profile_generation.py
test/data/seda_1_export.rng
--- a/cubicweb_seda/entities/profile_generation.py	Tue Nov 07 14:40:09 2017 +0100
+++ b/cubicweb_seda/entities/profile_generation.py	Tue Nov 07 14:40:41 2017 +0100
@@ -995,10 +995,12 @@
         if appraisal_rule_entity:
             self.xsd_appraisal_rule(parent, appraisal_rule_entity)
 
+    appraisal_tag_name = 'AppraisalRule'
+
     def xsd_appraisal_rule(self, parent, appraisal_rule):
         # XXX cardinality 1 on rule, not multiple + element name : 'Appraisal' ou 'AppraisalRule'
         # (cf http://www.archivesdefrance.culture.gouv.fr/seda/api/index.html)
-        ar_node = self.element_schema(parent, 'Appraisal',
+        ar_node = self.element_schema(parent, self.appraisal_tag_name,
                                       cardinality=appraisal_rule.user_cardinality,
                                       documentation=appraisal_rule.user_annotation,
                                       xsd_attributes=[XAttr('Id', 'xsd:ID')])
@@ -1315,7 +1317,8 @@
     system_id_tag_name = 'Identification'
     # in SEDA 0.2, ArchiveObject tag name is 'Contains' (as for Archive)
     archive_object_tag_name = 'Contains'
-    # in SEDA 0.2, AccessRestrictionRule tag name is 'AccessRestriction'
+    # in SEDA 0.2, [Appraisal|AccessRestriction]Rule tag name is 'AccessRestriction' / 'Appraisal'
+    appraisal_tag_name = 'Appraisal'
     access_restriction_tag_name = 'AccessRestriction'
     # in SEDA 0.2, keyword tag name is 'ContentDescriptive', not 'Keyword' and keyword content type
     # is TextType and there is no 'role' attribute
--- a/test/data/seda_1_export.rng	Tue Nov 07 14:40:09 2017 +0100
+++ b/test/data/seda_1_export.rng	Tue Nov 07 14:40:41 2017 +0100
@@ -348,7 +348,7 @@
             </rng:element>
           </rng:element>
           <rng:optional>
-            <rng:element name="Appraisal">
+            <rng:element name="AppraisalRule">
               <xsd:annotation>
                 <xsd:documentation>detruire le document</xsd:documentation>
               </xsd:annotation>
@@ -427,7 +427,7 @@
               </rng:element>
             </rng:element>
             <rng:optional>
-              <rng:element name="Appraisal">
+              <rng:element name="AppraisalRule">
                 <xsd:annotation>
                   <xsd:documentation>detruire le document</xsd:documentation>
                 </xsd:annotation>
@@ -511,7 +511,7 @@
                 </rng:element>
               </rng:element>
               <rng:optional>
-                <rng:element name="Appraisal">
+                <rng:element name="AppraisalRule">
                   <rng:optional>
                     <rng:attribute name="Id">
                       <rng:data type="ID"/>