Skip to content

Commit

Permalink
Merge pull request #8733 from tcoupin/oaidc-date
Browse files Browse the repository at this point in the history
oai_dc export: use publication date if production date is not set
  • Loading branch information
pdurbin authored Oct 13, 2022
2 parents 94ddff7 + 97cf6bc commit 1daae04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions doc/release-notes/8733-oai_dc-date.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
For exports and harvesting in `oai_dc` format, if "Production Date" is not set, "Publication Date" is now used instead. This change is reflected in the [Dataverse 4+ Metadata Crosswalk][] linked from the [Appendix][] of the User Guide.

[Dataverse 4+ Metadata Crosswalk]: https://docs.google.com/spreadsheets/d/10Luzti7svVTVKTA-px27oq3RxCUM-QbiTkm8iMd5C54/edit#gid=1901625433&range=K7
[Appendix]: https://guides.dataverse.org/en/latest/user/appendix.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ private static void createDC(XMLStreamWriter xmlw, DatasetDTO datasetDto, String
writeFullElementList(xmlw, dcFlavor+":"+"language", dto2PrimitiveList(version, DatasetFieldConstant.language));

writeRelPublElement(xmlw, version, dcFlavor);
writeFullElement(xmlw, dcFlavor+":"+"date", dto2Primitive(version, DatasetFieldConstant.productionDate));

String date = dto2Primitive(version, DatasetFieldConstant.productionDate);
if (date == null) {
date = datasetDto.getPublicationDate();
}
writeFullElement(xmlw, dcFlavor+":"+"date", date);

writeFullElement(xmlw, dcFlavor+":"+"contributor", dto2Primitive(version, DatasetFieldConstant.depositor));

Expand Down Expand Up @@ -172,7 +177,11 @@ private static void createOAIDC(XMLStreamWriter xmlw, DatasetDTO datasetDto, Str

writeFullElementList(xmlw, dcFlavor+":"+"language", dto2PrimitiveList(version, DatasetFieldConstant.language));

writeFullElement(xmlw, dcFlavor+":"+"date", dto2Primitive(version, DatasetFieldConstant.productionDate));
String date = dto2Primitive(version, DatasetFieldConstant.productionDate);
if (date == null) {
date = datasetDto.getPublicationDate();
}
writeFullElement(xmlw, dcFlavor+":"+"date", date);

writeFullElement(xmlw, dcFlavor+":"+"contributor", dto2Primitive(version, DatasetFieldConstant.depositor));

Expand Down

0 comments on commit 1daae04

Please sign in to comment.