@RequestMapping(value = URL_LOAD_CAMPAIGNS, method = RequestMethod.GET) public @ResponseBody String loadCampaigns( ModelMap model, HttpServletRequest request, @RequestParam("sEcho") Integer sEcho, @RequestParam("iDisplayStart") Integer iDisplayStart, @RequestParam("iDisplayLength") Integer iDisplayLength) throws Exception { LOGGER.debug( "Loading campaigns .. sEcho: " + sEcho + ", iDisplayStart: " + iDisplayStart + ", iDisplayLength: " + iDisplayLength); BatchCampaignAssociationModel filterCriteria = null; filterCriteria = getFilterAsInstance(request); ManageCampaignsDTBean dtBean = null; dtBean = manageCampaigns.getCampaignsDTBean(iDisplayStart, DATA_TABLE_RECORD_FETCH, filterCriteria); dtBean.setsEcho(sEcho); LOGGER.info("ResultSet size::: " + dtBean.getAaData().size()); String dtBeanInJson = ""; dtBeanInJson = JsonUtil.toJsonString(dtBean); LOGGER.debug("Json for : " + dtBeanInJson); return dtBeanInJson; }
@RequestMapping(value = URL_UPDATE_CAMPAIGN, method = RequestMethod.POST) public @ResponseBody String updateCampaign( @RequestBody final ManageCampaignRequestJsonBean jsonRequest) throws ParseException { LOGGER.debug("Updatingg Campaign, Id: " + jsonRequest.getId()); LOGGER.debug( "Other params .. CampaignStartDate: " + jsonRequest.getCampaignStartDate() + ", RegistrationStartDate: " + jsonRequest.getRegistrationStartDate() + ", RegistrationEndDate: " + jsonRequest.getRegistrationEndDate()); boolean updated = manageCampaigns.updateCampaign(jsonRequest); LOGGER.debug("Update campaign transaction status: " + updated); String status = updated ? "success" : "fail"; String jsonStatus = "{\"status\":\"" + status + "\"}"; return jsonStatus; }