Building click-across applications  Building composite applications

Chapter 4: Advanced Application Creation

Creating click-across applications

NoteThis discussion of click-across applications uses the Web element application type for examples. However, you can create click-across messaging applications from any application type that has tabular data, a grid, or table structured output, and allows you to enter input parameters—JSP, XML, database, and Web services.

This section walks you through creating a click-across messaging application:

  1. Creating a subscriber application

  2. Creating a publisher application

  3. Defining broadcast events

  4. Assigning events to listeners

  5. Adding applications to a page

  6. Adding the click-across applications page to a page group

  7. Testing the messaging applications

StepsCreating a subscriber application

  1. Select Build | Applications from the Mobile Web Studio left pane, and click New.

  2. When the Application Builder opens, click Add and select Web Element.

  3. In the New Web Element window, in Location, enter: http://www.marketwatch.com/tools

  4. Click Find.

  5. In the Enter Symbol field, enter SY and click the arrow to submit your search query.

  6. Click Next.

  7. On the next page, click the stock name once. Click Next.

  8. On the next page, move the mouse over the stock symbol SY and click to select. Click Next.

  9. Click Select next to the second capture option, then click Next.

  10. In the Configure Parameters window, click the Variable option next to the symb parameter and complete these options:

  11. In the Element Name field, enter a name for the captured data; for example, Stock Quote. Click Next.

  12. In the Continuous Capture window, click Finish.

  13. In Application Builder, you see a working preview of the application.

  14. To test overriding the CGI parameter, type a different stock symbol into the Symbol text box and click Update.

  15. Click Save. You see the New Element Finish window. Complete these options:

    Content tab

    Accept the defaults for the other options.

    Roles Click Add All to move all roles from the Available Roles list to the Assigned Roles list.

    Presentation tab Select these options:

    Leave the remaining options unselected.

    Accept the defaults for the remaining options.

  16. Click Finish to save the application.

  17. Click OK in the confirmation pop-up.

  18. Click Close.

StepsCreating a publisher application

  1. Select Build | Applications from the Mobile Web Studio left pane, and click New.

  2. When the Application Builder opens, click Add and select Web Element.

  3. In the New Web Element window, in the Location, enter: http://finance.yahoo.com

  4. Click Find.

  5. In the Yahoo Finance Web page, beneath the Market Summary heading, click the “Most Actives” link.

  6. Click Next, then move the mouse around until the cursor is positioned over the Name column of the table. Click on the “Name” heading once to capture the table.

  7. Click Select next to the top captured table option, then click Next.

  8. On the Split window, click Next.

  9. On the Define window, click Next.

  10. On the Filter window, click Next.

  11. On the Configure Parameters window, click Next.

  12. In the preview window, give the element a name such as Most Actives and click Next. Then click Finish.

  13. Click Save in Application Builder.

  14. In the Finish window, verify your save options and settings:

    Content tab

    Roles tab click Add All to move all roles from the Available Roles list to the Assigned Roles list.

    Presentation tab

    Accept the defaults for the remaining options.

    Administration tab Select Active.

    Click Finish.

  15. Click OK in the confirmation pop-up window.

  16. Click Close to close Application Builder and return to the Mobile Web Studio main menu.

StepsDefining broadcast events

NoteNot all application types can have events defined; the application must have tabular data, a grid, or table structured output. If you try to create an event and nothing seems to happen, try using a different application type. Mobile Web Studio does not always issue a warning if the application is not capable of having an event defined.

  1. Select Build | Applications from the Mobile Web Studio left pane.

  2. On the Application Manager Status menu, click New to display new applications.

  3. Locate the two newly saved applications (publisher and subscriber).

    NoteBy default, an application has the “New” status until you right-click the application in the detail pane, select Approval Status from the pop-up, and select a different status.

  4. Right-click the Most Actives application and select Define Events from the pop-up.

    The Define Events wizard displays in a new window. Defining events is a three-step process. The first step shows you all grid, table, or list (structured) objects contained in the current application. You can define events only on structured (tables and lists) content.

  5. In the first wizard window, click Select to choose the top table listed and click Next. The next window allows you to define or edit an event.

    You can define an event for a row, a column, or any subset of rows and columns. You can also use the row and column number to identify a specific cell to define an event.

    Enter the keyword “all” for Row and Column if you want to indicate all values in a row or column for an event.

    Event Name is a logical name that must be unique across the entire portal and you must have separate names for distinct events. You can reuse the name for different cells to have the same event generated.

    WARNING! Defining multiple events on the same data causes invalid HTML. In other words, column 1 cannot have more than one event defined on it.

    The differences between the types of data that can be sent in an event are:

  6. Enter these values:

    1. Select Client-side.

    2. Select:

      • Notify Now – if you want the listener application to refresh immediately when you click the source application

      • Notify Across Page – if the listener application for this event is on a different page.

  7. Click Add to add the event to your events list. After a short time, the first column should turn blue, which indicates there is an event defined for that column.

  8. Click Next to save the new event.

  9. When the Preview page displays, click Finish.

  10. Back in the Mobile Web Studio, right-click the Most Actives application and select Approval Status | Approved.

StepsDefining listeners

This step lets you define a listener for the event to which an application is going to subscribe and listen. You can register an application to listen for one or more events. Each event to which an application listens must be assigned an application input parameter. You must remember the name of the event to which you want an application to listen.

  1. On the Status Menu, click New, then right-click the Stock Quote application and select Define Listeners.

  2. In the Event Name field, type Stock_Click, the name of the event you defined for the My Actives application. Verify that the Listener Param is set to “Symb.”

  3. Select Auto Submit to have the publisher of the event call this listener and have the application re-execute immediately.

  4. Click the plus sign to the right of Listener Param to add the listener event to the application. Once the plus turns into a check mark, click OK to save your changes. If you make an error, click the X icon to delete the Listener Param association, and repeat steps 1 and 2.

  5. In the Mobile Web Studio, right-click Stock Quote application and select Approval Status | Approved.

StepsAdding messaging applications to a page

To test the event you defined, you must add the new applications to a new page that can be viewed in Portal Interface.

  1. In Mobile Web Studio, select Build | Pages from the left pane.

  2. Click New on the Page Manager toolbar.

  3. In the Page Builder window, click Add.

  4. In the Search window that displays, click Search.

    NoteThe application must have Approved status; otherwise, the applications do not display in the search results.

  5. In the Results pane, hold down the Ctrl key and select the Most Actives and Stock Quote applications. When both are selected, click Add.

  6. Click and drag the boxes in the right preview until the Most Actives application is on the left and the Stock Quote application is on the right.

    The options for each application in the left pane are:

  7. Click Save As to save the page. Complete these fields:

    Click OK to save the page.

  8. After a dialog box tells you the page has been saved, click OK, then click Close to exit the Page Builder.

  9. On the Page Manager Status menu, click New to locate the new page.

  10. Right-click the My Stock Quotes page in the detail pane, and select Status | Approved.

StepsAdding the click-across applications page to a page group

Add the new page that contains the click-across messaging applications to a page group.

  1. In Mobile Web Studio, select Build | Page Groups.

  2. Click the New button on the Page Groups Manager toolbar.

  3. When the Page Group Builder displays, click Add.

  4. When the Search window appears, click Search.

  5. In the Results pane, select the My Stock Quotes page and click Add.

  6. In the Page Group Builder, click Save As.

  7. When the Save Page Group window appears, complete the fields as follows:

  8. Click OK to save the page group, and click OK again when a prompt verifies that the page group has been saved.

  9. Click Close to exit the Page Group Builder.

  10. Select New from the Page Group Manager Status menu in the Mobile Web Studio main window.

  11. Right-click the new page group, and select Status | Approved from the pop-up. Click OK when the page group saved confirmation displays.

  12. Select Approved from the Status menu.

  13. Right-click the My Stock Quotes page group select Update Users.

  14. When you see the message that the operation succeeded, click OK. Because the My Stock Quotes page group is the “default” type, all registered Portal Interface users can access this page group after the update operation.

  15. Click Logout to exit Mobile Web Studio.

StepsTesting the messaging applications

  1. Start Portal Interface by entering:

    http://HOSTNAME.PORTALDOMAIN:4040/onepage/index.jsp
    

    If you are using the UA Demo version, enter:

    http://demo.sybase.com:4040/onepage/index.jsp
    
  2. Log in using an existing account or create a new account using the Join Now link.

  3. Select My Stock Quotes from the page group drop-down list on the far right of the Portal Interface window. You see the messaging applications.

  4. To test the click-across messaging applications, select one of the stock symbols in the Most Actives application. The My Stock Quote Symbol input field updates with the stock symbol that you clicked on and updated stock information for the new symbol appears.





Copyright © 2005. Sybase Inc. All rights reserved. Building composite applications

View this book as PDF