use of org.opennms.web.svclayer.model.DatabaseReportDescription 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.DatabaseReportDescription in project opennms by OpenNMS.
the class DefaultDatabaseReportListService method getAll.
/**
* <p>
* getAll Reports from all Repositories
* </p>
*
* @return a {@link java.util.List} object.
*/
@Deprecated
@Override
public List<DatabaseReportDescription> getAll() {
List<DatabaseReportDescription> allReports = new ArrayList<>();
for (ReportRepository globalRepository : m_globalReportRepository.getRepositoryList()) {
for (BasicReportDefinition report : globalRepository.getReports()) {
DatabaseReportDescription summary = new DatabaseReportDescription();
summary.setRepositoryId(globalRepository.getRepositoryId());
summary.setId(report.getId());
summary.setDisplayName(report.getDisplayName());
summary.setDescription(report.getDescription());
summary.setIsOnline(report.getOnline());
summary.setAllowAccess(report.getAllowAccess());
allReports.add(summary);
}
}
return allReports;
}
use of org.opennms.web.svclayer.model.DatabaseReportDescription in project opennms by OpenNMS.
the class DefaultDatabaseReportListService method getReportsByRepositoryId.
@Override
public List<DatabaseReportDescription> getReportsByRepositoryId(String repositoryId) {
List<DatabaseReportDescription> reportList = new ArrayList<>();
for (BasicReportDefinition reportDefinition : m_globalReportRepository.getRepositoryById(repositoryId).getReports()) {
DatabaseReportDescription summary = new DatabaseReportDescription();
summary.setRepositoryId(reportDefinition.getRepositoryId());
summary.setId(reportDefinition.getId());
summary.setDisplayName(reportDefinition.getDisplayName());
summary.setDescription(reportDefinition.getDescription());
summary.setIsOnline(reportDefinition.getOnline());
summary.setAllowAccess(reportDefinition.getAllowAccess());
reportList.add(summary);
}
return reportList;
}
use of org.opennms.web.svclayer.model.DatabaseReportDescription in project opennms by OpenNMS.
the class DefaultDatabaseReportListService method getAllOnline.
/**
* <p>
* getAll Reports from all Repositories
* </p>
*
* @return a {@link java.util.List} object.
*/
@Deprecated
@Override
public List<DatabaseReportDescription> getAllOnline() {
List<DatabaseReportDescription> onlineReports = new ArrayList<>();
for (ReportRepository m_repo : m_globalReportRepository.getRepositoryList()) {
for (BasicReportDefinition report : m_repo.getOnlineReports()) {
DatabaseReportDescription summary = new DatabaseReportDescription();
summary.setRepositoryId(m_repo.getRepositoryId());
summary.setId(report.getId());
summary.setDisplayName(report.getDisplayName());
summary.setDescription(report.getDescription());
summary.setIsOnline(report.getOnline());
summary.setAllowAccess(report.getAllowAccess());
onlineReports.add(summary);
}
}
return onlineReports;
}
use of org.opennms.web.svclayer.model.DatabaseReportDescription in project opennms by OpenNMS.
the class DefaultDatabaseReportListService method getOnlineReportsByRepositoryId.
@Override
public List<DatabaseReportDescription> getOnlineReportsByRepositoryId(String repositoryId) {
List<DatabaseReportDescription> onlineReportList = new ArrayList<>();
for (BasicReportDefinition reportDefinition : m_globalReportRepository.getRepositoryById(repositoryId).getOnlineReports()) {
DatabaseReportDescription summary = new DatabaseReportDescription();
summary.setRepositoryId(reportDefinition.getRepositoryId());
summary.setId(reportDefinition.getId());
summary.setDisplayName(reportDefinition.getDisplayName());
summary.setDescription(reportDefinition.getDescription());
summary.setIsOnline(reportDefinition.getOnline());
summary.setAllowAccess(reportDefinition.getAllowAccess());
onlineReportList.add(summary);
}
return onlineReportList;
}
Aggregations