This 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:
Creating a subscriber application
Creating a publisher application
Defining broadcast events
Assigning events to listeners
Adding applications to a page
Adding the click-across applications page to a page group
Testing the messaging applications
Creating a subscriber
application
Select Build | Applications from the Mobile Web Studio left pane, and click New.
When the Application Builder opens, click Add and select Web Element.
In the New Web Element window, in Location, enter: http://www.marketwatch.com/tools
Click Find.
In the Enter Symbol field, enter SY
and
click the arrow to submit your search query.
Click Next.
On the next page, click the stock name once. Click Next.
On the next page, move the mouse over the stock symbol SY and click to select. Click Next.
Click Select next to the second capture option, then click Next.
In the Configure Parameters window, click the Variable option next to the symb parameter and complete these options:
symb – select this option to create parameters for the stock quote.
Default Value – SY
.
Type – Text Field
Required – select this option.
Click Next to see a preview of the captured data.
Verify that
SY
is
the default value for the Symbol parameter. Parameters without default
values may not work.
In the Element Name field, enter a name for the captured
data; for example, Stock Quote
.
Click Next.
In the Continuous Capture window, click Finish.
In Application Builder, you see a working preview of the application.
To test overriding the CGI parameter, type a different stock symbol into the Symbol text box and click Update.
Click Save. You see the New Element Finish window. Complete these options:
Name – enter Stock
Quote
.
Content type – select “text/html.”
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:
Iframe
Messaging applications must have the Iframe option selected.
No Popup
Editable
Leave the remaining options unselected.
Accept the defaults for the remaining options.
Click Finish to save the application.
Click OK in the confirmation pop-up.
Click Close.
Creating a publisher application
Select Build | Applications from the Mobile Web Studio left pane, and click New.
When the Application Builder opens, click Add and select Web Element.
In the New Web Element window, in the Location, enter: http://finance.yahoo.com
Click Find.
In the Yahoo Finance Web page, beneath the Market Summary heading, click the “Most Actives” link.
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.
Click Select next to the top captured table option, then click Next.
On the Split window, click Next.
On the Define window, click Next.
On the Filter window, click Next.
On the Configure Parameters window, click Next.
In the preview window, give the element a name such
as Most Actives
and click Next.
Then click Finish.
Click Save in Application Builder.
In the Finish window, verify your save options and settings:
Name – enter a name for the
application, for example Most Actives
.
Content Type – select “text/html.”
Roles tab click Add All to move all roles from the Available Roles list to the Assigned Roles list.
Select these options:
Iframe
Messaging applications do not work unless Iframe is
selected.
No Popup
Editable
Accept the defaults for the remaining options.
Administration tab Select Active.
Click Finish.
Click OK in the confirmation pop-up window.
Click Close to close Application Builder and return to the Mobile Web Studio main menu.
Defining broadcast events
Not 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.
Select Build | Applications from the Mobile Web Studio left pane.
On the Application Manager Status menu, click New to display new applications.
Locate the two newly saved applications (publisher and subscriber).
By 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.
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.
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:
Cell – sends the text you click on as the event data.
Static – sends a constant value you specify in the text box to the right of the drop-down list as the event data.
HREF – if the text for which you are defining the event is a link, the underlying URL is sent as the event data.
Enter these values:
Row – all
Column – 1
Event Name – Stock_Click
(note
the underscore)
Select “Cell Value (this cell)” from the drop-down list
Select Client-side.
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.
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.
Click Next to save the new event.
When the Preview page displays, click Finish.
Back in the Mobile Web Studio, right-click the Most Actives application and select Approval Status | Approved.
Defining 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.
On the Status Menu, click New, then right-click the Stock Quote application and select Define Listeners.
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.”
Select Auto Submit to have the publisher of the event call this listener and have the application re-execute immediately.
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.
In the Mobile Web Studio, right-click Stock Quote application and select Approval Status | Approved.
Adding 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.
In Mobile Web Studio, select Build | Pages from the left pane.
Click New on the Page Manager toolbar.
In the Page Builder window, click Add.
In the Search window that displays, click Search.
The application must have Approved status; otherwise,
the applications do not display in the search results.
In the Results pane, hold down the Ctrl key and select the Most Actives and Stock Quote applications. When both are selected, click Add.
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:
Invisible – lets you hide a specific application from the end user. For example, you could set the display status of an application to invisible because the application is performing a server-side lookup operation; for example, transforming city names to postal codes.
Active – when this option is selected, which it is by default, the associated application is marked as active. Only applications marked active and approved display in Portal Interface.
Click Save As to save the page. Complete these fields:
Name – enter My
Stock Quotes
.
Type – select Default.
Active – this option is selected by default.
Roles – click Add All to assign all the available roles to the page.
Click OK to save the page.
After a dialog box tells you the page has been saved, click OK, then click Close to exit the Page Builder.
On the Page Manager Status menu, click New to locate the new page.
Right-click the My Stock Quotes page in the detail pane, and select Status | Approved.
Adding the click-across
applications page to a page group
Add the new page that contains the click-across messaging applications to a page group.
In Mobile Web Studio, select Build | Page Groups.
Click the New button on the Page Groups Manager toolbar.
When the Page Group Builder displays, click Add.
When the Search window appears, click Search.
In the Results pane, select the My Stock Quotes page and click Add.
In the Page Group Builder, click Save As.
When the Save Page Group window appears, complete the fields as follows:
Name – enter My
Stock Quotes
.
Type – select Default.
Pages must be of the same type as the page group to
which you add them. For example, if you create a “default” type
page group, you can only add pages to that page group that are also
the “default” type.
Navigation Style – accept the default.
Active – verify that this option is selected.
Assigned Roles – hold down the Ctrl key, select PortalAdmin and PortalUser, then click Add to move those roles to the Assigned Roles list.
Click OK to save the page group, and click OK again when a prompt verifies that the page group has been saved.
Click Close to exit the Page Group Builder.
Select New from the Page Group Manager Status menu in the Mobile Web Studio main window.
Right-click the new page group, and select Status | Approved from the pop-up. Click OK when the page group saved confirmation displays.
Select Approved from the Status menu.
Right-click the My Stock Quotes page group select Update Users.
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.
Click Logout to exit Mobile Web Studio.
Testing the messaging
applications
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
Log in using an existing account or create a new account using the Join Now link.
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.
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. |
![]() |