[PATCH saem v2] [seda] Add 'ark:/' prefix to ArchiveProfil identifier

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Jun 6 10:26:20 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1496294330 -7200
#      Thu Jun 01 07:18:50 2017 +0200
# Node ID 603ce8dc191d4f3572e551c69598d6a8fe215b16
# Parent  8ca8cd6800380cade46c17b39e59245b0318abae
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 603ce8dc191d
[seda] Add 'ark:/' prefix to ArchiveProfil identifier

consistently with record ids exposed in OAI.

Closes extranet #23707073

diff --git a/cubicweb_saem_ref/entities/seda.py b/cubicweb_saem_ref/entities/seda.py
--- a/cubicweb_saem_ref/entities/seda.py
+++ b/cubicweb_saem_ref/entities/seda.py
@@ -45,11 +45,11 @@ orig_xsd_archival_agreement = SEDA1XSDEx
 
 @monkeypatch(SEDA1XSDExport)
 def xsd_archival_agreement(self, parent, transfer):
     orig_xsd_archival_agreement(self, parent, transfer)
     self.element_schema(parent, 'ArchivalProfile', 'qdt:ArchivesIDType',
-                        fixed_value=transfer.ark)
+                        fixed_value=u'ark:/' + transfer.ark)
 
 
 # override agency_id to return ark instead of eid
 @monkeypatch(SEDA1XSDExport)
 def agency_id(self, agency):
diff --git a/test/test_seda.py b/test/test_seda.py
--- a/test/test_seda.py
+++ b/test/test_seda.py
@@ -73,11 +73,11 @@ class SEDAExportTC(CubicWebTC):
             transfer = testutils.seda_transfer(cnx)
             testutils.create_archive_unit(transfer)
             cnx.commit()
             for xml in self.iter_seda_xsd(transfer):
                 self.assertIn('ArchivalProfile', xml)
-                self.assertIn(transfer.ark, xml)
+                self.assertIn('ark:/' + transfer.ark, xml)
 
     def test_include_agency_ark(self):
         with self.admin_access.client_cnx() as cnx:
             transfer = testutils.seda_transfer(cnx)
             _, _, unit_alt_seq = testutils.create_archive_unit(transfer)


More information about the saem-devel mailing list