protected Stream<ReportQuery> getQueries(ExtractionContext context) { return context.getBand().getReportQueries().stream(); }
protected Stream<ReportQuery> getQueries(ExtractionContext context) { return context.getBand().getReportQueries().stream(); }
checkNotNull(context); if (CollectionUtils.isEmpty(context.getBand().getReportQueries())) { return Collections.singletonList(context.getParams());
checkNotNull(context); if (CollectionUtils.isEmpty(context.getBand().getReportQueries())) { return Collections.singletonList(context.getParams());
public static Map<String, Object> getParams(ReportBand band) { if (band == null) return Collections.emptyMap(); return Stream.concat( Optional.ofNullable(band.getReportQueries()).orElse(Collections.emptyList()).stream() .map(ReportQuery::getAdditionalParams), Optional.ofNullable(band.getChildren()).orElse(Collections.emptyList()).stream() .map(ExtractionUtils::getParams)) .filter(Objects::nonNull) .reduce((map1, map2)-> Stream.concat(map1.entrySet().stream(), map2.entrySet().stream()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2)-> e1))) .orElse(Collections.emptyMap()); }
public ReportBandImpl(ReportBand instanceToCopy) { this(instanceToCopy.getName(), instanceToCopy.getParent(), instanceToCopy.getChildren(), instanceToCopy.getReportQueries(), instanceToCopy.getBandOrientation()); }
public ReportBandImpl(ReportBand instanceToCopy) { this(instanceToCopy.getName(), instanceToCopy.getParent(), instanceToCopy.getChildren(), instanceToCopy.getReportQueries(), instanceToCopy.getBandOrientation()); }
protected void writeBandDefinition(Element element, ReportBand bandDefinition) { element.addAttribute("name", bandDefinition.getName()); element.addAttribute("orientation", bandDefinition.getBandOrientation().id); Element childrenBandsElement = element.addElement("bands"); Element reportQueriesElement = element.addElement("queries"); if (bandDefinition.getReportQueries() != null) { for (ReportQuery reportQuery : bandDefinition.getReportQueries()) { Element reportQueryElement = reportQueriesElement.addElement("query"); reportQueryElement.addAttribute("name", reportQuery.getName()); reportQueryElement.addAttribute("type", reportQuery.getLoaderType()); reportQueryElement.addElement("script").setText(reportQuery.getScript()); } } if (bandDefinition.getChildren() != null) { for (ReportBand childBandDefinition : bandDefinition.getChildren()) { Element childBandElement = childrenBandsElement.addElement("band"); writeBandDefinition(childBandElement, childBandDefinition); } } } }
protected void writeBandDefinition(Element element, ReportBand bandDefinition) { element.addAttribute("name", bandDefinition.getName()); element.addAttribute("orientation", bandDefinition.getBandOrientation().id); Element childrenBandsElement = element.addElement("bands"); Element reportQueriesElement = element.addElement("queries"); if (bandDefinition.getReportQueries() != null) { for (ReportQuery reportQuery : bandDefinition.getReportQueries()) { Element reportQueryElement = reportQueriesElement.addElement("query"); reportQueryElement.addAttribute("name", reportQuery.getName()); reportQueryElement.addAttribute("type", reportQuery.getLoaderType()); reportQueryElement.addElement("script").setText(reportQuery.getScript()); } } if (bandDefinition.getChildren() != null) { for (ReportBand childBandDefinition : bandDefinition.getChildren()) { Element childBandElement = childrenBandsElement.addElement("band"); writeBandDefinition(childBandElement, childBandDefinition); } } } }