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