Search in sources :

Example 1 with Contributor

use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.

the class ContributorUtilsTest method testFilterContributorPrivateDataForWorkWithNoOrcidRecord.

@Test
public void testFilterContributorPrivateDataForWorkWithNoOrcidRecord() {
    Work work = getWorkWithContributorWithoutOrcid();
    contributorUtils.filterContributorPrivateData(work);
    Contributor contributor = work.getWorkContributors().getContributor().get(0);
    assertNull(contributor.getContributorEmail());
    assertEquals("original credit name", contributor.getCreditName().getContent());
}
Also used : Work(org.orcid.jaxb.model.record_v2.Work) FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) Contributor(org.orcid.jaxb.model.common_v2.Contributor) Test(org.junit.Test)

Example 2 with Contributor

use of org.orcid.jaxb.model.common_v2.Contributor 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 3 with Contributor

use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.

the class ContributorUtilsTest method getFundingWithContributorWithoutOrcid.

private Funding getFundingWithContributorWithoutOrcid() {
    Funding funding = new Funding();
    FundingTitle fundingTitle = new FundingTitle();
    fundingTitle.setTitle(new Title("funding with contributor without ORCID record"));
    funding.setTitle(fundingTitle);
    funding.setContributors(getFundingContributorWithoutOrcid());
    return funding;
}
Also used : Funding(org.orcid.jaxb.model.record_v2.Funding) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Title(org.orcid.jaxb.model.common_v2.Title) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle)

Example 4 with Contributor

use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.

the class ContributorUtilsTest method getWorkWithOrcidContributor.

private Work getWorkWithOrcidContributor() {
    Work work = new Work();
    WorkTitle workTitle = new WorkTitle();
    workTitle.setTitle(new Title("work with contributor who has ORCID record"));
    work.setWorkTitle(workTitle);
    work.setWorkContributors(getWorkContributorWithOrcid());
    return work;
}
Also used : WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Work(org.orcid.jaxb.model.record_v2.Work) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Example 5 with Contributor

use of org.orcid.jaxb.model.common_v2.Contributor in project ORCID-Source by ORCID.

the class ContributorUtilsTest method getFundingWithOrcidContributor.

private Funding getFundingWithOrcidContributor() {
    Funding funding = new Funding();
    FundingTitle fundingTitle = new FundingTitle();
    fundingTitle.setTitle(new Title("work with contributor who has ORCID record"));
    funding.setTitle(fundingTitle);
    funding.setContributors(getFundingContributorWithOrcid());
    return funding;
}
Also used : Funding(org.orcid.jaxb.model.record_v2.Funding) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Title(org.orcid.jaxb.model.common_v2.Title) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle)

Aggregations

FundingContributor (org.orcid.jaxb.model.record_v2.FundingContributor)13 Contributor (org.orcid.jaxb.model.common_v2.Contributor)12 Work (org.orcid.jaxb.model.record_v2.Work)9 CreditName (org.orcid.jaxb.model.common_v2.CreditName)8 WorkTitle (org.orcid.jaxb.model.record_v2.WorkTitle)8 Title (org.orcid.jaxb.model.common_v2.Title)7 FundingTitle (org.orcid.jaxb.model.record_v2.FundingTitle)7 ContributorEmail (org.orcid.jaxb.model.common_v2.ContributorEmail)5 ContributorOrcid (org.orcid.jaxb.model.common_v2.ContributorOrcid)5 WorkContributors (org.orcid.jaxb.model.record_v2.WorkContributors)5 Test (org.junit.Test)4 Funding (org.orcid.jaxb.model.record_v2.Funding)4 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)4 TranslatedTitle (org.orcid.jaxb.model.common_v2.TranslatedTitle)3 FundingContributors (org.orcid.jaxb.model.record_v2.FundingContributors)3 ArrayList (java.util.ArrayList)2 Amount (org.orcid.jaxb.model.common_v2.Amount)2 Iso3166Country (org.orcid.jaxb.model.common_v2.Iso3166Country)2 PublicationDate (org.orcid.jaxb.model.common_v2.PublicationDate)2 Url (org.orcid.jaxb.model.common_v2.Url)2