Commit 2ed1aa98 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[profile gen] Fix position of the Description element in SEDA 0.2/1.0 exports

It should appears first for SEDA 1.0 and after custodial history in SEDA 0.2.

Update export test accordingly and add Description to SEDA 0.2 validation test.

Closes extranet #23707701
parent 5cda167cef43
......@@ -970,10 +970,10 @@ class SEDA1XSDExport(SEDA2ExportAdapter):
"""Append XSD elements for a description content to the given parent node"""
cd_node = self.element_schema(parent, 'ContentDescription',
xsd_attributes=[XAttr('Id', 'xsd:ID')])
self.xsd_description(cd_node, content)
self.xsd_description_level(cd_node, content.description_level_concept)
self.xsd_language(cd_node, content)
self.xsd_content_dates(cd_node, content)
self.xsd_description(cd_node, content)
self.xsd_custodial_history(cd_node, content)
self.xsd_keywords(cd_node, content)
self.xsd_originating_agency(cd_node, content)
......@@ -1204,9 +1204,9 @@ class SEDA02XSDExport(SEDA1XSDExport):
cd_node = self.element_schema(parent, 'ContentDescription',
xsd_attributes=[XAttr('Id', 'xsd:ID')])
self.xsd_custodial_history(cd_node, content)
self.xsd_description(cd_node, content)
self.xsd_language(cd_node, content)
self.xsd_content_dates(cd_node, content)
self.xsd_description(cd_node, content)
self.xsd_originating_agency(cd_node, content)
self.xsd_keywords(cd_node, content)
......
......@@ -37,6 +37,7 @@
<Name>Kesso</Name>
<TransferringAgencyObjectIdentifier>75241/a000000040</TransferringAgencyObjectIdentifier>
<ContentDescription>
<Description>Acte n°1234</Description>
<Language listVersionID="edition 2009">fr</Language>
<LatestDate>2009-07-14</LatestDate>
<OldestDate>2009-07-14</OldestDate>
......
......@@ -206,6 +206,16 @@
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Description">
<rng:optional>
<rng:attribute name="languageID">
<rng:data type="language"/>
</rng:attribute>
</rng:optional>
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:element name="Language">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
......@@ -222,16 +232,6 @@
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Description">
<rng:optional>
<rng:attribute name="languageID">
<rng:data type="language"/>
</rng:attribute>
</rng:optional>
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="OriginatingAgency">
<rng:element name="Identification">
......
......@@ -148,26 +148,26 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Language">
<xsd:element minOccurs="0" name="Description">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeLanguageType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" name="LatestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="OldestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="Description">
<xsd:element name="Language">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="optional"/>
<xsd:extension base="qdt:CodeLanguageType">
<xsd:attribute fixed="edition 2009" name="listVersionID" type="xsd:token" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" name="LatestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="OldestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="OriginatingAgency">
<xsd:complexType>
<xsd:sequence>
......
......@@ -164,6 +164,16 @@
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:element name="Description">
<rng:optional>
<rng:attribute name="languageID">
<rng:data type="language"/>
</rng:attribute>
</rng:optional>
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:element name="DescriptionLevel">
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
......@@ -186,16 +196,6 @@
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Description">
<rng:optional>
<rng:attribute name="languageID">
<rng:data type="language"/>
</rng:attribute>
</rng:optional>
<rng:data type="string"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="CustodialHistory">
<rng:optional>
......
......@@ -99,6 +99,15 @@
<xsd:element name="ContentDescription">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="Description">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="file" name="DescriptionLevel">
<xsd:complexType>
<xsd:simpleContent>
......@@ -119,15 +128,6 @@
</xsd:element>
<xsd:element minOccurs="0" name="LatestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="OldestDate" type="udt:DateType"/>
<xsd:element minOccurs="0" name="Description">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="udt:TextType">
<xsd:attribute name="languageID" type="xsd:language" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" name="CustodialHistory">
<xsd:complexType>
<xsd:sequence>
......
......@@ -897,6 +897,7 @@ class OldSEDARNGExportTC(RelaxNGTestMixin, OldSEDAExportMixin, CubicWebTC):
seda_transferring_agency_archive_unit_identifier=subunit_alt_seq)
create('SEDAStartDate', seda_start_date=subunit_alt_seq)
create('SEDAEndDate', seda_end_date=subunit_alt_seq)
create('SEDADescription', seda_description=subunit_alt_seq)
kw = create('SEDAKeyword', user_cardinality=u'0..n', seda_keyword=subunit_alt_seq)
create('SEDAKeywordReference', seda_keyword_reference_from=kw)
......
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