use of org.opennms.web.svclayer.model.ReportRepositoryDescription 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);
}
use of org.opennms.web.svclayer.model.ReportRepositoryDescription in project opennms by OpenNMS.
the class DefaultDatabaseReportListService method getActiveRepositories.
@Override
public List<ReportRepositoryDescription> getActiveRepositories() {
List<ReportRepositoryDescription> result = new ArrayList<>();
List<ReportRepository> reportRepositoryList = new ArrayList<>();
reportRepositoryList = m_globalReportRepository.getRepositoryList();
for (ReportRepository repository : reportRepositoryList) {
ReportRepositoryDescription reportRepositoryDescription = new ReportRepositoryDescription();
reportRepositoryDescription.setId(repository.getRepositoryId());
reportRepositoryDescription.setDescription(repository.getRepositoryDescription());
reportRepositoryDescription.setDisplayName(repository.getRepositoryName());
reportRepositoryDescription.setManagementUrl(repository.getManagementUrl());
result.add(reportRepositoryDescription);
}
return result;
}
Aggregations