use of org.ambraproject.rhino.identity.ArticleRevisionIdentifier in project rhino by PLOS.
the class ArticleCrudController method patchSyndication.
@RequestMapping(value = "/articles/{doi}/revisions/{number}/syndications", method = RequestMethod.PATCH)
@ApiImplicitParam(name = "body", paramType = "body", dataType = "SyndicationInputView", value = "example: {\"targetQueue\": \"activemq:plos.pmc\", \"status\": \"FAILURE\", \"errorMessage\": \"failed\"}")
public ResponseEntity<?> patchSyndication(HttpServletRequest request, @PathVariable("doi") String doi, @PathVariable("number") int revisionNumber) throws IOException {
ArticleRevisionIdentifier revisionId = ArticleRevisionIdentifier.create(DoiEscaping.unescape(doi), revisionNumber);
SyndicationInputView input = readJsonFromRequest(request, SyndicationInputView.class);
Syndication patched = syndicationCrudService.updateSyndication(revisionId, input.getTargetQueue(), input.getStatus(), input.getErrorMessage());
return ServiceResponse.serveView(new SyndicationView(patched)).asJsonResponse(entityGson);
}
Aggregations