Skip to content

Commit

Permalink
MDC Missed basic dataset json api #4821
Browse files Browse the repository at this point in the history
The fun never ends!
  • Loading branch information
matthew-a-dunlap committed Mar 6, 2019
1 parent 6375598 commit 0b46993
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,15 @@ private interface DsVersionHandler<T> {

@GET
@Path("{id}")
public Response getDataset(@PathParam("id") String id) {
public Response getDataset(@PathParam("id") String id, @Context UriInfo uriInfo, @Context HttpHeaders headers, @Context HttpServletResponse response) {
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);

MakeDataCountLoggingServiceBean.MakeDataCountEntry entry = new MakeDataCountEntry(uriInfo, headers, dvRequestService, retrieved);
mdcLogService.logEntry(entry);

return allowCors(ok(jsonbuilder.add("latestVersion", (latest != null) ? json(latest) : null)));
});
}
Expand Down

0 comments on commit 0b46993

Please sign in to comment.