use of com.evolveum.midpoint.report.impl.activity.ExportDashboardActivitySupport.DashboardWidgetHolder in project midpoint by Evolveum.
the class ClassicDashboardReportExportActivityRun method beforeRun.
@Override
public void beforeRun(OperationResult result) throws ActivityRunException, CommonException {
RunningTask task = getRunningTask();
support.beforeExecution(result);
@NotNull ReportType report = support.getReport();
support.stateCheck(result);
List<DashboardWidgetType> widgets = support.getDashboard().getWidget();
mapOfWidgetsController = new LinkedHashMap<>();
dataWriter = ReportUtils.createDashboardDataWriter(report, getActivityHandler().reportService, support.getMapOfCompiledViews());
basicWidgetController = new DashboardWidgetExportController(dataWriter, report, reportService);
basicWidgetController.initialize();
basicWidgetController.beforeBucketExecution(1, result);
for (DashboardWidgetType widget : widgets) {
if (support.isWidgetTableVisible()) {
String widgetIdentifier = widget.getIdentifier();
ContainerableReportDataSource searchSpecificationHolder = new ContainerableReportDataSource(support);
DashboardExportController<Containerable> controller = new DashboardExportController(searchSpecificationHolder, dataWriter, report, reportService, support.getCompiledCollectionView(widgetIdentifier), widgetIdentifier, support.getReportParameters());
controller.initialize(task, result);
controller.beforeBucketExecution(1, result);
mapOfWidgetsController.put(widgetIdentifier, new DashboardWidgetHolder(searchSpecificationHolder, controller));
}
}
}
use of com.evolveum.midpoint.report.impl.activity.ExportDashboardActivitySupport.DashboardWidgetHolder in project midpoint by Evolveum.
the class ClassicDashboardReportExportActivityRun method iterateOverItemsInBucket.
@Override
public void iterateOverItemsInBucket(OperationResult result) throws CommonException {
// Issue the search to audit or model/repository
// And use the following handler to handle the results
List<DashboardWidgetType> widgets = support.getDashboard().getWidget();
AtomicInteger widgetSequence = new AtomicInteger(1);
for (DashboardWidgetType widget : widgets) {
ExportDashboardReportLine<Containerable> widgetLine = new ExportDashboardReportLine<>(widgetSequence.getAndIncrement(), widget);
ItemProcessingRequest<ExportDashboardReportLine<Containerable>> widgetRequest = new ExportDashboardReportLineProcessingRequest(widgetLine, this);
coordinator.submit(widgetRequest, result);
if (support.isWidgetTableVisible()) {
AtomicInteger sequence = new AtomicInteger(1);
Handler<Containerable> handler = record -> {
ExportDashboardReportLine<Containerable> line = new ExportDashboardReportLine<>(sequence.getAndIncrement(), record, widget.getIdentifier());
ItemProcessingRequest<ExportDashboardReportLine<Containerable>> request = new ExportDashboardReportLineProcessingRequest(line, this);
coordinator.submit(request, result);
return true;
};
DashboardWidgetHolder holder = mapOfWidgetsController.get(widget.getIdentifier());
ContainerableReportDataSource searchSpecificationHolder = holder.getSearchSpecificationHolder();
searchSpecificationHolder.run(handler, result);
}
}
}
Aggregations