Implementing AJAX in IBM WCM Portlet

IBM WebSphere Portal 6 is built with some Ajax enabled features, i.e. drag’n’drop or DND. However we must understand that the portlets that we run on Portal 6 will not be Ajax enabled immediately. We need to adjust our code in such a way that utilizes Ajax capibilities. This article will give you one approach  to achieve Ajax in Web Content Viewer portlet. In addition to that, content caching to improve the portlet performance and inter-portlet communication through Ajax will also be covered.

Ajax Overview

Ajax or Asynchronoous Javascript XML is a browser-based technology to dynamically change the content of document or portion of web page without having to refresh the whole web page. Ajax is achieved by invoking an XML HTTP Request which is performed asynchronously then rendering the HTTP Request to the specified HTML Object using JavaScript

Portlet Overview

IBM WebSphere Portal is container for web portlets. Portlet JSR 168 is one of the portlet framework that is supported by IBM WebSphere Portal. The difference from standard J2EE Web Application is that portlet cannot be rendered as a standalone web application, but it must be rendered within the portal request, which might also include the rendering of other portlets.

IBM Web Content Management Overview

In IBM WebSphere Portal 6 (since 5.1), we can utilize the bundled Web Content Management (WCM). There are two approaches to view the contents created using IBM WCM. The first one is through the out-of-the-box WCM content viewer portlet, and the second one is through the custom developed portlet making use of WCM API. The first option is useful for end users to easiliy and quickly present the contents. However this option does not support Ajax and limited to some default rendering scheme provided by this product.

Ajax in Portlet JSR 168

If you look at the Portlet Overview section above, you might be wandering how to achieve the AJAX in Portlet 168 since Portlet will be rendered within the portal request. The technique is to use the Servlet which shares session with the Portlet. The servlet takes necessary input parameters and then the browser renders the servlet response asynchronously to a specified region (div or span). Please see the illustration below.

Ajax in Portlet 168 for Inter-portlets Communication

Achieving the Inter-portlets communication in JSR 168 is a trick. Please refer to the illustration as shown below.

content caching -> to be continued…

    • jochoa
    • November 17th, 2008

    Hi Fernando,
    This subject is something that I am really interested on, are you planning on finishing your post? or can you give me a little insight in the next parts?

    THX
    Javier

      • fernandokarnagi
      • May 17th, 2009

      Hi brother,

      Now I have completed this article.

      Go and check it out.

      Cheers!!

  1. No trackbacks yet.

You must be logged in to post a comment.