wt.query.template
Class ReportTemplateHelper

java.lang.Object
  extended by wt.query.template.ReportTemplateHelper
All Implemented Interfaces:
RemoteAccess

public class ReportTemplateHelper
extends Object
implements RemoteAccess

This is a helper class which contains the implementation for processing XML Source which defines a report.

Supported API: true

Extendable: false


Method Summary
static void bindParameters(XMLSource a_qmlSource, StatementSpec a_statementSpec, Hashtable a_parameterMap)
          This method is used to bind parameters from a name and value Hashtable to a StatementSpec instance.
static Hashtable buildParameterMap(ParameterTemplate[] a_parameterTemplates, Hashtable a_inputs, boolean use_defaults)
          This method is used to build a Hashtable of actual values from ParameterTemplate objects and an input Hashtable.
static ParameterTemplate[] buildParameterTemplates(XMLSource a_qmlSource)
          This method is used to build a Vector of ParameterTemplate objects from the specified XMLSource.
static StatementSpec buildStatement(XMLSource a_qmlSource, Locale a_locale, Hashtable a_parameterMap)
          This method is used to build the Statement given the QML XMLSource, locale and parameters.
static String concatMediaTypeAndEncoding(String mediaType, String encoding)
          Concatenate a MIME type string (without encoding information) and encoding information.
static XMLSource generateReport(ReportTemplate a_reportTemplate, Hashtable params, Locale locale)
          This method generates a standard report in XML format.
static XMLSource generateReport(ReportTemplate a_reportTemplate, Hashtable params, Locale locale, XMLSource resultSource)
          This method generates a standard report in XML format.
static QueryResult generateResults(ReportTemplate a_reportTemplate, Hashtable a_inputs, Locale a_locale)
          This method is used to generate a QueryResult from the Report Template and locale.
static QueryResult generateResults(String a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef)
          This method is used to generate a QueryResult from the QML specification and locale.
static QueryResult generateResults(XMLSource a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef)
          This method is used to generate a QueryResult from the QML specification and locale.
static TableModel generateTableModel(ReportTemplate a_ReportTemplate, Hashtable a_inputs)
          Deprecated. as of R7.0, use generateTableModel(ReportTemplate, Hashtable, Locale)
static TableModel generateTableModel(ReportTemplate a_ReportTemplate, Hashtable a_inputs, Locale a_locale)
          This method is used to generate a TableModel from a Report Template and parameter input values.
static TableModel generateTableModel(String a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef)
          This method is used to generate a TableModel from QML source and parameter input values.
static TableModel generateTableModel(XMLSource a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef)
          This method is used to generate a TableModel from QML source and parameter input values.
static XMLSource generateXML(ReportTemplate a_reportTemplate, Hashtable a_inputs, Locale a_locale)
          This method takes a Report Template as input and is used to execute the report query and return the results as an XMLSource.
static XMLSource generateXML(XMLSource a_qmlSource, Hashtable a_inputs, Locale a_locale)
          This method takes a Report Template and paramters as input and is used to execute the report query and return the results as an XMLSource.
static Enumeration getAvailableMacros()
          Return an enumeration of available macros that can be used in ParameterTemplate processing.
static List getAvailableXSLFormats(Locale a_locale)
          Return an List of available XSL formats that can be used in report processing.
static URL getExecuteReportURL(Properties a_properties, ReportTemplate a_reportTemplate)
          This method is used to construct the URL to execute the report.
static String getFileTypeExtension(String a_outputMimeType)
          This method will set the file extension type for the MIME type.
static URL getGenerateFormURL(Properties a_properties, ReportTemplate a_reportTemplate)
          This method is used to construct the URL for the report generation form.
static ReportPostProcessor getPostProcessor(String originalMimeType)
          Get an instance of a post-processor for a given MIME type if one has been registered, else returns null.
static Enumeration getQueryClassNames()
          Return an enumeration of query class names that should be included in the list of available query classes.
static XSLTransform getTransform(wt.query.template.XSLSpec xslSpec, XMLSource reportSource, Properties xslProperties, Locale locale)
          This method derives an XSLTransform object from the specified parameters.
static wt.query.template.XSLSpec getXSLSpec(ReportMetadata a_report, Hashtable params)
          This method derives an XSLSpec object from the specified ReportTemplate and parameters.
static wt.query.template.XSLSpec getXSLSpec(ReportTemplate a_reportTemplate, Hashtable params)
          This method derives an XSLSpec object from the specified ReportTemplate and parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildParameterTemplates

public static ParameterTemplate[] buildParameterTemplates(XMLSource a_qmlSource)
                                                   throws WTException
This method is used to build a Vector of ParameterTemplate objects from the specified XMLSource.

Supported API: true

Parameters:
a_qmlSource - Input QML representation of a query
Returns:
ParameterTemplate[]
Throws:
WTException

buildParameterMap

public static Hashtable buildParameterMap(ParameterTemplate[] a_parameterTemplates,
                                          Hashtable a_inputs,
                                          boolean use_defaults)
                                   throws WTException
This method is used to build a Hashtable of actual values from ParameterTemplate objects and an input Hashtable.

Supported API: true

Parameters:
a_parameterTemplates - Array of ParameterTemplate instances for a report
a_inputs - Parameter input name and value pairs
use_defaults -
Returns:
Hashtable
Throws:
WTException

bindParameters

public static void bindParameters(XMLSource a_qmlSource,
                                  StatementSpec a_statementSpec,
                                  Hashtable a_parameterMap)
                           throws WTException
This method is used to bind parameters from a name and value Hashtable to a StatementSpec instance. The specified QML indicates the bind parameter offests.

Supported API: true

Parameters:
a_qmlSource - Input QML representation of a query
a_statementSpec - Bind parameter values will be bound to this instance.
a_parameterMap - Parameter input name and value pairs
Throws:
WTException

getAvailableMacros

public static Enumeration getAvailableMacros()
Return an enumeration of available macros that can be used in ParameterTemplate processing. These values are specified in a service properties file.

Supported API: true

Returns:
Enumeration

getGenerateFormURL

public static URL getGenerateFormURL(Properties a_properties,
                                     ReportTemplate a_reportTemplate)
                              throws WTException
This method is used to construct the URL for the report generation form.

Supported API: true

Parameters:
a_properties - Additional properties to include in the URL. If null, then no additional properties are added.
a_reportTemplate - Context object for the URL. If null, then the context object is not added.
Returns:
URL
Throws:
WTException

getExecuteReportURL

public static URL getExecuteReportURL(Properties a_properties,
                                      ReportTemplate a_reportTemplate)
                               throws WTException
This method is used to construct the URL to execute the report.

Supported API: true

Parameters:
a_properties - Additional properties to include in the URL. If null, then no additional properties are added.
a_reportTemplate - Context object for the URL. If null, then the context object is not added.
Returns:
URL
Throws:
WTException

generateTableModel

public static TableModel generateTableModel(ReportTemplate a_ReportTemplate,
                                            Hashtable a_inputs,
                                            Locale a_locale)
                                     throws WTException
This method is used to generate a TableModel from a Report Template and parameter input values. A statement is built and executed using the specified inputs. The results are then returned in the TableModel.

Supported API: true

Parameters:
a_ReportTemplate -
a_inputs -
a_locale -
Returns:
TableModel
Throws:
WTException

generateReport

public static XMLSource generateReport(ReportTemplate a_reportTemplate,
                                       Hashtable params,
                                       Locale locale)
                                throws WTException
This method generates a standard report in XML format.

Supported API: true

Parameters:
a_reportTemplate - ReportTemplate instance to use as the report source
params - Parameter arguments to use as input for the report query.
locale - Locale to use for localized text
Returns:
XMLSource
Throws:
WTException

getXSLSpec

public static wt.query.template.XSLSpec getXSLSpec(ReportTemplate a_reportTemplate,
                                                   Hashtable params)
                                            throws WTException
This method derives an XSLSpec object from the specified ReportTemplate and parameters. The input parameters are used initially. If the format type (key="format") is custom (value="formatCustom"), then the XSL URLs specified by the keys, "xsl1" and "xsl2" are used. If the format type is delegate (value="formatDelegate"), then the delegate name specified by the key, "delegateName", is used to look up an XSL resource using Application Context Services. The resource name is used to reference the XSL file relative to codebase. If these parameters are not specified, then the XSL is obtained from the ReportTemplate. Finally, if this XSL value is null, then a simple HTML XSL specification is returned.

Supported API: true

Parameters:
a_reportTemplate - ReportTemplate object to derive the XSLSpec from.
params - Parameters to use to derive XSLSpec.
Returns:
XSLSpec instance to use as an XSL transform for the report.
Throws:
WTException

getXSLSpec

public static wt.query.template.XSLSpec getXSLSpec(ReportMetadata a_report,
                                                   Hashtable params)
                                            throws WTException
This method derives an XSLSpec object from the specified ReportTemplate and parameters. The input parameters are used initially. If the format type (key="format") is custom (value="formatCustom"), then the XSL URLs specified by the keys, "xsl1" and "xsl2" are used. If the format type is delegate (value="formatDelegate"), then the delegate name specified by the key, "delegateName", is used to look up an XSL resource using Application Context Services. The resource name is used to reference the XSL file relative to codebase. If these parameters are not specified, then the XSL is obtained from the ReportTemplate. Finally, if this XSL value is null, then a simple HTML XSL specification is returned.

Supported API: true

Parameters:
a_report - ReportMetadata object to derive the XSLSpec from.
params - Parameters to use to derive XSLSpec.
Returns:
XSLSpec instance to use as an XSL transform for the report.
Throws:
WTException

getTransform

public static XSLTransform getTransform(wt.query.template.XSLSpec xslSpec,
                                        XMLSource reportSource,
                                        Properties xslProperties,
                                        Locale locale)
                                 throws WTException
This method derives an XSLTransform object from the specified parameters. The XSLSpec instance is used to determine the XSL transformations that are applied to the report source. The xslProperties are passed to the factory instance that creates the XSLTransform objects.

Supported API: true

Parameters:
xslSpec - Specifies the XSL transforms that will be applied.
reportSource - Report source that will be transformed.
xslProperties - Properties passed to the factory creating the XSLTransform objects.
locale - Specifies the Locale that will be applied.
Returns:
XSLTransform that will generate the report source transformation.
Throws:
WTException

generateReport

public static XMLSource generateReport(ReportTemplate a_reportTemplate,
                                       Hashtable params,
                                       Locale locale,
                                       XMLSource resultSource)
                                throws WTException
This method generates a standard report in XML format.

Supported API: true

Parameters:
a_reportTemplate - ReportTemplate instance to use as the report source
params - Parameter arguments to use as input for the report query.
locale - Locale to use for localized text
resultSource - Result XML source to use in the report
Returns:
XMLSource
Throws:
WTException

generateXML

public static XMLSource generateXML(ReportTemplate a_reportTemplate,
                                    Hashtable a_inputs,
                                    Locale a_locale)
                             throws WTException
This method takes a Report Template as input and is used to execute the report query and return the results as an XMLSource. In addition, the locale is made available for localization of the data.

Supported API: true

Parameters:
a_reportTemplate -
a_inputs -
a_locale -
Returns:
XMLSource
Throws:
WTException

generateTableModel

public static TableModel generateTableModel(ReportTemplate a_ReportTemplate,
                                            Hashtable a_inputs)
                                     throws WTException
Deprecated. as of R7.0, use generateTableModel(ReportTemplate, Hashtable, Locale)

This method is used to generate a TableModel from a Report Template and parameter input values. A statement is built and executed using the specified inputs. The results are then returned in the TableModel.

Supported API: true

Parameters:
a_ReportTemplate -
a_inputs -
Returns:
TableModel
Throws:
WTException

generateTableModel

public static TableModel generateTableModel(XMLSource a_qmlSource,
                                            Hashtable a_inputs,
                                            Locale a_locale,
                                            WTContainerRef a_containerRef)
                                     throws WTException
This method is used to generate a TableModel from QML source and parameter input values. A statement is built and executed using the specified inputs. The results are then returned in the TableModel.

Supported API: true

Parameters:
a_qmlSource -
a_inputs -
a_locale -
a_containerRef - The container context to execute this query in.
Returns:
TableModel
Throws:
WTException

generateXML

public static XMLSource generateXML(XMLSource a_qmlSource,
                                    Hashtable a_inputs,
                                    Locale a_locale)
                             throws WTException
This method takes a Report Template and paramters as input and is used to execute the report query and return the results as an XMLSource.

Supported API: true

Parameters:
a_qmlSource -
a_inputs -
a_locale -
Returns:
XMLSource
Throws:
WTException

generateTableModel

public static TableModel generateTableModel(String a_qmlSource,
                                            Hashtable a_inputs,
                                            Locale a_locale,
                                            WTContainerRef a_containerRef)
                                     throws WTException
This method is used to generate a TableModel from QML source and parameter input values. A statement is built and executed using the specified inputs. The results are then returned in the TableModel.

Supported API: true

Parameters:
a_qmlSource -
a_inputs -
a_locale -
a_containerRef - The container context to execute this query in.
Returns:
TableModel
Throws:
WTException

generateResults

public static QueryResult generateResults(String a_qmlSource,
                                          Hashtable a_inputs,
                                          Locale a_locale,
                                          WTContainerRef a_containerRef)
                                   throws WTException
This method is used to generate a QueryResult from the QML specification and locale. A statement is built and executed and the QueryResult is returned. This method can be called from the client and will be indirectly executed remotely.

Supported API: true

Parameters:
a_qmlSource -
a_inputs -
a_locale -
a_containerRef - The container context to execute this query in.
Returns:
QueryResult
Throws:
WTException

generateResults

public static QueryResult generateResults(ReportTemplate a_reportTemplate,
                                          Hashtable a_inputs,
                                          Locale a_locale)
                                   throws WTException
This method is used to generate a QueryResult from the Report Template and locale. A statement is built and executed and the QueryResult is returned. This method can be called from the client and will be indirectly executed remotely.

Supported API: true

Parameters:
a_reportTemplate -
a_inputs -
a_locale -
Returns:
QueryResult
Throws:
WTException

generateResults

public static QueryResult generateResults(XMLSource a_qmlSource,
                                          Hashtable a_inputs,
                                          Locale a_locale,
                                          WTContainerRef a_containerRef)
                                   throws WTException
This method is used to generate a QueryResult from the QML specification and locale. A statement is built and executed and the QueryResult is returned. This method can be called from the client and will be indirectly executed remotely.

Supported API: true

Parameters:
a_qmlSource -
a_inputs -
a_locale -
a_containerRef - The container context to execute this query in.
Returns:
QueryResult
Throws:
WTException

buildStatement

public static StatementSpec buildStatement(XMLSource a_qmlSource,
                                           Locale a_locale,
                                           Hashtable a_parameterMap)
                                    throws WTException
This method is used to build the Statement given the QML XMLSource, locale and parameters.

Supported API: true

Parameters:
a_qmlSource -
a_locale -
a_parameterMap -
Returns:
StatementSpec
Throws:
WTException

getQueryClassNames

public static Enumeration getQueryClassNames()
Return an enumeration of query class names that should be included in the list of available query classes. The class names are specified as a resource in a service properties file.

Supported API: true

Returns:
Enumeration

getFileTypeExtension

public static String getFileTypeExtension(String a_outputMimeType)
                                   throws WTException
This method will set the file extension type for the MIME type.

Supported API: true

Parameters:
a_outputMimeType -
Returns:
String
Throws:
WTException

getAvailableXSLFormats

public static List getAvailableXSLFormats(Locale a_locale)
Return an List of available XSL formats that can be used in report processing. These values are specified in a service properties file and may be overriden with locale specific XSL formats. All specified formats will be available for a given locale unless the service properties entry for the locale specifies a null XSL path ("NULL").

Supported API: true

Parameters:
a_locale - Locale to use to look up XSL formats
Returns:
List of available XSL formats

getPostProcessor

public static ReportPostProcessor getPostProcessor(String originalMimeType)
Get an instance of a post-processor for a given MIME type if one has been registered, else returns null.

Supported API: true

Parameters:
originalMimeType - original MIME type of report result
Returns:
ReportPostProcessor

concatMediaTypeAndEncoding

public static String concatMediaTypeAndEncoding(String mediaType,
                                                String encoding)
Concatenate a MIME type string (without encoding information) and encoding information.

Supported API: true

Parameters:
mediaType - MIME type string without encoding information
encoding - character encoding name
Returns:
String