use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidMessageVersionConverterImplV1_2_rc3ToV1_2_rc4 method upgradeMessage.
@Override
public OrcidMessage upgradeMessage(OrcidMessage orcidMessage) {
if (orcidMessage == null) {
return null;
}
orcidMessage.setMessageVersion(TO_VERSION);
OrcidProfile orcidProfile = orcidMessage.getOrcidProfile();
upgradeProfile(orcidProfile);
return orcidMessage;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidProfileManagerImplTest method testUpdatePreferences.
@Test
@Transactional
@Rollback(true)
public void testUpdatePreferences() {
OrcidProfile profile1 = createBasicProfile();
profile1 = orcidProfileManager.createOrcidProfile(profile1, false, false);
assertEquals(Visibility.PRIVATE, profile1.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue());
OrcidProfile profile2 = new OrcidProfile();
profile2.setOrcidIdentifier(TEST_ORCID);
OrcidInternal internal = new OrcidInternal();
profile2.setOrcidInternal(internal);
Preferences preferences = new Preferences();
internal.setPreferences(preferences);
preferences.setSendChangeNotifications(new SendChangeNotifications(false));
preferences.setSendOrcidNews(new SendOrcidNews(true));
preferences.setDeveloperToolsEnabled(new DeveloperToolsEnabled(true));
preferences.setActivitiesVisibilityDefault(new ActivitiesVisibilityDefault(Visibility.PUBLIC));
orcidProfileManager.updatePreferences(profile2.getOrcidIdentifier().getPath(), profile2.getOrcidInternal().getPreferences());
OrcidProfile retrievedProfile = orcidProfileManager.retrieveOrcidProfile(TEST_ORCID);
assertEquals(false, retrievedProfile.getOrcidInternal().getPreferences().getSendChangeNotifications().isValue());
assertEquals(true, retrievedProfile.getOrcidInternal().getPreferences().getSendOrcidNews().isValue());
assertEquals(true, retrievedProfile.getOrcidInternal().getPreferences().getDeveloperToolsEnabled().isValue());
assertEquals(Visibility.PUBLIC, retrievedProfile.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue());
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method getOrcidWithSubtitledWork.
private OrcidProfile getOrcidWithSubtitledWork() {
OrcidProfile orcidProfile = getStandardOrcid();
OrcidWork orcidWork1 = orcidProfile.retrieveOrcidWorks().getOrcidWork().get(0);
OrcidWork orcidWork2 = orcidProfile.retrieveOrcidWorks().getOrcidWork().get(1);
OrcidWork orcidWork3 = orcidProfile.retrieveOrcidWorks().getOrcidWork().get(2);
WorkTitle workTitle1 = new WorkTitle();
Subtitle subTitle1 = new Subtitle("Subtitle 1");
workTitle1.setSubtitle(subTitle1);
workTitle1.setTitle(new Title("Work title 1"));
orcidWork1.setWorkTitle(workTitle1);
WorkTitle workTitle2 = orcidWork2.getWorkTitle();
Subtitle subTitle2 = new Subtitle("Subtitle 2");
workTitle2.setSubtitle(subTitle2);
workTitle2.setTitle(new Title("Work title 2"));
orcidWork2.setWorkTitle(workTitle2);
WorkTitle workTitle3 = orcidWork3.getWorkTitle();
Subtitle subTitle3 = new Subtitle("Subtitle 3");
workTitle3.setSubtitle(subTitle3);
workTitle3.setTitle(new Title("Work title 3"));
orcidWork3.setWorkTitle(workTitle3);
return orcidProfile;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method solrDocFilteredByAffilliationVisibility.
private OrcidSolrDocument solrDocFilteredByAffilliationVisibility() {
OrcidSolrDocument orcidSolrDocument = fullyPopulatedSolrDocumentForPersistence();
OrcidProfile orcidProfile = orcidProfileLimitedVisiblityAffiliations();
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 OrcidIndexManagerTypeMatcherTestFactory method orcidBasicProfileCreate.
public static ArgumentMatcher<OrcidProfile> orcidBasicProfileCreate() {
return new ArgumentMatcher<OrcidProfile>() {
@Override
public boolean matches(OrcidProfile orcidProfile) {
if (!"4444-4444-4444-0001".equals(orcidProfile.getOrcidIdentifier().getPath())) {
return false;
}
PersonalDetails personDetails = orcidProfile.getOrcidBio().getPersonalDetails();
if (personDetails.getCreditName() != null || personDetails.getFamilyName() != null) {
return false;
}
boolean matchesGivenNameCorrectly = "Reserved For Claim".equals(personDetails.getGivenNames().getContent());
return matchesGivenNameCorrectly;
}
};
}
Aggregations