Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the portlet has important functions that could likely be reused by some other portlets it makes sense to use the servant mode. Based on the information received with the PortletRequest such portlets can distinguish the normal modes like VIEW,EDIT,HELP from the "servant" and perform different operations to interact with the client-portlet. To provide portlet-servant communication ServerPortletUtil class is used. In the following example the servant checks the current portlet mode is "servant" than it groups manager portlet gets the request attribute sent by the client-portlet in the servant mode:

Code Block
titleGroupsManagerPortlet.java
borderStylesolid
if ( ServerPortletUtil.isServantMode(request) ) {
   IGroupMember[] groupMembers = (IGroupMember[]) ServerPortletUtil.getAttribute(request);
   ...
}

...