Search in sources :

Example 66 with Education

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

the class ActivityUtilsTest method setPathToEducationsTest.

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

Example 67 with Education

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

the class MemberV3ApiServiceDelegatorImpl method viewEducation.

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

Example 68 with Education

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

the class MemberV3ApiServiceDelegatorImpl method updateEducation.

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

Aggregations

Education (org.orcid.jaxb.model.v3.dev1.record.Education)54 Test (org.junit.Test)46 DBUnitTest (org.orcid.test.DBUnitTest)23 Response (javax.ws.rs.core.Response)22 Employment (org.orcid.jaxb.model.v3.dev1.record.Employment)12 Distinction (org.orcid.jaxb.model.v3.dev1.record.Distinction)11 Membership (org.orcid.jaxb.model.v3.dev1.record.Membership)11 Service (org.orcid.jaxb.model.v3.dev1.record.Service)11 InvitedPosition (org.orcid.jaxb.model.v3.dev1.record.InvitedPosition)10 Qualification (org.orcid.jaxb.model.v3.dev1.record.Qualification)10 EducationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)9 Affiliation (org.orcid.jaxb.model.v3.dev1.record.Affiliation)8 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)8 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)7 Funding (org.orcid.jaxb.model.v3.dev1.record.Funding)6 Work (org.orcid.jaxb.model.v3.dev1.record.Work)6 OrgAffiliationRelationEntity (org.orcid.persistence.jpa.entities.OrgAffiliationRelationEntity)6 Address (org.orcid.jaxb.model.v3.dev1.record.Address)5 ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)5 Keyword (org.orcid.jaxb.model.v3.dev1.record.Keyword)5