Building WAP Content Modules

WAP content is created by subroutine modules.  These modules must generate all of the <card> content that is to be sent to the browser.  The content must be a WML-formatted deck containing one or more cards.

The content building modules do not and should not supply the document header or the <wml> </wml> tags as this task falls to the utility module, WAPSession.src.

There are two essential functions that the modules must perform – both of which can be broken down into several sub-steps. 

1.  Gather the information to show.

This might include tag values, current alarm states, etc.  You will need to find the tags containing the information that you are interested in, extract that data, and perform any calculations required to produce the summary information you might be interested in displaying.

2.  Display the information. 

If the information is relatively simple, such as the number of active alarms, you can create a WML template file that is hard-coded except for the active alarm count. By calling BuildDeckFromFile, you can pass the number of alarms to this file and your WAP page will be ready for use.

If the information is a table of data that is likely to vary from one session to the next, you can call the helper module BuildCards.  This module requires much more information than BuildDeckFromFile, but will return a stream containing a series of WAP cards. This stream can then be served up as the WAP page.

Topics in this section:

Declaring a WAP Content Generator

WAP Content Generator Tasks

Helper Modules

The Sample WAP Content Provider - WAPAlarms.src

Compression

Custom Error Formatting

WAP considerations for VTScada