protected boolean isBeingAccessedByCreator(OrcidProfile orcidProfile) { String amenderOrcid = sourceManager.retrieveSourceOrcid(); Source source = orcidProfile.getOrcidHistory().getSource(); if (NullUtils.noneNull(amenderOrcid, source)) { return amenderOrcid.equals(source.retrieveSourcePath()); } return false; }
private String getSponsorOrcid(OrcidMessage orcidMessage) { if (orcidMessage != null && orcidMessage.getOrcidProfile() != null && orcidMessage.getOrcidProfile().getOrcidHistory() != null && orcidMessage.getOrcidProfile().getOrcidHistory().getSource() != null) { return orcidMessage.getOrcidProfile().getOrcidHistory().getSource().retrieveSourcePath(); } else { return 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); } } }