Search in sources :

Example 1 with ContributorEmail

use of org.orcid.jaxb.model.common_v2.ContributorEmail 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));
}
Also used : WorkContributors(org.orcid.jaxb.model.record_v2.WorkContributors) CreditName(org.orcid.jaxb.model.common_v2.CreditName) FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) Contributor(org.orcid.jaxb.model.common_v2.Contributor) ContributorOrcid(org.orcid.jaxb.model.common_v2.ContributorOrcid) ContributorEmail(org.orcid.jaxb.model.common_v2.ContributorEmail)

Example 2 with ContributorEmail

use of org.orcid.jaxb.model.common_v2.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;
}
Also used : FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) CreditName(org.orcid.jaxb.model.common_v2.CreditName) FundingContributorAttributes(org.orcid.jaxb.model.record_v2.FundingContributorAttributes) ContributorOrcid(org.orcid.jaxb.model.common_v2.ContributorOrcid) URISyntaxException(java.net.URISyntaxException) ContributorEmail(org.orcid.jaxb.model.common_v2.ContributorEmail) URI(java.net.URI)

Example 3 with ContributorEmail

use of org.orcid.jaxb.model.common_v2.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;
}
Also used : FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) CreditName(org.orcid.jaxb.model.common_v2.CreditName) FundingContributors(org.orcid.jaxb.model.record_v2.FundingContributors) ContributorOrcid(org.orcid.jaxb.model.common_v2.ContributorOrcid) ContributorEmail(org.orcid.jaxb.model.common_v2.ContributorEmail)

Example 4 with ContributorEmail

use of org.orcid.jaxb.model.common_v2.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;
}
Also used : FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) CreditName(org.orcid.jaxb.model.common_v2.CreditName) FundingContributors(org.orcid.jaxb.model.record_v2.FundingContributors) ContributorEmail(org.orcid.jaxb.model.common_v2.ContributorEmail)

Example 5 with ContributorEmail

use of org.orcid.jaxb.model.common_v2.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));
}
Also used : WorkContributors(org.orcid.jaxb.model.record_v2.WorkContributors) CreditName(org.orcid.jaxb.model.common_v2.CreditName) FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) Contributor(org.orcid.jaxb.model.common_v2.Contributor) ContributorEmail(org.orcid.jaxb.model.common_v2.ContributorEmail)

Aggregations

ContributorEmail (org.orcid.jaxb.model.common_v2.ContributorEmail)6 CreditName (org.orcid.jaxb.model.common_v2.CreditName)6 FundingContributor (org.orcid.jaxb.model.record_v2.FundingContributor)6 ContributorOrcid (org.orcid.jaxb.model.common_v2.ContributorOrcid)4 Contributor (org.orcid.jaxb.model.common_v2.Contributor)3 WorkContributors (org.orcid.jaxb.model.record_v2.WorkContributors)3 FundingContributorAttributes (org.orcid.jaxb.model.record_v2.FundingContributorAttributes)2 FundingContributors (org.orcid.jaxb.model.record_v2.FundingContributors)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ContributorAttributes (org.orcid.jaxb.model.common_v2.ContributorAttributes)1 Country (org.orcid.jaxb.model.common_v2.Country)1 Iso3166Country (org.orcid.jaxb.model.common_v2.Iso3166Country)1 PublicationDate (org.orcid.jaxb.model.common_v2.PublicationDate)1 Title (org.orcid.jaxb.model.common_v2.Title)1 TranslatedTitle (org.orcid.jaxb.model.common_v2.TranslatedTitle)1 Url (org.orcid.jaxb.model.common_v2.Url)1 Citation (org.orcid.jaxb.model.record_v2.Citation)1 FundingTitle (org.orcid.jaxb.model.record_v2.FundingTitle)1 Work (org.orcid.jaxb.model.record_v2.Work)1