public static ExternalID fromMessageExtId(org.orcid.jaxb.model.message.WorkExternalIdentifier oldExtId) { ExternalID id = new ExternalID(); id.setType(oldExtId.getWorkExternalIdentifierType().value()); id.setValue(oldExtId.getWorkExternalIdentifierId().getContent()); return id; }
public ExternalID clone() { ExternalID id = new ExternalID(); id.type=this.getType(); id.value=this.getValue(); if (this.getUrl()!=null) id.url=new Url(this.getUrl().getValue()); if (this.getRelationship()!=null) id.relationship=this.getRelationship(); return id; }
for (GroupAble groupKey : groupKeys) { PeerReviewGroupKey key = (PeerReviewGroupKey) groupKey; ExternalID id = new ExternalID();
@Override public ExternalIDs convertFrom(String source, Type<ExternalIDs> destinationType) { JSONFundingExternalIdentifiers fundingExternalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONFundingExternalIdentifiers.class); ExternalIDs externalIDs = new ExternalIDs(); for (JSONExternalIdentifier externalIdentifier : fundingExternalIdentifiers.getFundingExternalIdentifier()) { ExternalID id = new ExternalID(); if (externalIdentifier.getType() == null) { id.setType(FundingExternalIdentifierType.GRANT_NUMBER.value()); } else { id.setType(externalIdentifier.getType().toLowerCase()); } if (externalIdentifier.getUrl() != null && !PojoUtil.isEmpty(externalIdentifier.getUrl().getValue())) { Url url = new Url(externalIdentifier.getUrl().getValue()); id.setUrl(url); } if (!PojoUtil.isEmpty(externalIdentifier.getValue())) { id.setValue(externalIdentifier.getValue()); } if (externalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(externalIdentifier.getRelationship(), null))); } externalIDs.getExternalIdentifier().add(id); } return externalIDs; }
@Override public ExternalIDs convertFrom(String source, Type<ExternalIDs> destinationType) { JSONWorkExternalIdentifiers workExternalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONWorkExternalIdentifiers.class); ExternalIDs externalIDs = new ExternalIDs(); for (JSONWorkExternalIdentifier workExternalIdentifier : workExternalIdentifiers.getWorkExternalIdentifier()) { if(workExternalIdentifier.getRelationship() == null || !org.orcid.jaxb.model.common.Relationship.VERSION_OF.name().equals(workExternalIdentifier.getRelationship())) { ExternalID id = new ExternalID(); if (workExternalIdentifier.getWorkExternalIdentifierType() == null) { id.setType(WorkExternalIdentifierType.OTHER_ID.value()); } else { id.setType(conv.convertFrom(workExternalIdentifier.getWorkExternalIdentifierType(), null)); } if (workExternalIdentifier.getWorkExternalIdentifierId() != null) { id.setValue(workExternalIdentifier.getWorkExternalIdentifierId().content); } if (workExternalIdentifier.getUrl() != null) { id.setUrl(new Url(workExternalIdentifier.getUrl().getValue())); } if (workExternalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(workExternalIdentifier.getRelationship(), null))); } externalIDs.getExternalIdentifier().add(id); } } return externalIDs; }
@Override public ExternalID convertFrom(String source, Type<ExternalID> destinationType) { JSONWorkExternalIdentifier workExternalIdentifier = JsonUtils.readObjectFromJsonString(source, JSONWorkExternalIdentifier.class); ExternalID id = new ExternalID(); if (workExternalIdentifier.getWorkExternalIdentifierType() == null) { id.setType(WorkExternalIdentifierType.OTHER_ID.value()); } else { id.setType(conv.convertFrom(workExternalIdentifier.getWorkExternalIdentifierType(), null)); } if (workExternalIdentifier.getWorkExternalIdentifierId() != null) { id.setValue(workExternalIdentifier.getWorkExternalIdentifierId().content); } if (workExternalIdentifier.getUrl() != null) { id.setUrl(new Url(workExternalIdentifier.getUrl().getValue())); } if (workExternalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(workExternalIdentifier.getRelationship(), null))); } return id; }