Search in sources :

Example 46 with Qualification

use of org.orcid.jaxb.model.v3.dev1.record.Qualification in project ORCID-Source by ORCID.

the class AffiliationsManagerTest method getQualification.

private Qualification getQualification() {
    Qualification element = new Qualification();
    fillAffiliation(element);
    return element;
}
Also used : Qualification(org.orcid.jaxb.model.v3.dev1.record.Qualification)

Example 47 with Qualification

use of org.orcid.jaxb.model.v3.dev1.record.Qualification in project ORCID-Source by ORCID.

the class ActivityUtilsTest method setPathToQualificationTest.

@Test
public void setPathToQualificationTest() {
    Qualifications x = getQualifications();
    ActivityUtils.setPathToAffiliations(x, ORCID);
    assertEquals("/" + ORCID + "/qualification/123", x.getSummaries().get(0).getPath());
}
Also used : Qualifications(org.orcid.jaxb.model.v3.dev1.record.summary.Qualifications) Test(org.junit.Test)

Example 48 with Qualification

use of org.orcid.jaxb.model.v3.dev1.record.Qualification in project ORCID-Source by ORCID.

the class MemberV3ApiServiceDelegatorImpl method viewQualification.

@Override
public Response viewQualification(String orcid, Long putCode) {
    Qualification e = affiliationsManagerReadOnly.getQualificationAffiliation(orcid, putCode);
    orcidSecurityManager.checkAndFilter(orcid, e, ScopePathType.AFFILIATIONS_READ_LIMITED);
    ActivityUtils.setPathToActivity(e, orcid);
    sourceUtils.setSourceName(e);
    return Response.ok(e).build();
}
Also used : Qualification(org.orcid.jaxb.model.v3.dev1.record.Qualification)

Example 49 with Qualification

use of org.orcid.jaxb.model.v3.dev1.record.Qualification in project ORCID-Source by ORCID.

the class MemberV3ApiServiceDelegatorImpl method updateQualification.

@Override
public Response updateQualification(String orcid, Long putCode, Qualification qualification) {
    orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.AFFILIATIONS_UPDATE);
    if (!putCode.equals(qualification.getPutCode())) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("urlPutCode", String.valueOf(putCode));
        params.put("bodyPutCode", String.valueOf(qualification.getPutCode()));
        throw new MismatchedPutCodeException(params);
    }
    clearSource(qualification);
    Qualification e = affiliationsManager.updateQualificationAffiliation(orcid, qualification, true);
    sourceUtils.setSourceName(e);
    return Response.ok(e).build();
}
Also used : Qualification(org.orcid.jaxb.model.v3.dev1.record.Qualification) HashMap(java.util.HashMap) MismatchedPutCodeException(org.orcid.core.exception.MismatchedPutCodeException)

Example 50 with Qualification

use of org.orcid.jaxb.model.v3.dev1.record.Qualification in project ORCID-Source by ORCID.

the class MemberV3ApiServiceDelegatorImpl method createQualification.

@Override
public Response createQualification(String orcid, Qualification qualification) {
    orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.AFFILIATIONS_CREATE, ScopePathType.AFFILIATIONS_UPDATE);
    clearSource(qualification);
    Qualification e = affiliationsManager.createQualificationAffiliation(orcid, qualification, true);
    sourceUtils.setSourceName(e);
    try {
        return Response.created(new URI(String.valueOf(e.getPutCode()))).build();
    } catch (URISyntaxException ex) {
        throw new RuntimeException(localeManager.resolveMessage("apiError.createdistinction_response.exception"), ex);
    }
}
Also used : Qualification(org.orcid.jaxb.model.v3.dev1.record.Qualification) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI)

Aggregations

Qualification (org.orcid.jaxb.model.v3.dev1.record.Qualification)40 Test (org.junit.Test)31 DBUnitTest (org.orcid.test.DBUnitTest)18 Response (javax.ws.rs.core.Response)17 Distinction (org.orcid.jaxb.model.v3.dev1.record.Distinction)11 Education (org.orcid.jaxb.model.v3.dev1.record.Education)11 Membership (org.orcid.jaxb.model.v3.dev1.record.Membership)11 Service (org.orcid.jaxb.model.v3.dev1.record.Service)11 Employment (org.orcid.jaxb.model.v3.dev1.record.Employment)10 InvitedPosition (org.orcid.jaxb.model.v3.dev1.record.InvitedPosition)10 Affiliation (org.orcid.jaxb.model.v3.dev1.record.Affiliation)8 QualificationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.QualificationSummary)7 OrgAffiliationRelationEntity (org.orcid.persistence.jpa.entities.OrgAffiliationRelationEntity)6 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)5 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Funding (org.orcid.jaxb.model.v3.dev1.record.Funding)4 Work (org.orcid.jaxb.model.v3.dev1.record.Work)4 Qualifications (org.orcid.jaxb.model.v3.dev1.record.summary.Qualifications)4