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 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; }
parent_id = ref.getRef();
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; }