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

[profile gen] Consider content's language in SEDA 1.0 / 0.2 export

parent 60e12b2537ae
......@@ -131,6 +131,10 @@ class SEDAContent(generated.SEDAContent):
def type(self):
return self.reverse_seda_type_from[0] if self.reverse_seda_type_from else None
@property
def language(self):
return self.reverse_seda_language_from[0] if self.reverse_seda_language_from else None
@property
def description_level_concept(self):
return self.seda_description_level[0] if self.seda_description_level else None
......@@ -301,3 +305,10 @@ class SEDAType(generated.SEDAType):
@property
def concept(self):
return self.seda_type_to[0] if self.seda_type_to else None
class SEDALanguage(generated.SEDALanguage):
@property
def concept(self):
return self.seda_language_to[0] if self.seda_language_to else None
......@@ -1007,8 +1007,10 @@ class SEDA1XSDExport(SEDA2XSDExport):
xsd_attributes=[XAttr('Id', 'xsd:ID')])
if self.__regid__.startswith('SEDA-1.0'):
self.xsd_description_level(cd_node, content.description_level_concept)
# XXX language is 0..1 in SEDA 2, 1..n in earlier version
language = content.language.concept if content.language else None
self.element_schema(cd_node, 'Language', 'qdt:CodeLanguageType',
fixed_value='fr',
fixed_value=_concept_value(language, self.concepts_language),
xsd_attributes=[LIST_VERSION_ID_2009])
for seda2_name, seda1_name in (('end', 'latest'), ('start', 'oldest')):
date_entity = getattr(content, '%s_date' % seda2_name)
......
......@@ -56,7 +56,7 @@
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:value type="string">fr</rng:value>
<rng:data type="string"/>
</rng:element>
<rng:optional>
<rng:element name="LatestDate">
......
......@@ -105,7 +105,7 @@
<xsd:element name="ContentDescription">
<xsd:complexType>
<xsd:sequence>
<xsd:element fixed="fr" name="Language">
<xsd:element name="Language">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeLanguageType">
......
......@@ -65,7 +65,7 @@
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:value type="string">fr</rng:value>
<rng:data type="string"/>
</rng:element>
<rng:optional>
<rng:element name="LatestDate">
......@@ -158,7 +158,7 @@
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:value type="string">fr</rng:value>
<rng:data type="string"/>
</rng:element>
</rng:element>
<rng:optional>
......@@ -209,7 +209,7 @@
<rng:attribute name="listVersionID">
<rng:value type="token">edition 2009</rng:value>
</rng:attribute>
<rng:value type="string">fr</rng:value>
<rng:data type="string"/>
</rng:element>
</rng:element>
<rng:optional>
......
......@@ -105,7 +105,7 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="fr" name="Language">
<xsd:element name="Language">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeLanguageType">
......@@ -235,7 +235,7 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="fr" name="Language">
<xsd:element name="Language">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeLanguageType">
......@@ -314,7 +314,7 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element fixed="fr" name="Language">
<xsd:element name="Language">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="qdt:CodeLanguageType">
......
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