Oracle9i Application Server Wireless Edition Implementation Guide Release 1.1 Part Number A86699-01 |
Library | Service | Contents | Index

# 8
Logical Devices

This document explains how to create and manage logical devices. Each section of this document presents a different topic. These sections include:

- Section 8.1, "Overview"

- Section 8.2, "Creating a Logical Device"

- Section 8.3, "Modifying a Logical Device"

- Section 8.4, "Deleting a Logical Device"

- Section 8.5, "Determining the Client Device Type"

## 8.1 Overview

A logical device is a repository object that represents either a physical device, such as a Nokia mobile phone, or an abstract device, such as email. Logical devices represent the interface between Wireless Edition transformers and the target devices or applications.

Wireless Edition determines the type of device that is requesting a service using the user agent parameter of the HTTP request. When adding support for a new device type, you generally need to:

1. Create the logical device in the repository.

2. Create a transformer for the device.

3. Configure Wireless Edition to recognize the new device.

In many cases, when adding support for a new device type, you can simply modify or re-use an existing transformer or logical device.

## 8.2 Creating a Logical Device

You use the Logical Devices form sequence in the Wireless Edition Service Designer to create a logical device in the repository.

To display the form sequence:

1. Right-click Logical Devices in the Wireless Edition repository tree view.

2. Click Create New Device to display the first form in the sequence.

#### Figure 8-1 The Logical Device Name and Display Data Form

Text description of the illustration log_cnd1.gif

The first form in the Create New Device sequence has the following parameters:

Table 8-1 Parameters for the Create New Device Screen

Parameter | Value
--- | ---
Name | The logical device name. This must be a unique name.
MIME Type | The logical device MIME type.
Encoding | Content encoding for the logical device. Content encoding is used to transport the result of the device type.
Needs URL Caching | When selected, the URL-encoding request parameters are cached on the server and only small pointers are encoded within the URL that is sent to the logical device. Use this option for devices with limited memory. You should also select this option if the browser does not support cookies.
Screen Width | Use this option to describe the width of the screen of the physical device in points.
Screen Height | Use this option to describe the height of the screen of the physical device in points.
Screen Columns | The screen sizs in characters. Use this option if you want to break text into pages.
Screen Rows | The screen size in characters. Use this option if you want to break text into pages.
Number of Softkeys | Allows users to map a hot link to a phone soft key.
Default Transformer | Specifies the transformer to use to convert content for the device.
Prolog | Specifies the format of the prolog required by the device. The prolog frequently includes processing instructions and meta tags.

The second form in the Create New Device sequence appears as follows:

#### Figure 8-2 The Login Page Form

Text description of the illustration log_cnd2.gif

The second form in the Create New Device sequence includes the following parameter:

Table 8-2 Parameter of the Login Page

Parameter | Value
--- | ---
Login Page | The XSLT stylesheet that generates the login page for the device. Click Import and choose an XSLT stylesheet from the Open dialog.

The third form in the Create New Device sequence appears as follows:

#### Figure 8-3 The Error Page Form

Text description of the illustration log_cnd3.gif

The third form in the Create New Device sequence has the following parameter:

Table 8-3 Parameter of the Error Page

Parameter | Value
--- | ---
Error Page | The XSLT stylesheet that generates the error page for the device. Click Import and choose an XSLT stylesheet from the Open dialog.

Click Finish to create the object in the repository.

## 8.3 Modifying a Logical Device

The Wireless Edition Service Designer enables you to modify a logical device in the repository. To modify a logical device:

1. Expand the Logical Device folder in the Wireless Edition repository tree view.

2. Click the device you want to modify. The Edit Logical Device form appears in the right frame.

3. Modify the desired parameter(s). You can toggle between the General, Login Page, and Error Page tabs.

4. Click Apply.

## 8.4 Deleting a Logical Device

To delete a logical device from the repository:

1. Expand the Logical Device folder in the Wireless Edition repository tree view.

2. Right-click the device you want to delete.

3. Click Delete.

4. Click Yes in the Confirm Delete dialog to confirm the action.

## 8.5 Determining the Client Device Type

When Wireless Edition receives a service request, it determines the device type that submitted the request by querying the user agent parameter of the HTTP header. The System.properties file specifies the Wireless Edition class that queries the header and makes the determination:

    locator.useragent.class=oracle.panama.core.xform.UserAgentImpl

The `UserAgentImpl` class is a generic implementation of the `UserAgent` interface. The `UserAgent` interface takes the HTTP user agent parameter and returns the device type as a string corresponding to the device name in the repository. If the device type is unknown, it returns NULL.

You can create your own implementation of the `UserAgent` interface to implement specialized logic for determining the client device type. For example, if the HTTP gateway that passes requests to Wireless Edition includes the telephone number of the client, you can implement a user agent that uses the telephone number to retrieve end user information from a directory.

Once you implement your own user agent, you must point the user agent class locator in the System.properties file to your implementation:

    locator.useragent.class=oracle.panama.core.xform.MyUserAgentImpl

Wireless Edition uses a properties file, useragent.properties, to map the HTTP user agent parameter to a logical device in the Wireless Edition repository. The `UserAgentImpl` class retrieves this information from useragent.properties dynamically. When you add logical devices to the repository, you should map the device to the corresponding HTTP user agent parameter in the useragent.properties file.

To determine what information Wireless Edition actually receives in the HTTP header, you can check the Wireless Edition system log files. For full request manager logging, set the request manager debug flag. Using the probe monitor, click Debug, then click "Change debug flag".

Note: The useragent.properties file also specifies the default logical device that Wireless Edition uses if it cannot determine the device type. By default, this is set to WML11.

The useragent.properties file uses the following syntax to map an HTTP user agent parameter to a Wireless Edition logical device:

    [ID].useragent=[UserAgent startstring from HTTP Request]
    [ID].logicaldevice=[which logical device to use]

The logical device should appear on the line immediately following the corresponding user agent string. They should use the same ID, which is simply a unique number in the useragent.properties file. The ID associates a user agent string in the request with a logical device. For example:

    30.useragent=MOTO
    30.logicaldevice=Motorola

The `UserAgentImpl` class matches the actual header string to the longest matching user agent mapping in the useragent.properties file. That is, given the following mappings:

    42.useragent=UP.Browser/3.01-IG01
    42.logicaldevice=HDML

    43.useragent=UP.Browser
    43.logicaldevice=WML11

The `UserAgentImpl` class would match the header string "UP.Browser/3.01" to the HDML logical device, rather than the WML11 logical device.

Once you create or modify a device mapping, you can restart Wireless Edition or force a re-read of the property file using the probe runtime monitor (on port 8090), so that the changes to the property file take effect.

| Copyright © 2001 Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index