use of org.orcid.jaxb.model.common_rc2.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithNoOrcidRecord.
@Test
public void testFilterContributorPrivateDataForWorkWithNoOrcidRecord() {
Work work = getWorkWithContributorWithoutOrcid();
contributorUtils.filterContributorPrivateData(work);
Contributor contributor = work.getWorkContributors().getContributor().get(0);
assertNull(contributor.getContributorEmail());
assertEquals("original credit name", contributor.getCreditName().getContent());
}
use of org.orcid.jaxb.model.common_rc2.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkContributorWithOrcid.
private WorkContributors getWorkContributorWithOrcid() {
ContributorOrcid contributorOrcid = new ContributorOrcid();
contributorOrcid.setPath("0000-0003-4902-6327");
contributorOrcid.setHost("orcid.org");
contributorOrcid.setUri("http://orcid.org/0000-0003-4902-6327");
Contributor contributor = new Contributor();
contributor.setContributorOrcid(contributorOrcid);
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
return new WorkContributors(Arrays.asList(contributor));
}
use of org.orcid.jaxb.model.common_rc2.Contributor in project ORCID-Source by ORCID.
the class MemberV2ApiServiceImplV2_0_rc1 method compareWorkAndCreditNameVisibility.
private void compareWorkAndCreditNameVisibility(Work work) {
Visibility workVisibility = work.getVisibility();
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) {
for (Contributor contributor : work.getWorkContributors().getContributor()) {
if (contributor.getCreditName() != null && contributor.getCreditName().getVisibility() != null && contributor.getCreditName().getVisibility().isMoreRestrictiveThan(workVisibility)) {
String title = (work.getWorkTitle() == null || work.getWorkTitle().getTitle() == null) ? null : work.getWorkTitle().getTitle().getContent();
LOGGER.error("Client posting work '{}' with visibility ({}) less restrictive than its contributor credit name '{}' ({})", new Object[] { title, workVisibility, contributor.getCreditName().getContent(), contributor.getCreditName().getVisibility() });
}
}
}
}
use of org.orcid.jaxb.model.common_rc2.Contributor in project ORCID-Source by ORCID.
the class MemberV2ApiServiceImplV2_0_rc2 method compareFundingAndCreditNameVisibility.
private void compareFundingAndCreditNameVisibility(Funding funding) {
Visibility fundingVisibility = funding.getVisibility();
if (funding.getContributors() != null && funding.getContributors().getContributor() != null) {
for (FundingContributor contributor : funding.getContributors().getContributor()) {
if (contributor.getCreditName() != null && contributor.getCreditName().getVisibility() != null && contributor.getCreditName().getVisibility().isMoreRestrictiveThan(fundingVisibility)) {
String title = (funding.getTitle() == null || funding.getTitle().getTitle() == null) ? null : funding.getTitle().getTitle().getContent();
LOGGER.error("Client posting funding '{}' with visibility ({}) less restrictive than its contributor credit name '{}' ({})", new Object[] { title, fundingVisibility, contributor.getCreditName().getContent(), contributor.getCreditName().getVisibility() });
}
}
}
}
use of org.orcid.jaxb.model.common_rc2.Contributor in project ORCID-Source by ORCID.
the class MemberV2ApiServiceImplV2_0_rc3 method compareWorkAndCreditNameVisibility.
private void compareWorkAndCreditNameVisibility(Work work) {
Visibility workVisibility = work.getVisibility();
if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) {
for (Contributor contributor : work.getWorkContributors().getContributor()) {
if (contributor.getCreditName() != null && contributor.getCreditName().getVisibility() != null && contributor.getCreditName().getVisibility().isMoreRestrictiveThan(workVisibility)) {
String title = (work.getWorkTitle() == null || work.getWorkTitle().getTitle() == null) ? null : work.getWorkTitle().getTitle().getContent();
LOGGER.error("Client posting work '{}' with visibility ({}) less restrictive than its contributor credit name '{}' ({})", new Object[] { title, workVisibility, contributor.getCreditName().getContent(), contributor.getCreditName().getVisibility() });
}
}
}
}
Aggregations