public RunParams(Report report) { this.report = report; this.reportTemplate = report.getReportTemplates().get(ReportTemplate.DEFAULT_TEMPLATE_CODE); }
public RunParams(Report report) { this.report = report; this.reportTemplate = report.getReportTemplates().get(ReportTemplate.DEFAULT_TEMPLATE_CODE); }
/** * Setup necessary template by string code. Throws validation exception if code is null or template not found * @param templateCode - string code of template */ public RunParams templateCode(String templateCode) { if (templateCode == null) { throw new NullPointerException("\"templateCode\" parameter can not be null"); } this.reportTemplate = report.getReportTemplates().get(templateCode); if (reportTemplate == null) { throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode)); } return this; }
/** * Setup necessary template by string code. Throws validation exception if code is null or template not found * @param templateCode - string code of template */ public RunParams templateCode(String templateCode) { if (templateCode == null) { throw new NullPointerException("\"templateCode\" parameter can not be null"); } this.reportTemplate = report.getReportTemplates().get(templateCode); if (reportTemplate == null) { throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode)); } return this; }
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()); } }