Commit 68793317 authored by Fischer, Tim's avatar Fischer, Tim
Browse files

Added date reformat exception for Campus-Verlag

parent 274e3674
......@@ -141,19 +141,27 @@ public class XsltTransformerOaiPmhBundlesStreamSource implements BundlesStreamSo
Stream<OAIPMHtype> listIdentifiersResponseStream = metadataPrefixes.stream().flatMap(mp -> {
LOG.info("filling list identifier stream with mp {}, from {}, until {}, setSpec {}", mp, from, until,
setSpec);
// exeley only takes "YYY-mm-dd" as from date
String exeleyFrom = from.split("T")[0];
// String exeleyUntil= until.split("T")[0];
if (setSpec == null || setSpec.trim().isEmpty() && mp.equals("pam")) {
LOG.info("exeley specials: {} -> {}", exeleyFrom, until);
return client.listIdentifiersStream(mp, exeleyFrom, until, null);
// some providers (eg exeley) only take "YYY-mm-dd" as date format
// mp.equals("pam") => for Exeley
// setSpec.equals("a0c6b3eb-a8b2-4fac-8ebb-32376f33a17d") => for Campus-Verlag (Knowledge Unlatched)
boolean modifiedTimeStamp = false;
String fromWithoutTimeStamp = "";
if(mp.equals("pam") || setSpec.equals("a0c6b3eb-a8b2-4fac-8ebb-32376f33a17d")) {
modifiedTimeStamp = true;
fromWithoutTimeStamp = from.split("T")[0];
}
if (setSpec == null || setSpec.trim().isEmpty() && modifiedTimeStamp) {
LOG.info("modified date (Exeley or Campus Verlag) specials: {} -> {}", fromWithoutTimeStamp, until);
return client.listIdentifiersStream(mp, fromWithoutTimeStamp, until, null);
} else if (setSpec == null || setSpec.trim().isEmpty()) {
return client.listIdentifiersStream(mp, from, until, null);
}
if ( mp.equals("pam") ) {
LOG.info("exeley specials: {} -> {}", exeleyFrom, until);
return client.listIdentifiersStream(mp, exeleyFrom, until, setSpec);
if (modifiedTimeStamp) {
LOG.info("modified date (Exeley or Campus Verlag) specials: {} -> {}", fromWithoutTimeStamp, until);
return client.listIdentifiersStream(mp, fromWithoutTimeStamp, until, setSpec);
}
return client.listIdentifiersStream(mp, from, until, setSpec);
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment