@Override public void copyRelevantUpdatedHistoryElements(OrcidHistory existing, OrcidHistory updated) { Assert.notNull(updated, "The updated history is null"); Assert.notNull(existing, "The existing history is null"); if (updated.isClaimed() && !existing.isClaimed()) { existing.setClaimed(new Claimed(true)); } if (existing.getCompletionDate() == null && updated.getCompletionDate() != null) { existing.setCompletionDate(updated.getCompletionDate()); } // TODO: There may be some others that need to be added to this. }
String clientId = authorizationRequest.getClientId(); String sponsorOrcid = getSponsorOrcid(orcidMessage); if (StringUtils.isNotBlank(sponsorOrcid) && clientId.equals(sponsorOrcid) && !orcidMessage.getOrcidProfile().getOrcidHistory().isClaimed()) { visibilities.add(Visibility.LIMITED); visibilities.add(Visibility.PRIVATE);
Affiliations updatedAffiliations = updatedOrcidProfile.retrieveAffiliations(); Visibility workVisibilityDefault = existingProfile.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue(); Boolean claimed = existingProfile.getOrcidHistory().isClaimed(); setAffiliationPrivacy(updatedAffiliations, workVisibilityDefault, claimed == null ? false : claimed); updatedAffiliations = dedupeAffiliations(updatedAffiliations);
FundingList updatedFundingList = updatedOrcidProfile.retrieveFundings(); Visibility workVisibilityDefault = existingProfile.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue(); Boolean claimed = existingProfile.getOrcidHistory().isClaimed(); setFundingPrivacy(updatedFundingList, workVisibilityDefault, claimed == null ? false : claimed); updatedFundingList = dedupeFundings(updatedFundingList);
OrcidWorks updatedOrcidWorks = updatedOrcidProfile.retrieveOrcidWorks(); Visibility workVisibilityDefault = existingProfile.getOrcidInternal().getPreferences().getActivitiesVisibilityDefault().getValue(); Boolean claimed = existingProfile.getOrcidHistory().isClaimed(); setWorkPrivacy(updatedOrcidWorks, workVisibilityDefault, claimed == null ? false : claimed); if(updatedOrcidWorks != null) {
private void setHistoryDetails(ProfileEntity profileEntity, OrcidHistory orcidHistory) { if (orcidHistory != null) { CompletionDate completionDate = orcidHistory.getCompletionDate(); profileEntity.setCompletedDate(completionDate == null ? null : toDate(completionDate.getValue())); SubmissionDate submissionDate = orcidHistory.getSubmissionDate(); profileEntity.setSubmissionDate(submissionDate == null ? null : toDate(submissionDate.getValue())); DeactivationDate deactivationDate = orcidHistory.getDeactivationDate(); profileEntity.setDeactivationDate(deactivationDate == null ? null : toDate(deactivationDate.getValue())); profileEntity.setClaimed(orcidHistory.isClaimed()); CreationMethod creationMethod = orcidHistory.getCreationMethod(); profileEntity.setCreationMethod(creationMethod != null ? creationMethod.value() : null); Source source = orcidHistory.getSource(); if (source != null) { SourceEntity sourceEntity = new SourceEntity(); ClientDetailsEntity clientDetailsEntity = new ClientDetailsEntity(); clientDetailsEntity.setId(source.retrieveSourcePath()); sourceEntity.setSourceClient(clientDetailsEntity); profileEntity.setSource(sourceEntity); } } }
addSourceToEmails(orcidProfile, existingProfileEntity, amenderOrcid); Boolean claimed = orcidProfile.getOrcidHistory() != null ? orcidProfile.getOrcidHistory().isClaimed() : existingProfileEntity.getClaimed();