Oracle® Application Server Wireless Administrator's Guide
10g Release 2 (10.1.2) B13820-02 |
|
Previous |
Next |
This chapter includes the following sections:
Oracle Application Server Wireless supports multi-locale and multi-encoding. The OracleAS Wireless Server dynamically determines locale and request and response encoding based on the runtime context.
The OracleAS Wireless Server dynamically determines the appropriate locale of a user by using such locale information as PALocale, the user's preferred locale, the Accept Language header, and the site locale.
PAlocale
is a HTTP parameter that specifies the preferred value before login. The possible value for the PAlocale
parameter follows the HTTP accept-language header format. For example, PAlocale
= en-US. This format is distinct from the Java locale format (en_US
).
The user's preferred locale is the language preference of a OracleAS Wireless user, which is set with the User Manager. For more information, see Section 5.5.
The Accept Language header is an HTTP protocol parameter that user agents (Web browsers) send with HTTP requests.
Note: For information on the HTTP accept-language header format, see the HTTP specification of the World Wide Web Consortium (W3C). |
The Site Locale is an instance-wide default locale of the OracleAS Wireless Server. For more information, see Section 15.2.4.
Before login, the OracleAS Wireless and Voice Portal (ptg/rm), Async Listener, the OracleAS Wireless Tools and the Customization Portal each determine the appropriate locale of a user's device.
Table 15-1 illustrates how the Async Listener, the OracleAS WirelessWeb Server, the OracleAS Wireless Tools and the Customization Portal determine the locale of a user. The numeric value indicates the preference for the detection methods in descending order.
Table 15-1 Locale Determination
Method | Async Listener | OracleAS Wireless and Voice Portal | OracleAS Wireless Tools and Customization Portal |
---|---|---|---|
Locale of the registered user or virtual user |
1 |
1 |
1 |
HTTP parameter: PAlocale |
N/A |
2 |
N/A |
Accept-language http header |
N/A |
3 |
N/A |
Site default locale |
2 |
4 |
2 |
The OracleAS Wireless and Voice Portal (ptg/rm) determines the locale of a user in the following order:
Use PAlocale
(if present).
Use the Accept_Language HTTP header (if present).
Use the site default locale.
The OracleAS Wireless Tools and Customization Portal determine the location of a user in the following order:
Use PAlocale
(if present).
Use the site default locale.
The Async Listner determines the location of a user in the following order:
Use the user's preferred locale if the connecting user can be identified through the device ID.
Use the site default locale. For more information, see Section 15.2.4.
You can set a preferred location for a user when you create a user or edit a user profile. If the preferred location is not specified, then the default site locale is used.
From the Site Administration page of the System Manager (accessed through the Oracle Enterprise Manager Application Server Control), you can specify the default site locale and add to the list of locales that the site can support. Use a java locale (such as en_US
) when adding to the list of supported locales (depicted in Figure 15-1). For more information, see Section 3.9.1.4.
Note: You can also set the site locale using the Basic Site Configuration wizard, accessed from the Home page of the System Manager. For more information, see Section 3.3. |
Figure 15-1 The Site Locale Screen of the System Manager (Partial View)
The content sent to the device is encoded using the character encoding of the device. The character encoding is among the device attributes stored in the OracleAS Wireless repository. Using the Foundation Manager, you can edit the browser capabilities of a device in the OracleAS Wireless repository to update it to the encoding appropriate to a given country or locale (Figure 15-2). For more information on creating, cloning, or editing a device, see Section 8.3.2, Section 8.3.3, and Section 8.3.2.1, respectively.
Figure 15-2 Editing the Encoding for a Device (Partial View of the Editing Function)
The Internet Assigned Numbers Authority (IANA) specifies the valid values for the character encoding format of a device. The names of the IANA character set are available at:
http://www.iana.org/assignments/character-sets
Table 15-2 illustrates how the encoding is determined.
Table 15-2 Determining the Device Encoding at Runtime
Component | Method of Determination |
---|---|
Multi-Channel Server |
|
Async Listener |
Determined by the corresponding transport driver. |
OracleAS Wireless Tools and Customization Portal |
|
Notification Application |
Determined by the corresponding transport driver. |
This section describes the encoding for the request and response of a HTTPAdapter-based application
When sending the HTTP request to the remote content provider, only the parameters of the HTTPAdapter application are encoded using the input_encoding
of the application (if it is specified). Use the encoding format of the IANA (Internet Assigned Numbers Authority) when specifying the value for input_encoding
.
When using JSPs to write Multi-Channel applications, insert the content described in Example 15-1 at the top of the JSP.
Example 15-1 Multi-Channel Content
XHTML MP Content: <% String userAgent = request.getHeader("User-Agent"); if(userAgent != null && userAgent.indexOf("PTG/2.0 (Oracle9iAS Wireless") >= 0) { response.setContentType ("application/vnd.wap.xhtml+xml; charset=UTF-8"); %><?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <% } else { response.setContentType ("text/xml; charset=UTF-8"); %><?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <% } // Set the request character encoding String encoding = request.getCharacterEncoding(); if(encoding == null) { encoding = request.getHeader("x-oracle-mcs.character.encoding"); encoding = ((encoding == null) || (encoding.length() == 0)) ? "UTF-8" : encoding; request.setCharacterEncoding(encoding); } // Optional - Prevent Page Caching response.setHeader("Cache-Control", "no-store"); // HTTP 1.1 response.setHeader("Pragma", "no-cache"); // HTTP 1.0 response.setHeader("Expires", "0"); // prevents caching at the proxy server %> MobileXML Content: <% String userAgent = request.getHeader("User-Agent"); if(userAgent != null && userAgent.indexOf("PTG/2.0 (Oracle9iAS Wireless") >= 0) { response.setContentType ("text/vnd.oracle.mobilexml; charset=UTF-8"); %><?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <!DOCTYPE SimpleResult PUBLIC "-//ORACLE//DTD SimpleResult 1.1//EN" "http://xmlns.oracle.com/ias/dtds/SimpleResult_1_1_0.dtd"> <% } else { response.setContentType ("text/xml; charset=UTF-8"); %><?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <% } // Set the request character encoding String encoding = request.getCharacterEncoding(); if(encoding == null) { encoding = request.getHeader("x-oracle-mcs.character.encoding"); encoding = ((encoding == null) || (encoding.length() == 0)) ? "UTF-8" : encoding; request.setCharacterEncoding(encoding); } // Optional - Prevent Page Caching response.setHeader("Cache-Control", "no-store"); // HTTP 1.1 response.setHeader("Pragma", "no-cache"); // HTTP 1.0 response.setHeader("Expires", "0"); // prevents caching at the proxy server %>
Note: This example uses UTF-8 encoding. Substitute this value for that of the correct encoding for the application. Be sure to replace all occurences of this value. |
OracleAS Wireless determines the encoding of the response of an HTTPAdapter-based application in the following order:
Charset as part of the content-type header on the response.
Input-encoding (if present) of the input parameter of the application.
ISO-8859-1 (the default).
Users can view the online help for the OracleAS Wireless Tool and the Customization Portal in 29 languages. The site locale, configured through the System Manager, determines the display language. For more information, see Section 3.9.1.4.
In this release, the built-in labels and on-line help for the OracleAS Wireless Tools and System Manager display in nine languages.
OracleAS Wireless and Voice Portal (ptg/rm) can display the built-in labels in 29 different languages.