optiPoint application module Programming WML applications

The target group for this guide to program WML applications are developers creating WML applications for the optiPoint application module.

The guide covers all elements/tags that are part of the WML 1.3 specification. It describes the individual WML elements, their attributes and their interpretation by the WAP browser application as far as it is relevant for the WAP developer.

Of course, this guide does not supersede a WML training manual.

Technical Browser Properties
This chapter specifies the relevant physical properties of the optiPoint application module.

Maximum Data Volume
The following restrictions have to be taken into account when developing WAP pages for the optiPoint application module:
 * The individual cards should not exceed 15 kilobytes (including graphics).
 * A deck should not exceed 80 kilobytes (including graphics).

The optiPoint application module was developed for a wired LAN environment and the HTTP transfer protocol. If the browser is connected via a WAP gateway, WSP can be used instead of HTTP. In this case please consider that some gateways restrict the data volume transferred via WSP. Please also note that WAP gateways usually compile WML pages (i.e. compress them to a binary format). This format considerably reduces the data volume.

Display
If the browser is used, the display is divided into a system bar, a URL entry field, the browser window for the WAP content and the application bar with symbols to open the context menu an exit the browser.

The display has a total size of 320 (height) by 240 (width) pixels. If the content is bigger, please take into account that the two scroll bars take a certain part of the available display size. As soon as a vertical scroll bar is shown, the visible width of the browser window is reduced so much that a horizontal scroll bar is also displayed at the bottom of the screen.

If you want to fill the display with a maximum size graphic without triggering the display of scroll bars, rectangles of 230 (width) by 221 (height) pixels or 234 (width) by 192 (height) pixels are available. The difference is due to different threshold values that trigger the generation of scroll bars. In detail, the scroll bar behaviour is as follows: If the maximum height is exceeded, both vertical and horizontal scroll bars are displayed; if only the maximum width is exceeded and the height is smaller than or equals 192 pixels, only a horizontal scroll bar is generated.

The maximum scope for text content is 9 lines (normal font and size). Starting with the 10th line, both a vertical and a horizontal scroll bar are displayed. If a string of characters that cannot be syllabicated exceeds the display width, two things happen: The display is expanded by generating a horizontal scroll bar, and the string of characters is wrapped right in front of the character that exceeds the maximum length.

Using the Browser
The following explains how to use the browser. For detailed information refer to the Operating Manual.

Keyboard and Touchscreen
An alphanumeric keyboard and a touchscreen keypad are available for navigation and data entry. Before you can enter e.g. a URL into the address bar or data into an entry field, the field has to be activated using the touchscreen. Also, task or form elements can only be selected via the context menu, i.e. through the touchscreen.

Certain characters have to be entered via the touchscreen keypad which contains the complete character set. Some special characters (e.g. the  and  ) are only available within a submenu of the touchscreen keypad.

Starting and Closing the Browser
In the initial state, the optiPoint application module displays the start menu.
 * 1) Select the browser symbol [[Image:symbol-browser.png|18px]] using the touchscreen or the navi key. Once the browser symbol is selected, a second click on the symbol using the touchscreen or the confirmation using the navi key starts the browser, displaying the pre-defined start page.
 * 2) You can close the browser by clicking on the cross symbol [[Image:symbol-cross.png|18px]]. By activating the home symbol you return to the start menu and can change to another application. In this case, the browser is not closed, i.e. the browser retains its current status.

Context Menu
Using the context menu (symbol in the application bar) you can:
 * access the browser’s homepage
 * manage the favorites or add the current page to the favorites
 * reload the page, i.e. the deck
 * set user name/password combinations for access to the gateway or proxy
 * use Options to access the softkeys generated via WML

Data Formats / MIME Types
To WAP-enable a web server, the following MIME types have to be defined:

Data Formats
Due to its compression, the binary format allows for faster transfer of XML files.

One of the reasons for the considerably smaller file size is that WML elements are represented by defined byte values; in plain text files these are represented as strings, resulting in increased redundancy. The compilation from plain text to binary format can be done in the WAP Gateway or in a separate application. A useful tool is e.g. the WBXML Library.

The filename extensions  and   can be used alternatively for the same binary format.

Server Configuration
You can use one of the standard web servers, e.g. Apache or Microsoft IIS to provide WML pages. In addition, dynamic WAP pages can be generated using the same tools as dynamic HTML pages: ASP, CGI/Perl, PHP, JSP, etc.

HTTP Header
If you want to adapt a WAP application for the optiPoint application module’s browser, it is useful to know the information sent from the client to the server.

The following table shows the data sent to the server in the HTTP header. To show a typical scenario, the header data display the corresponding CGI environment variable.

HTTP Error Messages
The following table shows the names and error codes of the browser’s HTTP error messages as well as the corresponding HTTP error codes (for HTTP Codes see RFC 2616).

WML
This chapter describes the elements available in WML Version 1.3 and how these are interpreted by the browser. Please note that - apart from the attribute  - only those elements are described that have an impact in the browser. General attributes such as  or  would only be functional in case of using Cascading Style Sheets (CSS). An exception is the id attribute of the  element used for navigation between individual cards. WMLScript does not provide access to individual WML elements.

Supported Version
The browser supports WML Version 1.3. The corresponding DTD is available - among other technical materials - from the Open Mobile Alliance.

XML Prologue
According to the specifications there must not be any characters preceding the XML prologue. The optiPoint application module’s browser, however, tolerates such characters (like the majority of other WEB browsers). It even tolerates if the entire prologue is missing.

Example for an XML prologue:

WML: Overview
The following WML elements are described depending on how the optiPoint application module supports them:

WML Basic Structure: Deck, Card
The organization of WML documents is fundamentally different from the way HTML documents are organized. In case of HTML documents, one page is loaded and displayed completely in the browser at a time. Using labeled anchors , it can be separated into fragments that the user can select via hyperlinks. In this case the browser scrolls down/up to the correct position. An HTML page is equivalent to a file. In WML, however, the deck is the superior unit, containing one or more card elements. A WML card conforms to an HTML page insofar as it is displayed completely in the browser. The syntax for navigating between the individual cards of a deck is similar to the syntax used for navigating between HTML fragments. The technical background for this is that in case of mobile terminal devices (the main consumers of WAP pages) the latency for requesting new data from the server is relatively high.


 * This is the root element of a WML deck. It can contain any number of  elements.
 * This is the root element of a WML deck. It can contain any number of  elements.


 * This element is a container for the specifications in the  and   tags.
 * This element is a container for the specifications in the  and   tags.


 * This element provides various meta statements about the WML document currently loaded in the browser.
 * This element provides various meta statements about the WML document currently loaded in the browser.

Please note that certain attributes only make sense when used in combination with others, e.g.. This results in special formats for the following statements:


 * This element defines the access rights for the WML element using the attributes domain and path. The element is supported with its specific attributes domain and path.
 * This element defines the access rights for the WML element using the attributes domain and path. The element is supported with its specific attributes domain and path.


 * This element provides a container for the actual content.
 * This element provides a container for the actual content.

A WML document or deck can contain several  elements. A WML card is equivalent to an HTML page insofar as a WAP browser will always display only one card from a deck. Using the  attribute, you can directly jump to the individual.


 * The  element serves as a container for   and   elements and is positioned above the   level. The statements included apply to all cards of the WML document. Using the specific attributes   and   you can determine the behaviour of the individual cards.
 * The  element serves as a container for   and   elements and is positioned above the   level. The statements included apply to all cards of the WML document. Using the specific attributes   and   you can determine the behaviour of the individual cards.

Text Structure and Positioning

 * &lt;br/&gt;
 * This blank element produces a line break.


 * &lt;p&gt;
 * &lt;p&gt; produces a paragraph. Except &lt;onevent&gt;, &lt;timer&gt;, &lt;do&gt;, and &lt;pre&gt; all elements below the &lt;card&gt; level have to be child elements of &lt;p&gt; elements.


 * This element specifies that line breaks are only determined by the control characters of the character set used. If the WML code contains several consecutive blanks within  tags, these will be displayed.
 * This element specifies that line breaks are only determined by the control characters of the character set used. If the WML code contains several consecutive blanks within  tags, these will be displayed.

The browser responds to the line breaks in the WML document and also displays several consecutive blanks. Tabs are displayed as horizontal spaces only slightly wider than blanks. In addition, please note that the basic function of the tab - justification - is ignored. If a tab is inserted between two characters or strings of characters, the horizontal positioning of the haracters after the tab does not only depend on the length of the tab but also on the starting position of the tab.

Lines are wrapped automatically if they are longer than the width of the browser window. The display area is not extended by using a horizontal scroll bar. Please also note the behaviour of the browser in case a  element follows a   element: The content of the   element is separated from the content of a previous   element with a horizontal offset that is bigger than a normal line break.

Tables

 * &lt;table&gt;, &lt;tr&gt;, &lt;td&gt;
 * The &lt;table&gt; element generates a table. Associated child elements are &lt;tr&gt; (table row) and  (table cell).

When you generate tables please note that - contrary to HTML - these have to be enclosed by &lt;p&gt; tags. Otherwise the optiPoint application module’s browser will return an error message. Table columns have fixed widths in the optiPoint application module’s WML browser. Therefore, an e.g. two-column table does not cover the entire available width of the browser window.

Text Formatting
Combinations of two or more text formatting elements result in the following deviations in the display: In front of each start and end tag of a child element, an additional blank space is added. Therefore, the first line of a paragraph seems to be indented if it starts with a series of two or more tags. Please note that any additional child element will result in an additional space.


 * This element highlights text. The browser will display the text in bold. The usual display method is italics.
 * This element highlights text. The browser will display the text in bold. The usual display method is italics.


 * A text tagged with  is displayed in bold. This is the usual display method.
 * A text tagged with  is displayed in bold. This is the usual display method.


 * A text tagged with  is displayed in bold. This is the correct display method.
 * A text tagged with  is displayed in bold. This is the correct display method.


 * The  element indicates the text should be displayed in italics. However, the browser displays the text in bold.
 * The  element indicates the text should be displayed in italics. However, the browser displays the text in bold.


 * The  element indicates the text should be displayed underlined. However, the browser displays the text in bold.
 * The  element indicates the text should be displayed underlined. However, the browser displays the text in bold.


 * The  element indicates the text should be displayed in a larger font size. However, the browser displays the text only slightly larger and in bold.
 * The  element indicates the text should be displayed in a larger font size. However, the browser displays the text only slightly larger and in bold.


 * The  element indicates the text should be displayed in a smaller font size. However, the browser displays the text in the normal font size.
 * The  element indicates the text should be displayed in a smaller font size. However, the browser displays the text in the normal font size.

Links and Tasks
WML provides the attribute  for assigning links and numeric keys to each other; thus, these links can be accessed via the keyboard. However, this is not possible with the optiPoint application module as this only accepts keyboard input if the cursor is within the address field or text entry fields. Also, navigation using the tab or navi keys is not possible.


 * The  element generates a hyperlink to the URL specified. According to the specification, the elements   and   can also be contained. However, this linking only works for text content including , while graphical content is not activated.
 * The  element generates a hyperlink to the URL specified. According to the specification, the elements   and   can also be contained. However, this linking only works for text content including , while graphical content is not activated.

After a  element a large horizontal space is generated.


 * This element serves as a container for the tasks,  ,   as well as for texts or images describing the task.
 * This element serves as a container for the tasks,  ,   as well as for texts or images describing the task.


 * The  element generates a hyperlink to a URL. Using the child elements   or , data can be transmitted to the target address. Additional data can be transmitted by using specific attributes.
 * The  element generates a hyperlink to a URL. Using the child elements   or , data can be transmitted to the target address. Additional data can be transmitted by using specific attributes.


 * This element gets you back to the last URL visited.
 * This element gets you back to the last URL visited.

This element is not supported by the browser; however, a Back button is constantly available on the application bar.
 * If one or more  elements are inserted into the   element, the activation of the element triggers the use of the values in   in the variables.
 * If one or more  elements are inserted into the   element, the activation of the element triggers the use of the values in   in the variables.

Even if it looks like the page is rebuilt, the page is not retrieved again from the server (as it is if the menu item “Refresh Page“ from the Context Menu is used).

If the card contains an element generating a softkey, e.g., a copy of this softkey will be displayed after each refresh task execution. If you reload the page using “Refresh Page“ from the Context Menu, these additional softkeys disappear.
 * This elements cuts off the functionality of a superordinated  or   element into which it is nested. The result of a   element in the optiPoint browser is that the corresponding   element is not displayed in the Context Menu.
 * This elements cuts off the functionality of a superordinated  or   element into which it is nested. The result of a   element in the optiPoint browser is that the corresponding   element is not displayed in the Context Menu.

Graphics / Images

 * This element is used to embed graphics files.
 * This element is used to embed graphics files.

The browser only displays images in wbmp format. If gif or jpg files are offered, the browser displays the “alt“ text.

If you want to position graphics in line, please note: There is no line break, but the graphic is displayed some pixels below the line. Additionally, there is a relatively large horizontal offset between the graphic and the preceding text.

Events

 * This element generates buttons or softkeys that trigger certain tasks. The selection of the task type is done using the  attribute.
 * This element generates buttons or softkeys that trigger certain tasks. The selection of the task type is done using the  attribute.

In addition to the softkey, the  element generates a blank line at its position.


 * Using  data is transmitted to the server. The element is embedded into a   element containing the URL and the method.
 * Using  data is transmitted to the server. The element is embedded into a   element containing the URL and the method.


 * The code embedded in  is executed as soon as one of the events specified in the type attribute occurs.
 * The code embedded in  is executed as soon as one of the events specified in the type attribute occurs.

This element has to be specified immediately after the  tag so that the browser can understand it.

User Input

 * This element generates a data entry field.
 * This element generates a data entry field.

As soon as the field is activated it takes up the entire browser window area.


 * A  contains several   elements which enable the user to select from a range of predefined values. The application module’s browser displays this selection as most WAP browsers do: radiobuttons are used for single selectable options; in case of multiple selectable options checkboxes are displayed.
 * A  contains several   elements which enable the user to select from a range of predefined values. The application module’s browser displays this selection as most WAP browsers do: radiobuttons are used for single selectable options; in case of multiple selectable options checkboxes are displayed.


 * The  elements grouped together within a   element are the choices available. An   element can contain text, images  or   elements.
 * The  elements grouped together within a   element are the choices available. An   element can contain text, images  or   elements.


 * This element is used for grouping other elements, in particular  and   elements. This grouping is not visible in the browser.
 * This element is used for grouping other elements, in particular  and   elements. This grouping is not visible in the browser.


 * This element is used for grouping  elements within a   element.
 * This element is used for grouping  elements within a   element.

Variables

 * The element can occur within the task elements,  , and   and is used to set values for variables. Please note that by using   variables can only be passed on with the browser, e.g. between different  s. To transmit a variable to a server you have to use   (see  “ ”).
 * The element can occur within the task elements,  , and   and is used to set values for variables. Please note that by using   variables can only be passed on with the browser, e.g. between different  s. To transmit a variable to a server you have to use   (see  “ ”).


 * This element generates a timer. The only possible parent element is . You can associate certain task to the expiry of the allocated period. There is only one   allowed for each   element.
 * This element generates a timer. The only possible parent element is . You can associate certain task to the expiry of the allocated period. There is only one   allowed for each   element.

Character references
The following character references are a part of WML; they are a subset of the character references in HTML. In addition, the browser supports almost all other HTML character references.

Internationalization and Special Characters
According to the browser information in the CGI environment variable HTTP_ACCEPT_CHARSET, the following character codes are accepted: Accordingly the browser correctly displays text data encoded in Unicode and ISO-8859-1 (exceptions see below). As an alternative, HTML character references or Unicode references can also be used.
 * UTF-8
 * UTF-16
 * ISO-8859-1

The following characters are displayed differently or incorrectly:
 * Instead of the sign for a logical negation ¬ (HTML character reference:  Unicode reference:  ) the browser generates a boldfaced x.
 * The characters used for exponents (superscript) 1 and 2 (HTML character references:  and   Unicode references:   and  ) are truncated at the top.
 * Instead of the paragraph character ¶ (HTML character reference:  Unicode reference:  ) a checkmark is displayed.

General Information
The Wireless Telephony Applications Interface makes it possible to control telefone functions via WML or WMLScript under the precondition that the telephone network operator provides a WTA server. The WTA interface is divided into the following libraries: Public WTAI, Voice Call, Network Text, Phonebook, Call Logs, and Miscellaneous.

Invoking a WTAI command is similar to calling a URL and is structured as follows:

Example: For the function make call you set the desired telephone number as a parameter. You have to place a semicolon  in front of the parameter.

Example:

The make call function
The optiPoint application module supports the make call function which is part of the WTAI library Public WTAI. This enables a user to dial a certain phone number by activating a hyperlink or a  task.

The optiPoint application module’s browser not directly triggers dialing of the phone number in the telephone but displays an entry field where the user can edit the phone number. Only after you hit the Dial softkey the number is actually dialed.
 * WTAI command in


 * Example:


 * WTAI command in


 * Example:

If the call was successful, make call returns a 0. Otherwise, according to WAP 1.2 one of the following error codes is returned:

105 = busy

107 = no answer

1 = other error

There is a WTAPublic library in WMLScript to support WTAI. The optiPoint application module’s browser basically supports WMLScript; however, the makeCall function from the WMLScript library WTAPublic is not supported.

Integration of WMLScript in WML
The optiPoint browser supports WMLScript. As with other WAP browsers, the WMLScript files have first to be compiled. Therefore, it is not possible (as in JavaScript) to integrate the script into the WML file. Usually, a WAP gateway handles the compilation. If there is no WAP gateway available in the development environment, you need a compiler (as integrated in many development toolkits).

WMLScript calls can be used wherever you would usually specify a URL. The following example shows how to integrate a WMLScript function into a WML document using :

Syntax explanation:
 * Path and filename of the compiled WMLScript file.
 * : Name of the WMLScript function to be started as soon as the  or   element is activated. Using the brackets  you can enter parameters. Please note that parameters always have to be included in single quotes (’), no matter whether they are literal strings or variables. Variables are entered as follows:.

WMLScript Libraries Supported
WMLScript is structured into standard and special libraries. The following six standard libraries (except the Dialogs library) are supported by the optiPoint application module’s browser:


 * The Lang library contains arithmetical functions, functions for random numbers, conversion functions, User Agent functions as well as functions for program flow control.
 * The Float library contains functions for floating point operations. This library is optional.
 * The String library provides functions for character string recognition and manipulation.
 * The URL provides functions for checking and processing URLs.
 * The WMLBrowser library can take on navigational tasks and enables interaction with and transfer of variables to the WML document.
 * The Dialogs library provides several different types of dialogs for user interaction. This library is not supported.

The additional libraries Crypto and WTAPublic are not supported by the optiPoint application module’s browser.

WMLScript Examples
The following sections shows one example for each one of the supported standard libraries.

WMLScript functions should contain a refresh command after the individual operations: WMLBrowser.refresh. This ensures that the browser displays the result of the WMLScript call.
 * Lang library
 * Returns the character code currently used according to the IANA MIBEnum specification (see “Reference Documents”). Example: Number 106 refers to UTF-8.
 * Returns the character code currently used according to the IANA MIBEnum specification (see “Reference Documents”). Example: Number 106 refers to UTF-8.


 * Float library
 * Returns the integer part of the floating point number 5.9, i.e. 5.
 * Returns the integer part of the floating point number 5.9, i.e. 5.


 * String library
 * Returns the sentence “Today is Friday“. The replacement works as follows: The first argument is seached for the second argument. Any occurance of the second argument is replaced by the third argument.
 * Returns the sentence “Today is Friday“. The replacement works as follows: The first argument is seached for the second argument. Any occurance of the second argument is replaced by the third argument.


 * URL library
 * Returns the relative URL of the (WML) file from which the function was invoked.
 * Returns the relative URL of the (WML) file from which the function was invoked.


 * WMLBrowser library
 * Returns the value of the variable called “variable“. The variable has to exist in the WML document.
 * Returns the value of the variable called “variable“. The variable has to exist in the WML document.

Error categories
The following 10 main error categories are defined in the Wap stack (provided by a third party) of the optiPoint 410:

The names of the error messages are constants within the program code and not visible to the user. As soon as an error occurs and is identified, the WAP stack sends its error code to the browser’s GUI control. The error code is then translated into an error message for the user.

This error message contains the main category of the error, the error code and a recommended action, e.g. “Contact Administrator“. The individual error codes and their meanings are listed below.

Error codes and their meanings
The following table contains all error codes of the internet client’s third party software.

Many of the error codes listed relate to functions not implemented in the optiPoint application module’s browser. So if a certain error codes exists, this does not automatically imply that the browser supports the corresponding function.

Reference Documents

 * WBXML Library: http://libwbxml.aymerick.com/
 * Open Mobile Alliance: http://www.openmobilealliance.org
 * DTD for WML 1.3: http://www.openmobilealliance.org/tech/DTD/wml13.dtd
 * IANA MIBEnum: http://www.iana.org/assignments/character-sets