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

[profile gen] Export archival agency archive unit identifier in SEDA 1.0 / 0.2

Functional testing will be introduced by a later cset.

Related to #16269136
parent d709363d19d8
......@@ -147,6 +147,12 @@ class SEDAContent(generated.SEDAContent):
def end_date(self):
return self.reverse_seda_end_date[0] if self.reverse_seda_end_date else None
@property
def transferring_agency_archive_unit_identifier(self):
if self.reverse_seda_transferring_agency_archive_unit_identifier:
return self.reverse_seda_transferring_agency_archive_unit_identifier[0]
return None
class SEDAKeyword(generated.SEDAKeyword):
......
......@@ -911,6 +911,8 @@ class SEDA1XSDExport(SEDA2XSDExport):
documentation=name_entity.user_annotation,
xsd_attributes=[XAttr('languageID', 'xsd:language')])
content_entity = self.archive_unit_content(archive_unit)
self.xsd_transferring_agency_archive_identifier(archive_node, content_entity,
'TransferringAgencyArchiveIdentifier')
self.xsd_content_description(archive_node, content_entity)
appraisal_rule_entity = self.archive_unit_appraisal_rule(archive_unit)
if appraisal_rule_entity:
......@@ -939,6 +941,16 @@ class SEDA1XSDExport(SEDA2XSDExport):
fixed_value=agreement.archival_agreement,
xsd_attributes=self.xsd_attributes_scheme())
def xsd_transferring_agency_archive_identifier(self, parent, content_entity, tag_name):
if content_entity.transferring_agency_archive_unit_identifier:
agency_entity = content_entity.transferring_agency_archive_unit_identifier
self.element_schema(
parent, tag_name, 'qdt:ArchiveIDType',
fixed_value=agency_entity.transferring_agency_archive_unit_identifier,
cardinality=agency_entity.user_cardinality,
documentation=agency_entity.user_annotation,
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)
......@@ -1077,6 +1089,8 @@ class SEDA1XSDExport(SEDA2XSDExport):
fixed_value=content_entity.title.title,
documentation=content_entity.title.user_annotation,
xsd_attributes=[XAttr('languageID', 'xsd:language')])
self.xsd_transferring_agency_archive_identifier(ao_node, content_entity,
'TransferringAgencyObjectIdentifier')
if (self.__regid__.startswith('SEDA-1.0')
or content_entity.start_date
or content_entity.end_date
......@@ -1207,6 +1221,8 @@ class SEDA02XSDExport(SEDA1XSDExport):
fixed_value=name_entity.title,
documentation=name_entity.user_annotation,
xsd_attributes=[XAttr('languageID', 'xsd:language')])
self.xsd_transferring_agency_archive_identifier(archive_node, content_entity,
'TransferringAgencyArchiveIdentifier')
self.xsd_content_description(archive_node, content_entity)
appraisal_rule_entity = self.archive_unit_appraisal_rule(archive_unit)
......
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