Search in sources :

Example 6 with SourceOrcid

use of org.orcid.jaxb.model.message.SourceOrcid 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 7 with SourceOrcid

use of org.orcid.jaxb.model.message.SourceOrcid 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)

Example 8 with SourceOrcid

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

the class OrcidIndexManagerImplTest method createExternalIdentifier.

private ExternalIdentifier createExternalIdentifier(String orcid, String reference) {
    ExternalIdentifier externalIdentifier1 = new ExternalIdentifier();
    Source source = new Source();
    source.setSourceOrcid(new SourceOrcid(orcid));
    externalIdentifier1.setSource(source);
    externalIdentifier1.setExternalIdReference(new ExternalIdReference(reference));
    //you have to set this as visibility will filter out null visibilities.
    externalIdentifier1.setVisibility(Visibility.PUBLIC);
    return externalIdentifier1;
}
Also used : ExternalIdReference(org.orcid.jaxb.model.message.ExternalIdReference) WorkExternalIdentifier(org.orcid.jaxb.model.message.WorkExternalIdentifier) ExternalIdentifier(org.orcid.jaxb.model.message.ExternalIdentifier) SourceOrcid(org.orcid.jaxb.model.message.SourceOrcid) Source(org.orcid.jaxb.model.message.Source)

Aggregations

Source (org.orcid.jaxb.model.message.Source)8 SourceOrcid (org.orcid.jaxb.model.message.SourceOrcid)8 ExternalIdSource (org.orcid.jaxb.model.message.ExternalIdSource)3 SourceClientId (org.orcid.jaxb.model.message.SourceClientId)3 WorkExternalIdentifier (org.orcid.jaxb.model.message.WorkExternalIdentifier)3 WorkSource (org.orcid.jaxb.model.message.WorkSource)3 ExternalIdentifier (org.orcid.jaxb.model.message.ExternalIdentifier)2 OrcidWork (org.orcid.jaxb.model.message.OrcidWork)2 Date (java.util.Date)1 Test (org.junit.Test)1 ExternalIdReference (org.orcid.jaxb.model.message.ExternalIdReference)1 OrcidHistory (org.orcid.jaxb.model.message.OrcidHistory)1 OrcidInternal (org.orcid.jaxb.model.message.OrcidInternal)1 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)1 Preferences (org.orcid.jaxb.model.message.Preferences)1 ReferredBy (org.orcid.jaxb.model.message.ReferredBy)1 SourceName (org.orcid.jaxb.model.message.SourceName)1 SubmissionDate (org.orcid.jaxb.model.message.SubmissionDate)1 WorkExternalIdentifierType (org.orcid.jaxb.model.message.WorkExternalIdentifierType)1 WorkExternalIdentifiers (org.orcid.jaxb.model.message.WorkExternalIdentifiers)1