public static Contributor valueOf(org.orcid.jaxb.model.v3.rc2.common.Contributor 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.getContributorAttributes().getContributorSequence() != null) c.setContributorSequence(Text.valueOf(contributor.getContributorAttributes().getContributorSequence().value())); } if (contributor.getContributorOrcid() != null) { c.setOrcid(Text.valueOf(contributor.getContributorOrcid().getPath())); c.setUri(Text.valueOf(contributor.getContributorOrcid().getUri())); } //Set default values that must be overwritten by the controller if (contributor.getCreditName() != null) { c.setCreditName(Text.valueOf(contributor.getCreditName().getContent())); } } return c; }
contributor.setContributorEmail(null); if (!PojoUtil.isEmpty(contributor.getContributorOrcid())) { String orcid = contributor.getContributorOrcid().getPath(); String cachedName = getCachedContributorName(orcid); if(cachedName == null) { } else { CreditName creditName = new CreditName(cachedName); contributor.setCreditName(creditName); String orcid = contributor.getContributorOrcid().getPath(); contributor.setCreditName(creditName);
if(workForm.getContributors() != null && !workForm.getContributors().isEmpty()) { for(Contributor wfContributor : workForm.getContributors()) { org.orcid.jaxb.model.v3.rc2.common.Contributor workContributor = new org.orcid.jaxb.model.v3.rc2.common.Contributor(); org.orcid.jaxb.model.v3.rc2.common.ContributorAttributes contributorAttributes = new org.orcid.jaxb.model.v3.rc2.common.ContributorAttributes(); if(!PojoUtil.isEmpty(wfContributor.getContributorRole())) { contributorAttributes.setContributorSequence(org.orcid.jaxb.model.common.SequenceType.fromValue(wfContributor.getContributorSequence().getValue())); workContributor.setContributorAttributes(contributorAttributes); workContributor.setCreditName(creditName); workContributor.setContributorEmail(new org.orcid.jaxb.model.v3.rc2.common.ContributorEmail(wfContributor.getEmail().getValue())); contributorOrcid.setUri(wfContributor.getUri().getValue()); workContributor.setContributorOrcid(contributorOrcid); contributors.getContributor().add(workContributor);
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); } } } } }
if (!contributors.getContributor().isEmpty()) { for (Contributor contributor : contributors.getContributor()) { if (contributor.getContributorOrcid() != null) { ContributorOrcid contributorOrcid = contributor.getContributorOrcid(); if (!PojoUtil.isEmpty(contributorOrcid.getUri())) { if (!OrcidStringUtils.isValidOrcid2_1Uri(contributorOrcid.getUri())) { if (contributor.getCreditName() != null) { if (PojoUtil.isEmpty(contributor.getCreditName().getContent())) { throw new OrcidValidationException("Please specify a contributor credit name or remove the empty tag"); if (contributor.getContributorEmail() != null) { if (PojoUtil.isEmpty(contributor.getContributorEmail().getValue())) { throw new OrcidValidationException("Please specify a contributor email or remove the empty tag");
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());
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()));