use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityManagerImpl method fundingMap.
public LinkedHashMap<Long, Funding> fundingMap(String orcid) {
List<Funding> fundings = profileFundingManager.getFundingList(orcid);
LinkedHashMap<Long, Funding> fundingMap = new LinkedHashMap<>();
if (fundings != null) {
for (Funding funding : fundings) {
if (funding.getVisibility().equals(Visibility.PUBLIC))
fundingMap.put(Long.valueOf(funding.getPutCode()), funding);
}
}
return fundingMap;
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorImpl method viewFunding.
@Override
public Response viewFunding(String orcid, Long putCode) {
Funding f = profileFundingManagerReadOnly.getFunding(orcid, putCode);
publicAPISecurityManagerV2.checkIsPublic(f);
ActivityUtils.setPathToActivity(f, orcid);
ActivityUtils.cleanEmptyFields(f);
sourceUtilsReadOnly.setSourceName(f);
contributorUtilsReadOnly.filterContributorPrivateData(f);
return Response.ok(f).build();
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityUtilsTest method cleanFundingTest.
@Test
public void cleanFundingTest() {
// Test it cleans empty fields
Funding f = getEmptyFunding();
assertNotNull(f.getContributors().getContributor().get(0).getCreditName());
assertNotNull(f.getContributors().getContributor().get(0).getCreditName().getContent());
ActivityUtils.cleanEmptyFields(f);
assertNull(f.getContributors().getContributor().get(0).getCreditName());
// Test it doesn't remove non empty fields
f = getEmptyFunding();
f.getContributors().getContributor().get(0).getCreditName().setContent("test");
assertNotNull(f.getContributors().getContributor().get(0).getCreditName());
assertEquals("test", f.getContributors().getContributor().get(0).getCreditName().getContent());
ActivityUtils.cleanEmptyFields(f);
assertNotNull(f.getContributors().getContributor().get(0).getCreditName());
assertEquals("test", f.getContributors().getContributor().get(0).getCreditName().getContent());
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class ActivityUtilsTest method getEmptyFunding.
private Funding getEmptyFunding() {
Funding f = new Funding();
FundingContributors fcs = new FundingContributors();
FundingContributor fc = new FundingContributor();
fc.setCreditName(new CreditName(""));
fcs.getContributor().add(fc);
f.setContributors(fcs);
return f;
}
use of org.orcid.jaxb.model.record_rc4.Funding in project ORCID-Source by ORCID.
the class SourceInActivitiesTest method getFundingWithoutExtIdentifiers.
private ProfileFundingEntity getFundingWithoutExtIdentifiers(String userOrcid) {
Funding funding = new Funding();
funding.setOrganization(getOrganization());
FundingTitle title = new FundingTitle();
title.setTitle(new Title("Title " + System.currentTimeMillis()));
funding.setTitle(title);
funding.setType(org.orcid.jaxb.model.record_v2.FundingType.AWARD);
funding = profileFundingManager.createFunding(userOrcid, funding, true);
return profileFundingManager.getProfileFundingEntity(funding.getPutCode());
}
Aggregations