use of com.runwaysdk.mvc.InputStreamResponse in project geoprism-registry by terraframe.
the class ListTypeController method tile.
@Endpoint(error = ErrorSerialization.JSON)
public ResponseIF tile(ClientRequestIF request, @RequestParamter(name = "x", required = true) Integer x, @RequestParamter(name = "y", required = true) Integer y, @RequestParamter(name = "z", required = true) Integer z, @RequestParamter(name = "config", required = true) String config) throws JSONException {
JSONObject object = new JSONObject(config);
object.put("x", x);
object.put("y", y);
object.put("z", z);
return new InputStreamResponse(this.service.getTile(request.getSessionId(), object), "application/x-protobuf", null);
}
use of com.runwaysdk.mvc.InputStreamResponse in project geoprism-registry by terraframe.
the class LocalizationService method exportSpreadsheetInRequest.
@Request(RequestType.SESSION)
public InputStreamResponse exportSpreadsheetInRequest(String sessionId) {
ServiceFactory.getRolePermissionService().enforceSRA();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
BufferedOutputStream buffer = new BufferedOutputStream(bytes);
LocalizationExcelExporter exporter = new LocalizationExcelExporter(buildConfig(), buffer);
exporter.export();
ByteArrayInputStream is = new ByteArrayInputStream(bytes.toByteArray());
return new InputStreamResponse(is, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "localization.xlsx");
}
use of com.runwaysdk.mvc.InputStreamResponse in project geoprism-registry by terraframe.
the class ListTypeController method downloadShapefile.
@Endpoint(url = "download-shapefile", method = ServletMethod.GET, error = ErrorSerialization.JSON)
public ResponseIF downloadShapefile(ClientRequestIF request, @RequestParamter(name = "oid", required = true) String oid, @RequestParamter(name = "filter") String filter) throws JSONException {
JsonObject masterList = this.service.getVersion(request.getSessionId(), oid);
String code = masterList.get(ListType.TYPE_CODE).getAsString() + "-" + masterList.get(ListTypeVersion.FORDATE).getAsString();
return new InputStreamResponse(service.downloadShapefile(request.getSessionId(), oid), "application/zip", code + ".zip");
}
use of com.runwaysdk.mvc.InputStreamResponse in project geoprism-registry by terraframe.
the class ListTypeController method exportSpreadsheet.
// @Endpoint(url = "generate-shapefile", method = ServletMethod.POST, error =
// ErrorSerialization.JSON)
// public ResponseIF generateShapefile(ClientRequestIF request,
// @RequestParamter(name = "oid") String oid) throws JSONException
// {
// final String jobId = service.generateShapefile(request.getSessionId(),
// oid);
//
// final RestResponse response = new RestResponse();
// response.set("job", jobId);
//
// return response;
// }
@Endpoint(url = "export-spreadsheet", method = ServletMethod.GET, error = ErrorSerialization.JSON)
public ResponseIF exportSpreadsheet(ClientRequestIF request, @RequestParamter(name = "oid", required = true) String oid, @RequestParamter(name = "criteria") String criteria) throws JSONException {
JsonObject masterList = this.service.getVersion(request.getSessionId(), oid);
String code = masterList.get(ListType.TYPE_CODE).getAsString() + "-" + masterList.get(ListTypeVersion.FORDATE).getAsString();
return new InputStreamResponse(service.exportSpreadsheet(request.getSessionId(), oid, criteria), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", code + ".xlsx");
}
use of com.runwaysdk.mvc.InputStreamResponse in project geoprism-registry by terraframe.
the class ListTypeController method exportShapefile.
@Endpoint(url = "export-shapefile", method = ServletMethod.GET, error = ErrorSerialization.JSON)
public ResponseIF exportShapefile(ClientRequestIF request, @RequestParamter(name = "oid", required = true) String oid, @RequestParamter(name = "criteria") String criteria) throws JSONException {
JsonObject masterList = this.service.getVersion(request.getSessionId(), oid);
String code = masterList.get(ListType.TYPE_CODE).getAsString() + "-" + masterList.get(ListTypeVersion.FORDATE).getAsString();
return new InputStreamResponse(service.exportShapefile(request.getSessionId(), oid, criteria), "application/zip", code + ".zip");
}
Aggregations