use of org.orcid.jaxb.model.common_rc3.Title in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkWithOrcidContributor.
private Work getWorkWithOrcidContributor() {
Work work = new Work();
WorkTitle workTitle = new WorkTitle();
workTitle.setTitle(new Title("work with contributor who has ORCID record"));
work.setWorkTitle(workTitle);
work.setWorkContributors(getWorkContributorWithOrcid());
return work;
}
use of org.orcid.jaxb.model.common_rc3.Title in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getFundingWithOrcidContributor.
private Funding getFundingWithOrcidContributor() {
Funding funding = new Funding();
FundingTitle fundingTitle = new FundingTitle();
fundingTitle.setTitle(new Title("work with contributor who has ORCID record"));
funding.setTitle(fundingTitle);
funding.setContributors(getFundingContributorWithOrcid());
return funding;
}
use of org.orcid.jaxb.model.common_rc3.Title in project ORCID-Source by ORCID.
the class WorksTest method getWork.
private Work getWork(String title, boolean randomExtId, String extIdValue) {
Long time = System.currentTimeMillis();
Work work = new Work();
WorkTitle workTitle = new WorkTitle();
Title wTitle = new Title(title);
workTitle.setTranslatedTitle(new TranslatedTitle(title, "en"));
workTitle.setTitle(wTitle);
work.setWorkTitle(workTitle);
work.setWorkType(WorkType.BOOK);
ExternalID extId = new ExternalID();
extId.setRelationship(Relationship.SELF);
if (randomExtId) {
extId.setValue("work-ext-id-" + (Math.random() * 1000) + "-" + time);
} else {
extId.setValue("work-ext-id-" + extIdValue);
}
extId.setType("doi");
ExternalIDs extIds = new ExternalIDs();
extIds.getExternalIdentifier().add(extId);
work.setWorkExternalIdentifiers(extIds);
return work;
}
use of org.orcid.jaxb.model.common_rc3.Title in project ORCID-Source by ORCID.
the class WorksTest method getWork.
private Work getWork(String title, boolean randomExtId, String extIdValue) {
Long time = System.currentTimeMillis();
Work work = new Work();
WorkTitle workTitle = new WorkTitle();
Title wTitle = new Title(title);
workTitle.setTranslatedTitle(new TranslatedTitle(title, "en"));
workTitle.setTitle(wTitle);
work.setWorkTitle(workTitle);
work.setWorkType(WorkType.BOOK);
ExternalID extId = new ExternalID();
extId.setRelationship(Relationship.SELF);
if (randomExtId) {
extId.setValue("work-ext-id-" + (Math.random() * 1000) + "-" + time);
} else {
extId.setValue("work-ext-id-" + extIdValue);
}
extId.setType("doi");
ExternalIDs extIds = new ExternalIDs();
extIds.getExternalIdentifier().add(extId);
work.setWorkExternalIdentifiers(extIds);
return work;
}
use of org.orcid.jaxb.model.common_rc3.Title 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