use of org.orcid.jaxb.model.v3.dev1.common.ContributorEmail in project ORCID-Source by ORCID.
the class ActivityValidatorTest method getWork.
public Work getWork() {
Work work = new Work();
work.setCountry(new Country(Iso3166Country.US));
work.setJournalTitle(new Title("journal-title"));
work.setLanguageCode("en");
work.setPublicationDate(new PublicationDate(getFuzzyDate()));
work.setShortDescription("short-description");
work.setUrl(new Url("http://test.orcid.org"));
work.setVisibility(Visibility.PUBLIC);
work.setWorkCitation(new Citation("citation", CitationType.FORMATTED_HARVARD));
ContributorAttributes attributes = new ContributorAttributes();
attributes.setContributorRole(ContributorRole.ASSIGNEE);
attributes.setContributorSequence(SequenceType.FIRST);
ContributorOrcid contributorOrcid = new ContributorOrcid();
contributorOrcid.setHost("http://test.orcid.org");
contributorOrcid.setPath("0000-0000-0000-0000");
contributorOrcid.setUri("https://test.orcid.org/0000-0000-0000-0000");
Contributor contributor = new Contributor();
contributor.setContributorAttributes(attributes);
contributor.setContributorOrcid(contributorOrcid);
contributor.setCreditName(new CreditName("credit name"));
contributor.setContributorEmail(new ContributorEmail("email@test.orcid.org"));
WorkContributors contributors = new WorkContributors(Stream.of(contributor).collect(Collectors.toList()));
work.setWorkContributors(contributors);
work.setWorkExternalIdentifiers(getExternalIDs());
work.setWorkTitle(getWorkTitle());
work.setWorkType(WorkType.ARTISTIC_PERFORMANCE);
return work;
}
use of org.orcid.jaxb.model.v3.dev1.common.ContributorEmail in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getFundingContributorWithOrcid.
private FundingContributors getFundingContributorWithOrcid() {
ContributorOrcid contributorOrcid = new ContributorOrcid();
contributorOrcid.setPath("0000-0003-4902-6327");
contributorOrcid.setHost("orcid.org");
contributorOrcid.setUri("http://orcid.org/0000-0003-4902-6327");
FundingContributor contributor = new FundingContributor();
contributor.setContributorOrcid(contributorOrcid);
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
FundingContributors fundingContributors = new FundingContributors();
fundingContributors.getContributor().add(contributor);
return fundingContributors;
}
use of org.orcid.jaxb.model.v3.dev1.common.ContributorEmail in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getFundingContributorWithoutOrcid.
private FundingContributors getFundingContributorWithoutOrcid() {
FundingContributor contributor = new FundingContributor();
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
FundingContributors fundingContributors = new FundingContributors();
fundingContributors.getContributor().add(contributor);
return fundingContributors;
}
use of org.orcid.jaxb.model.v3.dev1.common.ContributorEmail in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkContributorWithoutOrcid.
private WorkContributors getWorkContributorWithoutOrcid() {
Contributor contributor = new Contributor();
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.v3.dev1.common.ContributorEmail in project ORCID-Source by ORCID.
the class Contributor method toFundingContributor.
public FundingContributor toFundingContributor() {
FundingContributor c = new FundingContributor();
if (this.getContributorRole() != null || this.getContributorSequence() != null) {
FundingContributorAttributes ca = new FundingContributorAttributes();
if (!PojoUtil.isEmpty(this.getContributorRole()))
ca.setContributorRole(FundingContributorRole.fromValue(this.getContributorRole().getValue()));
c.setContributorAttributes(ca);
}
if (this.getEmail() != null)
c.setContributorEmail(new ContributorEmail(this.getEmail().getValue()));
if (this.getOrcid() != null) {
ContributorOrcid contributorOrcid = new ContributorOrcid(this.getOrcid().getValue());
if (this.getUri() != null) {
String uriString = this.getUri().getValue();
if (StringUtils.isNotBlank(uriString)) {
try {
URI uri = new URI(uriString);
contributorOrcid.setHost(uri.getHost());
} catch (URISyntaxException e) {
throw new RuntimeException("Problem parsing contributor orcid uri", e);
}
}
}
contributorOrcid.setUri(this.getUri().getValue());
c.setContributorOrcid(contributorOrcid);
}
if (this.getCreditName() != null) {
CreditName cn = new CreditName(this.getCreditName().getValue());
c.setCreditName(cn);
}
return c;
}
Aggregations