use of org.cerberus.statistics.BuildRevisionStatisticsEnv in project cerberus-source by cerberustesting.
the class GetEnvironmentsPerBuildRevision method findBuildRevList.
private AnswerItem findBuildRevList(String system, ApplicationContext appContext, boolean userHasPermissions, HttpServletRequest request) throws JSONException {
AnswerItem item = new AnswerItem();
JSONObject object = new JSONObject();
envService = appContext.getBean(IEnvironmentStatisticsService.class);
cepService = appContext.getBean(ICountryEnvParamService.class);
AnswerList resp = envService.getEnvironmentStatistics(system);
JSONArray jsonArray = new JSONArray();
if (resp.isCodeEquals(MessageEventEnum.DATA_OPERATION_OK.getCode())) {
// the service was able to perform the query, then we should get all values
for (BuildRevisionStatisticsEnv buildRevStat : (List<BuildRevisionStatisticsEnv>) resp.getDataList()) {
jsonArray.put(convertToJSONObject(buildRevStat));
}
}
object.put("contentTable", jsonArray);
object.put("iTotalRecords", resp.getTotalRows());
object.put("iTotalDisplayRecords", resp.getTotalRows());
item.setItem(object);
item.setResultMessage(resp.getResultMessage());
return item;
}
Aggregations