use of org.orcid.jaxb.model.message.ReferredBy in project ORCID-Source by ORCID.
the class OrcidMessageVersionConverterImplV1_2_rc5ToV1_2_rc6 method downgradeProfile.
private void downgradeProfile(OrcidProfile orcidProfile) {
if (orcidProfile != null) {
if (orcidProfile.getOrcidBio() != null)
if (orcidProfile.getOrcidBio().getExternalIdentifiers() != null)
for (ExternalIdentifier externalIdentifier : orcidProfile.getOrcidBio().getExternalIdentifiers().getExternalIdentifier()) {
Source source = externalIdentifier.getSource();
if (source != null) {
SourceOrcid sourceOrcid = source.getSourceOrcid();
if (sourceOrcid != null) {
externalIdentifier.setSource(null);
externalIdentifier.setExternalIdSource(new ExternalIdSource(sourceOrcid));
}
}
}
if (orcidProfile.getOrcidActivities() != null) {
if (orcidProfile.getOrcidActivities().getOrcidWorks() != null) {
for (OrcidWork act : orcidProfile.getOrcidActivities().getOrcidWorks().getOrcidWork()) downGradeActivity(act);
}
}
OrcidInternal orcidInternal = orcidProfile.getOrcidInternal();
if (orcidInternal != null) {
Preferences prefs = orcidInternal.getPreferences();
if (prefs != null) {
prefs.setSendEmailFrequencyDays(null);
prefs.setSendMemberUpdateRequests(null);
}
ReferredBy referredBy = orcidInternal.getReferredBy();
if (referredBy != null && !OrcidStringUtils.isValidOrcid(referredBy.getPath())) {
orcidInternal.setReferredBy(null);
}
}
}
}
Aggregations