use of edu.harvard.iq.dataverse.engine.command.impl.SubmitDatasetForReviewCommand in project dataverse by IQSS.
the class Datasets method submitForReview.
@POST
@Path("{id}/submitForReview")
public Response submitForReview(@PathParam("id") String idSupplied) {
try {
Dataset updatedDataset = execCommand(new SubmitDatasetForReviewCommand(createDataverseRequest(findUserOrDie()), findDatasetOrDie(idSupplied)));
JsonObjectBuilder result = Json.createObjectBuilder();
boolean inReview = updatedDataset.isLockedFor(DatasetLock.Reason.InReview);
result.add("inReview", inReview);
result.add("message", "Dataset id " + updatedDataset.getId() + " has been submitted for review.");
return ok(result);
} catch (WrappedResponse wr) {
return wr.getResponse();
}
}
Aggregations