org.apache.jetspeed.portal
Class AbstractPortlet

java.lang.Object
  |
  +--org.apache.jetspeed.portal.AbstractPortlet

public abstract class AbstractPortlet
extends java.lang.Object
implements Portlet

The AbstractPortlet class is a convenience class for people wanting to implement a portlet. Most methods of the abstract Portal class have a default implementation provided.


Constructor Summary
AbstractPortlet()
           
 
Method Summary
 void destroy()
          Called by the portlet container to indicate to this portlet that it is being taken out of service.
 void doAdmin(PortletRequest aRequest, PortletResponse aResponse)
           
 void doAdminSave(PortletRequest aRequest, PortletResponse aResponse)
           
 void doContent(PortletRequest aRequest, PortletResponse aResponse)
           
 void doDetails(PortletRequest aRequest, PortletResponse aResponse)
           
 void doEdit(PortletRequest aRequest, PortletResponse aResponse)
           
 void doEditSave(PortletRequest aRequest, PortletResponse aResponse)
           
 void doHelp(PortletRequest aRequest, PortletResponse aResponse)
           
 PortletConfig getPortletConfig()
          Returns the configuration of this portlet.
 java.lang.String getPortletInfo()
          Returns information about the servlet, such as author, version, and copyright.
 void init(PortletConfig aConfig)
          Called by the portlet container to indicate to this portlet that it is being placed into service.
 void service(PortletRequest aRequest, PortletResponse aResponse)
          The service method is called by the framework to ask this portlet to render its content using the given context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPortlet

public AbstractPortlet()
Method Detail

getPortletInfo

public java.lang.String getPortletInfo()
Description copied from interface: Portlet
Returns information about the servlet, such as author, version, and copyright.

The string that this method returns should be plain text and not markup of any kind (such as HTML, XML, etc.).

Specified by:
getPortletInfo in interface Portlet
Tags copied from interface: Portlet
Returns:
the portlet information

init

public void init(PortletConfig aConfig)
          throws PortletException
Description copied from interface: Portlet
Called by the portlet container to indicate to this portlet that it is being placed into service.

The portlet container calls the init() method exactly once after instantiating the portlet. The init() method must complete successfully before the servlet can receive any requests.

The portlet container cannot place the portlet into service if the init() method

  1. Throws a PortletException
  2. Does not return within a time period defined by the portal server
Specified by:
init in interface Portlet
Tags copied from interface: Portlet
Parameters:
aConfig - the portlet configuration containing the portlet's configuration and initialization parameters
Throws:
PortletException - if an exception has occurrred that interferes with the portlet's normal initialization
See Also:
PortletConfig.getPortletContext()

destroy

public void destroy()
Description copied from interface: Portlet
Called by the portlet container to indicate to this portlet that it is being taken out of service. This method is only called once all threads within the portlet's service()method have exited or after a timeout period has passed. After the portlet container calls this method, it will not call the service() method again on this portlet.

This method gives the portlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the portlet's current state in memory.

Specified by:
destroy in interface Portlet

getPortletConfig

public PortletConfig getPortletConfig()
Description copied from interface: Portlet
Returns the configuration of this portlet.
Specified by:
getPortletConfig in interface Portlet
Tags copied from interface: Portlet
Returns:
the configuration

service

public void service(PortletRequest aRequest,
                    PortletResponse aResponse)
             throws PortletException,
                    java.io.IOException
Description copied from interface: Portlet
The service method is called by the framework to ask this portlet to render its content using the given context.

The context is the portlet's view of the framework. All that is required to perform the rendering of the content is accessible through the context.

Please note that every portlet gets passed a different context.

Specified by:
service in interface Portlet
Tags copied from interface: Portlet
Parameters:
aRequest - the request
aResponse - the respnse
Throws:
PortletException - if the portlet has trouble fulfilling the service request
java.io.IOException - if the streaming causes an I/O problem

doContent

public void doContent(PortletRequest aRequest,
                      PortletResponse aResponse)
               throws PortletException,
                      java.io.IOException

doDetails

public void doDetails(PortletRequest aRequest,
                      PortletResponse aResponse)
               throws PortletException,
                      java.io.IOException

doEdit

public void doEdit(PortletRequest aRequest,
                   PortletResponse aResponse)
            throws PortletException,
                   java.io.IOException

doEditSave

public void doEditSave(PortletRequest aRequest,
                       PortletResponse aResponse)
                throws PortletException,
                       java.io.IOException

doAdmin

public void doAdmin(PortletRequest aRequest,
                    PortletResponse aResponse)
             throws PortletException,
                    java.io.IOException

doAdminSave

public void doAdminSave(PortletRequest aRequest,
                        PortletResponse aResponse)
                 throws PortletException,
                        java.io.IOException

doHelp

public void doHelp(PortletRequest aRequest,
                   PortletResponse aResponse)
            throws PortletException,
                   java.io.IOException