OUI
Home
Overview
Download
Documentation
Support
Participating
Credits
 

Beta version of WALL library now available!

Have you ever heard about pancakes which are hard to make unless you break those eggs?
Well, I am serving you one of those pancakes right now.

WALL (the Wireless Abstraction Library) is taking OUI's place, meaning that I will not dedicate more time to OUI in the future. Of course, this site will still be available together with the OUI sourcecode for those who need it. It just won't get much of my time.
If you are serious about WAP, you gotta check it out!

For those who want to hear the whole story, here are the reasons for this move:
  • OUI was designed for a world where WML was here to stay. In 2001 this was changed with the introduction of XHTML MP. Upgrading OUI to support XHTML MP would be unpractical. Most developers are better off with an HTML mark-up that also offers WML support
  • OUI was based on the existence of an object model. This turned out to make integration with other tag-libs tricky (struts, JSTL) as these tag-libs became more and more of a defacto standard
  • OUI was pretty much about a world where there were two main browsers only. This is less and less true is day. WALL is based on WURFL and gives you the flexibility you need to support any device. With OUI, you had to build new Java rendering strategies. This is too complex for the random user.


Thank you

Luca Passani

OUI Overview


by Luca Passani, luca.passani@openwave.com

This document provides information about the main OUI abstractions, along with some examples using the WML tag library (and in one case, the XHTML tag library). It should help you start experimenting with OUI.

The abstractions will be illustrated through some simple JSP tag-lib examples and the pictures that show how such examples actually render on different classes of devices.

Important Note: the code examples in this document use the JSP tag-libs. Anyway, the same results are possible on any of the supported platforms (Servlets, ASP/COM, PHP and .Net)

Menus

In a way, menus are the most obvious OUI abstraction. The Nokia WML model forces developers to use lists of hyperlinks. Openwave phones are better served by the <select>/<option> WML construct, because it provides users with numbered lists and numeric key accelerators.
In addition, the Openwave Mobile Browser is the only widely deployed WAP browser that allows in-line icons on menus. This last feature is typically left unexploited in Europe for the sake of interoperability across different phones.

OUI menus make it possible for you to write applications with advanced features, and the library makes sure that your applications degrade gracefully on devices that do not fully support those features..

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="start" title="Wireless World"> <oui:p align="left" mode="nowrap"> <oui:menu> <oui:menu_item href="ema.jsp" text="Email" icon="envelope1" /> <oui:menu_item href="fin.jsp" text="Finance" icon="graph1" /> <oui:menu_item href="ent.jsp" text="Entertainment" icon="videocam" /> <oui:menu_item href="spo.jsp" text="Sports" icon="football" /> <oui:menu_item href="new.jsp" text="News &amp; weather" icon="partcloudy" /> <oui:menu_item href="tra.jsp" text="Travel" icon="plane" /> <oui:menu_item href="sho.jsp" text="Shopping" icon="dollarsign" /> <oui:menu_item href="oth.jsp" text="Other" icon="folder1" /> </oui:menu> </oui:p> </oui:card> </oui:wml>

The sample code is rendered like this for the Nokia browser:
Openwave phones, though, have a different way to render menus: numbered lists.
This looks like (please note those nice in-line icons):


Openwave Textual Browser


Openwave GUI Browser

Please observe that in-line icons are not just a fancy add-on: they improve end-users’ interactive experience. For example, you could use them on the very first page of a calendar application to visualize that an appointment is taking place within 16 hours. Which end-user would resist the temptation to hit your application at least once per day?

Forms and Primary Paths

Forms are a bunch of widgets that collect user input. Nokia phones, Openwave textual-phones and Openwave GUI phones have different ways to support forms (ref. Elective forms vs. Wizards on the Openwave Usability Guidelines).

The Form object helps. Just put your input elements and picker object there. You can regard a picker object as a <select> construct with the only purpose of picking an item out of a list.

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:form id="train" title="Find your train"> Hallo everyone! Start in (min 3): <oui:input type="text" size="6" title="from" name="startstation" value="" /> End in (min 3): <oui:input type="text" size="6" title="to" name="endstation" value="" /> When: <oui:picker name="when" title="when"> <oui:option value="3">within 3 hours</oui:option> <oui:option value="9">within 9 hours</oui:option> <oui:option value="0">whenever</oui:option> </oui:picker> <oui:primary_path short_label="Find" long_label="Find station"> <oui:go href="search.jsp"> <oui:postfield name="startstation" value="$startstation" /> <oui:postfield name="endstation" value="$endstation" /> <oui:postfield name="when" value="$when" /> </oui:go> </oui:primary_path> </oui:form> </oui:wml>

If you know WML, the above should make sense: a form with three form elements. The only part that may be unclear is the primary path. According to the Openwave usability guidelines, a primary path is the activity that most users are likely to perform when accessing a certain card. On the Openwave browser, primary paths should be associated with the main softkey (aka Accept key) through the <do type=”accept”> WML construct. On browsers without soft key support, primary paths are often more usable if implemented with a hyperlink. As a consequence, there is no generic WML best practice that guarantees satisfactory results for all phones.

OUI fixes this by letting a developer specify the intended main activity for each card. This abstraction has been conveniently called “primary_path”.

Note: a primary path can contain either an URL or a more complex task (as in the example above). On top of that, developers can specify two labels, a long and a short one. The short one is used for soft keys; the long one is used for hyperlinks.

Please observe how primary paths are rendered on different classes of devices:

XHTML Tag-lib

While this document won’t dig too deep into the details of the XHTML tag-lib, here is how the from in the previous example is implemented with XHTML:

<%@ taglib uri="/WEB-INF/tld/xhtmloui.tld" prefix="oui" %> <oui:html xmlns="http://www.w3.org/1999/xhtml"> <oui:head> <oui:title>Find your train</oui:title> </oui:head> <oui:body> <oui:form action="search.jsp"> Start in (min 3): <oui:input type="text" size="6" name="startstation" value="" /> <oui:br/> End in (min 3): <oui:input type="text" size="6" name="endstation" value="" /> <oui:br/> When:<oui:br/> <oui:select name="when"> <oui:option value="3">within 3 hours</oui:option> <oui:option value="9">within 9 hours</oui:option> <oui:option value="0">whenever</oui:option> </oui:select> <oui:input type="submit" value="Find station" name="submit"/> </oui:form> </oui:body> </oui:html>

Of course, the actual WAP devices will still get WML, but this doesn’t prevent you from playing around with a technology which we are bound to encounter sooner or later.

Secondary Paths and Side Paths

We have mentioned primary paths. You should always code your apps so that there is only one primary path. Of course, in many cases you will need users to have multiple choices readily available. Secondary paths serve this purpose. In general, a secondary path is an activity that many users perform now.

You can code as many secondary path as you want in each card. Even none. If you are coding more than 4 or 5 secondary paths for a single card, though, you should start wondering if the structure of your applications is the best possible: clogging the interface of a mobile applications is a very bad idea.

Here is an example of use of a secondary path:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="delete" title="Delete Email"> <oui:p> Delete email message from Grzegorz? <oui:primary_path short_label="No"> <oui:prev /> </oui:primary_path> <oui:secondary_path short_label="Yes"> <oui:go href="delete.jsp"> <oui:postfield name="emailid" value="573ad8sd9f994da8798" /> </oui:go> </oui:secondary_path> </oui:p> </oui:card> </oui:wml>

And here is the result for the different browsers:

TaskMenus

The new Openwave GUI browser has a new graphical widget that increases usability, the so called task menu. A task menu is a bit like the windows Start button in the bottom left corner of the screen. Increased usability is given by the fact that the end user does not loose the context of the card they are operating, since the content of the card is only partially covered by the menu. A task menu is an excellent way to group together a bunch of secondary paths in case you have many. When you use a task menu control, you will get the advanced behaviour for the GUI browser. Textual browser will show the menu in a separate card. Access to that card is implemented as a secondary path for the card with the menu.

Note: OUI does not let you implement a secondary path and a task menu for the same card. Here is an example of task menu usage:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="Inbox" title="Openwave Email"> <oui:p mode="nowrap"> <oui:menu> <oui:menu_item href="ema.jsp?344b53" title="View" text="Luca Passani:Portofino" /> <oui:menu_item href="ema.jsp?345a29" title="View" text="Lars Knudesn:Fixed!" /> <oui:menu_item href="ema.jsp?345a49" title="View" text="Grzegorz Cipiel:RE:Installer......" /> <oui:menu_item href="ema.jsp?345a45" title="View" text="Jaycelle Lao:Urgent Issue " /> <oui:menu_item href="ema.jsp?345a59" title="View" text="Srini Bhag..:Vegetarian recipies." /> <oui:menu_item href="ema.jsp?345a59" title="View" text="Raj: Re:I need an answer" /> <oui:menu_item href="ema.jsp?345a23" title="View" text="Heidi Gilstad: RE:Copenhagen" /> <oui:menu_item href="ema.jsp?345a24" title="View" text="Sandra Bella:is Tivoli open?" /> <oui:menu_item href="ema.jsp?345a25" title="View" text="Andrea Masella:Stasera? " /> </oui:menu> </oui:p> <oui:task_menu short_label="Menu" long_label="Show Menu"> <oui:menu_item href="#compose" text="Compose New"/> <oui:menu_item href="#viewfldr" text="View Folders"/> <oui:menu_item href="#newfldr" text="Create New Folder"/> <oui:menu_item href="#signout" text="Sign Out"/> </oui:task_menu> </oui:card> </oui:wml>

And here is the result for the different browsers:

ComboMenus

Another nice feature of the new GUI browser is the possibility to put multiple widgets in the same card. One commonly used configuration is a Menu followed by another bit of WML code or user-input constructs. Unfortunately, the WML code to achieve this effect on the GUI browser does not degrade gracefully on text-based browser.

OUI offers a solution in the form of a ComboMenu object. A ComboMenu requires two components:

  • A Menu
  • An Appendix, i.e. some UI controls (or just a bit of WML code) conveniently wrapped into an object called Appendix.

When rendering, GUI browsers will receive the fully-fledged composite GUI (see picture). Textual browsers will receive a card with a menu and a card with the controls in the appendix. A new menu item is conveniently added as the lat one of the menu to point to the new card for the textual phone (see picture).

This example:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="start" title="Wireless World"> <oui:p align="left" mode="nowrap"> <oui:combo_menu> <oui:menu> <oui:menu_item href="ema.jsp" text="Email" icon="envelope1" /> <oui:menu_item href="fin.jsp" text="Finance" icon="graph1" /> <oui:menu_item href="ent.jsp" text="Entertainment" icon="videocam" /> <oui:menu_item href="spo.jsp" text="Sports" icon="football" /> <oui:menu_item href="new.jsp" text="News &amp; weather" icon="partcloudy" /> <oui:menu_item href="tra.jsp" text="Travel" icon="plane" /> <oui:menu_item href="sho.jsp" text="Shopping" icon="dollarsign" /> <oui:menu_item href="oth.jsp" text="Other" icon="folder1" /> </oui:menu> <oui:appendix title="Search"> <oui:p> Search for: <oui:input type="text" name="keyword" value="" title="keyword" /> </oui:p> <oui:primary_path href="" short_label="Search" long_label="Start search now" /> </oui:appendix> </oui:combo_menu> </oui:p> </oui:card> </oui:wml>

The Openwave textual browsers are given a new card. The last menu item points to it.

Nokia browsers support elective forms, so they do not need a new card.

Publishing Large Chunks of Text: BodyPager

Maximum deck size in Europe is about 1.3 Kylobytes. Unfortunately, determining the amount of text that ends up in our decks is not always simple. OUI offers a solution though the BodyPager object. In the presence of large amounts of text, the BodyPager will split the content in conveniently sized pages and make sure that navigation across different pages is supported automatically. To give you an example, here is an example out of Alice’s Adventures in Wonderland (Lewis Caroll).

Also observe the possibility to add header and footer information (<bp_header> and <bp_footer> tags). Such info will be displayed at the top and bottom of each automatically generated page:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:body_pager title="Alice" text_link_forward="Skip" text_link_exit="Exit" url_link_exit="main.jsp"> <oui:bp_header> <oui:p mode="wrap"> <b>CANTO I - The Trystyng</b> </oui:p> </oui:bp_header> ONE winter night, at half-past nine,<br/> Cold, tired, and cross, and muddy,<br/> I had come home, too late to dine,<br/> And supper, with cigars and wine,<br/> Was waiting in the study.<br/> <br/><br/> There was a strangeness in the room,<br/> And Something white and wavy<br/> Was standing near me in the gloom -<br/> I took it for the carpet-broom<br/> Left by that careless slavey.<br/> <br/><br/> But presently the Thing began<br/> To shiver and to sneeze:<br/> On which I said "Come, come, my man!<br/> That's a most inconsiderate plan.<br/> Less noise there, if you please!"<br/> <br/><br/> "I've caught a cold," the Thing replies,<br/> "Out there upon the landing."<br/> I turned to look in some surprise,<br/> And there, before my very eyes,<br/> A little Ghost was standing!<br/> <br/><br/> He trembled when he caught my eye,<br/> And got behind a chair.<br/> "How came you here," I said, "and why?<br/> I never saw a thing so shy.<br/> Come out! Don't shiver there!"<br/> <br/><br/> He said "I'd gladly tell you how,<br/> And also tell you why;<br/> But" (here he gave a little bow)<br/> "You're in so bad a temper now,<br/> You'd think it all a lie.<br/> <br/><br/> "And as to being in a fright,<br/> Allow me to remark<br/> That Ghosts have just as good a right<br/> In every way, to fear the light,<br/> As Men to fear the dark."<br/> <br/><br/> "No plea," said I, "can well excuse<br/> Such cowardice in you:<br/> For Ghosts can visit when they choose,<br/> Whereas we Humans ca'n't refuse<br/> To grant the interview."<br/> <br/><br/> He said "A flutter of alarm<br/> Is not unnatural, is it?<br/> I really feared you meant some harm:<br/> But, now I see that you are calm,<br/> Let me explain my visit.<br/> <br/><br/> "Houses are classed, I beg to state,<br/> According to the number<br/> Of Ghosts that they accommodate:<br/> (The Tenant merely counts as WEIGHT,<br/> With Coals and other lumber).<br/> <br/><br/> "This is a 'one-ghost' house, and you<br/> When you arrived last summer,<br/> May have remarked a Spectre who<br/> Was doing all that Ghosts can do<br/> To welcome the new-comer.<br/> <br/><br/> "In Villas this is always done -<br/> However cheaply rented:<br/> For, though of course there's less of fun<br/> When there is only room for one,<br/> Ghosts have to be contented.<br/> <br/> "That Spectre left you on the Third -<br/> Since then you've not been haunted:<br/> For, as he never sent us word,<br/> 'Twas quite by accident we heard<br/> That any one was wanted.<br/> <br/><br/> "A Spectre has first choice, by right,<br/> In filling up a vacancy;<br/> Then Phantom, Goblin, Elf, and Sprite -<br/> If all these fail them, they invite<br/> The nicest Ghoul that they can see.<br/> <br/><br/> "The Spectres said the place was low,<br/> And that you kept bad wine:<br/> So, as a Phantom had to go,<br/> And I was first, of course, you know,<br/> I couldn't well decline."<br/> <br/><br/> "No doubt," said I, "they settled who<br/> Was fittest to be sent<br/> Yet still to choose a brat like you,<br/> To haunt a man of forty-two,<br/> Was no great compliment!"<br/> <br/><br/> "I'm not so young, Sir," he replied,<br/> "As you might think. The fact is,<br/> In caverns by the water-side,<br/> And other places that I've tried,<br/> I've had a lot of practice:<br/> <br/><br/> "But I have never taken yet<br/> A strict domestic part,<br/> And in my flurry I forget<br/> The Five Good Rules of Etiquette<br/> We have to know by heart."<br/> <br/><br/> My sympathies were warming fast<br/> Towards the little fellow:<br/> He was so utterly aghast<br/> At having found a Man at last,<br/> And looked so scared and yellow.<br/> <br/><br/> "At least," I said, "I'm glad to find<br/> A Ghost is not a DUMB thing!<br/> But pray sit down: you'll feel inclined<br/> (If, like myself, you have not dined)<br/> To take a snack of something:<br/> <br/><br/> "Though, certainly, you don't appear<br/> A thing to offer FOOD to!<br/> And then I shall be glad to hear -<br/> If you will say them loud and clear -<br/> The Rules that you allude to."<br/> <br/><br/> "Thanks! You shall hear them by and by.<br/> This IS a piece of luck!"<br/> "What may I offer you?" said I.<br/> "Well, since you ARE so kind, I'll try<br/> A little bit of duck.<br/> <br/><br/> "ONE slice! And may I ask you for<br/> Another drop of gravy?"<br/> I sat and looked at him in awe,<br/> For certainly I never saw<br/> A thing so white and wavy.<br/> <br/><br/> And still he seemed to grow more white,<br/> More vapoury, and wavier -<br/> Seen in the dim and flickering light,<br/> As he proceeded to recite<br/> His "Maxims of Behaviour."<br/> <oui:bp_footer> <oui:p> From: Alice in Wonderland, Lewis Caroll </oui:p> </oui:bp_footer> </oui:body_pager>

Here is how different browser visualise the BodyPager.

Nokia: The lack of soft key support on Nokia devices forces users to scroll to the bottom of the page to find navigation.

It should be noted that Openwave browsers introduce the optimisation of pre-loading the first page whenever the gateway allows this extensions to pass through.

Making Phone Calls: Caller (and rendering directives)

The lack of WTAI support in many phones has prevented developers from deploying this useful WAP feature in the past. The OUI library offers an abstraction called Caller. A Caller will resolve into a WTAI call for browser that support it. Other browsers will receive a new card containing the telephone number on a page of its own. This allows users of non-WTAI compliant devices to start a phone call through proprietary mechanisms (notably, the ‘use-number’ feature on Nokia phones).

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="pharmacy" title="Churchill Pharmacy"> <oui:rendering_directive apply_to="card"> <oui:method name="enforce_title" /> </oui:rendering_directive> <oui:p> 8 Ladybrook Square, Ladybrook Square Hemsel Nottinghamshire GY52 7UL <br/> <a href="map.jsp?id=32647287328" title="map">See map</a> </p> <p mode="nowrap"> Tel:(01452)9344615582<br/> Fax:(01452)2355810158<br/> info@openwave.com <oui:primary_path short_label="Call"> <oui:caller phone_number="014529344615582" text="Call Churchill Pharmacy" /> </oui:primary_path> </oui:p> </oui:card> </oui:wml>

Another OUI feature that you’ll find handy are rendering directives. You can think of a directive like an option to a compiler. Basically they are used to tell OUI to divert from its default behaviour in some specific cases. In the code above, you see an example of the ‘enforce_title’ directive. Some telephones honor the value of the ‘title’ attribute on each card. Some don’t. There are cases when you want the title to be displayed anyway. Putting the title in the body of the card is not the best solution, since you will see the title repeated on devices that support the title. The rendering directive delegates the problem to OUI. In practice, when using the rendering directive, each browser will display the title once (and only once).

WML Tables on all browsers: Table

Some devices do not properly support WML tables. This has prevented developers from using this valuable feature. OUI supports tables. WML tables are produced for devices that support the feature. Other devices are presented the same information using a convenient lay-out that does not require the feature tags. Example:

Old Nokia devices do not support tables.

Reducing Perceived Latency: Mobile-Originated Prefetch

Mobile-originated prefetch is basically the capability some browsers have to pre-load one or more decks, under the assumption that users are likely to navigate there soon anyway. This optimisation goes a long way into improving the application latency as perceived by the end user. Unfortunately, some devices (and gateways) break on this extension. OUI offers a solution by making sure that this feature is automatically discarded for device/gateway combinations that would break on it.

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:head> <oui:prefetch href="nextemailmsbbit.jsp" /> </oui:head> <oui:card id="mop" title="Long Email message"> <oui:p align="left" mode="nowrap"> From: Domenico &lt;domenico@openwave.com&gt;<br/> To:Luca Passani &lt;luca@openwave.com&gt;<br/> Date:Wed,10 Oct 2001<br/> </oui:p> <oui:p mode="wrap"> Subject: It will take some time to read the whole message..<br/> Hallo Luca, it's time to substantiate your guesses with facts. Here is my analysis of the situation. I am sorry that this message is a bit long, but woul'll find a lot of useful info. So please make yourself comfortable and start reading<br/> :<br/> [omitted]<br/> :<br/> <oui:primary_path href="nextemailmsbbit.jsp" short_label="More" long_label="24% read. Read more" /> <oui:task_menu short_label="Menu" long_label="Show Menu"> <oui:menu_item href="reply.jsp" text="Reply"/> <oui:menu_item href="reply.jsp" text="Reply All"/> <oui:menu_item href="delete.jsp" text="Delete"/> <oui:menu_item href="forwars.jsp" text="Forward"/> <oui:menu_item href="viewfold.jsp" text="Move to Folder"/> <oui:menu_item href="newfldr.jsp" text="Create New Folder"/> <oui:menu_item href="signout.jsp" text="Sign Out"/> </oui:task_menu> </oui:p> </oui:card> </oui:wml>

There are no significative screendumps to explain the concept further. A video might so the job ;)

Application–level Optimization: Conditional Tags

As you see, OUI performs a lot of optimisation behind the scenes. We refer to this feature as core usability support. If you want to use OUI to optimise usability even more, you can do it at the application level. OUI offers great support for this through so-called conditional tags: <oui:if>,<oui:condition> and <oui:condition_list>. Let’s look at the example:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="cond" title="Conditional tag"> <oui:p align="left"> GUI device detector activated....<br/> <oui:if agentfamily="upgui"> I can smell a GUI browser here </oui:if> <oui:if agentfamily="upgui" negate="true"> I cannot smell any GUI browser here </oui:if> <oui:if special="allopenwave"> The gateway and the handset run Openwave software </oui:if> <oui:if special="allnokia"> The gateway and the handset run Nokia software </oui:if> </oui:p> </oui:card> </oui:wml>

this was the simple case. A more complex use of the conditional tags is:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="condtag" title="Conditional Tags"> <oui:p align="left"> Openwave Detector activated... <oui:if> <oui:conditionlist logic="AND"> <oui:condition gateway_vendor="openwave" /> <oui:conditionlist logic="OR"> <oui:condition agentfamily="upgui" /> <oui:condition agentfamily="uptext" /> </oui:conditionlist> </oui:conditionlist> <oui:then> You have an Openwave browser and you are going through an Openwave gateway </oui:then> <oui:else> Either you browser or you gateway are not Openwave. It may be both. </oui:else> </oui:if> </oui:p> </oui:card> </oui:wml>

Conditions can be depend on:

  • gateway vendor name
  • user agent string
  • class of device
  • version of the browser
or any combination of the above.

Raw mode: when all else fails

Ideally, OUI will contain all you need to build good wireless applications. There may be cases, though, were a developer needs to hack bits of mark-up in ways that are not natively supported by the library. In all of those cases, it is possible to recur to the so-called raw mode. For example:

<%@ taglib uri="/WEB-INF/tld/oui.tld" prefix="oui" %> <oui:wml> <oui:card id="raw" title="Raw Mode"> <oui:if agentfamily="uptext"> <oui:do type="you need to write something here no matter what, or oui fails"> <oui:raw_mode> <do type="accept" label="Spawn"> <spawn href="http://www.openwave.com" /> </do> </oui:raw_mode> </oui:do> </oui:if> <oui:p align="left"> UPText browser should see a SPAWN....<br/> </oui:p> </oui:card> </oui:wml>

Only for UPText, this time:

 
Go Back