public Source(String amenderOrcidPath) { SourceOrcid so = new SourceOrcid(); so.setPath(amenderOrcidPath); this.sourceOrcid = so; }
public String retrieveSourcePath() { if (sourceClientId != null) { return sourceClientId.getPath(); } if (sourceOrcid != null) { return sourceOrcid.getPath(); } return null; }
public static Source forClient(String clientId, String oboId) { Source s = forClient(clientId); if (oboId != null) { if (oboId.startsWith("APP-")) { s.setAssertionOriginClientId(new SourceClientId(oboId)); } else { s.setAssertionOriginOrcid(new SourceOrcid(oboId)); } } return s; } }
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(s.getAssertionOriginOrcid() != null && s.getAssertionOriginOrcid().getPath() != null) { s.getAssertionOriginOrcid().setHost(orcidUrlManager.getBaseHost()); s.getAssertionOriginOrcid().setUri(orcidUrlManager.getBaseUrl() + "/" + s.getAssertionOriginOrcid().getPath()); String sourceNameValue = sourceNameCacheManager.retrieve(s.getAssertionOriginOrcid().getPath()); if (sourceNameValue != null) { s.setAssertionOriginName(new SourceName(sourceNameValue));
public String retriveSourceUri() { if (sourceClientId != null) { return sourceClientId.getUri(); } if (sourceOrcid != null) { return sourceOrcid.getUri(); } return null; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((assertionOriginClientId == null) ? 0 : assertionOriginClientId.hashCode()); result = prime * result + ((assertionOriginOrcid == null) ? 0 : assertionOriginOrcid.hashCode()); result = prime * result + ((sourceClientId == null) ? 0 : sourceClientId.hashCode()); result = prime * result + ((sourceOrcid == null) ? 0 : sourceOrcid.hashCode()); return result; }
/** Logic taken from SourceEntity constructor * * @param clientId * @return */ public static Source forClient(String clientId) { Source s = new Source(); if (clientId != null) { if (clientId.startsWith("APP-")) { s.setSourceClientId(new SourceClientId(clientId)); } else { s.setSourceOrcid(new SourceOrcid(clientId)); } } return s; }
public String retriveAssertionOriginUri() { if (assertionOriginClientId != null) { return assertionOriginClientId.getUri(); } if (assertionOriginOrcid != null) { return assertionOriginOrcid.getUri(); } return null; }
/** Utility that copies source ids from entity into new Source model. * */ public static Source extractSourceFromEntity(SourceAwareEntity<?> e) { Source source = new Source(); //orcid if (!StringUtils.isEmpty(e.getSourceId())) source.setSourceOrcid(new SourceOrcid(e.getSourceId())); //client if (!StringUtils.isEmpty(e.getClientSourceId())) source.setSourceClientId(new SourceClientId(e.getClientSourceId())); //obo if (!StringUtils.isEmpty(e.getAssertionOriginSourceId())) source.setAssertionOriginOrcid(new SourceOrcid(e.getAssertionOriginSourceId())); if (!StringUtils.isEmpty(e.getAssertionOriginClientSourceId())) source.setAssertionOriginClientId(new SourceClientId(e.getAssertionOriginClientSourceId())); return source; }
public String retrieveAssertionOriginPath() { if (assertionOriginClientId != null) { return assertionOriginClientId.getPath(); } if (assertionOriginOrcid != null) { return assertionOriginOrcid.getPath(); } return null; }
source.setSourceOrcid(new SourceOrcid(userOrcid)); return source;
/** 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()); } }
source.setSourceClientId(new SourceClientId(this.getSource())); } else { source.setSourceOrcid(new SourceOrcid(this.getSource()));
if (!(activeSource.getSourceOrcid() != null && activeSource.getSourceOrcid().getPath().equals(orcid))) { List<Work> existingWorks = this.findWorks(orcid); if((existingWorks.size() + 1) > this.maxNumOfActivities) {
source.setSourceClientId(new SourceClientId(this.getSource())); } else { source.setSourceOrcid(new SourceOrcid(this.getSource()));
if (!(activeSource.getSourceOrcid() != null && activeSource.getSourceOrcid().getPath().equals(orcid))) { if (peerReviews != null) { for (PeerReviewEntity entity : peerReviews) {