public OpenIDConnectUserInfo(String orcid, Person person, String path) { this.id = path+"/"+orcid; this.sub = orcid; if (person.getName() != null){ if (person.getName().getCreditName() != null){ this.name = person.getName().getCreditName().getContent(); } if (person.getName().getFamilyName() != null){ this.family_name = person.getName().getFamilyName().getContent(); } if (person.getName().getGivenNames() != null){ this.given_name = person.getName().getGivenNames().getContent(); } } } public OpenIDConnectUserInfo(String orcid, PersonalDetails person, String path) {
public Name toName() { Name name = new Name(); if(!PojoUtil.isEmpty(givenNames)) { name.setGivenNames(new GivenNames(givenNames.getValue())); } if(!PojoUtil.isEmpty(familyName)) { name.setFamilyName(new FamilyName(familyName.getValue())); } if(!PojoUtil.isEmpty(creditName)) { name.setCreditName(new CreditName(creditName.getValue())); } if(visibility != null && visibility.getVisibility() != null) { name.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } else { name.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(OrcidVisibilityDefaults.NAMES_DEFAULT.getVisibility().value())); } return name; }
return false; } else if (!name.equals(other.name)) { return false;
public static NamesForm valueOf(Name name) { NamesForm nf = new NamesForm(); if (name != null) { if (name.getGivenNames() != null) { nf.setGivenNames(Text.valueOf(name.getGivenNames().getContent())); } if (name.getFamilyName() != null) { nf.setFamilyName(Text.valueOf(name.getFamilyName().getContent())); } if (name.getCreditName() != null) { nf.setCreditName(Text.valueOf(name.getCreditName().getContent())); } if (name.getVisibility() != null) { nf.setVisibility(Visibility.valueOf(name.getVisibility())); } else { org.orcid.jaxb.model.common_v2.Visibility v = org.orcid.jaxb.model.common_v2.Visibility.fromValue(OrcidVisibilityDefaults.NAMES_DEFAULT.getVisibility().value()); nf.setVisibility(Visibility.valueOf(v)); } } return nf; }
@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; }
if (name != null && !Visibility.PUBLIC.equals(name.getVisibility())) { personalDetails.setName(null); } else {
@Override public String findByCreditName(String creditName) { Name name = recordNameManager.findByCreditName(creditName); if (name == null) { return null; } return name.getPath(); }
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 + ((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 (Visibility.PUBLIC.equals(name.getVisibility())) { person.setName(name);
public OpenIDConnectUserInfo(String orcid, PersonalDetails person, String path) { this.id = path+"/"+orcid; this.sub = orcid; if (person.getName() != null){ if (person.getName().getCreditName() != null){ this.name = person.getName().getCreditName().getContent(); } if (person.getName().getFamilyName() != null){ this.family_name = person.getName().getFamilyName().getContent(); } if (person.getName().getGivenNames() != null){ this.given_name = person.getName().getGivenNames().getContent(); } } } public String getId() {
Name name = new Name(); name.setCreditName(new CreditName()); name.setGivenNames(new GivenNames("Given Names Deactivated")); name.setFamilyName(new FamilyName("Family Name Deactivated")); name.setVisibility(Visibility.PUBLIC); name.setPath(orcid); recordNameManager.updateRecordName(orcid, name);
if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (otherNames == null) {
if (r.getPerson().getName().getCreditName() != null) doc.name = r.getPerson().getName().getCreditName().getContent(); if (r.getPerson().getName().getGivenNames() != null) doc.givenName = r.getPerson().getName().getGivenNames().getContent(); if (r.getPerson().getName().getFamilyName() != null) doc.familyName = r.getPerson().getName().getFamilyName().getContent();