EAD3 serialisation yields multiple fromdate & todate elements inside single daterange

Issue #20 resolved
Toni Sissala created an issue

EAD3 serialisation generates multiple fromdate & todate elements inside a single daterange element. It should repeat the daterange element for each from & to -pair.

POST http://localhost:6001/v0/studies
Content-Type: application/json

{
"study_number": "test_1",
"collection_periods": [
{"collection_period": "2017-01-20",
"language": "fi",
"event": "start"},
{"collection_period": "2018-01-20",
"language": "fi",
"event": "end"},
{"collection_period": "2016-01-02",
"language": "fi",
"event": "start"},
{"collection_period": "2017-01-02",
"language": "fi",
"event": "end"}]
}

GET http://localhost:6003/v0/oai?verb=GetRecord&metadataPrefix=ead3&identifier=test_1

[...]

<unitdatestructured datechar="collection">
<daterange lang="fi">
<fromdate lang="fi" standarddate="2017-01-20">2017-01-20</fromdate>
<todate lang="fi" standarddate="2018-01-20">2018-01-20</todate>
<fromdate lang="fi" standarddate="2016-01-02">2016-01-02</fromdate>
<todate lang="fi" standarddate="2017-01-02">2017-01-02</todate>
</daterange>
</unitdatestructured>

Comments (2)

  1. Toni Sissala reporter

    Repeat EAD3-daterange when a study has multiple ranged dates

    When a record has multiple ranged Study.collection_periods values, repeat the EAD3 daterange element.

    Add methods get_daterange_pairs() and get_singledates() to metadataformats.EAD3MetadataFormat class. Add them to record objects that get passed onto the templates via overloading EAD3MetadataFormat._on_record().

    Update the template ead3.xml accordingly.

    Write fixed item to 1.0.0 changelog entry.

    Fixes #20 at BB.

    → <<cset 9fbabd86c56e>>

  2. Toni Sissala reporter

    Merged in bugfix/20-ead3-incorrect-dateranges (pull request #4)

    Repeat EAD3-daterange when a study has multiple ranged dates

    When a record has multiple ranged Study.collection_periods values, repeat the EAD3 daterange element.

    Add methods get_daterange_pairs() and get_singledates() to metadataformats.EAD3MetadataFormat class. Add them to record objects that get passed onto the templates via overloading EAD3MetadataFormat._on_record().

    Update the template ead3.xml accordingly.

    Write fixed item to 1.0.0 changelog entry.

    Fixes #20 at BB.

    → <<cset 142bf3cf6499>>

  3. Log in to comment