+

Search Tips   |   Advanced Search

The client side portlet programming model

Use the client side programming model to make use of AJAX techniques in the standard and IBM portlet API portlets.

Use the client side programming model for writing your portlets. We can do everything with the client side programming model we can do with the server side portlet programming model. Additionally, the client side programming model has the following advantages:

  • The client side portlet programming model works in both client side aggregation (CSA) and server side aggregation (SSA).

  • Improved user experience by faster response and performance. Portlets using the clients side programming model render faster, as the portal does not re-render the whole page, but only the aspects of the portlet that change.

  • The client side programming model allows us to handle changes of the portlet mode and window state, preferences, and user customization of user profile locally. This provides a faster response time for the user. A fragment containing the customization is later sent to the server and saved.

  • Writing portlets to the client side programming model does not require deep Java knowledge. We can write such portlets as HTML code with css style sheets and JavaScript. They have few or no JSPs. Example scenarios for writing client side portlets are:

    • A user can add some markup to the portlet view by selecting options in a form.

    • Preference changes that a user makes to the portlet are applied immediately in the browser view without reloading the whole portlet. The preference change is later sent to the server and saved.

    • Access to the user profile on the client side.

    • Portlet mode changes are performed entirely on the client. Performance improves as no server-client communication is required.

    • The portlet can retrieve markup fragments from the server. The user does not notice this, as the ATOM feed format is hidden by the XMLPortletRequest implementation, similar to an XMLHttpRequest (XHR).

    • XSLT and XPath helper functions make it easier to handle XML feeds.

For the full description of the JavaScript interfaces refer to the Web 2.0 Javadoc documentation available on developerWorks.


Parent Web 2.0 user interface features