Previous Next Contents Index


ITemplateMap interface (deprecated)

ITemplateMap is deprecated and is provided for backward compatibility only. New Java applications should use the standard servlet-JSP programming model.

For information about replacing ITemplateMap functionality in existing applications, see the Migration Guide.

The ITemplateMap interface represents a mapping between a template field specification and dynamic data used for HTML template processing. ITemplateMap provides the get( ) method for resolving the id attribute in a GX markup tag. Each id attribute contains a field name that can be mapped.

To create a field map, an AppLogic calls GX.CreateTemplateMapBasic( ). The AppLogic then populates the field map using put( ), in the TemplateMapBasic class (deprecated), for each field mapping, then passes this ITemplateMap object as the map parameter in evalTemplate( ) or evalOutput( ) in the AppLogic class (deprecated). When the Template Engine encounters a GX markup tag with the id attribute while processing the template, it calls get( ) in the ITemplateMap interface (deprecated) to resolve the name. The get( ) method, in turn, calls getString( ) in the TemplateMapBasic class (deprecated) to actually resolve the name.

To provide application-specific special processing, an AppLogic can subclass the TemplateMapBasic class (deprecated) and override the getString( ) method to hook into the Template Engine generation process. For example, the AppLogic can intercept and filter data from a database before the Template Engine processes it.

Package
com.kivasoft

Method
get( )
Resolves the id attribute specified in a GX markup tag in the template being processed by the Template Engine. This method is called by the Template Engine.

Related Topics
evalTemplate( ) and evalOutput( ) in the AppLogic class (deprecated)

TemplateMapBasic class (deprecated)

ITemplateData interface (deprecated)

TemplateDataBasic class (deprecated)

get( )
Resolves the id attribute specified in a GX markup tag in the template being processed by the Template Engine. This method is called by the Template Engine.

Syntax
public IBuffer get(
	String szExpr,
	IObject pData,
	IObject pMark)

szExpr. In the current GX markup tag in the HTML template being processed, the name of the field, or placeholder, assigned to the id attribute. Must be an identical match (case-sensitive).

pData. Specify null. Internal use only.

pMark. Specify null. Internal use only.

Usage
GX markup tags are used in an HTML template to identify where dynamic data appears in the output report. In the GX markup tags, the id attribute specifies any of the following items: the name of a flat query within a hierarchical query, a field in the hierarchical result set or TemplateDataBasic object, or an HTML template. The type of item specified in the id attribute depends on the type attribute that is specified in the same GX markup tag.

The Template Engine calls get( ) to resolve theid attribute specified in a GX markup tag in the template being processed by the Template Engine. The get( ) method, in turn, calls getString( ) in the TemplateMapBasic class (deprecated) to actually resolve the name. To provide application-specific special processing, an AppLogic can subclass the TemplateMapBasic class (deprecated) and override getString( ) to manipulate the Template Engine generation process. For example, an AppLogic can intercept and filter data from a database before the Template Engine processes it.

Return Value
An IBuffer object that contains the value of the id mapping, or null for failure.

Related Topics
evalTemplate( ) and evalOutput( ) in the AppLogic class (deprecated)

getString( ) in theTemplateMapBasic class (deprecated)

ITemplateData interface (deprecated)

TemplateDataBasic class (deprecated)

 

© Copyright 1999 Netscape Communications Corp.