WDF on BlackBerry devices
Download
Report
Transcript WDF on BlackBerry devices
®
WDF Applications on
BlackBerry devices
IBM WebSphere® Dashboard Framework
Luciano Silva, Robert Loredo
12/20/2007
© 2007 IBM Corporation
IBM Software Group | Lotus software
WDF on BlackBerry devices – Background Information
The WebSphere Dashboard Framework is an extension of the
WebSphere Portlet Factory
Portlet Factory profiling mechanism allows for the creation of multiple
application variations from a single source code
My Application
Model
My Report
20%
20%
P1
Division
Results
IT
200,000
Sales
300,000
Finance
200,000
Ops
450,000
20%
20%
My Application
My Report
Text
P2
20%
3
2
1
Division
Results
IT
200,000
Sales
300,000
Finance 200,000
Ops
450,000
WebSphere Portal 6.x ships with default themes for cHTML markup,
which can be used to provide content for BlackBerry devices.
2
IBM Software Group | Lotus software
WDF on BlackBerry devices
By leveraging PF’s profiling features, simplified versions of existing
portlets can be created for mobile devices without having to write
additional code for such portlets.
WebSphere Portal’s chtml theme can be leveraged to provide content
for BlackBerry devices.
3
IBM Software Group | Lotus software
WDF on BlackBerry – PF project configuration steps
In the PF/WDF Designer, create a PF project and add a new
profile to determine the client device to be served.
The following PF wiki article provides sample code for such task:
http://www.ibm.com/developerworks/wikis/display/PortletFactoryID/IBM+-+Client+device+profile+selection
For specific support of BlackBerry devices in such profile class,
please see Appendix A in the last slide of this presentation file.
4
IBM Software Group | Lotus software
WDF on BlackBerry – PF project configuration steps (2)
In the PF project, profile portlet elements, such as tables and
charts, to make them smaller/simpler for mobile devices.
Example: making chart dimensions smaller for mobile devices.
Deploy the PF portlet project into WebSphere Portal
5
IBM Software Group | Lotus software
WDF on BlackBerry – WebSphere Portal configuration
The WebSphere Portal server needs to be
configured to support BlackBerry device clients.
On the Administration page in the Left Navigation
panel select Supported Clients.
This will open the Manage Clients portlet.
Click Add new client. This will open a form, type in
the following into their respective fields.
– User-Agent: .*BlackBerry.*
– Markup: chtml
– Capabilities: Type in the following individually and press Add for each:
– HTML_2_0
– HTML_3_0
– HTML_JAVASCRIPT
– HTML_4_0
– HTML_CSS
– HTML_NESTED_TABLE
– HTML_TABLE
– FRAGMENT_IDENTIFIER
– HTML_JAVA
– HTML_IFRAME
– Position: Select from the pull down menu, after(.*(B|b)ot.*….)
6
IBM Software Group | Lotus software
WDF on BlackBerry – WebSphere Portal configuration (2)
Create a new page for Mobile Devices
Dashboards and enable it to respond to chtml
markups.
On the Administration page in the Left
Navigation panel select Manage Pages.
Then, select “Content Root” and then
“Home”.
Add a new page (e.g. Mobile Dashboard) and
select the “chtml” markup under the Type of
Page section.
7
IBM Software Group | Lotus software
WDF on BlackBerry – WebSphere Portal configuration (3)
After the Mobile Dashboard page is created edit its layout and add the
profiled PF portlets for mobile devices to the page.
Set the appropriate Page Permissions for the created page, so the
targeted users can reach both the new page and the portlets in it.
E.g. add “All Authenticated Portal users” to the User role for both page and portlets.
8
IBM Software Group | Lotus software
WDF on BlackBerry – Portal page navigation
Once WebSphere Portal is configured appropriately, the Mobile
Dashboard page can be accessed by BlackBerry devices.
For information on how to download and setup BlackBerry device simulators, see Appendix B
of this presentation file.
9
IBM Software Group | Lotus software
Resources
WebSphere Dashboard Framework documentation
http://www.ibm.com/developerworks/workplace/documentation/dashboard/
http://publib.boulder.ibm.com/infocenter/wdfhelp/v6r0m0/index.jsp
WebSphere Portlet Factory product page
http://www-306.ibm.com/software/genservers/portletfactory/
WPF/WDF external wiki
http://www.ibm.com/developerworks/wikis/display/PortletFactoryID/Home
BlackBerry Developers page
http://www.blackberry.com/developers
10
IBM Software Group | Lotus software
Appendix A– Java class for ClientDeviceProfile
For BlackBerry support in the PF profile class, replace the code in the
DeviceTypeSelectionHandler.java class with the following:
package com.bowstreet.samples.deviceprofile;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.bowstreet.profiles.ProfileSet;
import com.bowstreet.profiles.SegmentList;
import com.bowstreet.profiles.SelectionHandlerBase;
import com.bowstreet.webapp.ModelInstanceCreator;
/**
* Selects profile based on client device type.
*/
public class DeviceTypeSelectionHandler extends SelectionHandlerBase implements SegmentList
{
static public final String USERAGENT_PROPNAME = "MobileUserAgentString";
static public final String BROWSER = "Browser";
static public final String MOBILE = "Mobile";
private String userAgentString = "BlackBerry";
public String selectProfile(HttpServletRequest request, ProfileSet profileSet, String modelName, String explicitProfileName, ModelInstanceCreator
modelInstanceCreator)
{
if(explicitProfileName != null)
return explicitProfileName;
11
IBM Software Group | Lotus software
Appendix B – BlackBerry Device simulators
Two packages are required to be installed on the client machine
to access a Portal server from a BlackBerry device simulator:
– BlackBerry MDS Server simulator
– BlackBerry Device simulator
The installer for these simulators can be downloaded from the
following website:
http://na.blackberry.com/eng/developers/downloads/simulators.jsp
After both packages are installed, initialize the MDS server and
then open the device simulator.
12