Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • WebSphere Portal Family wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM Redbooks: Building a Sample Website Using IBM Web Content Manager 7.0 IBM Redbooks: Building and Implementing a Social Portal IBM Redbooks: Developing Exceptional Multi-Channel Web Experiences V7: IBM Web Content Manager Product Documentation V7: IBM WebSphere Portal Enable for z/OS Product Documentation V7: IBM WebSphere Portal Express Product Documentation V7: WebSphere Portal Product Documentation V8: IBM Web Content Manager Product Documentation V8: IBM WebSphere Portal Express Product Documentation V8: IBM WebSphere Portal Product Documentation (includes z/OS) Custom Search Scope...
Search
Community Articles > WebSphere Portal > Developing > Developing Themes for WebSphere Portal > Leveraging Reverse AJAX in IBM WebSphere Portal 7.0 using Dojo CometD and Web messaging service
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorLeslie Gallo
Contribution Summary:
  • Articles authored: 30
  • Articles edited: 14
  • Comments Posted: 0

Recent articles by this author

Collecting performance measurements of your IBM WebSphere - Java Virtual Machine

This article discusses an example of creating a collection of IBM WebSphere Portal performance measurements, using the Administrator Thin Client to running a jython script for collecting the desired data.

Integrating IBM WebSphere Portal 7 with Microsoft SharePoint 2010

This article explains how to integrate the portal frameworks between IBM WebSphere Portal, which is based on the J2EE programming model, and Microsoft SharePoint, which is based on the .NET programming model.

IBM WebSphere Portal 7 customization scenario: Part 1, Customizing a menu portlet

During an IBM WebSphere Portal implementation, customization is typically required in a few areas. This article explains how to build a customized WebSphere Portal menu in a JSR portlet, using WebSphere Portal 7 APISPIs.

Increasing the Search Engine Optimization ranking for IBM Web Content Manager Web sites

Learn how how you can remove both the traditional 301 (0 302) redirect from a Web site root to an IBM Web Content Manager URL and the common path part from the URL, such as wcpwcmconnectlibraryName.

Performance management tools for IBM WebSphere Portal

This document details the tooling that was used during a recent performancerelated customer engagement. It describes the tools and how they were used to evaluate IBM WebSphere Portal 7 performance problem determination issues.

Community articleLeveraging Reverse AJAX in IBM WebSphere Portal 7.0 using Dojo CometD and Web messaging service

Added by IBM contributor Leslie Gallo | Edited by IBM contributor Leslie Gallo on February 8, 2012 | Version 4
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
This article provides a hands-on exercise to leverage Reverse AJAX in portlets using Dojo CometD foundation and the Web messaging service component of the Feature Pack for Web 2.0. It demonstrates a scenario in which an open channel is kept between a client's browser and the IBM® WebSphere® Portal server so that WebSphere Portal can push updates to the client as soon as they are available.
Tags:
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Understanding Reverse AJAX and Web messaging service
  • 3 Preparing for the example
  • 4 Example: Real-time task list portlet using Reverse AJAX
    • 4.1 Creating and configuring the Project
    • 4.2 Developing the task list portlet
    • 4.3 Developing the task administration portlet
    • 4.4 Deploying the portlets
  • 5 Testing the portlets
  • 6 Conclusion
  • 7 Resources
  • 8 About the author

Introduction


The Reverse Asynchronous JavaTM and XML (AJAX) technology enables dynamic content to be delivered to the browser, thus improving application performance by eliminating the need for constant polling. This technology can be used in many scenarios to deliver an excellent user experience.

For example, a news portal can push the news to a user's browser when it becomes available, without needing user action and without needing to keep refreshing or re-rendering the whole page. Another scenario is to display an up-to-date task list to which the server pushes the new task once it is created, so that the task owner doesn't need to keep pulling the updates.

In this article we go through all the steps needed to leverage Reverse AJAX in portlets using Dojo CometD implementation. We develop a Task List portlet that displays a set of tasks assigned to the logged-in user and to which the server keeps pushing any new tasks, using reverse AJAX.

To get the most from this article, you should have basic knowledge of AJAX and Dojo, prior experience in developing portlets, and basic IBM® WebSphere® Portal development and administration skills.

Understanding Reverse AJAX and Web messaging service


AJAX technology enables HTTP requests to be made to a dynamic Web resource from the client browser, without the need to refresh or submit the Web page. This is usually used to deliver better user experience and to use the network more efficiently by transferring only the needed data between client and server.

Reverse AJAX is the concept of sending data from server to client browser in the form of event notifications. This means that the client doesn't need to keep pulling the data; instead, it just subscribes to a specific topic and is notified once a related event occurs.

To implement Reverse AJAX in an application, you usually leverage a set of technologies and concepts including Comet, the Bayeux protocol, Dojo CometD, and Web messaging service, which are defined as follows:

Comet. A Web application model in which a long-held HTTP request allows a Web server to push data to a browser, without the browser explicitly requesting it. Comet is a term that combines many known technologies in a specific model to achieve this goal.

Bayeux protocol by the Dojo Foundation. Defines a higher-level protocol for communication between browser and server, with the aim of allowing re-use of client-side JavaScript code with multiple Comet servers, and allowing the same Comet server to communicate with multiple client-side JavaScript implementations. Bayeux is based on the publish/subscribe mechanism, so this must be supported by the server to be able to leverage this model.

Dojo CometD. A project by the Dojo Foundation to produce a specification for Bayeux, and a set of implementations of that specification.

Web messaging service. A publish and subscribe implementation that connects the browser to the IBM WebSphere Application Server service integration bus for server-side event push. Client/server communication is achieved through the Bayeux protocol. Any JavaScript library or HTTP client that implements the Bayeux protocol support can communicate with the Web messaging service.

Preparing for the example


To implement Reverse AJAX in WebSphere Portal, we must enable the Web messaging service, as it is disabled by default, following these steps:
  1. Log in to the administration console of WebSphere_Portal profile and navigate to Servers --- Application servers --- WebSphere_Portal.
  2. Expand Web Container Settings and select Web container transport chains.
  3. Select WCInboundDefault --- Web container inbound channel --- Custom Properties.
  4. Click New to enter a new property, and enter “webmsgenabled” for the name and “true” for the value (see figure 1).
Figure 1. webmsgenabled property


Next, we need to create a Bus and Topic connection factory for the example. Follow these steps to create the Bus:
  1. Log in to the administration console and navigate to Service Integration --- Buses.
  2. Click New, enter ReverseAjaxBus for the name, and clear the Bus Security check box.
  3. Click Next and then Finish, to create the Bus; save the changes to the master configuration.
  4. Click ReverseAjaxBus to enter its configuration page and click Bus members under the Topology detail page.
  5. Click Add, and select WebSphere_Portal server to add it to the Bus members.
  6. Accept the other defaults, click Next and then Finish, and save the changes to the master configuration.
  7. Restart WebSphere Portal.
Follow these steps to create the Topic connection factory:
  1. Log in to the administration console and navigate to Resources –- JMS --- Topic connection factories, making sure to select WebSphere_Portal in the server scope.
  2. Click New, select Default Messaging Provider, and click OK.
  3. Enter ReverseAjaxTopic for the name, and jms/reverseajax for the JNDI name.
  4. Select ReverseAjaxBus from the Bus Name menu.
  5. Click OK and then save the changes to the master configuration.

Example: Real-time task list portlet using Reverse AJAX


In this section we go through the implementation details of the example (see the attached RealtimeTaskList.zip file), in which we implement two portlets: The task list portlet, which will be used to render the task list to the logged-in user, and an administration portlet to simulate creating new tasks.

The task administration portlet simulates adding a new task and then pushing a notification, using Reverse Ajax, to the task list portlet to update the displayed list. We use IBM Rational® Software Architect to implement the Portlet Project; however, any Integrated Development Environment (IDE) that has access to the needed libraries and supports portlet development can be used for implementation.

Creating and configuring the Project

  1. Create a new Portlet Project using the wizard and enter RealtimeTaskList as project name.
  2. Select WebSphere Portal 7.0 (stub) as the target runtime for the project.
  3. Clear the Create a portlet check box and then click Finish.
  4. Right-click the created project, select properties, and then open the Project Facets section (see figure 2).
  5. Select “JSR Portlets on WebSphere Portal (v 7.0)”.
  6. Expand the Web 2.0 section, select “Dojo Toolkit on WebSphere Portal” and “Server-side Technologies”, and then click OK to save the properties.
Figure 2. Project Facets window



7. Open project properties again and add WebSphere Application Server 7.0 runtime to the project by selecting Java Build Path --- Libraries --- Add Library --- Server Runtime --- WebSphere Application Server 7.0.

8. Add the web messaging service APIs JAR file to the project Web app library (copy webmsg_applib.jar) to WEB-INF/lib directory of the project. This JAR file is under WebSphere Application Server feature pack for Web 2.0 (AppServer\web2fep\optionalLibraries\MessagingService).

Developing the task list portlet


In this section we will go through the steps of developing and configuring the Task List portlet; specifically, we discuss the steps to enable the portlet to use Web messaging service. Note, however, we do not discuss the details behind the steps; for more information on this you can refer to the Web Messaging Service overview topic in the WebSphere Application Server documentation.

Create the portlet:
  1. Right-click the project and select New --- Portlet.
  2. Enter TaskListPortlet as the portlet name, making sure that JSR 286 is the selected API, and select Basic Portlet for the type.
  3. Click Finish, to create the portlet resources.
Configure Web messaging service in deployment descriptor:
  1. Open web.xml and insert the code snippet in listing 1 into the web-app tag. (This configures the Web messaging service servlet and publisher servlet, and adds references to the JMS topic factory that will be used for communications.)
Listing 1. Code to insert into web-app tag

 	<servlet>
 	    <description></description>
 	    <display-name>Publisher</display-name>
 	    <servlet-name>Publisher</servlet-name>
 		<servlet-class>
	        com.ibm.websphere.webmsg.publisher.jndijms.JmsPublisherServlet
 	    </servlet-class>
 	    <init-param>
 	        <description></description>
 	        <param-name>CONNECTION_FACTORY_JNDI_NAME</param-name>
 	        <param-value>java:comp/env/jms/reverseajax</param-value>
 	    </init-param>
 	    <load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet>
 	    <description/>
 	    <display-name>WebMsgServlet</display-name>
 	    <servlet-name>WebMsgServlet</servlet-name>
 	    <servlet-class>com.ibm.websphere.webmsg.servlet.WebMsgServlet</servlet-class>
 	</servlet>
 	<servlet-mapping>
 	    <servlet-name>WebMsgServlet</servlet-name>
 	    <url-pattern>/webmsgServlet</url-pattern>
 	</servlet-mapping>	
 		<resource-ref id="ResourceRef_1224558884500">
 	    <description></description>
 	    <res-ref-name>jms/reverseajax</res-ref-name>
 	    <res-type>javax.jms.TopicConnectionFactory</res-type>
 	    <res-auth>Container</res-auth>
 	    <res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>


1. Open the ibm-web-bnd.xml file to add binding to the JMS resource we referenced in web.xml, and add the following line of code inside the web-bnd tag:

<resource-ref name="jms/reverseajax" binding-name="jms/reverseajax" />

Create Web messaging service configuration file:
  1. As described in the Web Messaging Service overview documentation, we need a JavaScript Object Notation (JSON) configuration file to define some properties needed by the service. Navigate to the WEB-INF directory of the project, right-click it, and select New --- File.
  2. Name the file webmsg.json, and copy the code in listing 2 to the newly created file.
Listing 2. Code to copy to webmsg.json
{
   "WebMsgServlet" : 
      {  
         "busName" : "ReverseAjaxBus", 
 	   "destination": "Default.Topic.Space", 
         "clientCanPublish" : true,
         "longPollTimeout" : 30
      }
}

Developing the Portlet JavaServer Pages (JSP):
  1. Open the JSP file TaskListPortletView.jsp (this should have been created for you when you create the basic portlet).
  2. We assume that the Dojo library has already been referenced from the Portal theme; if you are using a custom theme, you will need to add the references to Dojo manually. If you are using the default Portal theme, then no need to load the library in your JSP.
  3. In this page we use Dojo CometD APIs to subscribe to a specific topic and handle any notifications coming through that channel. The code is described as follows:
a) Add Dojo declarations for the needed classes:
dojo.require("dojo.io.script");
dojo.require("dojox.cometd");
dojo.require("dojox.cometd.callbackPollTransport");
b) Initialize the Dojo cometd configuration; this will initialize the connection and subscribe to the topics in which this portlet is interested (see listing 3). The page will subscribe to two topics, one private topic, which will have the userId as part of the topic context path, and one public topic (which will contain the root context path only; we do this to handle the case when you need to publish a public notification to all subscribers or publish a private notification to specific subscriber).
Listing 3. Code to initialize cometd configuration

    <portlet:namespace/>cometdConfig = function() {
    	//if not connected, connect to web messaging service servlet
    	if(dojox.cometd.state() == "unconnected"){
       dojox.cometd.init("<%= renderRequest.getContextPath()+"/webmsgServlet" %>");
      }
        
	//subscribe to private topic
      dojox.cometd.subscribe("/taskList/<%= renderRequest.getRemoteUser() %>",
		 "<portlet:namespace/>publishHandler");
      
 	//subscribe to public topic
 	dojox.cometd.subscribe("/taskList", "<portlet:namespace/>publishHandler");
        
    }

Note that, in the cometd subscription statement, we pass two arguments, the topic context path and a handler function to execute when a message is received over that channel.

c) Now we define the handler function, “publishHandler”, in which we just log the received message to the console and then append it to the task list section (see listing 4).
Listing 4. publishHandler function

    <portlet:namespace/>publishHandler = function (message) {
       console.log("<portlet:namespace/>received", message);
       dojo.byId("<portlet:namespace/>taskList").
       appendChild(document.createElement("div"))
		.appendChild(document.createTextNode(message.data));
    }
d) The final scripting step is to set the initialization function to run on page load:
dojo.addOnLoad(<portlet:namespace/>cometdConfig);

e) Finally, define the task list section that is referenced from handler function:
<div id="<portlet:namespace/>taskList">
    <strong>
        Tasks:
    </strong>
</div>

Listing 5 shows the full page code for reference; you might copy and replace the page source code with this one.

Listing 5. Full page code

<%@page session="false" contentType="text/html" pageEncoding="ISO-8859-1"
	 import="java.util.*,javax.portlet.*,com.ibm.realtimetasklist.*" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>        
<%@taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model" prefix="portlet-client-model" %>        
<portlet:defineObjects/>
<portlet-client-model:init>
      <portlet-client-model:require module="ibm.portal.xml.*"/>
      <portlet-client-model:require module="ibm.portal.portlet.*"/>   
</portlet-client-model:init>

<style type="text/css">
    body,  html { font-family:helvetica,arial,sans-serif; font-size:90%; }
</style>

<script type="text/javascript">
    dojo.require("dojo.io.script");
    dojo.require("dojox.cometd");
    dojo.require("dojox.cometd.callbackPollTransport");
    
    
    < portlet:namespace/>cometdConfig = function() {
    	//if not connected, connect to web messaging service servlet
    	if(dojox.cometd.state() == "unconnected"){
       dojox.cometd.init("<%= renderRequest.getContextPath()+"/webmsgServlet" %>");
      }
      //subscribe to private topic
      dojox.cometd.subscribe("/taskList/<%= renderRequest.getRemoteUser() %>",
		 "<portlet:namespace/>publishHandler");
        
       //subscribe to public topic
      dojox.cometd.subscribe("/taskList", "<portlet:namespace/>publishHandler");
        
    }
    dojo.addOnLoad(<portlet:namespace/>cometdConfig);
    commonHandler = function(message){alert(message);}
    
    < portlet:namespace/>publishHandler = function (message) {
        console.log("<portlet:namespace/>received", message);
        dojo.byId("<portlet:namespace/>taskList").
        appendChild(document.createElement("div")).
		appendChild(document.createTextNode(message.data));
    }
</script>

<div>
<h2>Real-Time Task List for user <%= renderRequest.getRemoteUser() %></h2>
</div>
<div id="<portlet:namespace/>taskList">
    <strong>
        Tasks:
    </strong>
</div>

This completes the development of the task list portlet, which now is now subscribing to two topics (private and public), and any task submitted by the task administration portlet will be pushed over those topics to subscriber(s).

Developing the task administration portlet


The task administration portlet is used to simulate task creation, after which the portlet pushes a notification to the owner of that task that a new task is created. The portlet can create common tasks (for all users) and private tasks (for specific user).

Create the portlet:
  1. Right-click the project and select New --- Portlet.
  2. Enter TaskAdminPortlet as the portlet name, making sure that JSR 286 is the selected API, and select Basic Portlet for the type.
  3. Click Finish, to create the portlet resources.
Develop the portlet JSP:
  1. Open the JSP file, TaskAdminPortletView.jsp (this should have been created for you when you created the basic portlet).
  2. Create a simple form with a text field to enter the task statement and a combo box of potential task owners to assign the task to (later we will need to create these users in a deployment step). Listing 6 is the full page code; you can copy and replace the code as necessary.
Listing 6. Full page code

	<%@page session="false" contentType="text/html" pageEncoding="ISO-8859-1" 
 		import="java.util.*,javax.portlet.*,com.ibm.realtimetasklist.*" %>
	<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>        
	<%@taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model" prefix="portlet-client-model" %>        
	<portlet:defineObjects/>
	<portlet-client-model:init>
      	<portlet-client-model:require module="ibm.portal.xml.*"/>
      	<portlet-client-model:require module="ibm.portal.portlet.*"/>   
	</portlet-client-model:init> 
	<div>
 		<form action="<portlet:actionURL/>">
 			<input type="text" name="TaskString">
 			<select name="TaskOwner">
 				<option value="taskcommon">Common</option>
 				<option value="taskuser1" >User 1</option>
 				<option value="taskuser2" >User 2</option>
 				<option value="taskuser3" >User 3</option>
 			</select>
 			<input type="submit" name="Submit">
 		</form>
	</div>

Develop the portlet action handler:
Now we implement the action handler that will simulate creating a task and then push a notification through the defined topics to notify the task owner.

1. Open the Java class TaskAdminPortlet (this is created while creating the portlet).
2. Import the needed classes as shown below (these classes comes from the webmsg_applib.jar that we added to the project Web library in the project creation step):

import com.ibm.websphere.webmsg.publisher.Publisher;
import com.ibm.websphere.webmsg.publisher.PublisherException;
import com.ibm.websphere.webmsg.publisher.jndijms.BayeuxJmsTextMsg;
import com.ibm.websphere.webmsg.publisher.jndijms.JmsPublisherServlet;

3. Navigate to the processAction method and write the code to extract the form parameters from the request and push the notification to topics accordingly. Listing 7 shows the full code for reference; you can copy and replace the processAction method with this code.

Listing 7. Full code for processAction

 	public void processAction(ActionRequest request, 
		 ActionResponse response) 
 		throws PortletException, java.io.IOException {

 		String taskString = request.getParameter("TaskString");
 		String taskOwner = request.getParameter("TaskOwner");
		
 		//Here comes the code that will create the task 
		//in database or process engine or whatever
		
 		//Now we will push a notification to owner's topic
		Publisher publisher = (Publisher) getPortletContext().getAttribute(
 		        JmsPublisherServlet.PUBLISHER_SERVLET_CONTEXT_KEY);
 		try {
 			if("taskcommon".equals(taskOwner)){//public task
				publisher.publish(
					new BayeuxJmsTextMsg("/taskList", taskString));

 			}else{//private task
				publisher.publish(
				new BayeuxJmsTextMsg("/taskList/"+taskOwner, taskString));
			}
 		} catch (PublisherException e) {
			e.printStackTrace();
		}
	}

To summarize, the code implementation has three main parts:

1. Create a publisher instance; this configures from the initialization parameter we defined in web.xml and uses the JMS connection factory we specified there for publishing:

Publisher publisher = (Publisher) getPortletContext().getAttribute(
JmsPublisherServlet.PUBLISHER_SERVLET_CONTEXT_KEY);

2. Publish a message to the common topic if the task is public (we do this by publishing the message to the topic /taskList for which all task users are subscribers):

publisher.publish(new BayeuxJmsTextMsg("/taskList", taskString));

3. Publish a message to specific user channel if the message is private (we do this by publishing the message to /taskList/ topic that is unique for each user):

publisher.publish(new BayeuxJmsTextMsg("/taskList/"+taskOwner,
taskString));

This completes the implementation of the task administration portlet. We are now ready to deploy and test the two portlets.

Deploying the portlets


In this section we deploy and prepare the portlets for testing, which requires creating some test users and pages as well. To complete the deployment, follow these steps:

Deploy the portlet application:
  1. Export the RealtimeTaskList project as a .war.
  2. Log in to WebSphere Portal using the administrator user account and navigate to Administration page --- Web Modules.
  3. Click the Install button, browse and select RealtimeTaskList.war; click Next and then Finish.
Create test users:
  1. While you are in Administration section, navigate to Access --- Users and Groups, and click the New User button
  2. Enter taskuser1 as user ID, fill in the other fields with valid data, and then click OK, to create the user.
  3. Repeat Step 2 to create the other two users, taskuser2 and taskuser3.
Create test pages and deploy portlets:
  1. On the administration page, navigate to Portal User Interface --- Manage Pages.
  2. Click the New Page button, enter Realtime Task List as the page name, fill in the other fields with valid data, and then click OK, to create the page.
  3. Click the New Page button again, enter Task Administration as the page name, and click OK, to create the page.
  4. Edit Realtime Task List access rights by clicking the small key button to the right-hand side of the page name.
  5. Edit the User role, adding the three test users we created in the previous section as allowed members.
  6. Return to the Access Rights editing page and click Done, to save the changes.
  7. Edit Realtime Task List page layout by clicking the pencil icon to the right-hand side of the page.
  8. Click the Add Portlets button, add TaskListPortlet to the page, and then click Done, to close the layout editor.
  9. Edit the Task Administration page layout by clicking the pencil icon to the right-hand side of the page.
  10. Click the Add Portlets button, add TaskAdminPortlet to the page, and then click Done, to close the layout editor.
  11. Edit TaskListPortlet access rights, adding the test users we created earlier with User roles on the portlet.

Testing the portlets


Now we test the portlets and verify their behavior. You'll need to use 3--4 different browsers to be able to test the portlets concurrently, because you must log in with different users and create a different session for each user, to test the private channels subscription.
  1. Log in to WebSphere Portal with the admin user and open the Task Administration page.
  2. Using another browser, log in to Portal with taskuser1 and open the Realtime Task List page.
  3. Repeat Step 2 for the other two users, making sure to use different browsers, for instance, Internet Explorer, Google Chrome, Mozilla Firefox, and Apple Safari (see figure 3).
Figure 3. Three users logged into different browsers



4. Create a common task by selecting the Common user from the combo box and click the Submit Query button. Note that the new task immediately appears in all users' task lists, since we published the message to the public channel and all subscribers received it (see figure 4).

Figure 4. Common task in all users' task lists



5. Create a task for TaskUser1 and click Submit Query (see figure 5).

Figure 5. Create a task



Note that the task appears in TaskUser1's task list, as shown in figure 6 because the notification has been pushed to the private topic for TaskUser1 (topic taskList/taskuser1).

Figure 6. Task for TaskUser1



6. Repeat the test by adding a task for TaskUser2 and TaskUser3 separately (see figures 7 and 8); note the real-time update to the task lists of users.

Figure 7. Add task for TastUser2



Figure 8. Add task for TastUser3



7. Finally, add another common task and see how it is pushed to all users and appears in their task list (see figure 9).

Figure 9. “Another common task” pushed to all users


Conclusion


Reverse AJAX technology is an excellent method for adding real-time-updates functionality to any Web application without the need for continuous polling by the client. This yields a better user experience and better network usage, which also leads to overall better performance.

WebSphere Feature Pack for Web 2.0 offers great support for leveraging Reverse AJAX through the Web messaging service and can be used also with WebSphere Portal to add more flexibility and better user experience to portlets. In this article we have used Web messaging service and Dojo CometD implementation to leverage Reverse AJAX in portlets.

Resources

  • RealtimeTaskList.zip file attached to this article.
  • CometD project documentation
  • wikipedia article, "Comet Programming Concepts"
  • WebSphere Application Server documentation topic, "Web messaging service overview"
  • developerWorks article, “Implementing Web messaging: Connect Ajax clients to near-real-time data with WebSphere Application Server Community Edition"
  • developerWorks WebSphere Portal zone

About the author


Mahmoud Matouk currently works as a Senior SOA and WebSphere Portal specialist and as a Subject Matter Expert (Portal & WCM) at GBM Qatar (IBM business partner). He previously worked as a Software Engineer at IBM Egypt in the Cairo Technology Development Center and has more than seven years of experience in implementing WebSphere Portal and SOA solutions. You can reach him at MMATOUK@qa.gbm.ihost.com.





  • Edit
  • More Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
application/x-zip 119 KB RealtimeTaskList.zip 2/8/12 3:48 PM
expanded Versions (4)
collapsed Versions (4)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (4)Feb 8, 2012 5:02:52 PMLeslie Gallo  IBM contributor
2Feb 8, 2012 4:35:56 PMLeslie Gallo  IBM contributor
1Feb 8, 2012 4:13:45 PMLeslie Gallo  IBM contributor
1Feb 8, 2012 4:28:54 PMLeslie Gallo  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use