@Override @JsonIgnore public boolean isGroupAble() { //Dont group if it is a part-of identifier if(Relationship.PART_OF.equals(relationship)) return false; // Dont groups works where the external id is empty if (this.getValue() == null || this.getValue().isEmpty()) return false; return true; }
if (other.relationship != null) return false; } else if (!relationship.equals(other.relationship)) return false; if (source == null) {
private void addExternalIdsToExistingSet(Work work, Set<ExternalID> existingExternalIDs) { if(work != null && work.getExternalIdentifiers() != null && work.getExternalIdentifiers().getExternalIdentifier() != null) { for(ExternalID extId : work.getExternalIdentifiers().getExternalIdentifier()) { //Don't include PART_OF external ids if(!Relationship.PART_OF.equals(extId.getRelationship())) { existingExternalIDs.add(extId); } } } }
/** * Return the list of existing external identifiers for the given user where the source matches the given sourceId * * @param existingWorks * The list of existing works for the current user * @param sourceId * The client id we are evaluating * @return A set of all the existing external identifiers that belongs to the given user and to the given source id * */ private Set<ExternalID> buildExistingExternalIdsSet(List<Work> existingWorks, String sourceId) { Set<ExternalID> existingExternalIds = new HashSet<ExternalID>(); for(Work work : existingWorks) { //If it is the same source if(work.retrieveSourcePath().equals(sourceId)) { if(work.getExternalIdentifiers() != null && work.getExternalIdentifiers().getExternalIdentifier() != null) { for(ExternalID extId : work.getExternalIdentifiers().getExternalIdentifier()) { //Don't include PART_OF external ids if(!Relationship.PART_OF.equals(extId.getRelationship())) { existingExternalIds.add(extId); } } } } } return existingExternalIds; }
if(externalIdentifier.getRelationship() == null || !Relationship.SELF.equals(externalIdentifier.getRelationship())) { String message = "Relationship field should be self for person identifiers"; LOGGER.error(message);
for(ExternalID extId : work.getExternalIdentifiers().getExternalIdentifier()) { if(existingExternalIdentifiers.contains(extId) && Relationship.SELF.equals(extId.getRelationship())) { Map<String, String> params = new HashMap<String, String>(); params.put("clientName", SourceEntityUtils.getSourceName(sourceEntity));