use of org.orcid.jaxb.model.record_rc4.CreditName 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.record_rc4.CreditName 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.record_rc4.CreditName 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.record_rc4.CreditName 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.record_rc4.CreditName in project ORCID-Source by ORCID.
the class ValidateV2_1SamplesTest method testMarshallCreditName.
@Test
public void testMarshallCreditName() throws JAXBException, SAXException, URISyntaxException {
CreditName object = (CreditName) unmarshallFromPath("/record_2.1/samples/read_samples/credit-name-2.1.xml", CreditName.class);
marshall(object, "/record_2.1/personal-details-2.1.xsd");
}
Aggregations