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 void setSourceName(OtherNames otherNames) { List<OtherName> list = otherNames.getOtherNames(); if (list != null) { for (SourceAware element : list) { setSourceName(element); } } }
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); long lastModifiedTime = lastModified.getTime(); 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; }
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);
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) {
if (otherNames.getOtherNames() != null) { OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
if (otherNames.getOtherNames() != null) { OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
@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());
checkAndFilter(orcid, person.getOtherNames().getOtherNames(), READ_BIO_REQUIRED_SCOPE, true);