use of org.activityinfo.shared.dto.SchemaCsvWriter in project activityinfo by bedatadriven.
the class RootResource method getDatabaseSchemaCsv.
@GET
@Path("/database/{id}/schema.csv")
public Response getDatabaseSchemaCsv(@PathParam("id") int id) {
UserDatabaseDTO db = getDatabaseSchema(id);
SchemaCsvWriter writer = new SchemaCsvWriter();
writer.write(db);
return Response.ok().type("text/css").header("Content-Disposition", "attachment; filename=schema_" + id + ".csv").entity(writer.toString()).build();
}
use of org.activityinfo.shared.dto.SchemaCsvWriter in project activityinfo by bedatadriven.
the class GetSchemaTest method toCSV.
@Test
public void toCSV() {
SchemaDTO schema = execute(new GetSchema());
SchemaCsvWriter writer = new SchemaCsvWriter();
writer.write(schema.getDatabaseById(1));
System.out.println(writer.toString());
}
Aggregations