use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl method updateFunding.
@Override
public Response updateFunding(String orcid, Long putCode, Funding funding) {
orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.FUNDING_UPDATE);
if (!putCode.equals(funding.getPutCode())) {
Map<String, String> params = new HashMap<String, String>();
params.put("urlPutCode", String.valueOf(putCode));
params.put("bodyPutCode", String.valueOf(funding.getPutCode()));
throw new MismatchedPutCodeException(params);
}
clearSource(funding);
Funding f = profileFundingManager.updateFunding(orcid, funding, true);
sourceUtils.setSourceName(f);
return Response.ok(f).build();
}
use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl 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();
}
use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl method updateWork.
@Override
public Response updateWork(String orcid, Long putCode, Work work) {
orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.ORCID_WORKS_UPDATE);
if (!putCode.equals(work.getPutCode())) {
Map<String, String> params = new HashMap<String, String>();
params.put("urlPutCode", String.valueOf(putCode));
params.put("bodyPutCode", String.valueOf(work.getPutCode()));
throw new MismatchedPutCodeException(params);
}
clearSource(work);
Work w = workManager.updateWork(orcid, work, true);
sourceUtils.setSourceName(w);
return Response.ok(w).build();
}
use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl method updatePeerReview.
@Override
public Response updatePeerReview(String orcid, Long putCode, PeerReview peerReview) {
orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.PEER_REVIEW_UPDATE);
if (!putCode.equals(peerReview.getPutCode())) {
Map<String, String> params = new HashMap<String, String>();
params.put("urlPutCode", String.valueOf(putCode));
params.put("bodyPutCode", String.valueOf(peerReview.getPutCode()));
throw new MismatchedPutCodeException(params);
}
clearSource(peerReview);
PeerReview updatedPeerReview = peerReviewManager.updatePeerReview(orcid, peerReview, true);
sourceUtils.setSourceName(updatedPeerReview);
return Response.ok(updatedPeerReview).build();
}
use of org.orcid.core.exception.MismatchedPutCodeException in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl 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();
}
Aggregations