private Set<String> getCollectionRels(DcsEntity collection) { Set<String> rels = new HashSet<String>(); DcsCollection coll = (DcsCollection) collection; for (DcsEntityReference ref : coll.getMetadataRef()) { rels.add(ref.getRef()); } if (coll.getParent() != null) { rels.add(coll.getParent().getRef()); } return rels; }
private Set<String> getCollectionRels(DcsEntity collection) { Set<String> rels = new HashSet<String>(); DcsCollection coll = (DcsCollection) collection; for (DcsEntityReference ref : coll.getMetadataRef()) { rels.add(ref.getRef()); } if (coll.getParent() != null) { rels.add(coll.getParent().getRef()); } return rels; }
private Set<String> getCollectionEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* selected collection is relevant */ entities.add(entityId); try { DcsCollection coll = builder.buildCollection(content); /* * A collection's metadata files are significantly related */ for (DcsEntityReference ref : coll.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A collections events are significantly related */ addRelated(md, entities, EVENT); return entities; }
private Set<String> getCollectionEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* selected collection is relevant */ entities.add(entityId); try { DcsCollection coll = builder.buildCollection(content); /* * A collection's metadata files are significantly related */ for (DcsEntityReference ref : coll.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A collections events are significantly related */ addRelated(md, entities, EVENT); return entities; }
/** * Copy constructor for a DcsCollection. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the collection to copy */ public DcsCollection(DcsCollection toCopy) { super(toCopy); this.coreMd = toCopy.getCoreMd(); this.parent = toCopy.getParent(); this.metadata = toCopy.getMetadata(); this.metadataRef = toCopy.getMetadataRef(); }
private Set<String> getCollectionEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* selected collection is relevant */ entities.add(entityId); try { DcsCollection coll = builder.buildCollection(content); /* A collection's parent is strongly related */ if (coll.getParent() != null) { entities.add(coll.getParent().getRef()); } /* A collection's metadata is significantly related */ for (DcsEntityReference ref : coll.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A collections events are strongly related, if it is the first */ addRelated(md, entities, EVENT); return entities; }
private Set<String> getCollectionEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* selected collection is relevant */ entities.add(entityId); try { DcsCollection coll = builder.buildCollection(content); /* A collection's parent is strongly related */ if (coll.getParent() != null) { entities.add(coll.getParent().getRef()); } /* A collection's metadata is significantly related */ for (DcsEntityReference ref : coll.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A collections events are strongly related, if it is the first */ addRelated(md, entities, EVENT); return entities; }
for (DcsEntityReference ref : col.getMetadataRef()) { updateAncestry(ancestrymap, ref, col.getId());
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; }
private static SolrInputDocument toSolr(DcsCollection col, ArchiveStore store) throws IOException { SolrInputDocument doc = new SolrInputDocument(); add(doc, EntityField.ID, col.getId()); add(doc, EntityField.TYPE, EntityTypeValue.COLLECTION.solrValue()); if (col.getParent() != null) { add(doc, CollectionField.PARENT, col.getParent().getRef()); } add(doc, CoreMetadataField.TITLE, col.getTitle()); addMetadataSet(doc, col.getMetadata()); addMetadataRefSet(doc, col.getMetadataRef(), EntityField.METADATA_REF, store); addResourceIdentifierSet(doc, col.getAlternateIds()); add(doc, CoreMetadataField.TYPE, col.getType()); addStrings(doc, col.getSubjects(), CoreMetadataField.SUBJECT); addStrings(doc, col.getCreators(), CoreMetadataField.CREATOR); return doc; }
final DcsCollection c = (DcsCollection) source; final Set<DcsMetadata> md = c.getMetadata(); final Set<DcsMetadataRef> mdRef = c.getMetadataRef(); final String id = c.getId(); final DcsCollectionRef parentRef = c.getParent();
final Collection<DcsMetadataRef> mdRef = c.getMetadataRef(); final String id = c.getId(); final Collection<DcsResourceIdentifier> altIds = c.getAlternateIds();