1
0
Fork 0

set the instance datepfacceptance with the Crossref createdDate in case the issuedDate is blank

This commit is contained in:
Alessia Bardi 2020-06-08 19:06:03 +02:00
parent bb659d870c
commit 16cb073b15
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,9 @@ case object Crossref2Oaf {
if (StringUtils.isNotBlank(issuedDate)) {
instance.setDateofacceptance(asField(issuedDate))
}
else {
instance.setDateofacceptance(asField(createdDate.getValue))
}
val s: String = (json \ "URL").extract[String]
val links: List[String] = ((for {JString(url) <- json \ "link" \ "URL"} yield url) ::: List(s)).filter(p => p != null).distinct
if (links.nonEmpty)