Search in sources :

Example 11 with FundingContributor

use of org.orcid.jaxb.model.record_rc3.FundingContributor 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 12 with FundingContributor

use of org.orcid.jaxb.model.record_rc3.FundingContributor 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 13 with FundingContributor

use of org.orcid.jaxb.model.record_rc3.FundingContributor in project ORCID-Source by ORCID.

the class ContributorUtilsTest method testFilterContributorPrivateDataForFundingWithNoOrcidRecord.

@Test
public void testFilterContributorPrivateDataForFundingWithNoOrcidRecord() {
    Funding funding = getFundingWithContributorWithoutOrcid();
    contributorUtils.filterContributorPrivateData(funding);
    FundingContributor contributor = funding.getContributors().getContributor().get(0);
    assertNull(contributor.getContributorEmail());
    assertEquals("original credit name", contributor.getCreditName().getContent());
}
Also used : Funding(org.orcid.jaxb.model.record_v2.Funding) FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) Test(org.junit.Test)

Example 14 with FundingContributor

use of org.orcid.jaxb.model.record_rc3.FundingContributor 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("http://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;
}
Also used : TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) Funding(org.orcid.jaxb.model.record_v2.Funding) Amount(org.orcid.jaxb.model.common_v2.Amount) FundingContributor(org.orcid.jaxb.model.record_v2.FundingContributor) FundingContributors(org.orcid.jaxb.model.record_v2.FundingContributors) FundingContributorAttributes(org.orcid.jaxb.model.record_v2.FundingContributorAttributes) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Title(org.orcid.jaxb.model.common_v2.Title) ContributorOrcid(org.orcid.jaxb.model.common_v2.ContributorOrcid) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Url(org.orcid.jaxb.model.common_v2.Url) OrganizationDefinedFundingSubType(org.orcid.jaxb.model.common_v2.OrganizationDefinedFundingSubType)

Aggregations

FundingContributor (org.orcid.jaxb.model.record_v2.FundingContributor)11 Funding (org.orcid.jaxb.model.record_v2.Funding)5 Test (org.junit.Test)4 CreditName (org.orcid.jaxb.model.common_v2.CreditName)4 ContributorEmail (org.orcid.jaxb.model.common_v2.ContributorEmail)3 ContributorOrcid (org.orcid.jaxb.model.common_v2.ContributorOrcid)3 FundingContributors (org.orcid.jaxb.model.record_v2.FundingContributors)3 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)3 FundingContributorAttributes (org.orcid.jaxb.model.record_v2.FundingContributorAttributes)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Visibility (org.orcid.jaxb.model.common_rc1.Visibility)1 Visibility (org.orcid.jaxb.model.common_rc2.Visibility)1 Visibility (org.orcid.jaxb.model.common_rc3.Visibility)1 Amount (org.orcid.jaxb.model.common_v2.Amount)1 DisambiguatedOrganization (org.orcid.jaxb.model.common_v2.DisambiguatedOrganization)1 Organization (org.orcid.jaxb.model.common_v2.Organization)1 OrganizationAddress (org.orcid.jaxb.model.common_v2.OrganizationAddress)1 OrganizationDefinedFundingSubType (org.orcid.jaxb.model.common_v2.OrganizationDefinedFundingSubType)1