public void setSourceName(OtherNames otherNames) { List<OtherName> list = otherNames.getOtherNames(); if (list != null) { for (SourceAware element : list) { setSourceName(element); } } }
@Override public OtherNames toOtherNameList(Collection<OtherNameEntity> entities) { if (entities == null) { return null; } List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class); OtherNames otherNames = new OtherNames(); otherNames.setOtherNames(otherNameList); return otherNames; }
return false; } else if (!otherNames.equals(other.otherNames)) { return false;
public static void setPathToOtherNames(OtherNames otherNames, String orcid) { if (otherNames != null) { otherNames.setPath(OTHER_NAMES.replace("{orcid}", orcid)); if (otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { for (OtherName otherName : otherNames.getOtherNames()) { setPathToOtherName(otherName, orcid); } } } }
public static void calculateLastModified(OtherNames otherNames) { if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { LastModifiedDate latest = null; for (OtherName otherName : otherNames.getOtherNames()) { if (otherName.getLastModifiedDate() != null && otherName.getLastModifiedDate().after(latest)) { latest = otherName.getLastModifiedDate(); } } otherNames.setLastModifiedDate(latest); } }
@Override public PersonalDetails getPersonalDetails(String orcid) { Date lastModified = getLastModifiedDate(orcid); PersonalDetails personalDetails = new PersonalDetails(); Name name = recordNameManager.getRecordName(orcid); if (name != null) { personalDetails.setName(name); } Biography bio = biographyManager.getBiography(orcid); if (bio != null) { personalDetails.setBiography(bio); } OtherNames otherNames = otherNameManager.getOtherNames(orcid); OtherNames filteredOtherNames = new OtherNames(); personalDetails.setOtherNames(filteredOtherNames); if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { // Lets copy the list so we don't modify the cached collection List<OtherName> filteredList = new ArrayList<OtherName>(otherNames.getOtherNames()); filteredOtherNames.setOtherNames(filteredList); } if (personalDetails.getLastModifiedDate() == null || personalDetails.getLastModifiedDate().getValue() == null) { personalDetails.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified))); } return personalDetails; }
public static void calculateLastModified(PersonalDetails personalDetails) { if (personalDetails != null) { calculateLastModified(personalDetails.getOtherNames()); LastModifiedDate l1 = personalDetails.getBiography() == null ? null : personalDetails.getBiography().getLastModifiedDate(); LastModifiedDate l2 = personalDetails.getName() == null ? null : personalDetails.getName().getLastModifiedDate(); LastModifiedDate l3 = personalDetails.getOtherNames() == null ? null : personalDetails.getOtherNames().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3); personalDetails.setLastModifiedDate(globalLatest); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); return result; }
OtherNames filteredOtherNames = new OtherNames(); personalDetails.setOtherNames(filteredOtherNames); if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { List<OtherName> filteredList = new ArrayList<OtherName>(otherNames.getOtherNames()); filteredOtherNames.setOtherNames(filteredList);
public static void calculateLastModified(Person person) { if (person != null) { calculateLastModified(person.getAddresses()); calculateLastModified(person.getEmails()); calculateLastModified(person.getExternalIdentifiers()); calculateLastModified(person.getKeywords()); calculateLastModified(person.getOtherNames()); calculateLastModified(person.getResearcherUrls()); LastModifiedDate l1 = person.getAddresses() == null ? null : person.getAddresses().getLastModifiedDate(); LastModifiedDate l2 = person.getEmails() == null ? null : person.getEmails().getLastModifiedDate(); LastModifiedDate l3 = person.getExternalIdentifiers() == null ? null : person.getExternalIdentifiers().getLastModifiedDate(); LastModifiedDate l4 = person.getKeywords() == null ? null : person.getKeywords().getLastModifiedDate(); LastModifiedDate l5 = person.getOtherNames() == null ? null : person.getOtherNames().getLastModifiedDate(); LastModifiedDate l6 = person.getResearcherUrls() == null ? null : person.getResearcherUrls().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5, l6); person.setLastModifiedDate(globalLatest); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addresses == null) ? 0 : addresses.hashCode()); result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((emails == null) ? 0 : emails.hashCode()); result = prime * result + ((externalIdentifiers == null) ? 0 : externalIdentifiers.hashCode()); result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((researcherUrls == null) ? 0 : researcherUrls.hashCode()); return result; }
if (otherNames.getOtherNames() != null) { OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
public static OtherNamesForm valueOf(OtherNames otherNames) { OtherNamesForm on = new OtherNamesForm(); if (otherNames == null) { on.setVisibility(new Visibility()); return on; } if (otherNames.getOtherNames() != null) { for (OtherName otherName : otherNames.getOtherNames()) { on.getOtherNames().add(OtherNameForm.valueOf(otherName)); } } return on; }
public OtherNames toOtherNames() { OtherNames otherNames = new OtherNames(); List<OtherName> onList = new ArrayList<OtherName>(); if(this.otherNames != null && !this.otherNames.isEmpty()) { for(OtherNameForm otherNameForm : this.otherNames) { onList.add(otherNameForm.toOtherName()); } } otherNames.setOtherNames(onList); return otherNames; }
if (other.otherNames != null) return false; } else if (!otherNames.equals(other.otherNames)) return false; if (path == null) {
if (otherNames.getOtherNames() != null) { OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
if(otherNames.getOtherNames() != null) { for(OtherName updatedOrNew : otherNames.getOtherNames()) { if(existingOtherName.getId().equals(updatedOrNew.getPutCode())) { deleteMe = false; if(otherNames != null && otherNames.getOtherNames() != null) { for(OtherName updatedOrNew : otherNames.getOtherNames()) { if(updatedOrNew.getPutCode() != null) {
@Override public OtherNames toMinimizedOtherNameList(Collection<OtherNameEntity> entities) { if (entities == null) { return null; } List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class); for(OtherName otherName : otherNameList) { otherName.setCreatedDate(null); otherName.setSource(null); } OtherNames otherNames = new OtherNames(); otherNames.setOtherNames(otherNameList); return otherNames; }
@Override public void checkAndFilter(String orcid, PersonalDetails personalDetails) { if (personalDetails == null) { return; } // Check the token isMyToken(orcid); if (personalDetails.getOtherNames() != null) { checkAndFilter(orcid, personalDetails.getOtherNames().getOtherNames(), READ_BIO_REQUIRED_SCOPE, true); } if (personalDetails.getBiography() != null) { try { checkAndFilter(orcid, personalDetails.getBiography(), READ_BIO_REQUIRED_SCOPE, true); } catch (Exception e) { personalDetails.setBiography(null); } } if (personalDetails.getName() != null) { try { checkAndFilter(orcid, personalDetails.getName(), READ_BIO_REQUIRED_SCOPE, true); } catch (Exception e) { personalDetails.setName(null); } } }
if (r.getPerson().getOtherNames() != null && r.getPerson().getOtherNames().getOtherNames() != null) for (OtherName n : r.getPerson().getOtherNames().getOtherNames()) { doc.alternateName.add(n.getContent());