Appendix B - Mobility Delivery Context Api - BEA WebLogic User Manual

Mobility server
Hide thumbs Also See for WebLogic:
Table of Contents

Advertisement

Appendix B – Mobility Delivery Context API
Introduction
The Mobility Delivery Context API provides a mechanism for developers to add "device-aware"
logic into their applications. The Mobility Delivery Context API provides methods to request a
delivery context and subsequently access device attributes in the retrieved delivery context.
Applications can use the Mobility Delivery Context API to:
Retrieve a delivery context for the device currently interacting with the application by passing
in the associated http request object. These are referred to In-session Queries because
WebLogic Mobility Server automatically maintains a delivery context for the current device
in the session.
Retrieve delivery contexts for one or more devices that match conditions passed by the
application as parameters in the delivery context query. These are referred to Out-of-session
Queries.
Note: The Mobility Delivery Context API provides access to the UAProf device attributes
available using the JSR 188 Delivery Context API and also provides access to the Mobility
proprietary device profile attributes that are not available using the JSR 188 Delivery Context
API.
Note: The JSR 188 Delivery Context API has not yet been extended to support Out-of-session
Queries.
Requesting the Delivery Context for an Active HTTP Session
The method call used to retrieve the Delivery Context for the device associated with the active
HTTP Session is
DeliveryContextFactory.getDeliveryContext (request)
where request is the request object.
The following code block illustrates how this method is used to request a Delivery Context for a
device associated with an active HTTP Session.
<%@ taglib uri="mmJSPtaglib" prefix="mm" %>
<mm:page content="false">
<%@ page import="com.mobileaware.deliverycontext.*" %>
<html>
<head>
<title>MA Delivery Context API</title>
<mm:structure id="st_101" where="IsMenuDriven">
<mm:group-ref idref="gp_101" depth="flat" type="normal" display="all"/>
</mm:structure>
</head>
<body>
<mm:group id="gp_101" title="Details">
<%
DeliveryContext dc = DeliveryContextFactory.getDeliveryContext(request);
try {
String deviceName= dc.getAttribute("DeviceName");
String imgList= dc.getAttribute("ImgTypePref");
%>
<p>I am a <%=deviceName%>.</p>
<p>I accept images that are: <%=imgList%></p>
BEA WebLogic Mobility Server User Guide - 191
Part VIII Appendixes

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WebLogic and is the answer not in the manual?

This manual is also suitable for:

Weblogic mobility server

Table of Contents