Search in sources :

Example 1 with SubmitDatasetForReviewCommand

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();
    }
}
Also used : SubmitDatasetForReviewCommand(edu.harvard.iq.dataverse.engine.command.impl.SubmitDatasetForReviewCommand) Dataset(edu.harvard.iq.dataverse.Dataset) JsonObjectBuilder(javax.json.JsonObjectBuilder) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

Dataset (edu.harvard.iq.dataverse.Dataset)1 SubmitDatasetForReviewCommand (edu.harvard.iq.dataverse.engine.command.impl.SubmitDatasetForReviewCommand)1 JsonObjectBuilder (javax.json.JsonObjectBuilder)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1