use of org.orcid.jaxb.model.v3.dev1.record.FundingContributorAttributes 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;
}
use of org.orcid.jaxb.model.v3.dev1.record.FundingContributorAttributes in project ORCID-Source by ORCID.
the class ActivityValidatorTest method getFunding.
public Funding getFunding() {
Funding funding = new Funding();
Amount amount = new Amount();
amount.setContent("1000");
amount.setCurrencyCode("$");
funding.setAmount(amount);
FundingContributor contributor = new FundingContributor();
FundingContributorAttributes attributes = new FundingContributorAttributes();
attributes.setContributorRole(FundingContributorRole.LEAD);
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.setContributorAttributes(attributes);
contributor.setContributorOrcid(contributorOrcid);
FundingContributors contributors = new FundingContributors();
contributors.getContributor().add(contributor);
funding.setContributors(contributors);
funding.setDescription("description");
funding.setEndDate(getFuzzyDate());
funding.setExternalIdentifiers(getExternalIDs());
funding.setOrganization(getOrganization());
funding.setOrganizationDefinedType(new OrganizationDefinedFundingSubType("subtype"));
funding.setStartDate(getFuzzyDate());
FundingTitle title = new FundingTitle();
title.setTitle(new Title("title"));
title.setTranslatedTitle(new TranslatedTitle("translated title", "en"));
funding.setTitle(title);
funding.setType(FundingType.AWARD);
funding.setUrl(new Url("http://test.orcid.org"));
funding.setVisibility(Visibility.PUBLIC);
return funding;
}
Aggregations