use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV3ApiServiceDelegatorImpl method updateDistinction.
@Override
public Response updateDistinction(String orcid, Long putCode, Distinction distinction) {
orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.AFFILIATIONS_UPDATE);
if (!putCode.equals(distinction.getPutCode())) {
Map<String, String> params = new HashMap<String, String>();
params.put("urlPutCode", String.valueOf(putCode));
params.put("bodyPutCode", String.valueOf(distinction.getPutCode()));
throw new MismatchedPutCodeException(params);
}
clearSource(distinction);
Distinction e = affiliationsManager.updateDistinctionAffiliation(orcid, distinction, true);
sourceUtils.setSourceName(e);
return Response.ok(e).build();
}
use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV3ApiServiceDelegatorImpl method updateGroupIdRecord.
@Override
public Response updateGroupIdRecord(GroupIdRecord groupIdRecord, Long putCode) {
orcidSecurityManager.checkScopes(ScopePathType.GROUP_ID_RECORD_UPDATE);
if (!putCode.equals(groupIdRecord.getPutCode())) {
Map<String, String> params = new HashMap<String, String>();
params.put("urlPutCode", String.valueOf(putCode));
params.put("bodyPutCode", String.valueOf(groupIdRecord.getPutCode()));
throw new MismatchedPutCodeException(params);
}
GroupIdRecord updatedRecord = groupIdRecordManager.updateGroupIdRecord(putCode, groupIdRecord);
return Response.ok(updatedRecord).build();
}
use of org.orcid.core.exception.MismatchedPutCodeException 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