26 Configuring WebCenter Sites to Support Mobile Websites
Mobility enables its users to create, preview, and deliver websites to a variety of mobile devices such as phones and tablets. You need to configure the Mobility framework to enable WebCenter Sites to support mobile-optimized websites.
Topics:
Prerequisites for Mobility Developers
You should have an experience with core WebCenter Sites features including site navigations and templates to be able to configure the Mobility framework.
You should also have an understanding of mobile devices and their user agents.
Understanding Key Mobility Concepts
WebCenter Sites uses a built-in device detection mechanism to identify the device that requests website content. Once the device is identified, WebCenter Sites finds the appropriate site navigation (called site navigation in the previous release) and invokes the correct template to render the website.
The mechanics of this device detection process involve new features, such as device repository, device groups and suffixes, device assets, template variants, and site navigations (which have been extended to support mobile websites). This section describes the concepts behind the new features. Later sections provide procedures for configuring the features to support mobile websites.
Once the features are configured, it is possible in the Oracle WebCenter Sites: Contributor interface to create, preview, and deliver mobile sites, such as the site shown in the figure below. In this figure, the Home page of the avisports sample site is displayed in the context of three devices (multi-device preview).
Figure 26-1 Preview of avisports Site Home Page in the Context of Multiple Devices in the Contributor Interface
Description of "Figure 26-1 Preview of avisports Site Home Page in the Context of Multiple Devices in the Contributor Interface"
Topics:
About Device Repository
The device repository is a file that WebCenter Sites uses to detect mobile devices. The device repository contains the properties of devices and uniquely identifies each device based on its user agent. WebCenter Sites detects devices by matching the user agent of the device to the user agent that is specified in the device repository.
Note:
A user agent is a software agent that acts on behalf of users. The format of a user-agent string is a list of product tokens (keywords) with optional comments. Most browsers specify the following format:
Mozilla[version] (system and browser information]) [ platform] ([platform details]) [extensions]
For example:
Mozilla/so(iPad;u;CPUOS 3.2.1 like Mac OSx;en-us)ppleWebkit/531.21.10(KHTML,like Gecko) Mobile/7B405
-
devices.xml
: This is the default repository included with WebCenter Sites. This repository is updated at the time of a product release and includes only popular devices. You can add more data to this repository as and when required. -
WURFL: This is a third-party device information database from ScientiaMobile. WURFL is much more comprehensive than
devices.xml
, and it is updated regularly by ScientiaMobile. We recommend using WURFL to ensure you have the latest devices. A licensed copy can be obtained from ScientiaMobile. It is not included with WebCenter Sites.
For procedures about using the device repository, see How to Configure the Device Repository.
About Device Groups and Suffixes
Device Groups enable features-based grouping of devices. A device group is an asset that defines a collection of devices with common characteristics, for which a common website can be delivered. For instance, all Touch phones could belong in one group, whereas NonTouch (QWERTY) phones could be in a separate group, as illustrated in the next figure. So, one website is delivered to all the Touch devices. Another website is delivered to all the NonTouch (QWERTY) devices. Therefore, two sets of templates must be coded: one set for the group of Touch devices, and another set for the group of NonTouch devices.
To support template variants, the concept of suffixes has been introduced. Suffixes are used to associate templates to the correct device groups. The association is made when the template and device group have the same suffix, such as _Touch
(or _NonTouch
). For example, if the base template HomeLayout
is used to render the desktop website, you would create template variants, that is, templates named HomeLayout_
suffix
. In this example, you would create the HomeLayout_Touch
template to render content on devices in the Touch device group. You would also create the HomeLayout_NonTouch
template to render content on devices in the NonTouch device group.
At runtime, WebCenter Sites will match the suffixes of the device groups to the names of the template variants. When HomeLayout
is requested from a Touch device, WebCenter Sites will use the HomeLayout_Touch
template to render the website. This is part of device detection.
Note:
A template without a suffix is called the base template. Templates with suffixes are called variants of the base template. The base template must exist before its variants can be created.
Suffixes are also used to associate device groups to site navigations, which enables you to implement different website navigation for devices in different device groups. Templates are coded with the device:siteplan
tag to specify website navigation on the delivery system.
To create a device group, you will create an asset of type DeviceGroup
. In the process, you will specify:
-
A suffix.
-
Either the registered device name(s), or criteria that WebCenter Sites will use to associate devices to the group you are creating.
Note:
Multiple device groups should be prioritized for proper matching of devices to device groups during device detection.
See How to Configure Device GroupsandHow to Prioritize Device Groups
About Device Assets
Any mobile device can be represented by a device asset, which enables previewing of mobile website content in the context of the mobile device, in the Contributor interface. Device assets are used strictly to support preview. Even when devices are similar enough to be gathered in the same device group, they display variations (for example, screen size). Previewing in the context of a device asset enables content contributors to ensure that content will be rendered properly on the corresponding real device.
A device asset consists of an image and a user agent. The user agent is used to associate the device asset to (1) a real device in the device repository and (2) to a device group with matching criteria. For an example of associations illustrating the relationship between device groups and device assets, see this figure:
Figure 26-3 Devices Associated with Device Groups
Description of "Figure 26-3 Devices Associated with Device Groups"
Device assets are associated to device groups by device detection. A device asset that matches the criteria specified in two or more device groups is automatically associated to your preferred (highest-priority) device group. A device that fails to match criteria in all device groups is automatically assigned to the Default device group (used for serving websites to desktop browsers). Once a device is associated to a device group, templates associated with that device group can render website content in preview mode. The content is superimposed on the device image.
Note:
Ensure that content contributors are aware of the following preview behavior:
-
While preview of web pages in mobile devices works in all browsers, some features are not displayed correctly if there is a mismatch between the browser and the user agent. For example, if the Contributor interface is opened in Internet Explorer, whereas the user agent is for FireFox on Android, the browser will use the Internet Explorer engine to render HTML. Therefore, previews in the Contributor interface are likely to differ from the look of the real pages on the real mobile device.
-
Preview renders pages as they would be displayed in full-screen mode on real devices.
About Site Navigations
A site navigation defines the navigational hierarchy of a website. For example, the next figure shows Default, Touch, and NonTouch site navigations for the avisports sample site in the Contributor interface.
Figure 26-4 Site Navigations in the Contributor Interface
Description of "Figure 26-4 Site Navigations in the Contributor Interface"
When creating a site navigation, you associate device groups to that site navigation by selecting a shared suffix. Site navigation can then be served to devices in those device groups. (Once selected, the suffix is no longer available for other site navigations.)
You have two basic approaches to creating site navigations:
-
Create a single site navigation for all devices across all device groups.
-
Create different site navigations for different device groups. The content can be reused across site navigations, or it can be different.
About Mobile Templates
You have two basic approaches for creating templates that render mobile websites:
-
Create a single set of templates that adapt to all mobile devices (and therefore all device groups). Adaptive templates adapt to the screen resolution of a device and render content suitably. In this scenario, there is no need for creating templates with suffixes.
-
Create different templates for different device groups. (An example was described in About Device Groups and Suffixes.) This scenario requires you to create two sets of templates: One set contains the base templates (without any suffixes). The other set contains the template variants (templates with suffixes). To create a template variant, you append
_suffix
to the name of the base template.For example, the template name for a device group called iPhones, whose suffix is
Touch
, will beBaseTemplateName
_Touch
. This naming convention and the matching of suffixes for device groups and templates ensures that WebCenter Sites routes requests from mobile devices to the correct template variants. The base template is used whenever a mobile template variant does not exist for a specific device group.Note:
WebCenter Sites does not recognize templates with two suffixes (such as
_Touch_NonTouch
). They are not considered variants of existing templates. Such templates are not available through the Choose Page Layout option on the asset toolbar in the Contributor interface, and therefore, they are not used for rendering assets. The base template is used in place of a template that has two suffixes.
You can create templates at any time once you have created the device groups and you know the suffixes. See Creating Templates.
Prerequisites for Configuring Mobility Features
To be able to configure Mobility features, you should have the necessary credentials and information. For example, the GeneralAdmin
role, device repository, and so on.
-
The only user who is automatically granted access to the Mobility tab in the Admin interface is the user with the
GeneralAdmin
role.Note:
The
MobileSitesDeveloper
role is no longer available. If you have upgraded from 11.1.1.8.0 release, be aware thatMobileSitesDeveloper
role acts as a user-defined role and has no particular significance. Therefore, you must grant access to the Mobility tab to theGeneralAdmin
role. -
An understanding of which device repository you will be using. See How to Configure the Device Repository.
-
Information about the device groups you will be configuring.
-
The names of device groups in which to organize different devices.
-
Which capabilities (such as user agent, touch, tablet, and screen resolution) you will use to identify and group devices. For more information as to which data you will provide, see How to Configure Device Groups.
-
Which suffix you will use for each device group. A suffix is required for each device group. (You will append the same suffix to the names of the template variants for these device groups. You will also select the same suffix for the site navigation.)
-
Whether you will use custom filters to apply conditions on capabilities that are not listed by default. See How to Create Custom Filters for Device Group Criteria.
-
-
The list of devices your contributors will be using to preview the mobile website. WebCenter Sites comes with several device assets that represent many commonly used devices.
To create your own device assets, first create your own images of the real devices, and look up the user agents of the real devices. You will use these images and user-agent information to create device assets. Also create their thumbnail images for use in the device selector panel in the Contributor interface.
-
Effective site navigations for the mobile versions of your website.
Configuring Mobility Features
Some of the tasks you perform to create the Mobility infrastructure are activating the device repository, configuring device groups, creating custom filters for device groups.
See these topics:
How to Configure the Device Repository
You have the option to use one of the following device repositories: devices.xml
(default repository) or WURFL.
-
To use
devices.xml
, do the following:-
Ensure the file contains the device names and user agents you require. Locate the file in the
DeviceRepository
directory and make the necessary changes. -
Activate
devices.xml
by uploading to WebCenter Sites.-
Open the General Admin tree, expand the Mobility node, and then double-click Device Repository.
-
In the Device Repository Uploader form, upload
devices.xml
, and then save.
-
-
-
To support more capabilities and devices than currently registered in the
devices.xml
file, use WURFL as the device repository. Do the following:-
Obtain the WURFL repository in one of the following formats:
-
WURFL.zip
-
WURFL.xml
with a WURFL patch file. The patch file is used to override the content ofWURFL.xml
. For more information about patch files, seehttp://wurfl.sourceforge.net/
.Note:
WURFL is a third-party device repository. You must purchase a license from ScientiaMobile to use this repository. It is not included with WebCenter Sites.
-
-
To use the
wurfl.xml
file and patch, configure the patch file before you continue to other steps. -
Activate the WURFL repository by uploading to WebCenter Sites.
-
How to Create Custom Filters for Device Group Criteria
WebCenter Sites provides a default custom filter implementation (DefaultCustomFilter.java)
, which takes an XML file as input. To create a custom filter of your own, write an implementation of the CustomDeviceFilter.java
interface. The XML file for a custom filter is uploaded from the Device Group configuration page, as described in How to Configure Device Groups.
This section includes the following:
Note:
For information about how to use custom filters, see How to Configure Device Groups.
Using the Default DefaultCustomFIlter.java Custom Filter Provided with WebCenter Sites
The default implementation class of a custom filter is called COM.FutureTense.Mobility.Filter.DefaultCustomFilter
. It takes input in XML format. In the default custom filter implementation provided with WebCenter Sites, a filter is passed only if all its arguments are passed. Similarly, an entire custom filter is passed when all its filters are passed. So, in any scenario, all arguments must be passed for the filter criteria to work.
The following example shows a sample filter XML in which device property names are taken from the WURFL repository:
<?xml version="1.0" encoding="UTF-8"?> <devicefilters> <filter name="tabletFilter" classname="COM.FutureTense.Mobility.Filter.DefaultCustomFilter"> //Filter 1 <argument name="is_tablet" value="true" datatype="boolean"/> //argument 1 of filter 1 <argument name="pointing_method" value="touchscreen" datatype="string" operator="equals"/> //argument 2 of filter 1 </filter> <filter name="flashFilter" classname="COM.FutureTense.Mobility.Filter.DefaultCustomFilter"> //Filter 2 <argument name=" full_flash_support" value="false" datatype="boolean"/> //argument 1 of filter 1 </filter> </devicefilters>
In the above sample, tabletFilter
has two arguments. argument 1
requires that the value of the is_tablet
property should be true
. argument 2
requires that the value of the pointing_method
property should be touchscreen
. flashFilter
has only one argument which is, the value of the full_flash_support
property should be false
. Each argument is a rule and a complete filter. Only when every argument is met, a device can match to the device group containing the above custom filter.
This sample XML uses device property names from the WURFL repository. The default device repository (devices.xml
) XML looks something like the following example (notice that the property names have changed). In this filter XML, there are two filters: tabletFilter
and flashFilter
.
<?xml version="1.0" encoding="UTF-8"?> <devicefilters> <filter name="tabletFilter" classname="COM.FutureTense.Mobility.Filter.DefaultCustomFilter"> //Filter 1 <argument name="tablet" value="true" datatype="boolean"/> //argument 1 of filter 1 <argument name="touch" value="true" datatype="string" operator="equals"/> //argument 2 of filter 1 </filter> <filter name="flashFilter" classname="COM.FutureTense.Mobility.Filter.DefaultCustomFilter"> //Filter 2 <argument name="flash" value="false" datatype="boolean" /> //argument 1 of filter 1 </filter></devicefilters>
While creating a custom filter based on DefaultCustomFIlter.java
, consider the following:
-
In a custom filter, possible values of the
datatype
argument attribute arestring
,number
,boolean
. Default value isstring
.-
When
datatype
=number
, the possible values of theoperator
attribute are:<>
,notequals
,<
,lt
,>
,gt
,=
,equals
. Default value isequals
. -
When
datatype
=boolean
, the possible values of theoperator
attribute are:=
,equals
. Any other value is treated as the reverse ofequals
. Default value isequals
. -
When
datatype
=string
, the possible values of theoperator
attribute are=
,equals
,%
,like
,!=
,notequals
,!%
,notlike
. Default value isequals
. The following snippet shows the use of thelike
or%
value for theoperator
attribute:<argument name="pointing_method" value="touch" datatype="string" operator="like"/>
Here, the value of the
pointing_method
property must contain the wordtouch
either as a substring or an entire word.
-
-
The value of the property attributes must be as per the property names in the current device repository (either
devices.xml
orWURFL.xml
).
Creating Your Own DeviceGroupFilter Implementation
The following example shows a Java class that implements the DeviceGroupFilter
interface and uses the matches
method. Your custom filter can consist of one or more filters. Each filter can contain zero or more arguments. The custom filter implementations can use the OR
rule, or any custom logic.
public class UserDefinedCustomFilter implements DeviceGroupFilter { public boolean matches(DeviceContext context) { // Logic that returns true/false depending on whether criteria matched or not. } }
How to Configure Device Groups
To configure a device group:
-
Under the Mobility node, expand the Device Groups node.
-
Click Add Device Group, as shown in this figure:
The Device Group form opens.
-
In the Device Group form, select the Content tab and do the following:
-
In the Name field, enter a meaningful name for the device group you are creating.
-
In the Suffix section, enter the suffix you plan to use for the templates you will create for this device group. Or, choose an existing suffix if there is any.
Note:
This suffix is not editable. To change it later, you will have to recreate this device group and change this suffix.
-
In the Active field, enable this device group for device detection by selecting Yes.
Note:
Device groups are global. Once enabled, they become available for all sites. Similarly once disabled, they are disabled for all sites and no longer used in device detection.
-
-
Select the Criteria tab (see the next figure) to create a set of rules for matching real devices so they can be associated with their correct template variants.
Either provide one or more device names (the rest of the form will be disabled (see the figure below), or omit the device name(s) and fill in the rest of the form.
-
If you choose to enter device name(s), enter the same name(s) that are registered in the device repository. If you uploaded
devices.xml
, enter the device entry name. If you uploaded WURFL, enter themodel_name
of the device.The Device Names field provides Typeahead feature so you can choose a registered device name from the list of available devices. As you start typing a device model number, this features shows all the registered devices beginning with the common letters. You can easily scroll and choose from the first 50 devices. To see more devices, please refine your search further.A device can belong to only one device group at a given time.
-
If you choose to omit device names, fill in the rest of the form, as follows:
-
User-Agent Section: This section is disabled if you specify the device names.
In this field, enter just a list of device names, or a combination of user agent, screen dimensions, capabilities, and custom filters. A combination of user-agent
regex
, capabilities, screen dimensions, and custom filter requires a device to meet all the rules to match with the device group.Enter the exact user agent of the browser from which the incoming request will be sent. Or, enter a regular expression or a substring to match the set of the user agents. For example, to match all iPhone user agents, specify the user-agent
reg exp
as(m|M)ozilla/5.0(| )\(i(p|P)(hone|od|rod).*
This expression will match any user-agent string which contains theiPhone
Javaregex
. Or, use the substringiPhone,
which matches all iPhones.Note:
To see how many devices for the user agent you entered are available in your device repository, click the Refresh icon in the Matching Devices section.
-
Capabilities Section: This section is disabled if you specify the device names. The capabilities are: Touch Screen, JavaScript, Dual Orientation, and Is Tablet. Each capability gives you the following options: Yes, No, Don't evaluate.
For example, to match this device group to only Tablet devices that do not support JavaScript, select Yes for the IsTablet capability; for the JavaScript capability, select No; and for the rest of the capabilities, select Don't evaluate.
-
Screen Resolution Section: This section is disabled if you specify the device names. Enter the minimum and maximum width and height for the display area (units are in pixels). For example, a maximum width of 640 will match this device group to all devices whose screen resolution width is 640 or less.
-
In the Custom Device Filters section, click Browse to choose a custom filter that you might have created to apply conditions on capabilities that are not listed on the Device Group Criteria tab.
-
-
-
Click the Save icon to save your device group.
Your new device group is listed on the Mobility tab, at the bottom of the Device Groups node (as shown in the next figure).
How to Prioritize Device Groups
You must prioritize multiple device groups to enable device detection which automatically associates a real device to the highest-priority device group at runtime.
To prioritize device groups:
How to Create Device Assets
To create a device asset:
-
Under the Mobility node, expand the Devices node.
-
Click Add Device .
The Device form opens.
-
On the Content tab:
-
In the Name field, enter a name for this device asset.
This name will be displayed in the Contributor interface. It does not have to match the name in the device repository.
-
(Optional). In the Manufacturer field, enter the name of the device maker company.
-
In the User Agent field, specify the registered user agent for the device whose image you are adding. You can copy the user agent from the device repository.
Note:
The User-Agent field identifies the real device that this device asset represents. This field is used in device detection logic to associate a device with the matching device group of highest priority.
-
Click Test User Agent to run device detection and confirm that this device matches a particular device group.
-
Select the Enable option to make this device asset available to device detection mechanism so this asset can be associated to device groups.
-
Next to the Device image field, click Browse to select the device image from the directory in which the image is stored.
-
(Optional). Next to the Thumbnail image field, upload a thumbnail image to be displayed in the device selector panel that is associated with the preview feature in the Contributor interface. Selecting the thumbnail displays a page preview in the device image.
-
-
On the Screen Dimensions tab, enter the required pixels in the Height, Width, Top, and Left fields and pixel ratio in the Pixel Ratio field to determine an appropriate dimension of the screen area.
-
Height: Height of display area within the device image in which you’ll preview your site content.
-
Width: Width of display area within the device image in which you’ll preview your site content.
-
Top: Top margin for display area within the device image in which you’ll preview your site content.
-
Left: Left margin for display area within the device image in which you’ll preview your site content.
-
Pixel Ratio: Ratio between physical pixels and logical pixels. For instance, iPhone 7 has a pixel ratio of 2 because the physical linear resolution is double the logical linear resolution.
As you enter the pixels in each field, the screen area of the device image begins to reset accordingly. This feature lets you determine the exact dimension of the device display area on the spot.
-
-
Click the Save icon on the form to create the new device.
The success message is displayed.
How to Create Site Navigations
Whether you need multiple site navigations or a single site navigation depends on your design approach. When creating a site navigation, you will associate device groups to this navigation by selecting a common suffix. Once selected, that suffix is no longer available for other site navigations.
To create a site navigation:
Mirror Publishing the Device Repository to Delivery System
After you’ve configured the infrastructure for your mobile site, remember to mirror publish the device repository to the delivery system.
Note:
After modifying and mirroring a device repository, you can trigger the reassociation of devices with device groups on the target system by opening a device group for editing and saving it without necessarily changing any values.To mirror publish the WURFL device repository:
Creating Templates
You can create just one set of templates that works for all mobile device or different sets using the suffix feature of WebCenter Sites.
So, you have two basic approaches for creating templates that render mobile websites:
-
Create a single set of templates that adapt to all mobile devices (and therefore all device groups).
-
Create different templates for different device groups. This scenario requires the use of suffixes. This section discusses this second approach.
See these topics:
Basic Guidelines for Creating Template Variants
When creating different templates for different device groups, note the following requirements:
-
Create the base template (the template that renders the desktop website).
-
Create the template variant by using the name of the base template and appending
_
suffix
. -
Use the suffix (the
d
parameter) as one of the cache criteria to cache pages based on your templates.
Understanding Mobility Tags
The table below describes the Mobility tags you will use when creating templates. See the Tag Reference for Oracle WebCenter Sites Reference.
Table 26-1 Tags for Mobility
Tag | Description |
---|---|
|
Detects the current device and loads the device information. Similar to |
|
For a loaded device, this tag returns the value of one of the following properties: |
|
For the currently loaded device, this tag allows you to specify a condition and code that will be executed when the condition is met. The default value for the optional attribute |
|
For the currently loaded device, this tag checks if this device supports the capability specified in this tag. The code in the tag is executed if the device supports this capability. |
|
For the currently loaded device, this tag sets the value of the specified capability in the |
|
Use the At runtime, WebCenter Sites computes the value of the |
Tags Modified to Support Device Detection and Page Rendering
The following tags include Mobility-specific attributes:
-
render:getpageurl
-
render:calltemplate
-
render:gettemplateurl
-
render:gettemplateurlparameters
-
insite:calltemplate
-
satellite:page
-
satellite:link
The attributes are:
-
d
, the suffix of a device group. -
resolvetemplatefordevice
, which appends the device group suffix to the template name. The default value istrue
. If the value is set tofalse
, the suffix is not appended to the template name and the base template is loaded.
The d
parameter is automatically passed down the chain in each of the tags above. The tags call the correct template variant by basing their call on the passed d
attribute.
In the following example for the avisports sample site, c=Page
and TestSite
is the current site.
<render:calltemplate tname='Detail' args="c,cid,p,d,locale,form-to-render" /> (i) for d=Desktop (default) or blank, the following template is called: TestSite/Page/Detail (ii) for d=Touch, the following template is called: TestSite/Page/Detail_Touch
For information about how the d
attribute is used, see How Device Detection Works.
Creating Template Variants
You create the template variants by copying, modifying, and adding a suffix to base templates. This suffix feature lets you create both, a single template variant and template variants in bulk for suffixes for which no variants exist.
This section includes the following topics:
Note:
Suffix-based search lets you easily locate templates of a certain suffix. That is, click Search on the menu bar and then choose Find Template from the Search table. On the Search for: Templates screen, choose Suffix from the Search drop-down list and the desired suffix from the for drop-down list. The search results also include deactivated or deleted templates. (Remove these templates from your site so they do not show up in search results again.)
Optimizing Images for Mobile Websites
The image optimization filter lets you optimize images for your mobile websites.
You can also plug in your own image optimization implementation to optimize images in a custom way. The following sections discuss both these approaches:
How to Optimize Images Using the Image Optimization Filter
The image optimization feature of WebCenter Sites is available for flex asset families. You can optimize full-size images to display them suitably on various types of mobile devices. This feature enables you to optimize images for different suffixes to support different screen dimensions. For instance, on some devices, the images displayed should be 50% of the full-size images, whereas on other devices, images should be displayed even smaller than 50% of the actual size.
To optimize images using the image optimization filter:
Include the Filter in Your Site's Image Definition
Include the filter you created in step 1 in the image definition for your site (For example, in the avisports sample site, you can search for Image
definition) by performing the following steps:
Create Instances of the blob Type Attribute Asset
In WebCenter Sites, both single-valued and multi-valued blob type attributes are supported. To apply the image optimization filter to all template variants, create as many instances of the blob
type attribute asset as there are suffixes for your site. For example, in avisports sample site, the existing blob
type attribute is imageFile
. So, in this case, create an instance of this attribute asset for the Touch
suffix and another for the NonTouch
suffix:
Apply the Image Optimization Filter on Existing Images
The image optimization filter comes into play when an image is created or edited. So, to apply this filter on existing images, they must be edited and saved.
- Open the images in Edit mode.
- Click the Save icon to apply the filter.
Use the Optimized Images in Your Site
- Set the
optimize
attribute of therender:getbloburl
tag totrue
(<render:getbloburl c=... cid=.. optimize='true' />
). See Property Files Reference for Oracle WebCenter Sites.
How Device Detection Works
WebCenter Sites uses a built-in device detection mechanism to identify the device that requests website content. Once the device is identified, WebCenter Sites looks for the matching device group and reads its suffix. Using the suffix, it finds the site navigation and invokes the template variant to render the content.
The detailed steps are as follows:
-
Remote Satellite Server receives a page request from a real device. The header for this request includes the user agent of the device.
-
Remote Satellite Server looks for the page in its own cache. If it fails to find the page, Remote Satellite Server sends the page request to WebCenter Sites.
-
WebCenter Sites responds as follows:
-
Identifies the device by its user agent in the request header.
-
Looks for the user agent in the device repository.
-
If it finds a matching device in the device repository, WebCenter Sites also looks for the capabilities of that device.
-
WebCenter Sites then uses the user agent and device capabilities to find device groups with matching criteria.
-
Associates the device to the highest-priority device group.
-
Reads the suffix for this device group.
-
Assigns the suffix to the
d
parameter in theics
scope. -
Appends
_suffix
to the requested template name in the URL. -
Appends
d=
suffix
to the URL of the requested page.For example:
If the suffix is
Touch
, WebCenter Sites converts the original URLpagename=avisports/HomeLayout1&c=Page&cid=1482760932
to the following URL:pagename=avisports/HomeLayout1_Touch&c=Page&cid=1482760932&d=Touch
-
If the template variant exists, WebCenter Sites executes the new URL, caches the page, and sends it to Remote Satellite Server.
If the template variant does not exist, WebCenter Sites executes the original URL, caches that page, and sends it to Remote Satellite Server.
-
-
Remote Satellite Server caches the page and sends the response back to the device.
-
Remote Satellite Server also caches device detection information and uses it to process subsequent requests from the same device. This prevents WebCenter Sites from re-running device detection.