/** * Create an instance of {@link SourceOrcid } * */ public SourceOrcid createSourceOrcid() { return new SourceOrcid(); }
public Source(String amenderOrcidPath) { SourceOrcid so = new SourceOrcid(); so.setPath(amenderOrcidPath); this.sourceOrcid = so; }
private void upgradeActivity(OrcidWork orcidWork) { WorkSource workSource = orcidWork.getWorkSource(); if (workSource != null) { Source source = new Source(); source.setSourceOrcid(new SourceOrcid(workSource)); } }
private Source getSponsor(ProfileEntity profileEntity) { SourceEntity sourceEntity = profileEntity.getSource(); if (sourceEntity != null) { Source sponsor = new Source(); SourceName sponsorName = new SourceName(SourceEntityUtils.getSourceName(sourceEntity)); sponsor.setSourceName(sponsorName); ClientDetailsEntity sourceClient = sourceEntity.getSourceClient(); if (sourceClient != null && !OrcidStringUtils.isValidOrcid(sourceClient.getClientId())) { SourceClientId sourceClientId = new SourceClientId(getOrcidIdBase(sourceClient.getId())); sponsor.setSourceClientId(sourceClientId); } else { SourceOrcid sponsorOrcid = StringUtils.isNotBlank(SourceEntityUtils.getSourceId(sourceEntity)) ? new SourceOrcid(getOrcidIdBase(SourceEntityUtils.getSourceId(sourceEntity))) : null; sponsor.setSourceOrcid(sponsorOrcid); } return sponsor; } return null; }
private Source createSource() { SourceEntity entity = sourceManager.retrieveSourceEntity(); Source source = new Source(); if (entity.getSourceClient() != null && !PojoUtil.isEmpty(entity.getSourceClient().getId())) { if(OrcidStringUtils.isValidOrcid(entity.getSourceClient().getId())) { source.setSourceOrcid(new SourceOrcid(entity.getSourceClient().getId())); } else { source.setSourceClientId(new SourceClientId(entity.getSourceClient().getId())); } } else if(entity.getSourceProfile() != null && !PojoUtil.isEmpty(entity.getSourceProfile().getId())) { source.setSourceClientId(null); source.setSourceOrcid(new SourceOrcid(entity.getSourceProfile().getId())); } return source; }
/** * Get the source of a sowrceAware object * * @param sourceAwareEntity * The entity to obtain the source * @return the source of the object * */ private Source getSource(SourceAwareEntity<?> sourceAwareEntity) { if (sourceAwareEntity == null || PojoUtil.isEmpty(sourceAwareEntity.getElementSourceId())) { return null; } Source source = new Source(); if (!PojoUtil.isEmpty(sourceAwareEntity.getSourceId())) { source.setSourceOrcid(new SourceOrcid(getOrcidIdBase(sourceAwareEntity.getSourceId()))); } String clientSourceId = sourceAwareEntity.getClientSourceId(); if (!PojoUtil.isEmpty(clientSourceId)) { if (OrcidStringUtils.isValidOrcid(clientSourceId)) { source.setSourceOrcid(new SourceOrcid(getOrcidIdBase(clientSourceId))); } else { source.setSourceClientId(new SourceClientId(getOrcidIdBase(clientSourceId))); } } Date createdDate = sourceAwareEntity.getDateCreated(); source.setSourceDate(new SourceDate(DateUtils.convertToXMLGregorianCalendar(createdDate))); return source; }
private Source getSource() { SourceEntity sourceEntity = sourceManager.retrieveSourceEntity(); Source source = new Source(); if (sourceEntity.getSourceProfile() != null && !PojoUtil.isEmpty(sourceEntity.getSourceProfile().getId())) { source.setSourceOrcid(new SourceOrcid(getOrcidIdBase(sourceEntity.getSourceProfile().getId()))); } if (sourceEntity.getSourceClient() != null && !PojoUtil.isEmpty(sourceEntity.getSourceClient().getId())) { if(OrcidStringUtils.isValidOrcid(sourceEntity.getSourceClient().getId())) { source.setSourceOrcid(new SourceOrcid(getOrcidIdBase(sourceEntity.getSourceClient().getId()))); } else { source.setSourceClientId(new SourceClientId(getOrcidIdBase(sourceEntity.getSourceClient().getId()))); } } return source; }