Search in sources :

Example 26 with WorkExternalIdentifier

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;
}
Also used : WorkExternalIdentifiers(org.orcid.jaxb.model.message.WorkExternalIdentifiers) WorkExternalIdentifierId(org.orcid.jaxb.model.message.WorkExternalIdentifierId) WorkExternalIdentifier(org.orcid.jaxb.model.message.WorkExternalIdentifier)

Example 27 with WorkExternalIdentifier

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;
}
Also used : WorkExternalIdentifiers(org.orcid.jaxb.model.message.WorkExternalIdentifiers) JSONWorkExternalIdentifiers(org.orcid.core.adapter.jsonidentifier.JSONWorkExternalIdentifiers) JSONWorkExternalIdentifiers(org.orcid.core.adapter.jsonidentifier.JSONWorkExternalIdentifiers) WorkExternalIdentifier(org.orcid.jaxb.model.message.WorkExternalIdentifier) JSONWorkExternalIdentifier(org.orcid.core.adapter.jsonidentifier.JSONWorkExternalIdentifier) JSONWorkExternalIdentifier(org.orcid.core.adapter.jsonidentifier.JSONWorkExternalIdentifier)

Example 28 with WorkExternalIdentifier

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);
}
Also used : WorkExternalIdentifiers(org.orcid.jaxb.model.message.WorkExternalIdentifiers) WorkExternalIdentifierId(org.orcid.jaxb.model.message.WorkExternalIdentifierId) WorkExternalIdentifier(org.orcid.jaxb.model.message.WorkExternalIdentifier)

Aggregations

WorkExternalIdentifier (org.orcid.jaxb.model.message.WorkExternalIdentifier)28 WorkExternalIdentifiers (org.orcid.jaxb.model.message.WorkExternalIdentifiers)20 WorkExternalIdentifierId (org.orcid.jaxb.model.message.WorkExternalIdentifierId)19 OrcidWork (org.orcid.jaxb.model.message.OrcidWork)15 Title (org.orcid.jaxb.model.message.Title)13 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)12 FundingTitle (org.orcid.jaxb.model.message.FundingTitle)10 WorkTitle (org.orcid.jaxb.model.message.WorkTitle)10 Test (org.junit.Test)9 OrcidActivities (org.orcid.jaxb.model.message.OrcidActivities)8 OrcidMessage (org.orcid.jaxb.model.message.OrcidMessage)7 OrcidWorks (org.orcid.jaxb.model.message.OrcidWorks)6 Source (org.orcid.jaxb.model.message.Source)5 OrcidIdentifier (org.orcid.jaxb.model.message.OrcidIdentifier)4 WorkExternalIdentifierType (org.orcid.jaxb.model.message.WorkExternalIdentifierType)4 DBUnitTest (org.orcid.test.DBUnitTest)4 Transactional (org.springframework.transaction.annotation.Transactional)4 ArrayList (java.util.ArrayList)3 ContactDetails (org.orcid.jaxb.model.message.ContactDetails)3 Email (org.orcid.jaxb.model.message.Email)3