Skip to content
Snippets Groups Projects
Commit cdb8dbec authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

Divide id and title, finally

parent e93bba8b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment