public FamilyNames(org.orcid.jaxb.model.message.GivenNames givenNames) { this.setContent(givenNames.getContent()); }
public String retrieveDisplayNameIgnoringVisibility() { if (creditName != null) { return creditName.getContent(); } StringBuilder builder = new StringBuilder(); builder.append(givenNames.getContent()); if (familyName != null) { builder.append(" "); builder.append(familyName.getContent()); } return builder.toString(); }
public GivenNames(org.orcid.jaxb.model.message.GivenNames givenNames) { this.setContent(givenNames.getContent()); }
private void setGivenNames(ProfileEntity profileEntity, GivenNames givenNames) { if (givenNames != null && StringUtils.isNotBlank(givenNames.getContent())) { if(profileEntity.getRecordNameEntity() == null) { profileEntity.setRecordNameEntity(new RecordNameEntity()); profileEntity.getRecordNameEntity().setProfile(profileEntity); } profileEntity.getRecordNameEntity().setGivenNames(givenNames.getContent()); } }
if (persistPersonalDetails) { profileIndexDocument.setFamilyName(personalDetails.getFamilyName() != null ? personalDetails.getFamilyName().getContent() : null); profileIndexDocument.setGivenNames(personalDetails.getGivenNames() != null ? personalDetails.getGivenNames().getContent() : null); profileIndexDocument.setCreditName(personalDetails.getCreditName() != null ? personalDetails.getCreditName().getContent() : null); List<OtherName> otherNames = personalDetails.getOtherNames() != null ? personalDetails.getOtherNames().getOtherName() : null;
@Override public void copyUpdatedPersonalDetailsToExistingPreservingVisibility(OrcidBio existing, OrcidBio updated) { PersonalDetails existingPersonalDetails = existing.getPersonalDetails(); PersonalDetails updatedPersonalDetails = updated.getPersonalDetails(); // if no update, nothing to do if (updatedPersonalDetails == null) { return; } // if existing null, update unconditionally - we've no previous to // compare to if (existingPersonalDetails == null) { existing.setPersonalDetails(updatedPersonalDetails); return; } // otherwise preserve visibility of other names && credit names copyOtherNamesPreservingVisibility(existingPersonalDetails, updatedPersonalDetails); copyCreditNamePreservingVisibility(existingPersonalDetails, updatedPersonalDetails); if(updatedPersonalDetails.getFamilyName() != null && !PojoUtil.isEmpty(updatedPersonalDetails.getFamilyName().getContent())) { existingPersonalDetails.setFamilyName(updatedPersonalDetails.getFamilyName()); } if(updatedPersonalDetails.getGivenNames() != null && !PojoUtil.isEmpty(updatedPersonalDetails.getGivenNames().getContent())) { existingPersonalDetails.setGivenNames(updatedPersonalDetails.getGivenNames()); } }