Search in sources :

Example 1 with SubreportType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SubreportType in project midpoint by Evolveum.

the class ReportCreateTaskHandler method getSubreportParameters.

private Map<String, Object> getSubreportParameters(SubreportType subreportType, Task task, OperationResult subResult) throws SchemaException, ObjectNotFoundException {
    Map<String, Object> reportParams = new HashMap<String, Object>();
    ReportType reportType = objectResolver.resolve(subreportType.getReportRef(), ReportType.class, null, "resolve subreport", task, subResult);
    Map<String, Object> parameters = prepareReportParameters(reportType, subResult);
    reportParams.putAll(parameters);
    JasperReport jasperReport = ReportTypeUtil.loadJasperReport(reportType);
    reportParams.put(subreportType.getName(), jasperReport);
    Map<String, Object> subReportParams = processSubreportParameters(reportType, task, subResult);
    reportParams.putAll(subReportParams);
    return reportParams;
}
Also used : HashMap(java.util.HashMap) PrismObject(com.evolveum.midpoint.prism.PrismObject) JasperReport(net.sf.jasperreports.engine.JasperReport) ReportType(com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType)

Example 2 with SubreportType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SubreportType in project midpoint by Evolveum.

the class ReportCreateTaskHandler method processSubreportParameters.

private Map<String, Object> processSubreportParameters(ReportType reportType, Task task, OperationResult subreportResult) throws SchemaException, ObjectNotFoundException {
    Map<String, Object> subreportParameters = new HashMap<String, Object>();
    for (SubreportType subreport : reportType.getSubreport()) {
        Map<String, Object> subreportParam = getSubreportParameters(subreport, task, subreportResult);
        LOGGER.trace("create subreport params : {}", subreportParam);
        subreportParameters.putAll(subreportParam);
    }
    return subreportParameters;
}
Also used : HashMap(java.util.HashMap) SubreportType(com.evolveum.midpoint.xml.ns._public.common.common_3.SubreportType) PrismObject(com.evolveum.midpoint.prism.PrismObject)

Aggregations

PrismObject (com.evolveum.midpoint.prism.PrismObject)2 HashMap (java.util.HashMap)2 ReportType (com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType)1 SubreportType (com.evolveum.midpoint.xml.ns._public.common.common_3.SubreportType)1 JasperReport (net.sf.jasperreports.engine.JasperReport)1