@Override public Set<DcsMetadataRef> getMetadataRef() { return fileDelegate.getMetadataRef(); }
private Set<String> getFileRefs(DcsEntity file) { Set<String> rels = new HashSet<String>(); DcsFile f = (DcsFile) file; for (DcsEntityReference ref : f.getMetadataRef()) { rels.add(ref.getRef()); } return rels; }
private Set<String> getFileRefs(DcsEntity file) { Set<String> rels = new HashSet<String>(); DcsFile f = (DcsFile) file; for (DcsEntityReference ref : f.getMetadataRef()) { rels.add(ref.getRef()); } return rels; }
private void updateFileAncestry(Map<String, List<String>> ancestrymap, Collection<DcsFile> set) throws IOException, SolrServerException { for (DcsFile file : set) { for (DcsMetadataRef ref : file.getMetadataRef()) { updateAncestry(ancestrymap, ref, file.getId()); } } }
private Set<String> getFileEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* An entity is significantly related to itself */ entities.add(entityId); try { DcsFile file = builder.buildFile(content); /* * A file's metadata files are significantly related */ for (DcsEntityReference ref : file.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A file's events are significantly related */ addRelated(md, entities, EVENT); return entities; }
private Set<String> getFileEntities(String entityId, InputStream content, Metadata md, boolean initial) { Set<String> entities = new HashSet<String>(); /* An entity is significantly related to itself */ entities.add(entityId); try { DcsFile file = builder.buildFile(content); /* * A file's metadata files are significantly related */ for (DcsEntityReference ref : file.getMetadataRef()) { entities.add(ref.getRef()); } } catch (InvalidXmlException e) { throw new RuntimeException(e); } finally { try { content.close(); } catch (Exception e) { } } /* A file's events are significantly related */ addRelated(md, entities, EVENT); return entities; }
for (DcsEntityReference ref : file.getMetadataRef()) { entities.add(ref.getRef());
for (DcsEntityReference ref : file.getMetadataRef()) { entities.add(ref.getRef());
/** * Copy constructor for a DcsFile. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the dcs file to copy */ public DcsFile(DcsFile toCopy) { super(toCopy); this.name = toCopy.getName(); this.extant = toCopy.isExtant(); this.sizeBytes = toCopy.getSizeBytes(); this.fixity = toCopy.getFixity(); this.formats = toCopy.getFormats(); this.source = toCopy.getSource(); this.valid = toCopy.getValid(); this.metadata = toCopy.getMetadata(); this.metadataRef = toCopy.getMetadataRef(); }
for (DcsMetadataRef m : file.getMetadataRef()) { writer.startNode(MetadataConverter.E_METADATA); context.convertAnother(m);
for (DcsMetadataRef m : file.getMetadataRef()) { writer.startNode(MetadataConverter.E_METADATA); context.convertAnother(m);
private static SolrInputDocument toSolr(DcsFile file, ArchiveStore store) throws IOException { SolrInputDocument doc = new SolrInputDocument(); add(doc, EntityField.ID, file.getId()); add(doc, EntityField.TYPE, EntityTypeValue.FILE.solrValue()); add(doc, FileField.NAME, file.getName()); add(doc, FileField.SOURCE, file.getSource()); add(doc, FileField.SIZE, file.getSizeBytes()); if (file.getValid() != null) { doc.addField(FileField.VALID.solrName(), file.getValid()); } doc.addField(FileField.EXTANT.solrName(), file.isExtant()); addFixitySet(doc, file.getFixity()); addFormatSet(doc, file.getFormats()); addResourceIdentifierSet(doc, file.getAlternateIds()); addMetadataSet(doc, file.getMetadata()); addMetadataRefSet(doc, file.getMetadataRef(), EntityField.METADATA_REF, store); return doc; }