use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method solrDocFilteredByNameVisibility.
private OrcidSolrDocument solrDocFilteredByNameVisibility() {
OrcidSolrDocument orcidSolrDocument = fullyPopulatedSolrDocumentForPersistence();
orcidSolrDocument.setCreditName(null);
orcidSolrDocument.setOtherNames(null);
orcidSolrDocument.setGivenNames(null);
orcidSolrDocument.setFamilyName(null);
orcidSolrDocument.setGivenAndFamilyNames(null);
OrcidProfile orcidProfile = orcidProfileLimitedVisiblityCreditNameAndOtherNames();
OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
return orcidSolrDocument;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method getOrcidWithGrants.
private OrcidProfile getOrcidWithGrants() {
OrcidProfile orcidWithGrants = getStandardOrcid();
FundingList orcidFundings = new FundingList();
Funding funding1 = new Funding();
funding1.setVisibility(Visibility.PUBLIC);
FundingTitle title = new FundingTitle();
title.setTitle(new Title("grant 1"));
funding1.setTitle(title);
Funding funding2 = new Funding();
funding2.setVisibility(Visibility.PUBLIC);
FundingTitle title2 = new FundingTitle();
title2.setTitle(new Title("grant 2"));
funding2.setTitle(title2);
Funding funding3 = new Funding();
funding3.setVisibility(Visibility.LIMITED);
FundingTitle title3 = new FundingTitle();
title3.setTitle(new Title("grant 3"));
funding3.setTitle(title3);
Funding funding4 = new Funding();
funding4.setVisibility(Visibility.PUBLIC);
orcidFundings.getFundings().addAll(Arrays.asList(new Funding[] { funding1, funding2, funding3, funding4 }));
orcidWithGrants.setFundings(orcidFundings);
return orcidWithGrants;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method onlyDoiPersistedFromOrcidWorks.
@Test
@Rollback
public void onlyDoiPersistedFromOrcidWorks() {
OrcidProfile orcidProfileWithDOI = getStandardOrcidWithDoiInformation();
OrcidSolrDocument doiListings = solrDocumentLimitedtoVisibleDoi();
// check that the limited profiles or non doi identifiers aren't
// included
orcidIndexManager.persistProfileInformationForIndexing(orcidProfileWithDOI);
verify(solrDao).persist(eq(doiListings));
// now check null values aren't persisted when either the type or value
// are missing
OrcidWork orcidWork1 = orcidProfileWithDOI.retrieveOrcidWorks().getOrcidWork().get(0);
orcidWork1.getWorkExternalIdentifiers().getWorkExternalIdentifier().get(0).setWorkExternalIdentifierType(null);
OrcidWork orcidWork2 = orcidProfileWithDOI.retrieveOrcidWorks().getOrcidWork().get(1);
orcidWork2.getWorkExternalIdentifiers().getWorkExternalIdentifier().get(0).setWorkExternalIdentifierId(null);
// so this should leave only the second doi
doiListings.setDigitalObjectIds(Arrays.asList(new String[] { "work2-doi2" }));
OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfileWithDOI);
doiListings.setPublicProfileMessage(orcidMessage.toString());
orcidIndexManager.persistProfileInformationForIndexing(orcidProfileWithDOI);
verify(solrDao).persist(eq(doiListings));
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method orcidProfileLimitedVisiblityAffiliations.
private OrcidProfile orcidProfileLimitedVisiblityAffiliations() {
OrcidProfile limitedOrcid = getStandardOrcid();
List<Affiliation> affiliations = limitedOrcid.getOrcidActivities().getAffiliations().getAffiliation();
for (Affiliation affiliation : affiliations) {
affiliation.setVisibility(Visibility.LIMITED);
}
return limitedOrcid;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class RegistrationControllerTest method createBasicProfile.
protected OrcidProfile createBasicProfile() {
OrcidProfile profile = new OrcidProfile();
profile.setPassword("password");
profile.setVerificationCode("1234");
profile.setSecurityQuestionAnswer("random answer");
OrcidBio bio = new OrcidBio();
ContactDetails contactDetails = new ContactDetails();
contactDetails.addOrReplacePrimaryEmail(new Email("will@semantico.com"));
bio.setContactDetails(contactDetails);
profile.setOrcidBio(bio);
PersonalDetails personalDetails = new PersonalDetails();
bio.setPersonalDetails(personalDetails);
personalDetails.setGivenNames(new GivenNames("Will"));
personalDetails.setFamilyName(new FamilyName("Simpson"));
bio.setBiography(new Biography("Will is a software developer"));
ResearcherUrls researcherUrls = new ResearcherUrls();
bio.setResearcherUrls(researcherUrls);
researcherUrls.getResearcherUrl().add(new ResearcherUrl(new Url("http://www.wjrs.co.uk"), null));
OrcidWorks orcidWorks = new OrcidWorks();
profile.setOrcidWorks(orcidWorks);
return profile;
}
Aggregations