next up previous
Next: The class element; detached instances
Up: The WOM language
Previous: Conditional text

Sessions and applications


WOM is used for writing dynamic pages, so it makes sense that in most cases, the person interacting with a WOM application will do so several times, in the Web equivalent of a login session. For example, with Tow, the user first starts up a new session by clicking on a ``lead-in'' URL. This causes WOM to display a set of frames containing navigation buttons and controls, with one frame reserved for results from, or input to, the economic model. The navigation buttons can be used to select pages which contain fill-in data forms (e.g. for tax). Typically, the user will select one of these, fill it in and submit the data, get back a new copy of the form with the updated values in its fields, and then press another button to run the economic model and view the results. Even the examples above, though containing only one page each, can be used in a session of repeated interactions.

We use the word application to refer to a program such as Tow. Most applications will contain several pages working together --- Tow, for instance, contains about ten different pages, including: a user-guide; a page for moving data to and from a database; several data-input forms for parameters describing Income Tax, indirect taxes, benefits and other parts of the UK tax system; and a page for graphs and tables generated by the economic model. There is also a ``cover page'' which entertains the user with a countdown while the session is being initialised.

As we mentioned in Section 2.1, multi-page applications will typically be structured hierarchically, with a root instance which creates several different pages and decides which one should be seen by the user. A small example follows:

<!-- Top.wom -->

<Class Top Book>

<Instance><Fact  Fact>               </Instance>
<Instance><Count Count>              </Instance>
<Instance><Menus Menus>              </Instance>
<Instance><Conditionals Conditionals></Instance>

<HEAD><TITLE><Text title></TITLE></HEAD>
<H1><Text header></H1>

This session demonstrates a simple WOM
application. You can:
     instance=Fact book=ROOT>Go to the factorials page
     instance=Count book=ROOT>Go to the counter page
     instance=Menus book=ROOT>Go to the menus page
     instance=Conditionals book=ROOT>Go to the conditionals page
<LI><ActionLink>End the session
    <OnSubmit rexx>
      { localnamebase~getRoot~deleteAndExpire('user') }


<Behaviour rexx>
  if localnamebase~getT = -1 then
    start_date_time = time() 'on' date('L')
    $title~setValue( "Top [session started at" start_date_time||"]" )
    $header~setValue( "Top [session started at" start_date_time||"]" )


Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997