use of org.orcid.jaxb.model.message.WorkVisibilityDefault in project ORCID-Source by ORCID.
the class OrcidMessageVersionConverterImplV1_2_rc3ToV1_2_rc4 method downgradeProfile.
private void downgradeProfile(OrcidProfile orcidProfile) {
if (orcidProfile != null) {
if (orcidProfile.getOrcidHistory() != null) {
if (orcidProfile.getOrcidHistory().getVerifiedEmail() != null) {
orcidProfile.getOrcidHistory().setVerifiedEmail(null);
}
if (orcidProfile.getOrcidHistory().getVerifiedPrimaryEmail() != null) {
orcidProfile.getOrcidHistory().setVerifiedPrimaryEmail(null);
}
}
if (orcidProfile.getOrcidInternal() != null) {
// earlier versions of the XSD don't have GroupOrcidIdentifier
if (orcidProfile.getOrcidInternal().getReferredBy() != null) {
orcidProfile.getOrcidInternal().setReferredBy(null);
}
// earlier versions of the XSD don't have
if (orcidProfile.getOrcidInternal().getPreferences() != null && orcidProfile.getOrcidInternal().getPreferences().getDeveloperToolsEnabled() != null) {
orcidProfile.getOrcidInternal().getPreferences().setDeveloperToolsEnabled(null);
}
}
if (orcidProfile.getOrcidInternal() != null) {
if (orcidProfile.getOrcidInternal().getPreferences() != null) {
Preferences prefs = orcidProfile.getOrcidInternal().getPreferences();
if (prefs.getActivitiesVisibilityDefault() != null && prefs.getActivitiesVisibilityDefault().getValue() != null) {
prefs.setWorkVisibilityDefault(new WorkVisibilityDefault(prefs.getActivitiesVisibilityDefault().getValue()));
prefs.setActivitiesVisibilityDefault(null);
}
}
}
//Previews versions doesnt have organization defined funding type
if (orcidProfile.getOrcidActivities() != null) {
OrcidActivities activities = orcidProfile.getOrcidActivities();
if (activities.getFundings() != null) {
FundingList fundingList = activities.getFundings();
for (Funding funding : fundingList.getFundings()) {
funding.setOrganizationDefinedFundingType(null);
}
}
}
}
}
Aggregations