WAP/WML Templates and Wireless Support

The Wireless Application Protocol (WAP) is an open, global specification that empowers mobile users with wireless devices to easily access and interact with information and services instantly. You can find more information about WAP at http://www.wapforum.org .

WML is a markup language that is based on XML (eXtensible Markup Language). The official WML specification is developed and maintained by the WAP Forum, an industry-wide consortium founded by Nokia, Phone.com, Motorola, and Ericsson. This specification defines the syntax, variables, and elements used in a valid WML file. The actual WML 1.1 Document Type Definition (DTD) is available for those familiar with XML at: http://www.wapforum.org/DTD/wml_1.1.xml .

Alkaline 1.7 supports serving the WML text/vnd.wap.wml content-type. This means that wireless clients can perform search operations on Alkaline-powered servers when directed to a WML template.

WML Search Form

A WML search form is similar to an html form. Before you start designing an Alkaline WML search form and template, please make sure you read any WML reference and get familiar with concepts of decks and cards.

A typical wml search form for a configuration foo is:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
   <card id="searchcard" title="Search">
    <p>
     <do name="back" type="prev" label="back">
      <prev/>
     </do>     
     <big>Search</big><br/>          
     <input name="search" size="15"/>
     <select name="quant">
      <option value="-1">all results</option>
      <option value="10">10 results</option>
      <option value="50">50 results</option>      
     </select>     
     [ <a href="http://server:port/alias/search.wml?search=$(search)&quant=$(quant)">search</a> ]
    </p>
   </card>
</wml>

WML Search Template

A sample WML template (search.wml) can be found in the admin directory of the Alkaline distribution. Such a template constructs a card of search totals followed by a deck of cards containing search results.
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card id="results" title="Search Results">
   <p>
    <b>WAP Search</b>: <!--SEARCH-GENERAL $post.searchconfig --> <br/>
    <!--SEARCH-GENERAL Alkaline has found $total page(s) in $time seconds, showing $quant results.--><br/>
    <!--SEARCH-RESULTS-->
   </p>
  </card>   
  <!--SET MAP--    
    <br/>[ <a href="#res$index">next</a> ]
   </p>
  </card>
  <card id="res$index" title="$title">
   <p>
    <do name="back" type="prev" label="back">
      <prev/>
    </do>
    <do name="link" type="accept" label="$url">
     <go href="$url"/>
    </do>
    <a href="$url">$title</a><br/>
    <small>$header ...</small>
    <br/>
    size: <b>$size</b> bytes<br/>
    modified: <b>$modif</b><br/>
    relevance: <b>$quality</b>%<br/>    
  --> 
</wml>