Search in sources :

Example 1 with BasicReportDefinition

use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.

the class DefaultRemoteRepositoryTest method reportIdsStartWithRepositoryIdTest.

@Test
public void reportIdsStartWithRepositoryIdTest() {
    List<BasicReportDefinition> reports = m_defaultRemoteRepository.getReports();
    logger.debug("reportIdsStartWithRepositoryIdTest");
    for (BasicReportDefinition report : reports) {
        assertTrue(report.getId().startsWith(m_defaultRemoteRepository.getRepositoryId()));
        logger.debug(report.getId());
        logger.debug("'{}'", report.getRepositoryId());
    }
}
Also used : BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition) Test(org.junit.Test)

Example 2 with BasicReportDefinition

use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.

the class DefaultRemoteRepositoryTest method getReports.

@Test
public void getReports() {
    List<BasicReportDefinition> reports = m_defaultRemoteRepository.getReports();
    logger.debug("getReports");
    for (BasicReportDefinition report : reports) {
        logger.debug(report.toString());
    }
}
Also used : BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition) Test(org.junit.Test)

Example 3 with BasicReportDefinition

use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.

the class DefaultReportStoreService method getFormatMap.

/**
 * <p>getFormatMap</p>
 *
 * @return a {@link java.util.Map} object.
 */
@Override
public Map<String, Object> getFormatMap() {
    final HashMap<String, Object> formatMap = new HashMap<String, Object>();
    for (final BasicReportDefinition report : m_globalReportRepository.getAllReports()) {
        final List<ReportFormat> formats = m_reportServiceLocator.getReportService(report.getReportService()).getFormats(report.getId());
        formatMap.put(report.getId(), formats);
    }
    return formatMap;
}
Also used : HashMap(java.util.HashMap) ReportFormat(org.opennms.api.reporting.ReportFormat) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Example 4 with BasicReportDefinition

use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.

the class DefaultGlobalReportRepository method getAllReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getAllReports() {
    List<BasicReportDefinition> results = new ArrayList<>();
    for (ReportRepository repository : m_repositoryList) {
        results.addAll(repository.getReports());
    }
    logger.debug("getAllReports was called result: '{}'", results);
    return results;
}
Also used : ArrayList(java.util.ArrayList) ReportRepository(org.opennms.features.reporting.repository.ReportRepository) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Example 5 with BasicReportDefinition

use of org.opennms.features.reporting.model.basicreport.BasicReportDefinition in project opennms by OpenNMS.

the class DefaultGlobalReportRepository method getReports.

/**
 * {@inheritDoc}
 */
@Override
public List<BasicReportDefinition> getReports(String repositoryId) {
    List<BasicReportDefinition> results = new ArrayList<>();
    ReportRepository repository = this.getRepositoryById(repositoryId);
    if (repository != null) {
        results.addAll(repository.getReports());
    }
    logger.debug("getReports was called for: '{}' result: '{}'", repositoryId, results);
    return results;
}
Also used : ArrayList(java.util.ArrayList) ReportRepository(org.opennms.features.reporting.repository.ReportRepository) BasicReportDefinition(org.opennms.features.reporting.model.basicreport.BasicReportDefinition)

Aggregations

BasicReportDefinition (org.opennms.features.reporting.model.basicreport.BasicReportDefinition)20 ArrayList (java.util.ArrayList)14 ReportRepository (org.opennms.features.reporting.repository.ReportRepository)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)5 Test (org.junit.Test)4 DatabaseReportDescription (org.opennms.web.svclayer.model.DatabaseReportDescription)4 LegacyLocalReportDefinition (org.opennms.features.reporting.model.basicreport.LegacyLocalReportDefinition)3 GlobalReportRepository (org.opennms.features.reporting.repository.global.GlobalReportRepository)3 RemoteReportSDO (org.opennms.features.reporting.sdo.RemoteReportSDO)3 WebTarget (javax.ws.rs.client.WebTarget)2 GenericType (javax.ws.rs.core.GenericType)2 Before (org.junit.Before)2 HashMap (java.util.HashMap)1 ReportFormat (org.opennms.api.reporting.ReportFormat)1 LocalReportsDao (org.opennms.features.reporting.dao.LocalReportsDao)1 LocalJasperReportsDao (org.opennms.features.reporting.dao.jasper.LocalJasperReportsDao)1 SimpleJasperReportDefinition (org.opennms.features.reporting.model.jasperreport.SimpleJasperReportDefinition)1 DefaultDatabaseReportListService (org.opennms.web.svclayer.support.DefaultDatabaseReportListService)1