/** 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; }
/** 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; }
String clientId = authorizationRequest.getClientId(); ClientDetailsEntity clientDetails = clientDetailsManager.findByClientId(clientId); Source source = new Source(); source.setSourceClientId(new SourceClientId(clientId)); source.setSourceName(new SourceName(clientDetails.getClientName())); Source source = new Source(); source.setSourceOrcid(new SourceOrcid(userOrcid)); return source;
public OtherName toOtherName() { OtherName otherName = new OtherName(); if (!PojoUtil.isEmpty(this.getContent())) { otherName.setContent(this.getContent()); } if (this.visibility != null && this.visibility.getVisibility() != null) { otherName.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { otherName.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { otherName.setDisplayIndex(displayIndex); } else { otherName.setDisplayIndex(0L); } otherName.setSource(new Source(source)); return otherName; }
public Address toAddress() { Address address = new Address(); if (this.iso2Country != null && this.iso2Country.getValue() != null) { Country country = new Country(); country.setValue(Iso3166Country.fromValue(this.iso2Country.getValue().value())); address.setCountry(country); } if (this.visibility != null && this.visibility.getVisibility() != null) { address.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { address.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { address.setDisplayIndex(displayIndex); } else { address.setDisplayIndex(0L); } address.setSource(new Source(source)); return address; }
public ResearcherUrl toResearcherUrl() { ResearcherUrl researcherUrl = new ResearcherUrl(); if (!PojoUtil.isEmpty(this.getUrl())) { researcherUrl.setUrl(new Url(this.getUrl().getValue())); } if (!PojoUtil.isEmpty(this.getUrlName())) { researcherUrl.setUrlName(this.getUrlName()); } if (this.visibility != null && this.visibility.getVisibility() != null) { researcherUrl.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { researcherUrl.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { researcherUrl.setDisplayIndex(displayIndex); } else { researcherUrl.setDisplayIndex(0L); } researcherUrl.setSource(new Source(source)); return researcherUrl; }
public Keyword toKeyword() { Keyword keyword = new Keyword(); if (!PojoUtil.isEmpty(putCode)) { keyword.setPutCode(Long.valueOf(putCode)); } if (!PojoUtil.isEmpty(content)) { keyword.setContent(content); } if (visibility != null && visibility.getVisibility() != null) { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } else { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(OrcidVisibilityDefaults.KEYWORD_DEFAULT.getVisibility().value())); } if (createdDate != null) { keyword.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(createdDate.toCalendar()))); } if (lastModified != null) { keyword.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified.toCalendar()))); } if (displayIndex != null) { keyword.setDisplayIndex(displayIndex); } else { keyword.setDisplayIndex(0L); } keyword.setSource(new Source(source)); return keyword; }
org.orcid.jaxb.model.v3.rc2.common.Source source = new org.orcid.jaxb.model.v3.rc2.common.Source();
history.setSource(new Source(SourceEntityUtils.getSourceId(profile.getSource())));
org.orcid.jaxb.model.v3.rc2.common.Source source = new org.orcid.jaxb.model.v3.rc2.common.Source();