Oracle Portal-to-Go Implementation Guide Release 1.0.2.2 A86635-02 |
Library | Service | Contents | Index

# 11
Logical Devices

This document explains how to create and manage logical devices. Topics include:

- Overview

- Creating a Logical Device

- Modifying a Logical Device

- Deleting a Logical Device

- Determining the Client Device Type

## 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 Portal-to-Go transformers and the target devices or applications.

Portal-to-Go 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 Portal-to-Go 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.

## Creating a Logical Device

You use the Logical Devices form sequence in the Portal-to-Go Service Designer to create a logical device in the repository.

To display the form sequence:

1. Right-click Logical Devices in the Portal-to-Go repository tree view.

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

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

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.
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:

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

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:

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

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.

## Modifying a Logical Device

The Portal-to-Go 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 Portal-to-Go 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.

## Deleting a Logical Device

To delete a logical device from the repository:

1. Expand the Logical Device folder in the Portal-to-Go 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.

## Determining the Client Device Type

When Portal-to-Go 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 Portal-to-Go 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 Portal-to-Go 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

Portal-to-Go uses a properties file, useragent.properties, to map the HTTP user agent parameter to a logical device in the Portal-to-Go 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 Portal-to-Go actually receives in the HTTP header, you can check the Portal-to-Go 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 Portal-to-Go 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 Portal-to-Go 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 Portal-to-Go 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 © 2000 Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index