Mobile XDIME JSR168 sample portlet

The Mobile XDIME JSR168 sample portlet demonstrates a number of the capabilities of XDIME. It is written to the JSR 168 specification.

Using XDIME JSR168

This sample portlet contains two sets of JSPs: an XDIME and an HTML version. The XDIME JSP demonstrates how to code in XDIME a version of the page that was coded in HTML. This help text is available only from the HTML version of the page. The help text provides information about each of the pages in this sample.

Note: The sample portlet displays differently on different devices, depending upon which markup type a given device supports and what browser it uses.

Setting up XDIME JSR168

Client requirements
This portlet supports browsers and devices that are handled by either the HTML or XDIME aggregators.
Server requirements
There are no special server requirements.
Deployment and installation
The Mobile XDIME JSR168 sample portlet is installed with the Mobile Portal Accelerator runtime components and also as a sample in the Mobile Portal Toolkit samples gallery. When it is installed with the Mobile Portal Accelerator runtime components, it is located on the Mobile Applications page.

You can use the Mobile Portal Toolkit to view the source code for the portlet and to run it in the WebSphere® Portal Test Environment.

The name of the portlet's WAR file is MWPJSR168Sample.war.

Configuration parameters
There are no configuration parameters in this portlet.

Main Menu

The sample XDIME JSR168 portlet does not look like a real application. Instead, it has pages that say This page shows the use of xxxx XDIME elements and yyyy policies. Here's a zzzz created with the following XDIME elements: nn, mm....

From the main menu on the first page of the portlet you can select links to other pages to display the samples. The main menu page uses the menu elements (both rollover text or rollover image type may be included). The menu element also refers to a style class (either in the portlet's own theme or in the aggregator theme) that defines menu properties. This main menu can be used to select the following pages for other samples listed in the following subsections.

Forms

The Forms page displays the different types of form selection element samples using the XDIME menu elements. The user can select the sample type to see and another page with the selected sample. Each of the sample form pages can show the results of the form entry when the user selects the submit action. Each of the following form samples is on a separate page:

Large Form

These pages include fragmentation and form fragmentation.

Lists with Conditionals

This page displays two lists. Using the portlet's configure mode, the administrator can specify whether or not to use an ordered list or an unordered list. The portlet code places the preference setting into a view bean, which is used by the standard JSP tag conditional processing to determine which type of list to display. A definition list can use the device characteristics to determine which definition of a term to show. The definition list conditional processing is done by the XDIME select tag with the expr testing of device characteristics.

Link

There is a page that shows the use of the link (“a”) element with both a URL as well as with a link component.

Dissecting panes

There is a page containing dissecting panes along with the div and dividehint elements. This page also displays the results of the edit mode page as the data to place within the shards of dissecting pane fragments.

Edit mode

The Edit mode page is displayed when the user selects edit from the portlet's toolbar. The page enables the user to add or remove URL type bookmarks on a list. This page also demonstrates the spatial iterator to show an unknown size list of items. The portlet code processes the submission from the form and save the results in the preferences. The code also demonstrates the use of the preference validation and passing an error message to be displayed on the page. The page uses both XDIME form submission and the portlet code to show how to switch from the current mode to another mode pragmatically.

Config mode

The Config mode page is displayed when the user selects config from the portlet's toolbar. This page demonstrates the radio form to control the setting of the list type preference. The portlet code processes the submission from the form and save the results in the preferences. This page demonstrates that this mode was added correctly to the list of available modes and the portlet code that must be added to support additional portlet modes. The page uses both XDIME form submission and the portlet code to show how to switch from the current mode to another mode pragmatically.



Terms of use
(C) Copyright IBM Corporation 2012. All Rights Reserved.