diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java b/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java index a3e1a0e770480ff51c5d15876f39768f6fd49705..b01b8e4a8538df307c3e35e3bec332fc515753b0 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/SetDeliverer.java @@ -40,6 +40,7 @@ public class SetDeliverer { private static final String DH_COLLECTION_FILTER_NAME = "collectionFilter"; private static final String DH_COLLECTION_FILTER_TERM_NAME = "collectionFilterTerm"; + private static final String DH_FIELD_DIVIDER = "&"; // private static Map<String, String> setSet = new Hashtable<String, String>(); @@ -125,7 +126,8 @@ public class SetDeliverer { else if (this.dariah) { Script mergeCollectionIDAndTitle = new Script( - "doc['administrativeMetadata.dcterms:identifier'].value + '&' + doc['descriptiveMetadata.dc:title'].value"); + "doc['administrativeMetadata.dcterms:identifier'].value + '" + DH_FIELD_DIVIDER + + "' + doc['descriptiveMetadata.dc:title'].value"); // Do filter all collections (via descriptiveMetadata.dc:format) AND // get out all the child objects and collections (NO descriptiveMetadata.dc:relation), @@ -235,12 +237,15 @@ public class SetDeliverer { Terms collectionTerms = filterCollection.getAggregations().get(DH_COLLECTION_FILTER_TERM_NAME); for (Bucket b : collectionTerms.getBuckets()) { - - System.out.println(" ## key as string --> " + b.getKeyAsString()); - + // Divide ID and title. + String combined = b.getKeyAsString(); + int indexOf = combined.indexOf(DH_COLLECTION_FILTER_NAME); + String id = combined.substring(0, indexOf); + String title = combined.substring(indexOf + 1); + // Set set. SetType newSet = new SetType(); - newSet.setSetSpec(b.getKeyAsString()); - newSet.setSetName("urgl! argl! aua!"); + newSet.setSetSpec(id); + newSet.setSetName(title); setList.getSet().add(newSet); } }