Projects:Add HTML Export In ProcessDefinition Reports/Technical Specifications
Contents |
Technical Specification
Tables
In order to add HTML output to Process Definition reports, a new column named HTML_TEMPLATE was added to OBUIAPP_REPORT table, to hold the value of the template to use when generating HTML output.
Together with this column another column USE_PDF_AS_HTML_TEMPLATE is going to be added, it will be used to specify if the template specified for the PDF format must be used for the HTML output also.
Windows
The corresponding fields for the columns mentioned in the previous section were added to the Report Definition tab of the Process Definition window.
Action Handlers
The BaseReportActionHandler java class was enhanced to allow passing data into the reports, apply logic in the selection of the report template to use, and allow report generation in HTML format:
- A new protected method getReportTemplatePath was added as a placeholder for the logic for report template selection. The default implementation retrieves the templates defined in the Report Definition tab of the Process Definition window.
- A new protected method getReportData was added to return the JRDataSource object to pass to the report.
- A new method getReportConnectionProvider was added to return the ConnectionProvider object to use in report generation.
- When generating a report in HTML format, a new response action OBUIAPP_browseReport is invoked, to trigger the browsing of the generated HTML report in a new tab of the application.
- A new private method was added to return the generated report back to the browser.
Client side components and scripts
A new method isHtmlExport was added to the ParameterWindowComponent java class, to get whether the HTML template is defined for the Report Definition.
The Freemarker template ob-pick-and-execute-view-window.js.ftl was modified to add a new property htmlExport.
The method setAllButtonEnabled of the OBBaseParameterWindowView javascript class, defined in the file ob-base-parameter-window-view.js, was modified to allow enabling/disabling the button that triggers the HTML output.
The javascript class OBParameterWindowView, defined in the file ob-parameter-window-view.js, was modified to:
- Hold the new property htmlExport.
- Register the new property in the Test Registry.
- Create a new button associated with the property.
- Set the focus to the new created button, if defined.
The new response action OBUIAPP_browseReport was defined in the file ob-utilities-action-def.js to browse the gerenated HTML report in a new tab of the application.