/** Utility method that copies from model to entity, as entity can't see model and vis-versa. * * @param from * @param to */ @SuppressWarnings("deprecation") public static void populateSourceAwareEntityFromSource(Source from, SourceAwareEntity<?> to) { //Set the source if(from.getSourceOrcid() != null && from.getSourceOrcid().getPath() != null) { to.setSourceId(from.getSourceOrcid().getPath()); } if(from.getSourceClientId() != null && from.getSourceClientId().getPath() != null) { to.setClientSourceId(from.getSourceClientId().getPath()); } //Set the OBO if(from.getAssertionOriginOrcid() != null && from.getAssertionOriginOrcid().getPath() != null) { to.setAssertionOriginSourceId(from.getAssertionOriginOrcid().getPath()); } if(from.getAssertionOriginClientId() != null && from.getAssertionOriginClientId().getPath() != null) { to.setAssertionOriginClientSourceId(from.getAssertionOriginClientId().getPath()); } }
if (!(activeSource.getSourceOrcid() != null && activeSource.getSourceOrcid().getPath().equals(orcid))) { List<Work> existingWorks = this.findWorks(orcid); if((existingWorks.size() + 1) > this.maxNumOfActivities) {
public static Source extractSourceFromEntityComplete(SourceAwareEntity<?> b, SourceNameCacheManager sourceNameCacheManager, OrcidUrlManager orcidUrlManager) { Source s = extractSourceFromEntity(b); if(s.getSourceOrcid() != null && s.getSourceOrcid().getPath() != null) { s.getSourceOrcid().setHost(orcidUrlManager.getBaseHost()); s.getSourceOrcid().setUri(orcidUrlManager.getBaseUrl() + "/" + s.getSourceOrcid().getPath()); String sourceNameValue = sourceNameCacheManager.retrieve(s.getSourceOrcid().getPath()); if (sourceNameValue != null) { s.setSourceName(new SourceName(sourceNameValue));
if (!(activeSource.getSourceOrcid() != null && activeSource.getSourceOrcid().getPath().equals(orcid))) { if (peerReviews != null) { for (PeerReviewEntity entity : peerReviews) {