Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

org.apache.jetspeed.portlet
Class PortletAdapter

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.ibm.wps.pe.pc.legacy.cache.CacheablePortlet
              extended byorg.apache.jetspeed.portlet.Portlet
                  extended byorg.apache.jetspeed.portlet.PortletAdapter
All Implemented Interfaces:
com.ibm.websphere.servlet.cache.CacheableServlet, PortletSessionListener, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AbstractPortlet

public abstract class PortletAdapter
extends Portlet
implements PortletSessionListener

The PortletAdapter provides a default implementation for the Portlet interface. It is recommended not to extend the portlet interface directly. Rather, a portlet should derive from this or any other derived class, because changes in the Portlet interface are then mostly likely to be catched by the default implementation, rather than breaking your portlet implementation.

The virtual instance is created and destroyed with the login() and logout() methods, respectively. If a portlet provides personalized views these methods should be implemented.

Since:
4.1
See Also:
Serialized Form
Note:
This interface is designed to be implemented by clients.

Nested Class Summary
 

Nested classes inherited from class org.apache.jetspeed.portlet.Portlet
Portlet.Mode, Portlet.ModeModifier
 

Constructor Summary
PortletAdapter()
           
 

Method Summary
 void destroy(PortletConfig config)
          The default implementation of this method is to do nothing.
 void destroyConcrete(PortletSettings settings)
          The default implementation of this method is to do nothing.
 void doConfigure(PortletRequest request, PortletResponse response)
          Helper method to serve up the CONFIGURE mode.
 void doEdit(PortletRequest request, PortletResponse response)
          Helper method to serve up the EDIT mode.
 void doHelp(PortletRequest request, PortletResponse response)
          Helper method to serve up the HELP mode.
 void doView(PortletRequest request, PortletResponse response)
          Helper method to serve up the VIEW mode.
 long getLastModified(PortletRequest request)
          The default implementation of this method defines that the portlet never expires.
 PortletConfig getPortletConfig()
          Returns the portlet configuration.
 PortletLog getPortletLog()
          Returns the portlet log.
 java.lang.Object getVariable(java.lang.String name)
          Returns a transient variable of the concrete portlet.
 void init(PortletConfig config)
          The default implementation of this method is to remember the portlet configuration for later use.
 void initConcrete(PortletSettings settings)
          The default implementation of this method is to do nothing.
 void login(PortletRequest request)
          The default implementation of this method is to do nothing.
 void logout(PortletSession session)
          The default implementation of this method is to do nothing.
 void removeVariable(java.lang.String name)
          Removes a transient variable of the concrete portlet.
 void service(PortletRequest request, PortletResponse response)
          The default implementation of this method routes the request to a set of helper methods that are already split out by portlet mode.
 void setVariable(java.lang.String name, java.lang.Object value)
          Sets a transient variable of the concrete portlet.
 

Methods inherited from class org.apache.jetspeed.portlet.Portlet
destroy, doGet, doPost, doPut, getId, getInitParameter, getInitParameterNames, getLastModified, getPortletSettings, getServletContext, getServletInfo, init, service
 

Methods inherited from class com.ibm.wps.pe.pc.legacy.cache.CacheablePortlet
getSharingPolicy, service
 

Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doTrace
 

Methods inherited from class javax.servlet.GenericServlet
getServletConfig, getServletName, init, log, log
 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletAdapter

public PortletAdapter()

Method Detail

init

public void init(PortletConfig config)
          throws UnavailableException
The default implementation of this method is to remember the portlet configuration for later use.

Specified by:
init in class Portlet
Parameters:
config - the portlet configuration
Throws:
UnavailableException - if an exception has occurrred that interferes with the portlet's normal initialization

destroy

public void destroy(PortletConfig config)
The default implementation of this method is to do nothing.

Specified by:
destroy in class Portlet
Parameters:
config - the portlet configuration

initConcrete

public void initConcrete(PortletSettings settings)
                  throws UnavailableException
The default implementation of this method is to do nothing.

Specified by:
initConcrete in class Portlet
Parameters:
settings - the portlet settings
Throws:
UnavailableException - if an exception has occurrred that interferes with the portlet's normal initialization

destroyConcrete

public void destroyConcrete(PortletSettings settings)
The default implementation of this method is to do nothing.

Specified by:
destroyConcrete in class Portlet
Parameters:
settings - the portlet settings

login

public void login(PortletRequest request)
           throws org.apache.jetspeed.portlet.PortletException
The default implementation of this method is to do nothing.

Specified by:
login in interface PortletSessionListener
Specified by:
login in class Portlet
Parameters:
request - the portlet request
Throws:
PortletException - if the portlet has trouble fulfilling the login request

logout

public void logout(PortletSession session)
            throws org.apache.jetspeed.portlet.PortletException
The default implementation of this method is to do nothing.

Specified by:
logout in interface PortletSessionListener
Specified by:
logout in class Portlet
Parameters:
session - the portlet session
Throws:
PortletException - if the portlet has trouble fulfilling the logout

getLastModified

public long getLastModified(PortletRequest request)
The default implementation of this method defines that the portlet never expires.

Specified by:
getLastModified in class Portlet
Parameters:
request - the PortletRequest object that is sent to the portlet
Returns:
a long integer specifying the time the PortletRequest object was last modified, in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is not known

service

public void service(PortletRequest request,
                    PortletResponse response)
             throws org.apache.jetspeed.portlet.PortletException,
                    java.io.IOException
The default implementation of this method routes the request to a set of helper methods that are already split out by portlet mode. Therefore if this portlet only supports the VIEW mode, only the doView method needs to be implemented.

Specified by:
service in class Portlet
Parameters:
request - the portlet request
response - the portlet response
Throws:
java.io.IOException - if the streaming causes an I/O problem
org.apache.jetspeed.portlet.PortletException
See Also:
doView(org.apache.jetspeed.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletResponse), doEdit(org.apache.jetspeed.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletResponse), doHelp(org.apache.jetspeed.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletResponse), doConfigure(org.apache.jetspeed.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletResponse)

doView

public void doView(PortletRequest request,
                   PortletResponse response)
            throws org.apache.jetspeed.portlet.PortletException,
                   java.io.IOException
Helper method to serve up the VIEW mode.

Parameters:
request - the portlet request
response - the portlet response
Throws:
org.apache.jetspeed.portlet.PortletException
java.io.IOException

doEdit

public void doEdit(PortletRequest request,
                   PortletResponse response)
            throws org.apache.jetspeed.portlet.PortletException,
                   java.io.IOException
Helper method to serve up the EDIT mode.

Parameters:
request - the portlet request
response - the portlet response
Throws:
org.apache.jetspeed.portlet.PortletException
java.io.IOException

doHelp

public void doHelp(PortletRequest request,
                   PortletResponse response)
            throws org.apache.jetspeed.portlet.PortletException,
                   java.io.IOException
Helper method to serve up the HELP mode.

Parameters:
request - the portlet request
response - the portlet response
Throws:
org.apache.jetspeed.portlet.PortletException
java.io.IOException

doConfigure

public void doConfigure(PortletRequest request,
                        PortletResponse response)
                 throws org.apache.jetspeed.portlet.PortletException,
                        java.io.IOException
Helper method to serve up the CONFIGURE mode.

Parameters:
request - the portlet request
response - the portlet response
Throws:
org.apache.jetspeed.portlet.PortletException
java.io.IOException

getPortletConfig

public PortletConfig getPortletConfig()
Returns the portlet configuration.

Specified by:
getPortletConfig in class Portlet
Returns:
the portlet configuration

getPortletLog

public PortletLog getPortletLog()
Returns the portlet log.

Returns:
the portlet log

setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
                 throws AccessDeniedException
Sets a transient variable of the concrete portlet.

Parameters:
name - the name of the transient variable
value - the value of the transient variable
Throws:
AccessDeniedException - if the method is called outside of a concrete portlet

getVariable

public java.lang.Object getVariable(java.lang.String name)
                             throws AccessDeniedException
Returns a transient variable of the concrete portlet.

Parameters:
name - the name of the transient variable
Throws:
AccessDeniedException - if the method is called outside of a concrete portlet

removeVariable

public void removeVariable(java.lang.String name)
                    throws AccessDeniedException
Removes a transient variable of the concrete portlet.

Parameters:
name - the name of the transient variable
Throws:
AccessDeniedException - if the method is called outside of a concrete portlet

Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.