Implementation Guide for Oracle Self-Service E-Billing > Using the Reporting Engine > Components Used by the Reporting Engine >

Integration with Struts and Tiles


The Reporting Engine can be used with any presentation framework. However, because Oracle Self-Service E-Billling is based on Struts and Tiles, the Reporting Engine has special extensions to help it integrate with Struts and Tiles. This topic describes that integration.

Struts Action Class

The Struts action class does following processing:

ReportContext ctx = new ReportContext()
ctx.put(...) //put whatever your stuff used in template
IReportActionHelper helper = ReportManager.getReportActionHelper()
IReport report = helper.execute(ctx, form, request, response); //IReport will be in session

return mapping.findForward(" page.reports.report ");

It creates a ReportContext object which you can put your own objects into. These objects can then be used in report templates. Then it calls IReportActionHelper.execute() method to get an IReport object. If this is the first time to access the report, a new IReport object will be created; if this is a sorting or paging operation, the IReport object cached in the session will be returned. In case a new IReport object is necessary, the report data will be retrieved from the DataSource defined in the report XML of this reportId.

Next it calls IReportActionHelper.execute() method to get an IReport object. If this is the first time to access the report, a new IReport object will be created; if this is a sorting or paging operation, the IReport object cached in the session will be returned. In case a new IReport object is necessary, the report data will be retrieved from the DataSource defined in the report XML of this reportId.

For the last action of this class, control is forwarded to the tile, page.reports.report, which is defined in the tiles definition file.

Tiles Definition

Tiles are defined in the ebilling-tiles-defs.xml file in the WAR file of the EAR file.

<definition name="page.reports.report" extends="simpleLayout_1">

<put name="pageName" value="Billing Report"/>

<put name="leftBar" value="/_includes/sidebar_left_analytics.jsp"/>

<put name="pageDesc" value=""/>

<put name="header" value="/_includes/header_analytics.jsp"/>

<put name="footer" value="/_includes/footer_relative.jsp"/>

<put name="subtab" value="/_includes/subtab_billing.jsp"/>

<put name="body" value="/reporting/report.jsp"/>

</definition>

The key to this tile is that the body tile is report.jsp, which generates the main body of reporting UI.

Report.jsp

The report.jsp page is used to render the view. In fact, there is almost no HTML code in this page. Instead, this page just invokes the Velocity template engine to parse the templates:

IReport report = (IReport)request.getSession().getAttribute(reportId);

IReport.writeTemplate(jspWriter, templateId);
//template is the one defined in report xml and default to "HTML_TEMPLATE"

The Reporting Engine goes through the Transformers defined in the report XML for this reportId and for each transformer, parsing the template whose ID matches templateId. Note a transformer will be ignored if it has no template with a matching templateId defined in the transformer configuration of the report XML.

The matching templates will be parsed in the same order as defined in the report XML, and the results will be written back into JSPWriter sequentially.

Implementation Guide for Oracle Self-Service E-Billing Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices.