use of org.orcid.jaxb.model.message.WorkExternalIdentifier in project ORCID-Source by ORCID.
the class JSONWorkExternalIdentifiersConverterV1Test method getWorkIdentifiers.
private WorkExternalIdentifiers getWorkIdentifiers() {
WorkExternalIdentifiers workExternalIdentifiers = new WorkExternalIdentifiers();
WorkExternalIdentifier workExternalIdentifier1 = new WorkExternalIdentifier();
workExternalIdentifier1.setWorkExternalIdentifierType(WorkExternalIdentifierType.DOI);
workExternalIdentifier1.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work1-doi1"));
WorkExternalIdentifier workExternalIdentifier2 = new WorkExternalIdentifier();
workExternalIdentifier2.setWorkExternalIdentifierType(WorkExternalIdentifierType.PMID);
workExternalIdentifier2.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work1-pmid"));
WorkExternalIdentifier workExternalIdentifier3 = new WorkExternalIdentifier();
workExternalIdentifier3.setWorkExternalIdentifierType(WorkExternalIdentifierType.SOURCE_WORK_ID);
workExternalIdentifier3.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work1-source-id"));
workExternalIdentifiers.getWorkExternalIdentifier().add(workExternalIdentifier1);
workExternalIdentifiers.getWorkExternalIdentifier().add(workExternalIdentifier2);
workExternalIdentifiers.getWorkExternalIdentifier().add(workExternalIdentifier3);
return workExternalIdentifiers;
}
use of org.orcid.jaxb.model.message.WorkExternalIdentifier in project ORCID-Source by ORCID.
the class JSONWorkExternalIdentifiersConverterV1 method convertFrom.
public WorkExternalIdentifiers convertFrom(String source) {
JSONWorkExternalIdentifiers jsonWorkExternalIdentifiers = JsonUtils.readObjectFromJsonString(source, JSONWorkExternalIdentifiers.class);
WorkExternalIdentifiers workExternalIdentifiers = new WorkExternalIdentifiers();
for (JSONWorkExternalIdentifier jsonWorkExternalIdentifier : jsonWorkExternalIdentifiers.getWorkExternalIdentifier()) {
WorkExternalIdentifier workExternalIdentifier = new WorkExternalIdentifier();
try {
workExternalIdentifier.setWorkExternalIdentifierType(WorkExternalIdentifierType.fromValue(conv.convertFrom(jsonWorkExternalIdentifier.getWorkExternalIdentifierType(), null)));
} catch (Exception e) {
workExternalIdentifier.setWorkExternalIdentifierType(WorkExternalIdentifierType.OTHER_ID);
}
workExternalIdentifier.setWorkExternalIdentifierId(new org.orcid.jaxb.model.message.WorkExternalIdentifierId());
if (jsonWorkExternalIdentifier.getWorkExternalIdentifierId() != null) {
workExternalIdentifier.getWorkExternalIdentifierId().setContent(jsonWorkExternalIdentifier.getWorkExternalIdentifierId().content);
}
workExternalIdentifiers.getWorkExternalIdentifier().add(workExternalIdentifier);
}
return workExternalIdentifiers;
}
use of org.orcid.jaxb.model.message.WorkExternalIdentifier in project ORCID-Source by ORCID.
the class OrcidSearchManagerImplTest method assignWorkIdentifers.
private void assignWorkIdentifers(OrcidWork orcidWork1, OrcidWork orcidWork2) {
WorkExternalIdentifiers work1ExternalIdentifiers = new WorkExternalIdentifiers();
WorkExternalIdentifier work1ExternalIdentifier1 = new WorkExternalIdentifier();
work1ExternalIdentifier1.setWorkExternalIdentifierType(WorkExternalIdentifierType.DOI);
work1ExternalIdentifier1.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work1-doi1"));
work1ExternalIdentifiers.getWorkExternalIdentifier().add(work1ExternalIdentifier1);
orcidWork1.setWorkExternalIdentifiers(work1ExternalIdentifiers);
WorkExternalIdentifiers work2ExternalIdentifiers = new WorkExternalIdentifiers();
WorkExternalIdentifier work2ExternalIdentifier1 = new WorkExternalIdentifier();
work2ExternalIdentifier1.setWorkExternalIdentifierType(WorkExternalIdentifierType.DOI);
work2ExternalIdentifier1.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work2-doi1"));
WorkExternalIdentifier work2ExternalIdentifier2 = new WorkExternalIdentifier();
work2ExternalIdentifier2.setWorkExternalIdentifierType(WorkExternalIdentifierType.DOI);
work2ExternalIdentifier2.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work2-doi2"));
work2ExternalIdentifiers.getWorkExternalIdentifier().add(work2ExternalIdentifier1);
work2ExternalIdentifiers.getWorkExternalIdentifier().add(work2ExternalIdentifier2);
orcidWork2.setWorkExternalIdentifiers(work2ExternalIdentifiers);
}
Aggregations