GridSphere Portlet API
The GridSphere Portlet API is an implementation based upon the GridLab Portal
Technical Specification. The Portlet API presented has been based largely on
the IBM WebSphere Portlet API 4.1.
In particular the portlet hierarchy is as follows:
Portlet implements PortletSessionListener
^
|
PortletAdapter
^
|
AbstractPortlet implements ActionListener, MessageListener, WindowListener, PortletTitleListener
Portlet developers would subclass the AbstractPortlet and override the hook
methods of the various Listeners for added functionality.
The following list is the order in which portlet lifecycle methods are invoked:
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#init(PortletConfig)} is invoked.
This provides the application portlet with its initial configuration,
{@link org.gridlab.gridsphere.portlet.PortletConfig}.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#initConcrete(PortletSettings)} is invoked.
This provides the concrete portlet instance with its initial configuration,
{@link org.gridlab.gridsphere.portlet.PortletSettings}.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#login(PortletRequest)} is invoked.
Once a user has successfully logged in, the login() method is invoked for each of the
portlets in their subscription list.
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#service(PortletRequest, PortletResponse)} is invoked.
This services the concrete portlet instance for a particular user request.
This lifecycle method is invoked on concrete portlets for each and every user request.
Additionally the following lifecycle methods may be performed in the following order:
An appropriate portlet action method is called:
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#actionPerformed(ActionEvent)}
handles a portlet action event
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#messageReceived(MessageEvent)}
handles a portlet message event
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#windowMinimized(WindowEvent)}
handles a portlet window minimized event
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#windowMaximized(WindowEvent)}
handles a portlet window maximized event
-
{@link org.gridlab.gridsphere.portlet.AbstractPortlet#windowRestored(WindowEvent)}
handles a portlet window restored event
An appropriate portlet render method is called:
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#doView(PortletRequest, PortletResponse)}
render the portlet
VIEW
mode.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#doEdit(PortletRequest, PortletResponse)}
render the portlet
VIEW
mode.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#doHelp(PortletRequest, PortletResponse)}
render the portlet
VIEW
mode.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#doConfigure(PortletRequest, PortletResponse)}
render the portlet
VIEW
mode.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#logout(PortletSession)} is invoked.
The logout() method is invoked for each of the portlets a user's subscription list.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#destroyConcrete(PortletSettings)} is invoked.
This destroys the concrete portlet instance.
-
{@link org.gridlab.gridsphere.portlet.PortletAdapter#destroy()} is invoked.
This destroys the application portlet and takes it out of service.