use of com.runwaysdk.mvc.Endpoint in project geoprism-registry by terraframe.
the class TransitionEventController method getHistoricalReport.
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = "historical-report")
public ResponseIF getHistoricalReport(ClientRequestIF request, @RequestParamter(name = "typeCode", required = true) String typeCode, @RequestParamter(name = "startDate") String startDate, @RequestParamter(name = "endDate") String endDate, @RequestParamter(name = "pageSize") Integer pageSize, @RequestParamter(name = "pageNumber") Integer pageNumber) throws ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
format.setTimeZone(GeoRegistryUtil.SYSTEM_TIMEZONE);
Date sDate = startDate != null ? format.parse(startDate) : new Date();
Date eDate = endDate != null ? format.parse(endDate) : new Date();
return new RestBodyResponse(service.getHistoricalReport(request.getSessionId(), typeCode, sDate, eDate, pageSize, pageNumber));
}
use of com.runwaysdk.mvc.Endpoint in project geoprism-registry by terraframe.
the class TransitionEventController method exportExcel.
@Endpoint(method = ServletMethod.GET, error = ErrorSerialization.JSON, url = "export-excel")
public ResponseIF exportExcel(ClientRequestIF request, @RequestParamter(name = "typeCode", required = true) String typeCode, @RequestParamter(name = "startDate") String startDate, @RequestParamter(name = "endDate") String endDate) throws ParseException, IOException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
format.setTimeZone(GeoRegistryUtil.SYSTEM_TIMEZONE);
Date sDate = startDate != null ? format.parse(startDate) : new Date();
Date eDate = endDate != null ? format.parse(endDate) : new Date();
return new InputStreamResponse(service.exportExcel(request.getSessionId(), typeCode, sDate, eDate), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "historical-report.xlsx");
}
use of com.runwaysdk.mvc.Endpoint in project geoprism-registry by terraframe.
the class UndirectedGraphController method getChildren.
@Endpoint(url = "get-related-geo-objects", method = ServletMethod.GET, error = ErrorSerialization.JSON)
public ResponseIF getChildren(ClientRequestIF request, @RequestParamter(name = "sourceCode", required = true) String sourceCode, @RequestParamter(name = "sourceTypeCode", required = true) String sourceTypeCode, @RequestParamter(name = "undirectedRelationshipCode", required = true) String undirectedRelationshipCode, @RequestParamter(name = "recursive", required = true) Boolean recursive, @RequestParamter(name = "date", required = true) String sDate) {
Date date = GeoRegistryUtil.parseDate(sDate, true);
JsonObject response = this.service.getChildren(request.getSessionId(), sourceCode, sourceTypeCode, undirectedRelationshipCode, recursive, date);
return new RestBodyResponse(response);
}
Aggregations