1
0
Fork 0

preserving the old identifier among the originalIds in the doiboost construction process

This commit is contained in:
Claudio Atzori 2021-05-14 11:30:41 +02:00
parent ca3f3a7687
commit 1bd70fa2c6
1 changed files with 10 additions and 3 deletions

View File

@ -102,9 +102,16 @@ case object Crossref2Oaf {
//IMPORTANT //IMPORTANT
//The old method result.setId(generateIdentifier(result, doi)) //The old method result.setId(generateIdentifier(result, doi))
//will be replaced using IdentifierFactory //is replaced using IdentifierFactory, but the old identifier
result.setId(generateIdentifier(result, doi)) //is preserved among the originalId(s)
result.setId(IdentifierFactory.createIdentifier(result)) val oldId = generateIdentifier(result, doi)
val newId = IdentifierFactory.createIdentifier(result)
if (!oldId.equalsIgnoreCase(newId)) {
result.getOriginalId.add(oldId)
}
result.setId(newId)
// Add DataInfo // Add DataInfo
result.setDataInfo(generateDataInfo()) result.setDataInfo(generateDataInfo())