WML Language Reference - SourceForge

3y ago
24 Views
2 Downloads
630.46 KB
44 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Ophelia Arruda
Transcription

Getting StartedO pe n w a v e U s a b i l i t y I n t e rf a c e , J a v a E d i t i o n 1 . 0 Be t aOpenwave Systems Inc.1400 Seaport BoulevardRedwood City, CA 94063http://www.openwave.comPart Number OUGS-10-006November 2001

LEGAL NOTICECopyright 1994–2001, Openwave Systems Inc.All rights reserved.Openwave, the Openwave Systems Inc. logo, Phone.com, the Phone.com logo, and the family of terms carrying the “UP.” prefix aretrademarks of Openwave Systems Inc.All other company, brand, and product names are referenced for identification purposes only and may be trademarks that are thesole property of their respective owners.

ContentsAbout This Book vAudience vRelated Documentation vTechnical Support viOther Resources viWAP viJava viStyle and Typographical Conventionsvi1: Introducing OUI 1The WML Dilemma 1The OUI Solution 2An Example with Menus 2Getting Started 72: Creating a OUI Service 9Installing OUI and a Java Server 9Openwave SDK 9OUI Programming 9WML Tag Library 10XHTML Tag Library 11Previewing Your OUI Application 15Using the Openwave SDK 15Using Other SDKs 15Using Mobile Browser Devices 15Using MS Internet Explorer 5.x 15Raw Mode: An Extra Operation Mode 17Openwave Usability Interface, Java Edition 1.0 BetaGetting Startediii

Contents3: OUI Application Fundamentals 19Menus 19Forms and Primary Paths 21XHTML Tag Library 23Secondary Paths and Side Paths 23TaskMenus 25ComboMenu 27Publishing Large Chunks of Text: BodyPager 29Making Phone Calls: Caller (and Rendering Directives) 31WML Tables on All Browsers: Table 33Reducing Perceived Latency: Mobile-Originated Prefetch 35Application-level Optimization: Conditional Tags 36Raw Mode: When All Else Fails 38ivGetting StartedOpenwave Usability Interface, Java Edition 1.0 Beta

PrefaceA b o u t T h is B o o kThis book shows you how to use the OpenwaveTM Usability Interface (OUI), Java Edition1.0 Beta to create a single Wireless Markup Language (WML) application that operatesoptimally on various types of Wireless Application Protocol (WAP) devices.Au d i e n c eThis book is intended for WAP developers who want to create and host WML applicationsthat run well on more than one type of mobile browser.You can write OUI applications using the Java language or the OUI XHTML or WML taglibraries. Depending on the method you choose, you will need a background in thattechnology.Related DocumentationOUI comes with the following documentation: Installation and Integration describes how to install and configure OUI and the Javaserver and development software required to host and develop OUI applications. Italso includes some basic OUI examples. Getting Started (this book) describes OUI and how to use it. The Object Model Reference describes the details about the Java implementation foreach OUI object. The WML Tag Library Reference describes each WML tag library tag and attribute. The XHTML Tag Library Reference describes each XHTML Mobile Profile taglibrary tag and attribute.The Openwave SDK comes with documentation for XHTML-MP, WML and WML script,and related topics. For a complete list of documentation, see:http://developer.openwave.comOpenwave Usability Interface, Java Edition 1.0 BetaGetting Startedv

PrefaceTechnical SupportTe ch ni ca l S u pp o r tThe best resource for up-to-date information on using OUI is the Openwave Developersite:http://developer.openwave.comIn addition to the downloadable OUI, this site contains a variety of useful resources,including Frequently Asked Questions, bug reporting, technical support, and aninteractive developer forum.O t h e r R e s o u rc e sWA P WAP Forum:http://www.wapforum.com WML Pulse Europe: http://wmlpulse-europe.openwave.com WAP FAQs: http://www.allnetdevices.com/faq/ WML Forum: http://groups.yahoo.com/group/wmlprogramming WMLScript.com: http://www.wmlscript.com WirelessDeveloper.com: http://www.wirelessdeveloper.com WirelessDevNet.com: http://www.wirelessdevnet.comJ ava Allaire JRun: http://www.jrun.com/ Jakarta Tomcat: http://jakarta.apache.org/ Resin-CMP: http://www.caucho.com SUN JSP: http://java.sun.com/products/jsp SUN Servlets: http://java.sun.com/products/servletSt y l e a n d Ty p o g r a p h i c a l C o nv e n t i o n sThis manual uses different fonts to represent the information that you enter: Text that appears like this identifies command names, path names, URLs,and specific text that you must enter. viGetting StartedText that appears like this identifies placeholders or variables that youshould replace with values appropriate to your environment.Openwave Usability Interface, Java Edition 1.0 Beta

Chapter 11Introducing OUIYou can use the Openwave Usability Interface (OUI) to build a single wireless applicationthat delivers the best possible user experience to a wide variety of Wireless ApplicationProtocol (WAP) devices. The current release of OUI is a developer library implemented inJava, plus tag libraries modeled on the Wireless Markup Language (WML) and XHTMLMobile Profile (XHTML-MP).You can download OUI at no charge from the Openwave Developer Web site:http://developer.openwave.comThe best tool for writing OUI applications is the Openwave SDK 5.1 Preview, which isalso available free of charge from the Openwave Developer Web site. This edition of theOpenwave SDK features an integrated development environment (IDE), with a text editorthat recognizes and can highlight the syntax of code you write using the OUI WML andXHTML tag libraries. The IDE also provides a simulator for the graphical OpenwaveMobile Browser, which you can use to test your OUI applications.You host OUI applications on a web server that is configured to support Java Server Pages(JSP) and servlets. One example is the Tomcat Java server from the Apache SoftwareFoundation. Installing and configuring a Java server, a Java SDK, and OUI so you can startdeveloping and hosting OUI applications is described detail in the OUI Installation andIntegration book.The WML DilemmaWML is a markup language based on Extensible Markup Language (XML). It is designedfor specifying user interface behavior and displaying content on wireless devices such asphones, pagers, and personal digital assistants (PDAs).The Wireless Application Protocol (WAP) Forum is an industry organization dedicated todeveloping open standards for wireless communication. It has provided a formalspecification for WML, which includes the Document Type Definition (DTD) for WML.See the WAP Forum web site for full WAP specifications:http://www.wapforum.orgIn practice, the manufacturers of WML browsers and the devices they run on haveinterpreted the WML standard very differently, so WML applications that run well on onedevice are often unusable or simply fail on other devices.Openwave Usability InterfaceGetting Started1

1Introducing OUIThe OUI SolutionThis has left developers with difficult choices: Write WML applications that work well onone device but work poorly (if at all) on others, or write and maintain two or more versionsof the same application. A third choice, writing a lowest-common-denominatorapplication that works on all devices has proved equally frustrating: The set of commonfeatures is small, and shrinks each time a new device is introduced.T h e O U I S o lu t io nOUI solves this dilemma by offering a set of high-level APIs that encapsulate the buildingblocks of ideally usable WML applications.When you build a OUI application out of these building blocks and a user connects to it,OUI recognizes the details of the user’s WAP browser, device, and gateway and deliversthe most appropriate and usable WML code: You don’t need to write and maintainmultiple versions of your applications to offer the best user experience to a wide array ofmobile devices.OUI is optimized for the current generations of graphical and text-based OpenwaveMobile Browsers (4.x and 5.x) and for Nokia WAP 1.1 browsers. For current or futuredevices that OUI doesn’t recognize, OUI delivers a generic version of WML that ensuresyour applications will run. As new WAP devices appear on the market, new OUI librariescan support them without your having to change your current code: Your applications willsimply run better.A n E x a m p l e w it h M e n u sMenus are a feature of WML applications that are interpreted quite differently on differentbrowsers.The WML code segment shown in Listing 1-1 provides optimum usability for menunavigation on Nokia browsers.2Getting StartedOpenwave Usability Interface

Introducing OUIAn Example with Menus1Listing 1-1. ?xml version "1.0" ? !DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml 1.1.xml" !--Control examples: Menu Navigation on Nokia-- wml card id "testcard" title "short" p align "left" mode "wrap" a title "Weather" href "#weath" Weather /a a title "Eat" href "#eat" Restaurants /a a title "Movie" href "#cinema" Movie Theaters /a a title "Gamble" href "#gamble" Casinos /a a title "Zoo" href "#zoo" Zoologic Park /a a title "Fun" href "#fun" Fun for family /a /p /card /wml When this code is run on an Openwave Mobile Browser, users are deprived of a usefulshortcut to access menu items: they cannot use the numeric keypad to jump to an option.Instead, they must scroll down to reach it.To optimize the WML code for Openwave Mobile Browser users, you can take theapproach shown in Listing 1-2.Openwave Usability InterfaceGetting Started3

1Introducing OUIAn Example with MenusListing 1-2. ?xml version "1.0" ? !DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN""http://www.phone.com/dtd/wml11.dtd" !-- Control examples: Menu Navigation on the Openwave MobileBrowser -- wml card id "testcard" title "short" p align "left" mode "nowrap" select option title "Weather" onpick "#weath" img alt "" src "" localsrc "sun" / Weather /option option title "Eat" onpick "#eat" img alt "" src "" localsrc "meal1" / Restaurants /option option title "Movie" onpick "#cinema" img alt "" src "" localsrc "camcorder" / Movie Theaters /option option title "Gamble" onpick "#gamble" img alt "" src "" localsrc "dice" / Casinos /option option title "Zoo" onpick "#zoo" img alt "" src "" localsrc "camera1" / Zoologic Park /option option title "Fun" onpick "#fun" img alt "" src "" localsrc "family" / Fun for family /option /select /p /card /wml Unfortunately, this code degrades usability on the Nokia browser to an unacceptable level:The Nokia browser actually breaks on this code because of the in-line images, whichdepend on WML extensions. If the images were removed the Nokia would not break, butusability would be poor. For this reason, many developers use hyperlinks to build menus.They adopt the “generic WML” model—that is, coding for a generic browser.However, this approach has some serious problems. It deprives the owners of advancedWAP devices of many of the possibilities offered by their handsets. This is a directconsequence of the “least common denominator” approach. In particular, the genericapproach prevents users from fully exploiting the capabilities of the Openwave MobileBrowser.This is not the only serious problem. Let’s assume that you have chosen the genericapproach for your application and that a new WAP device is released onto the market. Thefact that you have already compromised in terms of user interface capabilities does notprotect you from new devices with different interpretations that require you to change yourcode again and possibly further degrade the overall usability of your application.4Getting StartedOpenwave Usability Interface

Introducing OUIAn Example with Menus1OUI provides a solution that allows you to create and maintain a single version of yourapplication while supporting optimal usability on a multitude of devices.Consider the segment of OUI WML tag library code shown in Listing 1-3:Listing 1-3. %@ taglib uri "/WEB-INF/tld/oui.tld" prefix "oui" % oui:wml oui:card id "testcard" title "short" oui:p align "left" mode "nowrap" oui:menu oui:menu item title "Weather" href "#weath" text "Weather" icon "sun"/ oui:menu item title "Eat" href "#eat" text "Restaurants" icon "meal1"/ oui:menu item title "Movie" href "#cinema" text "MovieTheaters"icon "camcorder" / oui:menu item title "Gamble" href "#gamble" text "Casinos"icon "dice" / oui:menu item title "Zoo" href "#zoo" text "Zoologic Park"icon "camera1" / oui:menu item title "Fun" href "#fun" text "Fun for family"icon "family" / /oui:menu /oui:p /oui:card /oui:wml The Menu object is a OUI abstraction representing a navigation menu. The object iscreated and progressively enriched with information about the menu items.When this file is served to a user, OUI determines the requesting device and returns one ofthe WML versions shown in Listing 1-1 and Listing 1-2, depending on the family of thedevice: Hyperlinks for Nokia handsets, select / option for the Openwave MobileBrowser, and hyperlinks followed by line breaks for generic WAP devices.This application produces the following output on a Nokia handset.This illustration shows the best output that the handset can manage when implementingmenu-like navigation.Openwave Usability InterfaceGetting Started5

1Introducing OUIAn Example with MenusThe Openwave Mobile Browser is better served by select / option elements (andpossibly some in-line icons), as shown in the following figure.This is a great improvement over the generic WML, which many developers use in GSMareas.Compare the previous figure with what generic WML would produce on the same phone.This is what Openwave Mobile Browser users experience in GSM areas. Usability is muchlower than the level that the handsets are actually capable of providing.6Getting StartedOpenwave Usability Interface

Introducing OUIGetting Started1Getting StartedThe current version of OUI offers you a number of choices for how you write your OUIapplications: You can write your applications in Java, to take advantage of the powerful Javaprograming environment. You can write your applications using the OUI WML tag library, a quick and easyway to start writing OUI applications, particularly if you’re already familiar withWML. You can write your applications using the OUI XHTML tag library, which is alsomuch simpler than the OUI Java APIs, and which you can use to experiment withXHTML Mobile Profile, the new mark-up standard specified by the WAP forum. You can write applications that mix these approaches, taking advantage of thestrengths of each.The next chapter in this book, “Creating a OUI Service,”, gets you started writing a simpleapplication using each of these approaches.The final chapter in this book, “OUI Application Fundamentals,” offers greater detailabout the most important building blocks of OUI applications.Openwave Usability InterfaceGetting Started7

18Introducing OUIGetting StartedGetting StartedOpenwave Usability Interface

Chapter 22Creating a OUI ServiceThe information in this chapter will help you begin to create and preview OUIapplications and services.In s t a l li n g O U I a nd a J ava S e r v e rTo use the Openwave Usability Interface (OUI), you must first install and configure OUIand a Java Application Server. See OUI Installation and Integration for instructions.O p e n w av e SD KThe Openwave SDK 5.1 Preview provides an Integrated Development Environment (IDE)that helps you develop OUI services. The IDE integrates a number of mobile browsersimulators that allow you to preview your services on several phone models. It alsoprovides file headers for new JSP files and syntax coloring for OUI tag library files in theeditor.You can download the Openwave SDK 5.1 Preview from the Openwave Developer website:http://developer.openwave.comO U I P ro g r a m m i ngYou can write OUI applications using the Java language or the OUI XHTML or WML taglibraries. OUI applications are implemented as Java Server Pages (JSP) or Java servlets.You can use the examples in the this chapter to learn about OUI and to determine the OUIprogramming tools that make the most sense for your needs.In each example, a different OUI technology is used to create the same application for amobile browser device.Openwave Usability InterfaceGetting Started9

2Creating a OUI ServiceOUI ProgrammingW M L Tag L i b ra r yThe following example shows a “Hello World” application using the OUI WML taglibrary.1 In the application server webapps directory, create a new directory calledtesting.For Tomcat:%TOMCAT HOME%\webapps\ROOT\testing2 Enter the following code in a text editor (such as the Openwave IDE). %@ taglib uri "/WEB-INF/tld/oui.tld" prefix "oui" % oui:wml oui:card title "WML Greeting" id "main" oui:p mode "nowrap" Hello World! /oui:p /oui:card /oui:wml 3 Save the file in the new testing directory as wmlHello.jsp.4 Open the file in a web browser or in the Openwave IDE.For Tomcat, the URL ting StartedOpenwave Usability Interface

Creating a OUI ServiceOUI Programming2Figure 2-1. WML JSP displayX H T M L Tag L i br a r y1 Enter the following code in a text editor (such as the Openwave IDE). %@ taglib uri "/WEB-INF/tld/xhtmloui.tld" prefix "oui" % oui:html xmlns "http://www.w3.org/1999/xhtml" oui:head oui:title XHTML Greeting /oui:title /oui:head oui:body oui:p align "center" Hello World! /oui:p /oui:body /oui:html 2 Save the file in the testing directory as xhtmlHello.jsp.Openwave Usability InterfaceGetting Started11

2Creating a OUI ServiceOUI Programming3 Open the file in a web browser or in the Openwave IDE.For Tomcat, the URL igure 2-2. XHTML JSP display12Getting StartedOpenwave Usability Interface

Creating a OUI ServiceOUI Programming2J ava S e r v l e t sThe following example shows you how to create a “Hello World” application that is a Javaservlet.1 Enter the following code in a text s.*;javax.servlet.http.*;public class HelloWorld extends HttpServlet {public void doGet(HttpServletRequest request,HttpServletResponse response)throws javax.servlet.ServletException,java.io.IOException {performTask(request, response);}public void doPost(HttpServletRequest request,HttpServletResponse response)throws javax.servlet.ServletException,java.io.IOException {performTask(request, response);}public void performTask(HttpServletRequest request,HttpServletResponse response) {try {DeviceContext dc new DeviceContext(request,response);Deck myDeck new Deck();Card myCard new Card("hello","A Greeting");myCard.setTitle("A "Hello rd);dc.render(myDeck);}catch (Throwable theException) {theException.printStackTrace();}}}2 Save the file as HelloWorld.java in the directory where the Java server storesJava class files.For Tomcat, the class directory is:%TOMCAT HOME\webapps\ROOT\WEB-INF\classes3 Choose Start Run.Openwave Usability InterfaceGetting Started13

2Creating a OUI ServiceOUI Programming4 In the Run dialog box, enter cmd and click OK.5 In the DOS command prompt window, change to the directory in which the Javaserver stores Java class files.For Tomcat, Enter:cd %TOMCAT HOME%\webapps\ROOT\WEB-INF\classes6 Enterjavac HelloWorld.javaThe class directory now contains the HelloWorld.class file, which can beaccessed from a web browser or the SDK simulator. When accessing this file, don’tinclude the .class extension in the URL.7 Open the file in a web browser or in the Openwave IDE.For Tomcat, the URL is:http://localhost:8080/servlet/HelloWorldFigure 2-3. WML servlet display14Getting StartedOpenwave Usability Interface

Creating a OUI ServicePreviewing Your OUI Application2Pr ev i ew i n g Yo u r O U I A pp l i c a t io nThere are a number of ways to preview your OUI application.U s i n g th e O p e n w av e S DKWhen developing OUI ap

Unfortunately, this code degrades usability on the Nokia browser to an unacceptable level: The Nokia browser actually breaks on this code because of the in-line images, which depend on WML extensions. If the images were removed the Nokia would not break, but usability would be poor. For this reason, many developers use hyperlinks to build menus.

Related Documents:

Wireless Application Protocol (WAP) . HTTP Browser HTML StyleSheet WML Browsers WML Stylesheet . WML The basic unit is a card. . HTML, Java HTTP Internet WAP WAE comprises WML (Wireless Markup Language), WML Script, WTAI etc. Transaction Layer (WTP) additional services

WAP/WML: The Wireless Access Protocol and the Wireless Markup Language 2. XHTML: The XML representation of HTML, or a subset thereof 3. XUL: The XML User Interface Language 4. J2ME: The Java 2 Micro Edition wireless-clients-final.fm Page 505 Wednesday, May 12, 2004 1:54 PM. Chapter 11 Wireless Clients 506 WAP is a protocol stack for wireless devices, and WML is a markup language that is .

application from desktop browser to WAP-enabled phone, to whatever other device/application. Among other things, this design will keep mos t of your software investment insulated from future changes to WML and WAP, and from device-type proliferation. JSP is not the only technology that can be used in the XML transformation layer. In

a Waste management licence (Wml) is required by any person, company, municipality or state department that wishes to undertake one or more waste . a Waste management application form initiates the Wml process for s&eir . once the la authority has reached a decision, the la has to inform the .

OpenCOBOL 1.0 the current o cial release version, hosted on SourceForge.net, compiles on: All 32-bit MS Windows (95/98/NT/2000/XP) All POSIX (Linux/BSD/UNIX-like OSes) OS/X OpenCOBOL 1.1, has been built on MS Windows native MS Windows with Cygwin POSIX Systems including OpenSol

SMC History SMC is Robert Martin's invention (it is discussed in Robert's book Agile Software Development (Ch 29)) Charles Rapp happened to have succeeded Robert at Clear Communications Corporation. He added many features, made design revisions, and open-sourced the project (more information in the preface of the SMC manual on sourceforge). 26

2009 Moses receives support from EuromatrixPlus, also EU-funded 2010 Moses now supports hierarchical and syntax-based models, using chart decoding 2011 Moses moves from sourceforge to github, after over 4000 sourceforge check-ins 2012 EU-funded MosesCore launched to support continued development of Moses

Senior Jazz Combo Wild and unpredictable band of senior musicians in years 10 to 13 for whom anything goes! (Grade 5 with a focus on improvisation). Senior Vocal Group Run by 6th form students for 6th form students, this is an acappella group of mixed voices with high standards of singing. St Bartholomew’s School Orchestra (SBSO) All instrumentalists are expected to perform in the school .