use of org.springframework.beans.support.PagedListHolder in project opennms by OpenNMS.
the class ManageDatabaseReportController method listReports.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView listReports(@RequestParam(value = "p", required = false, defaultValue = "0") int page, ModelAndView modelAndView) {
List<ReportCatalogEntry> reportCatalog = reportStoreService.getAll();
Map<String, Object> formatMap = reportStoreService.getFormatMap();
PagedListHolder<ReportCatalogEntry> pagedListHolder = new PagedListHolder<>(reportCatalog);
pagedListHolder.setPageSize(m_pageSize);
// strip minus values
pagedListHolder.setPage(Math.max(page, 0));
modelAndView.addObject("formatMap", formatMap);
modelAndView.addObject("pagedListHolder", pagedListHolder);
modelAndView.addObject("command", new ManageDatabaseReportCommand());
modelAndView.setViewName("/report/database/manage");
return modelAndView;
}
use of org.springframework.beans.support.PagedListHolder in project opennms by OpenNMS.
the class ManageReportScheduleController method listTriggers.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView listTriggers(@RequestParam(value = "p", required = false, defaultValue = "0") int page, ModelAndView modelAndView) {
List<TriggerDescription> reportTriggers = m_reportSchedulerService.getTriggerDescriptions();
PagedListHolder<TriggerDescription> pagedListHolder = new PagedListHolder<>(reportTriggers);
pagedListHolder.setPageSize(m_pageSize);
// strip minus values
pagedListHolder.setPage(Math.max(page, 0));
modelAndView.addObject("pagedListHolder", pagedListHolder);
modelAndView.addObject("command", new ManageReportScheduleCommand());
modelAndView.setViewName("/report/database/manageSchedule");
return modelAndView;
}
use of org.springframework.beans.support.PagedListHolder in project opennms by OpenNMS.
the class ReportListController method handleRequestInternal.
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
logger.debug("start: reload reporting configuration files");
// TODO indigo: We have to solve this problem on DAO level
synchronized (m_reportListService) {
m_reportListService.reloadConfigurationFiles();
}
logger.debug("stop : reload reporting configuration files");
Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>>();
for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getReportsByRepositoryId(reportRepositoryDescription.getId()));
pageListholder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(request, "p_" + reportRepositoryDescription.getId(), 0);
pageListholder.setPage(page);
repositoryList.put(reportRepositoryDescription, pageListholder);
}
return new ModelAndView("report/database/reportList", "repositoryList", repositoryList);
}
Aggregations