7.6 Designing the mobile applications


7.6 Designing the mobile applications

In the following sections, we discuss the options provided by WebSphere Everyplace Access to extend applications to mobile and wireless devices. These options cover the two ways an application can be accessible from pervasive devices, either by using wireless devices with WAP, HTML or cHTML devices or by using mobile devices that store data for further manipulation.

When you want to extend existing applications to pervasive devices, the design tasks are basically the following:

  • Define the application processes that are going to be accessible from the devices.

  • Define the kind of access the users must have to these applications.

The application itself may help you decide what kind of access must be provided to the users; for example, a Web application is, in general terms, easier to extend by using a browser-based device than by developing a whole new application for the device in order to manipulate the synchronized data.

The target device platform is also a decision point; if you want your application to be enabled for several device platforms, it is better to develop a Web application and make it accessible from the browsers included on each platform.

7.6.1 Transcoding guidelines

Once you have developed a portal, you may want it to be accessible by using pervasive devices such as WAP-phones and PDAs. The easiest way to do this is by enabling the Transcoding Technologies provided with WebSphere Everyplace Access.

With Transcoding Technologies, the portal content and presentation can be modified in order to fit specific device characteristics; for example, the content can be optimized to show only the most relevant information and the images can be reduced in size and color depth. By providing a single access point for multiple device types, the cost of re-development and maintenance of applications is significantly reduced.

The content is transformed according to the information associated with each device and user profile. Transcoding Technologies also transforms the markup language to make it comprehensible by the device.

In Transcoding Technologies, there are three types of resources that can be used to transform contents:

  • XML Stylesheets

  • Annotators

  • Transcoding plug-ins

There is another type of resource called preference profiles ; this resource is used by Transcoding Technologies to determine the device and user characteristics, as well as the stylesheet, annotator or plug-in to use.

Transcoding Technologies acts as a filter for a single portlet, so you need to enable this filter for every portlet you want to be accessible from wireless devices.

Next, we discuss the differences between the transformation options, as well as scenarios showing their use.

Preference profiles

This represents a particular type of device, or a particular user or group of users. Transcoding Technologies uses these files to decide how to treat documents depending on the device and the user making the request.

The device preference profiles are represented by .prop files located in:

  • <TTRoot>\etc\preferences\device

The user preference profiles are represented by .prop files located in:

  • <TTRoot>\etc\preferences\user

If the X-IBM-PVC-Device-Type field is present in the HTTP header, Transcoding Technologies uses the device profile whose file name matches the value specified for that field. If this field is not present in the HTTP header, Transcoding Technologies uses the device profile whose user-agent value matches the value of the user-agent field in the HTTP header. If no matching profile is found, Transcoding Technologies uses the default device profile. Example 7-12 shows an example of a device preference profile.

Example 7-12: Device preference profile
start example
 #version = 1.0 #Wed Jul 10 12:55:23 CDT 2002 framesSupported=true deviceRule=(User_Agent%e*MSIE 6.0*) javaAppletSupported=true portalOrdinal=360 portalMarkupVersion=ie createCHTML=false portalClient=true desiredContentTypes=[text/html] parent=NT.InternetExplorer javaScriptSupported=true 
end example
 

If more than one device profile matches the incoming request, it is impossible to predict which of the matching profiles would be selected.

The user profile is selected for a request following these steps:

  1. If a value is specified for UserAndSessionExtractor in <TTRoot>\etc\localConfig.prop, Transcoding Technologies tries to execute the referenced implementation of the UserAndSessionExtractor interface to obtain the user and session names and select the user profile that matches the user name.

  2. You can specify a field in the HTTP header to be used to select a user profile by setting the httpUserIdField value in <TTRoot>\etc\localConfig.prop; Transcoding Technologies would then find the value of the defined field in the HTTP header and select the user profile that matches that value.

  3. If the X-IBM-PVC-User field is present in the HTTP header, Transcoding Technologies uses the user profile that matches the value specified for that field.

  4. If none of these methods identifies a user profile, Transcoding Technologies does not use a specific user profile. If one of these methods is used to specify the user profile and the specified user profile file is not found, Transcoding Technologies does not try the other methods .

Each profile contains values for the preferences that are important to the device represented by the profile. If the preference is not important for the device, it can be omitted so that a value can be chosen from a different profile. Transcoding Technologies will check profiles for a value in this order:

  1. Specific user

  2. Specific device

  3. Default user

  4. Default device

XML stylesheets

If your existing Web applications generate XML documents, the easiest way to extend them to wireless devices is to use XSL stylesheets; this approach also provides the company a single way of sharing data among different kind of users, while maintaining one representation of the data as XML documents.

In order to transform the XML documents, the stylesheets must be registered in the transcoding server. You can do so by:

  • Adding the stylesheet resources to the configuration.

  • Configuring the portlet to use a stylesheet. This can be done by using one of the following alternatives:

    • If the stylesheet is part of the portlet .war file, a <config-param> element with the stylesheet specifics is added to the <concrete-portlet> element within the portlet's portlet.xml file.

    • If the portlet is not within the portlet .war file, you can specify the StylesheetFile parameter with the installed portlet.

  • Specifying the stylesheets within the XML document using the wtp-condition. This approach supports multiple stylesheets for a single document.

Annotators

Annotation files are used to modify an HTML document to meet specific device characteristics. This type of modification is known as clipping .

This option is useful when you are trying to reach devices with limited screen size, since it only allows the showing of critical information and avoids showing irrelevant content, such as graphics. There are two types of annotators:

  • Internal annotators can be created by using the tools available in WebSphere Studio Application Developer and WebSphere Studio Site Developer. They are special tags embedded in the original HTML document. When the transcoding server filters the document, these tags are processed .

  • External annotators are separate and independent annotation files used by Transcoding Technologies to operate on the original HTML document. They can be created with simple text editors or with tools supplied in the Pervasive Toolkit.

    The external annotators can be registered by using the XML Configuration tool, and they can be visible to all portlets, or can be set for specific portlets using Portal Administration.

Transcoding plug-ins

A transcoding plug-in is a piece of software that modifies the content of a document. These plug-ins are selected to process a document based on conditions specified by the program when the plug-in is created.

Several transcoding plug-ins are provided with Transcoding Technologies and you can obtain or develop others. Some of the plug-ins included are as follows .

  • The image transcoding plug-in modifies images regarding color support and size to better support the display capabilities of a device.

  • The text transcoding plug-in converts textual data, such as HTML or XML, from one format to another and can perform a number of transformations to simplify the output.

  • The fragmentation transcoding plug-in fragments XML documents into smaller pieces that can be managed by the target device.

  • The HTML DOM generator creates a Document Object Model (DOM) version of the incoming HTML documents.

  • The annotation transcoding plug-in , also known as the annotation engine, interprets the contents of the annotation files to perform the document clipping.

  • The HTML to WML Transcoding plug-in converts HTML documents to WML for devices with WAP browsers.

  • The HTML to compact HTML transcoding plug-in transforms HTML documents to Compact HTML documents for devices with cHTML browsers.

New transcoding plug-ins can be developed by using the API provided.

For more information about transcoding, refer to the following IBM Redbook and Redpaper:

  • Mobile Applications with IBM WebSphere Everyplace Access Design and Development , SG24-6259

  • Transcoding Technologies in IBM WebSphere Everyplace Access V4.1.1 , REDP3592




Patterns. Pervasive Portals
Patterns: Pervasive Portals Patterns for E-Business Series
ISBN: 0738427772
EAN: 2147483647
Year: 2002
Pages: 83
Authors: IBM Redbooks

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net