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

[profile gen] Export archival agreement in SEDA 1.0 / 0.2

Functional testing will be introduced by a later cset.

Related to #16269136
parent c97ebc87f85e
......@@ -28,6 +28,12 @@ class SEDAArchiveTransfer(generated.SEDAArchiveTransfer):
return set()
return set(self.compat_list.split(', '))
@property
def archival_agreement(self):
if self.reverse_seda_archival_agreement:
return self.reverse_seda_archival_agreement[0]
return None
@property
def comments(self):
return self.reverse_seda_comment
......
......@@ -899,6 +899,8 @@ class SEDA1XSDExport(SEDA2XSDExport):
cardinality=archive_unit.user_cardinality,
documentation=archive_unit.user_annotation,
xsd_attributes=[XAttr('Id', 'xsd:ID')])
transfer = archive_unit.cw_adapt_to('ITreeBase').parent()
self.xsd_archival_agreement(archive_node, transfer)
# hard-coded description's language XXX fine, content language may be specified
self.element_schema(archive_node, 'DescriptionLanguage', 'qdt:CodeLanguageType',
fixed_value='fra',
......@@ -928,6 +930,15 @@ class SEDA1XSDExport(SEDA2XSDExport):
return rule_holder.reverse_seda_appraisal_rule[0]
return None
def xsd_archival_agreement(self, parent, transfer):
agreement = transfer.archival_agreement
if agreement:
self.element_schema(parent, 'ArchivalAgreement', 'qdt:ArchivesIDType',
cardinality=agreement.user_cardinality,
documentation=agreement.user_annotation,
fixed_value=agreement.archival_agreement,
xsd_attributes=self.xsd_attributes_scheme())
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)
......@@ -1182,6 +1193,8 @@ class SEDA02XSDExport(SEDA1XSDExport):
cardinality=archive_unit.user_cardinality,
documentation=archive_unit.user_annotation,
xsd_attributes=[XAttr('Id', 'xsd:ID')])
transfer = archive_unit.cw_adapt_to('ITreeBase').parent()
self.xsd_archival_agreement(archive_node, transfer)
# hard-coded description's language
self.element_schema(archive_node, 'DescriptionLanguage', 'qdt:CodeLanguageType',
fixed_value='fr',
......
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