From 970a5f87fe90969eefaca39432739e5df4edef25 Mon Sep 17 00:00:00 2001 From: kstamatis Date: Sat, 16 Nov 2013 18:30:15 +0200 Subject: [PATCH] fix crossref BTE configuration --- .../dspace/submit/lookup/CrossRefUtils.java | 30 ++++++++++++++----- dspace/config/spring/api/bte.xml | 17 +++++++++-- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefUtils.java b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefUtils.java index fcb1ac29ebec..e05d6d4577ef 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefUtils.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefUtils.java @@ -59,7 +59,7 @@ public static Record convertCrossRefDomToRecord(Element dataRoot) String itemType = doi != null ? XMLUtils.getElementAttribute(dataRoot, "doi", "type") : "unspecified"; if (itemType != null) - record.addValue("itemType", new StringValue(itemType)); + record.addValue("doiType", new StringValue(itemType)); List identifier = XMLUtils.getElementList(dataRoot, "issn"); for (Element ident : identifier) @@ -69,24 +69,38 @@ public static Record convertCrossRefDomToRecord(Element dataRoot) { String issn = ident.getTextContent().trim(); if (issn != null) - record.addValue("issn", new StringValue(issn)); + record.addValue("printISSN", new StringValue(issn)); } else { String eissn = ident.getTextContent().trim(); if (eissn != null) - record.addValue("eissn", new StringValue(eissn)); + record.addValue("electronicISSN", new StringValue(eissn)); + } + } + + List identifierisbn = XMLUtils.getElementList(dataRoot, "isbn"); + for (Element ident : identifierisbn) + { + if ("print".equalsIgnoreCase(ident.getAttribute("type")) + || StringUtils.isNotBlank(ident.getAttribute("type"))) + { + String issn = ident.getTextContent().trim(); + if (issn != null) + record.addValue("printISBN", new StringValue(issn)); + } + else + { + String eissn = ident.getTextContent().trim(); + if (eissn != null) + record.addValue("electronicISBN", new StringValue(eissn)); } } - - String isbn = XMLUtils.getElementValue(dataRoot, "isbn"); - if (isbn != null) - record.addValue("isbn", new StringValue(isbn)); String editionNumber = XMLUtils.getElementValue(dataRoot, "editionNumber"); if (editionNumber != null) - record.addValue("volume", new StringValue(editionNumber)); + record.addValue("editionNumber", new StringValue(editionNumber)); String volume = XMLUtils.getElementValue(dataRoot, "volume"); if (volume != null) diff --git a/dspace/config/spring/api/bte.xml b/dspace/config/spring/api/bte.xml index c55c780a0ae0..a67bae45c67d 100644 --- a/dspace/config/spring/api/bte.xml +++ b/dspace/config/spring/api/bte.xml @@ -413,14 +413,27 @@ - - + + + + + + + + + + + + +