public Set<DcsCollection> getCollections() { final Set<DcsCollection> collections = new HashSet<DcsCollection>(this.collections.size()); for (DcsCollection c : this.collections) { collections.add(new DcsCollection(c)); } return collections; }
public void addCollection(DcsCollection... collection) { Assertion.notNull(collection); for (DcsCollection c : collection) { Assertion.notNull(c); this.collections.add(new DcsCollection(c)); } }
public DcsCollection createCollection(String parent) { DcsCollection col = new DcsCollection(); col.setId(nextid()); col.setTitle(randomText(rand.nextInt(10) + 1)); if (parent != null) { col.setParent(createCollectionRef(parent)); } col.setMetadata(createMetadataSet(rand.nextInt(2))); col.setSubjects(randomStringSet(4, 4)); col.setType(randomString(4, false)); col.setCreators(randomStringSet(4, 4)); return col; } }
/** Populates an example sip */ @BeforeClass public static void initExampleSips() { DcsCollection coll = new DcsCollection(); coll.setId("example:/collection"); DcsDeliverableUnit du = new DcsDeliverableUnit(); du.addCollection(new DcsCollectionRef(coll.getId())); du.setId("example:/deleverableUnit"); exampleDcp = new Dcp(); exampleDcp.addCollection(coll); exampleDcp.addDeliverableUnit(du); }
final DcsCollection collection = new DcsCollection(); if (!isEmptyOrNull(id)) { collection.setId(id);
final DcsCollection collection = new DcsCollection(); if (!isEmptyOrNull(id)) { collection.setId(id);
private static DcsCollection getCollection(SolrDocument doc) { DcsCollection col = new DcsCollection(); col.setId(getFirst(doc, EntityField.ID)); if (has(doc, CollectionField.PARENT)) { col.setParent(getCollectionRef(doc, CollectionField.PARENT)); } if (has(doc, CoreMetadataField.TYPE)) { col.setType(getFirst(doc, CoreMetadataField.TYPE)); } if (has(doc, CoreMetadataField.TITLE)) { col.setTitle(getFirst(doc, CoreMetadataField.TITLE)); } col.setMetadata(getMetadataSet(doc)); col.setMetadataRef(col.getMetadataRef()); col.setSubjects(getStringSet(doc, CoreMetadataField.SUBJECT)); col.setCreators(getStringSet(doc, CoreMetadataField.CREATOR)); col.setAlternateIds(getResourceIdentifierSet(doc)); return col; }