Search in sources :

Example 1 with BuildRevisionStatisticsEnv

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;
}
Also used : IEnvironmentStatisticsService(org.cerberus.statistics.IEnvironmentStatisticsService) AnswerList(org.cerberus.util.answer.AnswerList) JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray) BuildRevisionStatisticsEnv(org.cerberus.statistics.BuildRevisionStatisticsEnv) AnswerList(org.cerberus.util.answer.AnswerList) List(java.util.List) ICountryEnvParamService(org.cerberus.crud.service.ICountryEnvParamService) AnswerItem(org.cerberus.util.answer.AnswerItem)

Aggregations

List (java.util.List)1 ICountryEnvParamService (org.cerberus.crud.service.ICountryEnvParamService)1 BuildRevisionStatisticsEnv (org.cerberus.statistics.BuildRevisionStatisticsEnv)1 IEnvironmentStatisticsService (org.cerberus.statistics.IEnvironmentStatisticsService)1 AnswerItem (org.cerberus.util.answer.AnswerItem)1 AnswerList (org.cerberus.util.answer.AnswerList)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1