Customizing the InternetExpress Page Producer Template
The template of an InternetExpress page producer is an HTML document with extra embedded tags that your application translates dynamically. Initially, the page producer generates a default template as the value of the HTMLDoc property. This default template has the form:
<HTML> <HEAD> </HEAD> <BODY> <#INCLUDES> <#STYLES> <#WARNINGS> <#FORMS> <#SCRIPT> </BODY> </HTML>
The HTML-transparent tags in the default template are translated as follows:
- <#STYLES> generates the statements that define a style sheet from definitions listed in the Styles or StylesFile property of the InternetExpress page producer.
- <#WARNINGS> generates nothing at run time. At design time, it adds warning messages for problems detected while generating the HTML document. You can see these messages in the Web page editor.
- <#FORMS> generates the HTML produced by the components that you add in the Web page editor. The HTML from each component is generated in the order it appears in WebPageItems.
You can replace the default template by changing the value of HTMLDoc or setting the HTMLFile property. The customized HTML template can include any of the HTML-transparent tags that make up the default template. The InternetExpress page producer automatically translates these tags when you call the Content method. In addition, the InternetExpress page producer automatically translates three additional tags:
- <#BODYELEMENTS> is replaced by the same HTML as results from the 5 tags in the default template. It is useful when generating a template in an HTML editor when you want to use the default layout but add additional elements using the editor.
- <#COMPONENT Name=WebComponentName> is replaced by the HTML that the component named WebComponentName generates. This component can be one of the components added in the Web page editor, or it can be any component that supports the WebComp.IWebContent interface and has the same Owner as the InternetExpress page producer.
- <#DATAPACKET XMLBroker=BrokerName> is replaced with the XML data packet obtained from the XML broker specified by BrokerName. When, in the Web page editor, you see the HTML that the InternetExpress page producer generates, you see this tag instead of the actual XML data packet.
In addition, the customized template can include any other HTML-transparent tags that you define. When the InternetExpress page producer encounters a tag that is not one of the seven types it translates automatically, it generates an HTML template.
Tip: The components that appear in the Web page editor generate static code. That is, unless the application server changes the metadata that appears in data packets, the HTML is always the same, no matter when it is generated. You can avoid the overhead of generating this code dynamically at run time in response to every request message by copying the generated HTML in the Web page editor and using it as a template. Because the Web page editor displays a <#DATAPACKET> tag instead of the actual XML, using this as a template still allows your application to fetch data packets from the application server dynamically.