350 WebSphere Commerce Portal V5.4 Solutions
The main elements of the WAP specification are as follows:
A Wireless Application Environment (WAE), which includes a microbrowser
and is very well suited for devices with poor capabilities.
A new markup language called the Wireless Markup Language (WML), and a
new scripting language called WMLScript.
A new protocol stack, which is independent of the underlying network and is
suitable for connections that have low bandwidth and are often unreliable.
A secure protocol called Wireless Transport Layer Security (WTLS), which
provides authentication and confidentiality.
The WML markup language is based on XML. It can be viewed as a simplified
version of HTML. It allows the user to enter data, select from a list, and display
text and certain types of images. Example 10-1 shows a simple WML code
sample.
Example 10-1 A simple WML code sample
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1"title="A first example">
<p align="center">
Hello WAP World.
</p>
</card>
</wml>
10.2 Deploying the WAP portal adapter
During the IBM Commerce Enhancement Pack - April 2003 Edition installation,
the <WC_HOME>\schema\db2\wcs.portal.sql script is executed. This SQL script
updates the WebSphere Commerce instance database tables PVCDEVMDL,
PVCDEVSPEC, and PVCMDLSPEC for the portal and WAP portal adapter.
By default, wcs.portal.sql script set the deviceFormatId to the next available entry
number. You must ensure the MODEL_ID in the PVCDEVMDL table updated by
the wcs.portal.sql script matches the deviceFormatId in the WebSphere
Commerce instance XML file (Example 10-2 on page 351).
Chapter 10. Creating a commerce enabled portal for mobile clients 351
To enable the WebSphere Commerce WAP portal adapter, do the following:
1. Ensure the wcs.portal.sql file has been executed. When installing the IBM
Commerce Enhancement Pack - April 2003 Edition, this SQL file is executed
by the EP1_DBUpdate.db2 script. If you have executed the
EP1_DBUpdate.db2.script as documented in the installation procedure, this
step has already been completed.
2. Determine the MODEL_ID in the PVCDEVMDL table for the adapter
(PORTAL and WAP PORTAL). For example, to query the database for the
PORTAL adapter, enter the following from a DB2 command window:
db2 connect to <wc_dbname>
db2 select * from pvcdevmdl
Record the value of the MODEL_ID for the desired adapter.
Update the WebSphere Commerce instance XML file found in the
<WC_HOME>\instances\<instance>\xml\<instance>.xml directory with a text
editor.
a. Update deviceFormatId.
i. Search deviceFormatId within the HttpAdapter tag for the WAP portal
the <instance>.xml file.
ii. Update the value of the deviceFormatId to the MODEL_ID recorded for
the adapter.
b. Enable the adapter.
Enable the deployment descriptor of the WebSphere Commerce portal
adapter by changing the enabled=”false” value to enabled=”true” in the
<instance>.xml file as seen in Example 10-2.
Example 10-2 Enable the WebSphere Commerce WAP portal adapter
<HttpAdapter deviceFormatId="
-3"
enable="
true"
deviceFormatType="PVCAdapter"
deviceFormatTypeId="-1"
name="
WAPPORTAL">
<factoryClassname="com.ibm.commerce.portaladapters.WapPortalPvcAdapter">
<PVCAdapter preferredLogonTimeout="20"
bufferTimeout="5"
registrationMode="0"/>
</HttpAdapter>
Enable the deployment descriptor of the WebSphere Commerce mobile
portal adapter by changing the enabled=”false” value to enabled=”true”
in the <instance>.xml file as seen in Example 10-2.
c. Save and close file.
Get WebSphere Commerce Portal V5.4 Solutions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.