private java.util.Collection<DcsEntity> filterForLatestDeliverableUnits(java.util.Collection<? extends DcsEntity> entities) { java.util.Collection<DcsEntity> result = new HashSet<DcsEntity>(); List<String> predecessorDuIds = new ArrayList<String>(); for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit)entity; for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals(DcsRelationship.IS_SUCCESSOR_OF.asString())) { predecessorDuIds.add(rel.getRef().getRef()); } } } for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) { result.add(entity); continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; if (!predecessorDuIds.contains(du.getId())) { result.add(du); } } return result; }
private java.util.Collection<DcsEntity> filterForLatestDeliverableUnits(java.util.Collection<? extends DcsEntity> entities) { java.util.Collection<DcsEntity> result = new HashSet<DcsEntity>(); List<String> predecessorDuIds = new ArrayList<String>(); for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) { continue; } DcsDeliverableUnit du = (DcsDeliverableUnit)entity; for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals(DcsRelationship.IS_SUCCESSOR_OF.asString())) { predecessorDuIds.add(rel.getRef().getRef()); } } } for (DcsEntity entity : entities) { if (!(entity instanceof DcsDeliverableUnit)) { result.add(entity); continue; } DcsDeliverableUnit du = (DcsDeliverableUnit) entity; if (!predecessorDuIds.contains(du.getId())) { result.add(du); } } return result; }
private Set<String> getDeliverableUnitRefs(DcsEntity deliverableUnit) { Set<String> rels = new HashSet<String>(); DcsDeliverableUnit du = (DcsDeliverableUnit) deliverableUnit; for (DcsEntityReference ref : du.getCollections()) { rels.add(ref.getRef()); } for (DcsEntityReference ref : du.getMetadataRef()) { rels.add(ref.getRef()); } for (DcsEntityReference ref : du.getParents()) { rels.add(ref.getRef()); } for (DcsRelation ref : du.getRelations()) { rels.add(ref.getRef().getRef()); } return rels; }
private Set<String> getDeliverableUnitRefs(DcsEntity deliverableUnit) { Set<String> rels = new HashSet<String>(); DcsDeliverableUnit du = (DcsDeliverableUnit) deliverableUnit; for (DcsEntityReference ref : du.getCollections()) { rels.add(ref.getRef()); } for (DcsEntityReference ref : du.getMetadataRef()) { rels.add(ref.getRef()); } for (DcsEntityReference ref : du.getParents()) { rels.add(ref.getRef()); } for (DcsRelation ref : du.getRelations()) { rels.add(ref.getRef().getRef()); } return rels; }
String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals(DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals(DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals(DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
private String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals( DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
/** * Returns the identifier of the predecessor of the supplied {@code du}, or null if the DU has no predecessors. * * @param du the deliverable unit * @return the identifier of the predecessor, or null */ public String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals( DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
/** * Returns the identifier of the predecessor of the supplied {@code du}, or null if the DU has no predecessors. * * @param du the deliverable unit * @return the identifier of the predecessor, or null */ public String getPredecessorId(DcsDeliverableUnit du) { for (DcsRelation rel : du.getRelations()) { if (rel.getRelUri().equals( DcsRelationship.IS_SUCCESSOR_OF.asString())) { if (rel.getRef() == null || rel.getRef().getRef() == null) { return null; } return rel.getRef().getRef(); } } return null; }
/** * Copy constructor for a DcsDeliverableUnit. The state of <code>toCopy</code> is copied * to this. * * @param toCopy the deliverable unit to copy, must not be <code>null</code> * @throws IllegalArgumentException if <code>toCopy</code> is <code>null</code> */ public DcsDeliverableUnit(DcsDeliverableUnit toCopy) { super(toCopy); this.coreMd = toCopy.getCoreMd(); this.collections = toCopy.getCollections(); this.metadata = toCopy.getMetadata(); this.metadataRefs = toCopy.getMetadataRef(); this.relations = toCopy.getRelations(); this.formerExternalRefs = toCopy.getFormerExternalRefs(); this.isDigitalSurrogate = toCopy.isDigitalSurrogate(); this.parents = toCopy.getParents(); }
addRelationSet(doc, du.getRelations()); addResourceIdentifierSet(doc, du.getAlternateIds()); add(doc, CoreMetadataField.TYPE, du.getType());
final Set<String> creators = du.getCreators(); final Set<String> extRefs = du.getFormerExternalRefs(); final Set<DcsRelation> relations = du.getRelations(); final Set<String> subjects = du.getSubjects(); final Set<DcsDeliverableUnitRef> parents = du.getParents();
final Collection<String> creators = du.getCreators(); final Collection<String> extRefs = du.getFormerExternalRefs(); // Being deprecated, use AltIds DWD final Collection<DcsRelation> relations = du.getRelations(); final Collection<String> subjects = du.getSubjects(); final Collection<DcsDeliverableUnitRef> parents = du.getParents();