Portlet Modes

There are several portlet modes that Jetspeed supports:

  • 1. View
  • 2. Customize (Edit)
  • 3. Print Friendly
  • 4. Info
  • 5. Minimize
  • 6. Maximize

View mode is just the normal mode of operation. A request to display a portal page is considered the default or view mode. The getContent method will be called on the portlet.

Customize mode is an important mode of operation. The Portlet interface method providesCustomization can be overridden if you want to provide your own portlet customizer. Otherwise, Jetspeed provides a default customizer when you go into edit mode. If you are providing your own customization, you will need to check for the current mode of the request in your getContent method. Velocity portlets provide a more elegant way of handling customization covered in the next section.

Maximize Mode displays the selected portlet on the entire page. All other portlets are not displayed.

Print Friendly is the same as View Mode, but the portal engine does not display any controls around your portlet.

The other modes: Info, Close and Minimize do not make calls directly to your portlet. Unfortunately, your portlet is not notified of this event, but must check the request parameters to detect if it is being minimized. Info mode simply displays some runtime information about your portlet in a maximized view. The content generated for the portlet is controlled by Jetspeed. Minimizing a portlet will only show the control of the portlet, but not the content. There is also the Close action, which removes the portlet from the page. All six of these mode actions and the close action can be displayed on the control of a portlet:

In order from right to left we have: Customize, Print-Friendly, Info, Close, Minimize and Maximize.

By checking JetspeedRunData.getMode, you can determine the mode of the current request:

        switch (jrun.getMode())
        case JetspeedRunData.NORMAL:
            text.append("MODE = VIEW");
        case JetspeedRunData.CUSTOMIZE:
            text.append("MODE = CUSTOMIZE");
        case JetspeedRunData.MAXIMIZE:
            text.append("MODE = MINIMIZE");
            text.append("MODE = UNKNOWN");