Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows |
This section describes the basic interfaces, classes, and methods of the Portlet API. The following figure shows a map of many of the common objects in the Portlet API.
extended by PortletAdapter
1 PortletRequest and PortletResponse are passed by helper methods of PortletAdapter, such as doView().
The abstract Portlet class is the central abstraction of the Portlet API. All portlets extend this abstract class by extending one of its subclasses, such as PortletAdapter, that provide methods helpful for the developer.
2 This represents the methods called on all portlets. Other methods are called for portlets that implement listeners. See the Listener lifecycle for more information.
Portlets do not extend the abstract Portlet class directly, but rather extend PortletAdapter or any other helper class that in turn extends Portlet. Extending one of these classes helps protect your portlet from changes in the abstract Portlet class. Moreover it saves you the work of having to implement all of the methods of the Portlet interface, even if your portlet does not need to use them all. Using the PortletAdapter class, you only have to overwrite the methods you really need.
In its service() method, the PortletAdapter class invokes methods corresponding to the portlet mode. Portlets that extend this class can overwrite the doView(), doEdit(), and doHelp() methods without having to test the mode or write a specific service() method.
Additionally, the PortletAdapter enables a portlet to store variables with the concrete portlet. Concrete portlet variables differ from Java instance variables because they are bound to the portlet class or non-concrete portlet. PortletAdapter provides the methods setVariable(), getVariable() and removeVariable() to work with concrete portlet variables.