public ExternalID getExternalID() { ExternalID eid = new ExternalID(); eid.setType("doi"); eid.setValue(doi); eid.setNormalized(new TransientNonEmptyString(doi)); return eid; } }
public ExternalID getExternalID(DOINormalizer norm) { ExternalID eid = new ExternalID(); eid.setType("doi"); eid.setValue(DOI); eid.setNormalized(new TransientNonEmptyString(norm.normalise("doi", DOI))); return eid; } }
arxiv.setRelationship(Relationship.SELF); arxiv.setType("arxiv"); arxiv.setValue(normalizationService.normalise("arxiv", value)); arxiv.setUrl(new Url(value)); work.getWorkExternalIdentifiers().getExternalIdentifier().add(arxiv); doi.setRelationship(Relationship.SELF); doi.setType("doi"); doi.setValue(normalizationService.normalise("doi", value)); doi.setUrl(new Url(normalizationService.generateNormalisedURL("doi", value))); work.getWorkExternalIdentifiers().getExternalIdentifier().add(doi);
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; }
private void addExternalIdentifier(Work work, String type, String value, Locale locale) { ExternalID extId = new ExternalID(); extId.setType(type); extId.setValue(value); extId.setRelationship(Relationship.SELF); IdentifierType idType = identifierTypeManager.fetchIdentifierTypeByDatabaseName(type.toUpperCase(), locale); if (idType != null && !PojoUtil.isEmpty(idType.getResolutionPrefix())) { extId.setUrl(new Url(idType.getResolutionPrefix() + value)); } if(work.getExternalIdentifiers() == null) { work.setWorkExternalIdentifiers(new ExternalIDs()); } work.getExternalIdentifiers().getExternalIdentifier().add(extId); } }
ExternalID id = new ExternalID(); id.setType(PeerReviewGroupKey.KEY_NAME); id.setValue(key.getGroupId()); peerReviewGroup.getIdentifiers().getExternalIdentifier().add(id);
public ExternalID toFundingExternalIdentifier() { ExternalID result = new ExternalID(); if (!PojoUtil.isEmpty(type)) result.setType(type.getValue()); if (!PojoUtil.isEmpty(url)) result.setUrl(new Url(url.getValue())); else result.setUrl(new Url()); if (!PojoUtil.isEmpty(value)) result.setValue(value.getValue()); if(!PojoUtil.isEmpty(relationship)) result.setRelationship(Relationship.fromValue(relationship.getValue())); return result; }
public ExternalID toRecordFundingExternalIdentifier() { ExternalID result = new ExternalID(); if (!PojoUtil.isEmpty(type)) result.setType(type.getValue()); if (!PojoUtil.isEmpty(url)) result.setUrl(new Url(url.getValue())); else result.setUrl(new Url()); if (!PojoUtil.isEmpty(value)) result.setValue(value.getValue()); if(!PojoUtil.isEmpty(relationship)) result.setRelationship(Relationship.fromValue(relationship.getValue())); return result; } }
@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; }
private static void populateExternalIdentifiers(WorkForm workForm, Work work) { ExternalIDs workExternalIds = new ExternalIDs(); if(workForm.getWorkExternalIdentifiers() != null && !workForm.getWorkExternalIdentifiers().isEmpty()) { for(ActivityExternalIdentifier wfExtId : workForm.getWorkExternalIdentifiers()) { ExternalID wExtId = new ExternalID(); if(!PojoUtil.isEmpty(wfExtId.getExternalIdentifierId())) { wExtId.setValue(wfExtId.getExternalIdentifierId().getValue()); } if(!PojoUtil.isEmpty(wfExtId.getExternalIdentifierType())) { wExtId.setType(wfExtId.getExternalIdentifierType().getValue()); } if(!PojoUtil.isEmpty(wfExtId.getRelationship())) { wExtId.setRelationship(Relationship.fromValue(wfExtId.getRelationship().getValue())); } if(!PojoUtil.isEmpty(wfExtId.getUrl())) { wExtId.setUrl(new org.orcid.jaxb.model.v3.rc2.common.Url(wfExtId.getUrl().getValue())); } workExternalIds.getExternalIdentifier().add(wExtId); } } work.setWorkExternalIdentifiers(workExternalIds); }
public ExternalID toExternalIdentifier() { ExternalID we = new ExternalID(); if (!PojoUtil.isEmpty(this.getExternalIdentifierId())) we.setValue(this.getExternalIdentifierId().getValue()); if (!PojoUtil.isEmpty(this.getExternalIdentifierType())) we.setType(this.getExternalIdentifierType().getValue()); if(!PojoUtil.isEmpty(this.getRelationship())) we.setRelationship(Relationship.fromValue(this.getRelationship().getValue())); if(!PojoUtil.isEmpty(this.getUrl())) we.setUrl(new Url(this.getUrl().getValue())); return we; }
@Override public ExternalIDs convertFrom(String source, Type<ExternalIDs> destinationType) { JSONExternalIdentifiers externalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONExternalIdentifiers.class); ExternalIDs externalIDs = new ExternalIDs(); for (JSONExternalIdentifier externalIdentifier : externalIdentifiers.getExternalIdentifier()) { 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()); id.setNormalized(new TransientNonEmptyString(norm.normalise(id.getType(), externalIdentifier.getValue()))); if (StringUtils.isEmpty(id.getNormalized().getValue())){ id.setNormalizedError(new TransientError(localeManager.resolveMessage("transientError.normalization_failed.code"),localeManager.resolveMessage("transientError.normalization_failed.message", id.getType(), externalIdentifier.getValue()))); } } if (externalIdentifier.getRelationship() != null) { id.setRelationship(Relationship.fromValue(conv.convertFrom(externalIdentifier.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; }
extId.setType("doi"); extId.setRelationship(Relationship.SELF); extId.setValue(doi); IdentifierType idType = identifierTypeManager.fetchIdentifierTypeByDatabaseName("DOI", locale); if (idType != null && !PojoUtil.isEmpty(idType.getResolutionPrefix())) { extId.setType("isbn"); extId.setRelationship(Relationship.SELF); extId.setValue(isbn); if (idType != null && !PojoUtil.isEmpty(idType.getResolutionPrefix())) { extId.setUrl(new Url(idType.getResolutionPrefix() + isbn)); extId.setType("issn"); extId.setRelationship(Relationship.PART_OF); extId.setValue(issn); if (idType != null && !PojoUtil.isEmpty(idType.getResolutionPrefix())) { extId.setUrl(new Url(idType.getResolutionPrefix() + issn));
id.setValue(workExternalIdentifier.getWorkExternalIdentifierId().content);