use of com.runwaysdk.mvc.RestBodyResponse 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.RestBodyResponse 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);
}
use of com.runwaysdk.mvc.RestBodyResponse in project geoprism-registry by terraframe.
the class AccountServiceControllerTest method queryUsers.
/**
* Test returning possible roles that can be assigned to a person for a given
* organization.
*/
@Test
public void queryUsers() {
String rmDistrictRole = RegistryRole.Type.getRM_RoleName(moiOrg.getCode(), district.getCode());
String rmVillageRole = RegistryRole.Type.getRM_RoleName(moiOrg.getCode(), village.getCode());
String rcDistrictRole = RegistryRole.Type.getRC_RoleName(moiOrg.getCode(), district.getCode());
String rcVillageRole = RegistryRole.Type.getRC_RoleName(moiOrg.getCode(), village.getCode());
JSONObject johny = createUser("johny@gmail.com", rmDistrictRole + "," + rmVillageRole);
JSONObject sally = createUser("sallyy@gmail.com", rcDistrictRole + "," + rcVillageRole);
String rmHealthFacilityRole = RegistryRole.Type.getRM_RoleName(mohOrg.getCode(), healthFacility.getCode());
String rcHealthFacilityRole = RegistryRole.Type.getRC_RoleName(mohOrg.getCode(), healthFacility.getCode());
JSONObject franky = createUser("franky@gmail.com", rmHealthFacilityRole);
JSONObject becky = createUser("beckyy@gmail.com", rcHealthFacilityRole);
// try
// {
JSONArray orgCodeArray = new JSONArray();
orgCodeArray.put(moiOrg.getCode());
// orgCodeArray.put(mohOrg.getCode());
// orgCodeArray.put("TEST1");
// orgCodeArray.put("TEST2");
RestBodyResponse response = (RestBodyResponse) controller.page(clientRequest, 1, 10);
// }
// finally
// {
// controller.remove(clientRequest, johny.getString(GeoprismUserDTO.OID));
// controller.remove(clientRequest, sally.getString(GeoprismUserDTO.OID));
//
// controller.remove(clientRequest, franky.getString(GeoprismUserDTO.OID));
// controller.remove(clientRequest, becky.getString(GeoprismUserDTO.OID));
// }
}
Aggregations