There are many types of Web-enabled mobile devices that can access your portals. Since these devices have different interfaces and different-sized viewing areas, each has a unique requirement for the type of content they display.
With the multichannel framework provided in WebLogic Workshop Portal Extensions, you can extend your portals to include support for different mobile devices. This flexible framework lets you create a single portal that serves content to Web-capable devices seamlessly and simultaneously. You can also serve different content to different browsers, such as Mozilla, Netscape, Opera, and Internet Explorer.
When a device accesses a portal, the portal knows what kind of device it is and automatically serves the device the content you created for it within the look & feel you created for it.
Adding multichannel capability to a portal Web project
You must add the multichannel framework to each portal Web project that will provide multichannel support.
To add multichannel capability to a portal Web project, right-click the portal Web project folder in WebLogic Workshop and choose Install > Default Portal Multichannel Files.
Building multichannel portals
This section describes the multichannel framework and the development tasks necessary for building portals that support multiple devices. Be sure you have completed the previous step of adding multichannel capability to a portal Web project.
When a device (whether it's a PC or a handheld) accesses a portal, it sends information about itself to the portal in the HTTP header—information such as the type of browser being used and the type of device. This combination of information defines a "client," which is equivalent to the model of a device. Clients, in turn, can be grouped into "classifications." For example, there are many models of Palm handheld devices, but they all fall under the classification of "Palm." Classifications are the key element in enabling multichannel support in portals.
The following illustration and table describe the multichannel framework and provide instructions for building content and presentation for mobile devices.
1 |
When a device accesses a portal-enabled server with a URL, the device sends a user-agent string in the HTTP header that tells what kind of client it is. The server stores this user-agent string in the "User-Agent" request property for the portal application. The "User-Agent" request property is automatically included with any portal application you create in WebLogic Workshop Platform Edition. To view this property, open the following file in WebLogic Workshop: <PORTAL_APP>\data\request\DefaultRequestPropertySet.req. Portal developer tasks: None. This happens automatically. |
2 |
To enable multichannel support for devices, a portal Web project must be able to map the user-agent string stored in the "User-Agent" property to a classification. This mapping must be created before portals are accessed by mobile devices. Portal developer tasks: You must map clients to classifications in your portal Web project WEB-INF\client-classifications.xml file. The default client-classifications.xml file contains default client mappings. For each client entry that maps to a classification, you can enter either an explicit user-agent string that maps exactly to what a device sends, or you can enter a regular expression that can encompass multiple user-agent strings. The following example of a client classification mapping in client-classifications.xml shows explicit mappings (with the <useragent> tag) and a regular expression mapping (with the <useragent-regex> tag). <classification name="pocketpc" description="For the PocketPC"> <useragent value="Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)"/> <useragent value="Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)"/> <useragent-regex value=".*PDA; Windows CE.*NetFront/3.*" priority="1"/> </classification> An explicit <useragent> value can be used for only one classification. If you use more than one <useragent-regex> tag to map with regular expressions, it is possible that a device accessing a portal could map to more than one classification. To determine which classification the device is mapped to, use the priority attribute, as shown above. The value "1" is the highest priority. Enter any whole number for the priority value. Note: For portlets that are assigned client classifications, the classification "description" value is used in the WebLogic Administration Portal to show which classifications the portlet is assigned to. Write descriptions that are easily understood by portal administrators. For information on user-agent strings and values for different devices, perform a Web search for "user-agent." |
3 |
Because of the client-classification.xml mappings you defined, the user-agent string stored in the "User-Agent" property is mapped to the classification name you provided. In the example mapping above, the name is "pocketpc". Portal developer tasks: None. This happens automatically. |
4 |
After the client is successfully mapped to a classification, the classification name is stored in the "Client Classification" property in the DefaultRequestPropertySet. Portal developer tasks: None. This happens automatically. |
5 |
The portal uses that client classification name stored in the DefaultRequestPropertySet throughout the portal framework to identify the content and presentation tailored to the device. Portal developer tasks: The portal is where you develop and enable specific content and presentation to be used for different mobile devices. The portal framework includes the following touch points for creating device-specific content and presentation:
|
6 |
Based on the mapping you set up to match user-agent (client) strings in the HTTP request to classification names, the portal sends the device-specific content and presentation you developed to the different devices that access the portal. Portal developer tasks: None. This happens automatically. |
The Tutorial Portal, one of the Portal Samples provided with the WebLogic Workshop Portal Extensions, includes examples of multichannel functionality. Also, when you create a portal Web project, a WEB-INF\client-classifications.xml file is created automatically with default settings.
Any portal Web project you create also includes a default set of multichannel Look & Feels located in skin and skeleton subdirectories (<project>\framework\skins and <project>\framework\skeletons).
Creating Skins and Skin Themes
Creating Skeletons and Skeleton Themes