The client side portlet programming model | HCL Digital Experience

You can use the client side programming model to make use of AJAX techniques in your standard API portlets.

You can use the client side programming model for writing your portlets. You can do everything with the client side programming model that you 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 that use 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 you 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 that contains the customization is later sent to the server and saved.
  • Writing portlets to the client side programming model does not require deep Java knowledge. You 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 a 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.