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 (contributor.getCreditName() != null) { if (PojoUtil.isEmpty(contributor.getCreditName().getContent())) { throw new OrcidValidationException("Please specify a contributor credit name or remove the empty tag");
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); } } } } }
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; }
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()));