WAP content generators must be declared, much like any other module you add to an application. How the module is declared depends on which system is used to add it to the browser menu. The built-in WAP session handler will look for a WAP menu as follows:
• If a file named WAPMenu.txt exists in the application, it controls which WAP decks are displayed in the menu. This is the case for all VTScada-based applications.
• Otherwise, any page which includes a WAP handler declaration in its variables section will be displayed in the WAP menu.
Of the two choices, declaring a WAPMenu.txt file in your application provides a more direct route to serving up pages. Note that putting a WAP handler declaration into a page’s variable list might make a link to that page show up in a WAP browser, but it does not actually cause the page to be displayed. Only the WML content generated by the handler module will be displayed.
Declaring a WAP handler that is to be displayed by WAPMenu.txt
1. Build the WAP handler.
For example, a module named TankMonitor.SRC.
Within this module file, assume that there is a module named TankLevels which generates a WML card showing fluid levels in a tank. This subroutine module must be declared as class [(WAPHANDLER)
2. In the application’s AppMod.SRC file, add the overall handler to the [(LIBRARIES) …] class.
TankMonitor Module "TankMonitor.src"; { WAP handler }
3. In the WAPMenu.txt, add a link to the subroutine module that displays the tank levels:
Tank Monitoring
TankLevels
Declaring a WAP Handler that is to be linked to from an application page
All pages in an application can be displayed in the WAP browser menu if the configuration variable WAPShowAllMenuEntries is set to 1. To make the page work as a click-able link it is also necessary to add a reference to a valid WAP handler to the page’s source code.
1. In the application page’s source file, add a reference to the valid WAP Handler
Example:
[(WAPHANDLER)
Shared WapAlarms;
]
2. In the application’s AppMod.src file, declare the WAP handler:
Example:
[ (WAPHANDLER)
{ WAP content plug-in for main alarm page }
WAPAlarms Module "WAPAlarms.src";
]