Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,11 @@ RDM_RECORDS_RELATED_IDENTIFIERS_SCHEMES = {
"validator": schemes.is_edms,
"datacite": "EDMS"
},
"archive": {
"label": _("ARCHIVE"),
"validator": schemes.is_archive,
"datacite": "ARCHIVE",
},
"hal": {
"label": "HAL",
"validator": schemes.is_hal,
Expand Down
6 changes: 6 additions & 0 deletions site/cds_rdm/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# Matches patterns like CERN-EP-2026-001 or CERN-TH-2026-042, as well as
# legacy multi-segment department codes like CERN-PH-EP-2012-369.
approval_rn_regexp = re.compile(r"^[A-Z]+(?:-[A-Z]+)*-\d{4}-\d+$")
archive_pattern = re.compile(r"^CERN-ARCH(?:-[A-Z0-9]+)+$", flags=re.I)


def is_aleph(val):
Expand Down Expand Up @@ -194,3 +195,8 @@ def hal():
"normalizer": lambda value: value.lower(),
"url_generator": generate_hal_url,
}


def is_archive(val):
"""Test if argument is a CERN Archives reference code."""
return archive_pattern.match(str(val).strip())
5 changes: 5 additions & 0 deletions site/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ def app_config(app_config, mock_datacite_client, mock_crossref_client):
"validator": schemes.is_edms,
"datacite": "EDMS",
},
"archive": {
"label": _("ARCHIVE"),
"validator": schemes.is_archive,
"datacite": "ARCHIVE",
},
"cdsrn": {
"label": _("CDS Report Number"),
"validator": always_valid,
Expand Down
Loading