use of org.opennms.netmgt.config.kscReports.Report in project opennms by OpenNMS.
the class DefaultKscReportService method buildResourceReport.
private static Report buildResourceReport(ResourceService service, OnmsResource parentResource, String title) {
Report report = new Report();
report.setTitle(title);
report.setShowTimespanButton(true);
report.setShowGraphtypeButton(true);
List<OnmsResource> resources = service.findChildResources(parentResource, "interfaceSnmp");
for (OnmsResource resource : resources) {
PrefabGraph[] graphs = service.findPrefabGraphsForResource(resource);
if (graphs.length == 0) {
continue;
}
Graph graph = new Graph();
graph.setTitle("");
graph.setResourceId(resource.getId().toString());
graph.setTimespan("7_day");
graph.setGraphtype(graphs[0].getName());
report.addGraph(graph);
}
return report;
}
Aggregations