public static void cleanEmptyFields(Funding funding) { if (funding != null && funding.getContributors() != null && !funding.getContributors().getContributor().isEmpty()) { for (FundingContributor c : funding.getContributors().getContributor()) { if (c.getCreditName() != null && PojoUtil.isEmpty(c.getCreditName().getContent())) { c.setCreditName(null); } } } } }
contributorsToPopulateName.add(contributor); } else { CreditName creditName = new CreditName(cachedName); contributor.setCreditName(creditName); CreditName creditName = new CreditName(name); contributor.setCreditName(creditName);
if (other.creditName != null) return false; } else if (!creditName.equals(other.creditName)) return false; if (familyName == null) {
org.orcid.jaxb.model.v3.rc2.common.CreditName creditName = new org.orcid.jaxb.model.v3.rc2.common.CreditName(); creditName.setContent(wfContributor.getCreditName().getValue()); workContributor.setCreditName(creditName);
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((creditName == null) ? 0 : creditName.hashCode()); result = prime * result + ((familyName == null) ? 0 : familyName.hashCode()); result = prime * result + ((givenNames == null) ? 0 : givenNames.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((visibility == null) ? 0 : visibility.hashCode()); return result; }
@Override public int hashCode() { int result = contributorOrcid != null ? contributorOrcid.hashCode() : 0; result = 31 * result + (creditName != null ? creditName.hashCode() : 0); result = 31 * result + (contributorEmail != null ? contributorEmail.hashCode() : 0); result = 31 * result + (contributorAttributes != null ? contributorAttributes.hashCode() : 0); return result; } }
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for (Contributor c : work.getWorkContributors().getContributor()) { if (c.getCreditName() != null && c.getCreditName().getContent() != null) { names.add(c.getCreditName().getContent());
public void filterContributorPrivateData(Funding funding) { if (funding.getContributors() != null && funding.getContributors().getContributor() != null) { for (FundingContributor contributor : funding.getContributors().getContributor()) { contributor.setContributorEmail(null); if (!PojoUtil.isEmpty(contributor.getContributorOrcid())) { String contributorOrcid = contributor.getContributorOrcid().getPath(); if (profileEntityManager.orcidExists(contributorOrcid)) { // contributor is an ORCID user - visibility of user's // name in record must be taken into account ProfileEntity profileEntity = profileEntityCacheManager.retrieve(contributorOrcid); String publicContributorCreditName = cacheManager.getPublicCreditName(profileEntity); CreditName creditName = new CreditName(publicContributorCreditName != null ? publicContributorCreditName : ""); contributor.setCreditName(creditName); } } } } }
@Override public int hashCode() { int result = contributorOrcid != null ? contributorOrcid.hashCode() : 0; result = 31 * result + (creditName != null ? creditName.hashCode() : 0); result = 31 * result + (contributorEmail != null ? contributorEmail.hashCode() : 0); result = 31 * result + (contributorAttributes != null ? contributorAttributes.hashCode() : 0); return result; } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Contributor)) { return false; } Contributor that = (Contributor) o; if (contributorAttributes != null ? !contributorAttributes.equals(that.contributorAttributes) : that.contributorAttributes != null) { return false; } if (contributorEmail != null ? !contributorEmail.equals(that.contributorEmail) : that.contributorEmail != null) { return false; } if (contributorOrcid != null ? !contributorOrcid.equals(that.contributorOrcid) : that.contributorOrcid != null) { return false; } if (creditName != null ? !creditName.equals(that.creditName) : that.creditName != null) { return false; } return true; }
if (PojoUtil.isEmpty(contributor.getCreditName().getContent())) { throw new OrcidValidationException("Please specify a contributor credit name or remove the empty tag");
CreditName cn = new CreditName(this.getCreditName().getValue()); c.setCreditName(cn);
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FundingContributor)) { return false; } FundingContributor that = (FundingContributor) o; if (contributorAttributes != null ? !contributorAttributes.equals(that.contributorAttributes) : that.contributorAttributes != null) { return false; } if (contributorEmail != null ? !contributorEmail.equals(that.contributorEmail) : that.contributorEmail != null) { return false; } if (contributorOrcid != null ? !contributorOrcid.equals(that.contributorOrcid) : that.contributorOrcid != null) { return false; } if (creditName != null ? !creditName.equals(that.creditName) : that.creditName != null) { return false; } return true; }
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; }
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() {
doc.name = r.getPerson().getName().getCreditName().getContent(); if (r.getPerson().getName().getGivenNames() != null) doc.givenName = r.getPerson().getName().getGivenNames().getContent();
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for (Contributor c : work.getWorkContributors().getContributor()) { if (c.getCreditName() != null && c.getCreditName().getContent() != null) { names.add(StringUtils.stripAccents(c.getCreditName().getContent()));
public static Contributor valueOf(FundingContributor contributor) { Contributor c = new Contributor(); if (contributor != null) { if (contributor.getContributorAttributes() != null) { contributor.getContributorAttributes(); if (contributor.getContributorAttributes().getContributorRole() != null) c.setContributorRole(Text.valueOf(contributor.getContributorAttributes().getContributorRole().value())); } if (contributor.getContributorOrcid() != null) { c.setOrcid(Text.valueOf(contributor.getContributorOrcid().getPath())); c.setUri(Text.valueOf(contributor.getContributorOrcid().getUri())); } if (contributor.getCreditName() != null) { c.setCreditName(Text.valueOf(contributor.getCreditName().getContent())); } } return c; }
public static void cleanEmptyFields(Work work) { if (work != null) { if (work.getWorkCitation() != null) { if (PojoUtil.isEmpty(work.getWorkCitation().getCitation())) { work.setWorkCitation(null); } } if (work.getWorkTitle() != null) { if (work.getWorkTitle().getTranslatedTitle() != null) { if (PojoUtil.isEmpty(work.getWorkTitle().getTranslatedTitle().getContent())) { work.getWorkTitle().setTranslatedTitle(null); } } } if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) { for (Contributor c : work.getWorkContributors().getContributor()) { if (c.getCreditName() != null && PojoUtil.isEmpty(c.getCreditName().getContent())) { c.setCreditName(null); } } } } }