Search in sources :

Example 1 with ReportRepositoryDescription

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);
}
Also used : ReportRepositoryDescription(org.opennms.web.svclayer.model.ReportRepositoryDescription) DatabaseReportDescription(org.opennms.web.svclayer.model.DatabaseReportDescription) ModelAndView(org.springframework.web.servlet.ModelAndView) PagedListHolder(org.springframework.beans.support.PagedListHolder) LinkedHashMap(java.util.LinkedHashMap)

Example 2 with ReportRepositoryDescription

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;
}
Also used : ReportRepositoryDescription(org.opennms.web.svclayer.model.ReportRepositoryDescription) ArrayList(java.util.ArrayList) GlobalReportRepository(org.opennms.features.reporting.repository.global.GlobalReportRepository) ReportRepository(org.opennms.features.reporting.repository.ReportRepository)

Aggregations

ReportRepositoryDescription (org.opennms.web.svclayer.model.ReportRepositoryDescription)2 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 ReportRepository (org.opennms.features.reporting.repository.ReportRepository)1 GlobalReportRepository (org.opennms.features.reporting.repository.global.GlobalReportRepository)1 DatabaseReportDescription (org.opennms.web.svclayer.model.DatabaseReportDescription)1 PagedListHolder (org.springframework.beans.support.PagedListHolder)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1