Search in sources :

Example 1 with WorkSource

use of org.orcid.jaxb.model.message.WorkSource in project ORCID-Source by ORCID.

the class OrcidMessageVersionConverterImplV1_2_rc5ToV1_2_rc6 method downGradeActivity.

private void downGradeActivity(OrcidWork orcidWork) {
    Source source = orcidWork.getSource();
    if (source != null) {
        SourceOrcid sourceOrcid = source.getSourceOrcid();
        if (sourceOrcid != null) {
            orcidWork.setSource(null);
            orcidWork.setWorkSource(new WorkSource(sourceOrcid));
        }
    }
    WorkExternalIdentifiers externalIdentifiers = orcidWork.getWorkExternalIdentifiers();
    if (externalIdentifiers != null) {
        for (WorkExternalIdentifier wei : externalIdentifiers.getWorkExternalIdentifier()) {
            WorkExternalIdentifierType type = wei.getWorkExternalIdentifierType();
            if (type != null) {
                if (Arrays.binarySearch(NEW_WORK_EXT_ID_TYPES, type) >= 0) {
                    wei.setWorkExternalIdentifierType(OTHER_ID);
                }
            }
        }
    }
}
Also used : WorkExternalIdentifierType(org.orcid.jaxb.model.message.WorkExternalIdentifierType) WorkExternalIdentifiers(org.orcid.jaxb.model.message.WorkExternalIdentifiers) SourceOrcid(org.orcid.jaxb.model.message.SourceOrcid) WorkSource(org.orcid.jaxb.model.message.WorkSource) WorkExternalIdentifier(org.orcid.jaxb.model.message.WorkExternalIdentifier) ExternalIdSource(org.orcid.jaxb.model.message.ExternalIdSource) Source(org.orcid.jaxb.model.message.Source) WorkSource(org.orcid.jaxb.model.message.WorkSource)

Example 2 with WorkSource

use of org.orcid.jaxb.model.message.WorkSource in project ORCID-Source by ORCID.

the class OrcidMessageVersionConverterImplV1_2_rc5ToV1_2_rc6 method upgradeActivity.

private void upgradeActivity(OrcidWork orcidWork) {
    WorkSource workSource = orcidWork.getWorkSource();
    if (workSource != null) {
        Source source = new Source();
        source.setSourceOrcid(new SourceOrcid(workSource));
    }
}
Also used : WorkSource(org.orcid.jaxb.model.message.WorkSource) SourceOrcid(org.orcid.jaxb.model.message.SourceOrcid) ExternalIdSource(org.orcid.jaxb.model.message.ExternalIdSource) Source(org.orcid.jaxb.model.message.Source) WorkSource(org.orcid.jaxb.model.message.WorkSource)

Aggregations

ExternalIdSource (org.orcid.jaxb.model.message.ExternalIdSource)2 Source (org.orcid.jaxb.model.message.Source)2 SourceOrcid (org.orcid.jaxb.model.message.SourceOrcid)2 WorkSource (org.orcid.jaxb.model.message.WorkSource)2 WorkExternalIdentifier (org.orcid.jaxb.model.message.WorkExternalIdentifier)1 WorkExternalIdentifierType (org.orcid.jaxb.model.message.WorkExternalIdentifierType)1 WorkExternalIdentifiers (org.orcid.jaxb.model.message.WorkExternalIdentifiers)1