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());
}
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();
}
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();
}
Aggregations