Package wt.query.template
Class ReportTemplateHelper
java.lang.Object
wt.query.template.ReportTemplateHelper
This is a helper class which contains the implementation for processing XML Source which defines a report.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbindParameters(XMLSource a_qmlSource, StatementSpec a_statementSpec, Hashtable a_parameterMap) Deprecated.static HashtablebuildParameterMap(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(ReportTemplate a_reportTemplate) This method is used to build an array of ParameterTemplate objects from the specified ReportTemplate.static ParameterTemplate[]buildParameterTemplates(XMLSource a_qmlSource) This method is used to build a Vector of ParameterTemplate objects from the specified XMLSource.static StatementSpecbuildStatement(XMLSource a_qmlSource, Locale a_locale, Hashtable a_parameterMap) Deprecated.Use buildStatement(XMLSource,Locale,Hashtable,Integer)static StatementSpecbuildStatement(XMLSource a_qmlSource, Locale a_locale, Hashtable a_parameterMap, Integer a_queryLimit) This method is used to build the Statement given the QML XMLSource, locale and parameters.static StringconcatMediaTypeAndEncoding(String mediaType, String encoding) Concatenate a MIME type string (without encoding information) and encoding information.static XMLSourcegenerateReport(ReportTemplate a_reportTemplate, Hashtable params, Locale locale) This method generates a standard report in XML format.static XMLSourcegenerateReport(ReportTemplate a_reportTemplate, Hashtable params, Locale locale, XMLSource resultSource) This method generates a standard report in XML format.static QueryResultgenerateResults(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 QueryResultgenerateResults(ReportTemplate a_reportTemplate, Hashtable a_inputs, Locale a_locale) This method is used to generate a QueryResult from the Report Template and locale.static QueryResultgenerateResults(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 TableModelgenerateTableModel(String a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef, boolean forClient) This method is used to generate a TableModel from QML source and parameter input values.static TableModelgenerateTableModel(ReportTemplate a_ReportTemplate, Hashtable a_inputs) Deprecated.as of R7.0, use generateTableModel(ReportTemplate, Hashtable, Locale)static TableModelgenerateTableModel(ReportTemplate a_ReportTemplate, Hashtable a_inputs, Locale a_locale, boolean forClient) This method is used to generate a TableModel from a Report Template and parameter input values.static TableModelgenerateTableModel(XMLSource a_qmlSource, Hashtable a_inputs, Locale a_locale, WTContainerRef a_containerRef, boolean forClient) This method is used to generate a TableModel from QML source and parameter input values.static XMLSourcegenerateXML(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 XMLSourcegenerateXML(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 EnumerationReturn an enumeration of available macros that can be used in ParameterTemplate processing.static ListgetAvailableXSLFormats(Locale a_locale) Return an List of available XSL formats that can be used in report processing.static URLgetExecuteReportURL(Properties a_properties, ReportTemplate a_reportTemplate) This method is used to construct the URL to execute the report.static StringgetFileTypeExtension(String a_outputMimeType) Deprecated.static URLgetGenerateFormURL(Properties a_properties, ReportTemplate a_reportTemplate) This method is used to construct the URL for the report generation form.static ReportPostProcessorgetPostProcessor(String originalMimeType) Get an instance of a post-processor for a given MIME type if one has been registered, else returns null.static EnumerationReturn an enumeration of query class names that should be included in the list of available query classes.static XSLTransformgetTransform(XSLSpec xslSpec, XMLSource reportSource, Properties xslProperties, Locale locale) This method derives an XSLTransform object from the specified parameters.static XSLSpecgetXSLSpec(ReportMetadata a_report, Hashtable params) This method derives an XSLSpec object from the specified ReportTemplate and parameters.static XSLSpecgetXSLSpec(ReportTemplate a_reportTemplate, Hashtable params) This method derives an XSLSpec object from the specified ReportTemplate and parameters.processParameterMap(Hashtable a_parameterMap, Locale a_locale) This method is used to build a Hashtable of actual values from ParameterTemplate objects and an input Hashtable.
-
Method Details
-
buildParameterTemplates
public static ParameterTemplate[] buildParameterTemplates(ReportTemplate a_reportTemplate) throws WTException This method is used to build an array of ParameterTemplate objects from the specified ReportTemplate.
Supported API: true- Parameters:
a_reportTemplate- Input QML representation of a query- Returns:
- ParameterTemplate[]
- Throws:
WTException
-
buildParameterTemplates
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 reporta_inputs- Parameter input name and value pairsuse_defaults-- Returns:
- Hashtable
- Throws:
WTException
-
processParameterMap
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 reporta_inputs- Parameter input name and value pairsuse_defaults-- Returns:
- Hashtable
- Throws:
WTException
-
bindParameters
@Deprecated public static void bindParameters(XMLSource a_qmlSource, StatementSpec a_statementSpec, Hashtable a_parameterMap) throws WTException Deprecated.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 querya_statementSpec- Bind parameter values will be bound to this instance.a_parameterMap- Parameter input name and value pairs- Throws:
WTException
-
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, boolean forClient) 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-forClient-- 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 sourceparams- Parameter arguments to use as input for the report query.locale- Locale to use for localized text- Returns:
- XMLSource
- Throws:
WTException
-
getXSLSpec
public static 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
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(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 sourceparams- Parameter arguments to use as input for the report query.locale- Locale to use for localized textresultSource- 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
@Deprecated 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, boolean forClient) 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, boolean forClient) 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
@Deprecated public static StatementSpec buildStatement(XMLSource a_qmlSource, Locale a_locale, Hashtable a_parameterMap) throws WTException Deprecated.Use buildStatement(XMLSource,Locale,Hashtable,Integer)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
-
buildStatement
public static StatementSpec buildStatement(XMLSource a_qmlSource, Locale a_locale, Hashtable a_parameterMap, Integer a_queryLimit) 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
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
Deprecated.This method will set the file extension type for the MIME type.
Supported API: true- Parameters:
a_outputMimeType-- Returns:
- String
- Throws:
WTException
-
getAvailableXSLFormats
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
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
Concatenate a MIME type string (without encoding information) and encoding information.
Supported API: true- Parameters:
mediaType- MIME type string without encoding informationencoding- character encoding name- Returns:
- String
-