use of org.obiba.mica.search.reports.generators.DatasetVariableCsvReportGenerator in project mica2 by obiba.
the class PublishedDatasetVariablesSetResource method reportVariables.
@GET
@Path("/documents/_report")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response reportVariables(@PathParam("id") String id, @QueryParam("locale") @DefaultValue("en") String locale) {
DocumentSet documentSet = getSecuredDocumentSet(id);
ReportGenerator reporter = new DatasetVariableCsvReportGenerator(variableSetService.getVariables(documentSet, false), locale);
StreamingOutput stream = reporter::write;
return Response.ok(stream).header("Content-Disposition", "attachment; filename=\"Variables.zip\"").build();
}
Aggregations