use of edu.harvard.iq.dataverse.engine.command.impl.GetLatestAccessibleDatasetVersionCommand in project dataverse by IQSS.
the class Datasets method getDataset.
@GET
@Path("{id}")
public Response getDataset(@PathParam("id") String id) {
return response(req -> {
final Dataset retrieved = execCommand(new GetDatasetCommand(req, findDatasetOrDie(id)));
final DatasetVersion latest = execCommand(new GetLatestAccessibleDatasetVersionCommand(req, retrieved));
final JsonObjectBuilder jsonbuilder = json(retrieved);
return allowCors(ok(jsonbuilder.add("latestVersion", (latest != null) ? json(latest) : null)));
});
}
Aggregations