<<

. 81
( 87 .)



>>

in an annotation ¬le (a ¬le with a .ann extension) and comprise two
parts”a location and an action. The location is an XPath expression that
de¬nes the location at which the action should be applied. The action is an
activity such as add or remove and is applied to the fragment of HTML
pointed to by the location. Internal annotations have the same functional
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




Supporting Mobile Users 491


behavior but are placed directly within your HTML document as small
XML fragments within HTML comments. Annotators are applied by TT
after your portlet returns its HTML content. At this point TT traverses your
document and applies each annotation instruction. This happens before
any other TT processing is performed, for example, transcoding to other
markup languages. As an example, if you need to create WML based on
a subset of your HTML page, you can add annotators that strip out less
important information and then use a generic HTML-to-WML transcoder.
External annotations are placed in a .ann ¬le. This is an XML ¬le that has
an <annot version="2.0"> element as the root XML element. The ¬le
then follows with a series of description elements” each one including a
location speci¬ed by a target attribute and a take-effect attribute, and
an action as an embedded element. For example, to replace a text fragment in
the ¬rst paragraph in the body of your HTML document, use the following
annotation:

<?xml version="1.0" encoding="ISO-8859-1"?>
<annot version="2.0">
<description take-effect="before" target="/HTML[1]/BODY[1]
/P[1]/text">
<replace>
<text>Replacement Text</text>
</replace>
</description>
...
</annot>

Internal annotations can be added using any text editor. In addition, in-
ternal annotations are supported by the Page Designer Classic tool within
WebSphere Studio Application Developer (which you have to install as an
add-on). When using Page Designer Classic, point to the HTML fragment to
which you want to apply the annotation, and right-click and select Annota-
tion along with the action you want to perform. When adding or modifying
a fragment, enter the new fragment in the dialog that opens. To make mod-
i¬cations to a TABLE, select the entry and choose Edit ➪Attributes from the
menu bar. The last tab on the dialog is the Annotation tab.
Each such annotation changes your HTML code; as an example, if you
add a replace annotation, your HTML code will now include a fragment
similar to (we added line breaks to make it clearer) what follows:

<!--METADATA type="Annotation" startspan
<?xml version="1.0"?>
<annot version="2.0">
<replace>
<text>Replacement Text</text>
</replace>
</annot>-->
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




492 Chapter 24


<P>Original Text</P>
<!--METADATA type="Annotation" endspan-->

Finally, if you would like an annotation to apply only to certain devices,
use a user-agent-based condition. As an example, if you want replacement
text to apply only to Nokia phones you can modify the internal annotation
as follows:

<!--METADATA type="Annotation" startspan
<?xml version="1.0"?>
<annot version="2.0" condition="!(user-agent=*Nokia*)">
<replace>
<text>Replacement Text</text?>
</replace>
</annot>-->
<P>Original Text</P>
<!--METADATA type="Annotation" endspan-->

The same set of annotators is available regardless of whether you are
using internal or external annotations. Annotators supported by TT include
the following:

column”removes a TABLE column located by the XPath expression
field”modi¬es a ¬eld within the HTML form located by the XPath
expression
insertattribute”inserts an HTML attribute into the element
located by the XPath expression
keep”keeps the HTML fragment located by the XPath expression
inserthtml”inserts content before the HTML located by the
XPath expression
remove”removes the HTML fragment located by the XPath
expression
replace”replaces the element located by the XPath expression
with the speci¬ed fragment
replacewithhtml”similar to replace but the content is always an
HTML fragment
row”removes a TABLE column located by the XPath expression
splitpoint”speci¬es a location at which fragmentation should
occur. This allows you to control how the fragmentation transcoder
(mentioned in the section titled “Transcoding Technology”) will
break up long documents
table”used with other annotators such as column and row and
affects the heading of the TABLE located by the XPath expression
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




Supporting Mobile Users 493


Transcoding Plug-ins
In addition to the use of TT for generating content for mobile and of¬‚ine
users, WEA provides a set of transcoding plug-ins that can help you prepare
portlet content for delivery to mobile units. Plug-ins are generic and handle
elements that exist in almost any portlet and hence can often do a lot of
work that you would otherwise have to do yourself. Transcoding plug-ins
include the following:
Image transcoding plug-in: this plug-in converts images ensuring
that you don™t download large images to devices with lower
resolution and overslow networks.
Text transcoding plug-in: this plug-in can convert text fragments
(including HTML and XML) from one format to another and can be
used to simplify output. For example, it can be used to convert a
complex multilevel table to a simple ordered list.
HTML-to-WML transcoding plug-in: this plug-in converts HTML to
WML and can be used to convert existing HTML pages to WML
pages without additional custom work on your behalf.
HTML-to-cHTML transcoding plug-in: similar to cHTML.


Enhanced Portlets
WEA provides not only tools but also packaged applications. These en-
hanced portlets allow you to support mobile users quickly and with no
additional development work. You can support mobile users with out-of-
the-box functions on the following devices:
1. Devices with Pocket IE compliant with HTML 3.2 and Javascript
support as de¬ned in the Windows CE JS3.0 speci¬cation
2. Palm OS devices with Eudora 2.1, the AU Mobile Internet browser
and Palm Web Pro Browser 1.0 and higher
3. WML microbrowsers
In terms of the functionality provided, the following portlets are available
for use by mobile users:
1. Lotus Notes portlets:
a. E-mail
b. Calendar
c. To-do lists
d. Contacts
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




494 Chapter 24


e. Journal
2. Microsoft Exchange portlets:
a. E-mail
b. Tasks
c. Contacts
d. Notes
3. Reminder portlet
4. World Clock portlet
5. QuickLinks portlet
6. Internet Mailbox portlet
7. Banner AD portlet
8. Image Viewer portlet

The Application Integrator Portlet
In Chapter 23 we discussed the Application Integrator portlet that allows
you to portalize functions implemented within back-end application suites
from vendors such as SAP, PeopleSoft, and Siebel. One of the useful fea-
tures of Application Integrator is that it can also work with pocket-PC-based
PDAs. More speci¬cally, you can use Application Integrator to deliver ap-
plications to Pocket IE running on a Pocket PC 2000 or a Pocket PC 2002
environment”but you will need WEA version 4.3 or higher. If you also
want these functions to be available in an of¬‚ine mode, you will need to
install the WEA client version 4.2.1 or higher.
When using Application Integrator there are some additional settings that
you need to specify in order for the back-end functionality to be available
on mobile devices. More speci¬cally, remember the following:
1. Choose the markup type from the Select Markup to Con¬gure
pull-down list in the Object Builder page.
2. Install the WEA client on all PDAs and RIM devices”Application
Integrator supports of¬‚ine usage for applications once the client is
installed.
3. Make sure the clipping portlet is installed”Application Integrator
makes use of clippers to create the of¬‚ine content and deliver it to the
mobile unit.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




Supporting Mobile Users 495


Summary
People are mobile”they have always been mobile. For developers, viewing
a user as someone using a full-blown PC connected through a fast connec-
tion to the Internet has always been a convenience. But this viewpoint is
quickly becoming obsolete”and more so for portal and portlet developers.
If you are part of a large-scale WP rollout, there is a good chance that sooner
or later you will have to service people on the move using mobile phones,
PDA, wireless-enabled laptops, or Blackberry devices. If so, remember that
WP and WEA allow you to provide comprehensive support to your users.
From a rollout perspective you can handle many issues relating to multi-
ple devices and markup within WP”and if this covers all of your require-
ments then your environment can be kept much simpler. If on the other
hand you need complex transcoding then you need to introduce WEA into
the mix and use its advanced TT capabilities. If you can stay with simple
transcoding but need of¬‚ine operations, then you can either choose WEA or
another caching solution such as AvantGo by Sybase or MCP by ViryaNet.
Finally, if the networks through which your functionality will be accessed
include non-IP networks, then you need to introduce a gateway such as
WebSphere Wireless Gateway or a third-party gateway such as the Broad-
beam gateway or integrate proprietary SDKs that are usually provided by
the network provider.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-24 WY009-BenNatan-v1.cls May 11, 2004 14:54




496
P1: FMK
WY009-IND WY009-BenNatan-v1.cls August 11, 2004 23:55




Index

SYMBOLS Action attribute, 301
* asterisk, 190 Action classes
comparison rules, 169 overview of, 308, 341, 351,
includes any of, 169 358
includes, 169 implementing, 309
is between but not equal to, 169 action event processing, 345
is between, 169 action events, 257
is equal to, 169 ActionClassManager, 307, 358
is greater than or equal to, 170 ActionEvent object, 271, 306
is greater than, 169 ActionEvent.getActionString ()
is included in, 170 method, 115
is less than or equal to, 170 ActionForward instance, 356
is less than, 170 ActionListener interface, 302
is not equal to, 170 ActionListener, 338
(#) hash, 122 actionPerformed() event listener
(.) period, 190 method, 264
(+) query operator, 235 actionPerformed() method, 256, 271,
(-) query operator, 235 288
( ) underscore, 190 actionPerformed(ActionEvent event)
method, 271
A ActionRequest object, 264, 338, 341
abstract portlet, 248, 250 ActionResponse object, 265, 338
AbstractAction class, 355 ActionURL, 338, 340

<<

. 81
( 87 .)



>>