Deploying the application  Using the @OP tag to insert parameters

Chapter 2: Getting Started

Creating an application with more features

This tutorial demonstrates how to create a JSP application; select and apply a template; create an XML application; and create a server-side click-across event to link a displayed column (Headline) to a hidden column (URL). This tutorial also shows how to use grid rules to optimize data presentation on a mobile device. (See the Unwired Accelerator Developer’s Guide for more information about grid rules). The resulting NewsStory application enables you to select a headline and display the corresponding news story.

This tutorial is divided into several procedures, so you can refer to them later when you create your own applications.

StepsCreating the NewsStory (JSP) application

  1. Log in to Mobile Web Studio.

  2. Select Applications in the left pane, and click the New button to launch Application Builder.

  3. In the Application Builder, click the down arrow next to the Add button. In the menu that appears select JSP Element.

  4. In the JSP Element window, enter:

    NoteFor remote JSP applications, only applications containing grid data or simple HTML are supported on WAP devices.

  5. Click Preview to preview the JSP page showing Yahoo’s Web site. If you do not see the Yahoo Web site, verify your input; you must see the Yahoo Web site before you go on.

  6. Click Next to continue.

  7. In Element Name, enter documentdisplay.

  8. Click Next to continue.

  9. Click Finish. The document display element is added to the Element List in Application Builder.

    The JSP element does not yet display in the Application Builder preview pane. The template needs to be changed so that the IFRAME in the document display JSP expands and fills the application’s available screen space.

  10. Click the Template button in Application Builder.

  11. In the Find Template window, verify that “html” is selected from the Type drop-down list, then click Search.

  12. When the template list appears in the detail pane, select the OP Basic template, and click Select. (The template name indicates the template layout; for example, OP-1-1 Basic means the template creates a table with one row and one column).

  13. The Find Template window closes and the template is applied to the application. It may take a few moments for the new preview of the application to appear showing the Yahoo.com Web site in the preview pane.

  14. In the Application Builder window, click Save.

  15. On the Finish window, make these entries (otherwise accept the defaults):

    Content tab Name – enter NewsStory (no spaces).

    Presentation tab Select No Popup.

  16. Click Finish to create the application.

  17. Click OK to confirm.

  18. Click the Close button in the upper-right corner to close the Application Builder window.

  19. In Mobile Web Studio, approve the application:

  20. Select Approved from the Application Manager Status menu. You see the NewsStory application in the detail pane.

  21. You can preview the NewsStory application, although it is not yet complete:

StepsCreating the TopNews (XML) application

In this step, create an XML application called, TopNews, and use grid rules to modify its presentation for the mobile device. You will display the three most important columns, and identify two hidden columns, one of which will be used in a click-across event.

NoteCurrently, only JSP templates are valid for mobile applications.

  1. Log in to Mobile Web Studio.

  2. Select Applications in the left pane, and click the New button to launch Application Builder.

  3. Click the arrow to the right of Add, and select XML Element. You see the XML Element Definition window.

  4. In XML URL, enter:

    http://www.moreover.com/cgi-local/page?o=xml_1&c=Top%20US%20stories
    
  5. For Content XSLT, click the Select button next to the text box. The Find XSLT Template window displays.

  6. In Type, make sure the drop-down list is set to XSL, and click Search in the upper-left corner of the window. A list of templates displays in the detail pane.

  7. Click the moreover_content_xsl template.

  8. Click Select to set this as the Content XSLT template for the XML Element. The Find Template window closes.

  9. On the XML Element Definition window, click Preview to test the settings entered. After a few moments a seven-column table with multiple rows displays in the Preview pane.

  10. Click Next to continue

  11. On the Split window, click Next as this feature is not used in this tutorial.

  12. Use the Define window to identify record 1 as the header row. In the Define Record Layout section, click “Records contain labels.” When the “Labels are displayed in Record” option displays, accept the default 1. Click Next.

  13. On the Filter window, rename the headers of the second, third, fourth, sixth, and seventh columns:

  14. Click Next to continue. The Window Preview window displays the modified table in the lower part of the screen. Only Headline, Source, and Date are displayed (3,4,7) in grid format.

  15. In Element name, enter TopNews (no space) as the XML Element name.

  16. Click Next to continue.

  17. On the Continuous Capture window, click Finish since this feature is not included in this tutorial. The XML Element Definition wizard closes and the XML Element displays under the Element List in the Application Builder window.

  18. In the Application Builder window, click Save.

  19. In the Finish window, make this entry (accept all other defaults):

    Content tab Name – enter TopNews (no space).

  20. Click Finish.

  21. Click OK to confirm.

  22. Click Close in the upper-right corner to close Application Builder.

  23. Click New under Application Manager Status in the middle pane. The TopNews application displays in the detail pane. Do not approve it yet.

StepsDefining a click-across event

In this step, define a server-side click-across event for the TopNews application that links the Headline field with the hidden URL field. You also use a grid rule formula to link the two fields.

  1. Right-click TopNews in the detail pane, and select Define Events.

  2. In the Define Click-Across Events window, click Select to the left of the data grid. The hidden fields (URL and SourceURL) are included in the grid.

  3. Click Next to continue.

  4. Under Assign An Event, enter these values:

  5. In the Assign An Event section, click Add. After a moment the second field in the grid is highlighted in blue to show the event is defined for the field. The fields are underlined indicating a link is established. This is the link to the hidden URL field.

  6. Click Next to continue. A preview of the application for which the event was defined displays.

  7. Click Finish to save the event definition to the application.

  8. In Mobile Web Studio, approve the application:

  9. Select Approved from the Application Manager Status menu. You see the NewsStory application in the detail pane.

StepsPreviewing the TopNews application

  1. Select the TopNews application in the detail pane, and click the Preview button. The Yahoo.com Web site displays in a window.

  2. Select a Headline link.

  3. Verify that the correct article displays.

  4. Close the window.





Copyright © 2005. Sybase Inc. All rights reserved. Using the @OP tag to insert parameters

View this book as PDF