Search in sources :

Example 1 with ContributorEmail

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;
}
Also used : PublicationDate(org.orcid.jaxb.model.v3.dev1.common.PublicationDate) ContributorAttributes(org.orcid.jaxb.model.v3.dev1.common.ContributorAttributes) FundingContributorAttributes(org.orcid.jaxb.model.v3.dev1.record.FundingContributorAttributes) WorkContributors(org.orcid.jaxb.model.v3.dev1.record.WorkContributors) Work(org.orcid.jaxb.model.v3.dev1.record.Work) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) Country(org.orcid.jaxb.model.v3.dev1.common.Country) Iso3166Country(org.orcid.jaxb.model.v3.dev1.common.Iso3166Country) Title(org.orcid.jaxb.model.v3.dev1.common.Title) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) FundingTitle(org.orcid.jaxb.model.v3.dev1.record.FundingTitle) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) Citation(org.orcid.jaxb.model.v3.dev1.record.Citation) ContributorOrcid(org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid) ContributorEmail(org.orcid.jaxb.model.v3.dev1.common.ContributorEmail) Url(org.orcid.jaxb.model.v3.dev1.common.Url)

Example 2 with ContributorEmail

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;
}
Also used : FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) FundingContributors(org.orcid.jaxb.model.v3.dev1.record.FundingContributors) ContributorOrcid(org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid) ContributorEmail(org.orcid.jaxb.model.v3.dev1.common.ContributorEmail)

Example 3 with ContributorEmail

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;
}
Also used : FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) FundingContributors(org.orcid.jaxb.model.v3.dev1.record.FundingContributors) ContributorEmail(org.orcid.jaxb.model.v3.dev1.common.ContributorEmail)

Example 4 with ContributorEmail

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));
}
Also used : WorkContributors(org.orcid.jaxb.model.v3.dev1.record.WorkContributors) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) ContributorEmail(org.orcid.jaxb.model.v3.dev1.common.ContributorEmail)

Example 5 with ContributorEmail

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;
}
Also used : FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) FundingContributorAttributes(org.orcid.jaxb.model.v3.dev1.record.FundingContributorAttributes) ContributorOrcid(org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid) URISyntaxException(java.net.URISyntaxException) ContributorEmail(org.orcid.jaxb.model.v3.dev1.common.ContributorEmail) URI(java.net.URI)

Aggregations

ContributorEmail (org.orcid.jaxb.model.v3.dev1.common.ContributorEmail)6 CreditName (org.orcid.jaxb.model.v3.dev1.common.CreditName)6 FundingContributor (org.orcid.jaxb.model.v3.dev1.record.FundingContributor)6 ContributorOrcid (org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid)4 Contributor (org.orcid.jaxb.model.v3.dev1.common.Contributor)3 WorkContributors (org.orcid.jaxb.model.v3.dev1.record.WorkContributors)3 Test (org.junit.Test)2 FundingContributorAttributes (org.orcid.jaxb.model.v3.dev1.record.FundingContributorAttributes)2 FundingContributors (org.orcid.jaxb.model.v3.dev1.record.FundingContributors)2 Work (org.orcid.jaxb.model.v3.dev1.record.Work)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ContributorAttributes (org.orcid.jaxb.model.v3.dev1.common.ContributorAttributes)1 Country (org.orcid.jaxb.model.v3.dev1.common.Country)1 Iso3166Country (org.orcid.jaxb.model.v3.dev1.common.Iso3166Country)1 PublicationDate (org.orcid.jaxb.model.v3.dev1.common.PublicationDate)1 Title (org.orcid.jaxb.model.v3.dev1.common.Title)1 TranslatedTitle (org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle)1 Url (org.orcid.jaxb.model.v3.dev1.common.Url)1 Citation (org.orcid.jaxb.model.v3.dev1.record.Citation)1