private Object readResolve() throws ObjectStreamException { return getOutputTypeById(id); } }
outputName = format("%s.%s", StringUtils.substringBeforeLast(outputName, "."), finalOutputType.getId());
outputName = format("%s.%s", StringUtils.substringBeforeLast(outputName, "."), finalOutputType.getId());
private Object readResolve() throws ObjectStreamException { return getOutputTypeById(id); } }
throw wrapWithReportingException("An error occurred while saving result report", e); } catch (IOException e) { throw wrapWithReportingException("An error occurred while saving result report to " + outputType.getId(), e); } finally { IOUtils.closeQuietly(outputStream);
protected Map<String, ReportTemplate> parseTemplates(Element rootElement) throws IOException { Element templatesElement = rootElement.element("templates"); List<Element> templates = templatesElement.elements("template"); Map<String, ReportTemplate> templateMap = new HashMap<String, ReportTemplate>(); for (Element template : templates) { String code = template.attribute("code").getText(); String documentName = template.attribute("documentName").getText(); String documentPath = template.attribute("documentPath").getText(); String outputType = template.attribute("outputType").getText(); String outputNamePattern = template.attribute("outputNamePattern").getText(); ReportTemplate reportTemplate = new ReportTemplateBuilder() .code(code) .documentName(documentName) .documentPath(documentPath) .documentContent(getDocumentContent(documentPath)) .outputType(ReportOutputType.getOutputTypeById(outputType)) .outputNamePattern(outputNamePattern).build(); templateMap.put(reportTemplate.getCode(), reportTemplate); } return templateMap; }
throw wrapWithReportingException("An error occurred while saving result report", e); } catch (IOException e) { throw wrapWithReportingException("An error occurred while saving result report to " + outputType.getId(), e); } finally { IOUtils.closeQuietly(outputStream);
protected Map<String, ReportTemplate> parseTemplates(Element rootElement) throws IOException { Element templatesElement = rootElement.element("templates"); List<Element> templates = templatesElement.elements("template"); Map<String, ReportTemplate> templateMap = new HashMap<String, ReportTemplate>(); for (Element template : templates) { String code = template.attribute("code").getText(); String documentName = template.attribute("documentName").getText(); String documentPath = template.attribute("documentPath").getText(); String outputType = template.attribute("outputType").getText(); String outputNamePattern = template.attribute("outputNamePattern").getText(); ReportTemplate reportTemplate = new ReportTemplateBuilder() .code(code) .documentName(documentName) .documentPath(documentPath) .documentContent(getDocumentContent(documentPath)) .outputType(ReportOutputType.getOutputTypeById(outputType)) .outputNamePattern(outputNamePattern).build(); templateMap.put(reportTemplate.getCode(), reportTemplate); } return templateMap; }
if (document.getReportOutputType().getId().equals(CubaReportOutputType.chart.getId())) { Map<String, Object> screenParams = new HashMap<>(); screenParams.put(ShowChartController.CHART_JSON_PARAMETER, new String(document.getContent(), StandardCharsets.UTF_8)); wm.openWindow(windowInfo, OpenType.DIALOG, screenParams); } else if (document.getReportOutputType().getId().equals(CubaReportOutputType.pivot.getId())) { Map<String, Object> screenParams = ParamsMap.of( ShowPivotTableController.PIVOT_TABLE_DATA_PARAMETER, document.getContent(), wm.openWindow(windowInfo, OpenType.DIALOG, screenParams); } else if (document.getReportOutputType().getId().equals(CubaReportOutputType.table.getId())) { Map<String, Object> screenParams = new HashMap<>(); screenParams.put(ShowReportTable.TABLE_DATA_PARAMETER, document.getContent());
protected void writeTemplates(Report report, Element root) { Map<String, ReportTemplate> reportTemplates = report.getReportTemplates(); Element reportTemplatesElement = root.addElement("templates"); for (ReportTemplate reportTemplate : reportTemplates.values()) { Element reportTemplateElement = reportTemplatesElement.addElement("template"); reportTemplateElement.addAttribute("code", reportTemplate.getCode()); reportTemplateElement.addAttribute("documentName", reportTemplate.getDocumentName()); reportTemplateElement.addAttribute("documentPath", reportTemplate.getDocumentPath()); reportTemplateElement.addAttribute("outputType", reportTemplate.getOutputType().getId()); reportTemplateElement.addAttribute("outputNamePattern", reportTemplate.getOutputNamePattern()); } }
protected void writeTemplates(Report report, Element root) { Map<String, ReportTemplate> reportTemplates = report.getReportTemplates(); Element reportTemplatesElement = root.addElement("templates"); for (ReportTemplate reportTemplate : reportTemplates.values()) { Element reportTemplateElement = reportTemplatesElement.addElement("template"); reportTemplateElement.addAttribute("code", reportTemplate.getCode()); reportTemplateElement.addAttribute("documentName", reportTemplate.getDocumentName()); reportTemplateElement.addAttribute("documentPath", reportTemplate.getDocumentPath()); reportTemplateElement.addAttribute("outputType", reportTemplate.getOutputType().getId()); reportTemplateElement.addAttribute("outputNamePattern", reportTemplate.getOutputNamePattern()); } }