use of com.runwaysdk.mvc.Endpoint 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.Endpoint in project geoprism-registry by terraframe.
the class ListTypeController method apply.
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON, url = "apply")
public ResponseIF apply(ClientRequestIF request, @RequestParamter(name = "list", required = true) String listJSON) {
JsonObject list = JsonParser.parseString(listJSON).getAsJsonObject();
JsonObject response = this.service.apply(request.getSessionId(), list);
return new RestBodyResponse(response);
}
use of com.runwaysdk.mvc.Endpoint 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.Endpoint 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");
}
use of com.runwaysdk.mvc.Endpoint in project geoprism-registry by terraframe.
the class RegistryAccountController method getRolesForUser.
@Endpoint(method = ServletMethod.POST, error = ErrorSerialization.JSON)
public ResponseIF getRolesForUser(ClientRequestIF request, @RequestParamter(name = "userOID", required = true) String userOID) throws JSONException {
RegistryRole[] roles = this.accountService.getRolesForUser(request.getSessionId(), userOID);
JsonArray rolesJSONArray = this.createRoleMap(roles);
return new RestBodyResponse(rolesJSONArray);
}
Aggregations