use of org.activityinfo.store.query.output.ColumnJsonWriter in project activityinfo by bedatadriven.
the class FormResource method queryColumns.
@GET
@NoCache
@Path("query/columns")
@Produces(MediaType.APPLICATION_JSON)
public Response queryColumns(@Context UriInfo uriInfo) {
final ColumnSet columnSet = query(uriInfo);
final StreamingOutput output = outputStream -> {
ColumnJsonWriter columnSetWriter = new ColumnJsonWriter(outputStream, Charsets.UTF_8);
columnSetWriter.write(columnSet);
columnSetWriter.flush();
};
return Response.ok(output).type(JSON_CONTENT_TYPE).build();
}
use of org.activityinfo.store.query.output.ColumnJsonWriter in project activityinfo by bedatadriven.
the class QueryResource method queryColumns.
@POST
@Path("columns")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Executes a query over a set of forms in columnar format")
public Response queryColumns(QueryModel model) {
ColumnSetBuilder builder = backend.newQueryBuilder();
final ColumnSet columnSet = builder.build(model);
final StreamingOutput output = outputStream -> {
ColumnJsonWriter columnSetWriter = new ColumnJsonWriter(outputStream, Charsets.UTF_8);
columnSetWriter.write(columnSet);
columnSetWriter.flush();
};
return Response.ok(output).type(MediaType.APPLICATION_JSON_TYPE).build();
}
Aggregations