case "id": if (work.getExternalIdentifiers() == null) { work.setWorkExternalIdentifiers(new ExternalIDs());
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); } }
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); }
result.setWorkExternalIdentifiers(new ExternalIDs()); if (json.has("DOI")) { String doi = json.getString("DOI");