net.sf.jportlet.portlet
Class PortletAdapter

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--net.sf.jportlet.portlet.Portlet
                    |
                    +--net.sf.jportlet.portlet.PortletAdapter
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
PortletProxy

public class PortletAdapter
extends Portlet

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

Author:
Herve Tchepannou
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class net.sf.jportlet.portlet.Portlet
Portlet.Markup, Portlet.Mode
 
Constructor Summary
PortletAdapter()
           
 
Method Summary
protected  void doConfigure(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.CONFIGURE mode
protected  void doEdit(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.EDIT mode
protected  void doHelp(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.HELP mode
protected  void doView(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.VIEW mode
 long getLastModified(net.sf.jportlet.portlet.PortletRequest request)
          Returns the time the response of the Portlet object was last modified, in milliseconds since midnight January 1, 1970 GMT.
 net.sf.jportlet.portlet.PortletLog getLog()
           
 net.sf.jportlet.portlet.PortletContext getPortletContext()
           
 java.lang.String getText(java.lang.String key, java.util.Locale locale)
          Returns the value of a localized text.
 void include(java.lang.String path, net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          Include a file into the PortletResponse.
 void login(net.sf.jportlet.portlet.PortletRequest request)
          Called by the portlet container to ask the portlet to initialize a personalized user experience
 void logout(net.sf.jportlet.portlet.PortletRequest request)
          Called by the portlet container to indicate that a concrete portlet instance is being removed
 void service(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          This function is invoke by the container in order to render the portlet
 
Methods inherited from class net.sf.jportlet.portlet.Portlet
getPortletConfig, init
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, 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

doConfigure

protected void doConfigure(net.sf.jportlet.portlet.PortletRequest request,
                           net.sf.jportlet.portlet.PortletResponse response)
                    throws PortletException,
                           java.io.IOException
Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.CONFIGURE mode

Parameters:
request -
response -
Throws:
PortletException
java.io.IOException

doEdit

protected void doEdit(net.sf.jportlet.portlet.PortletRequest request,
                      net.sf.jportlet.portlet.PortletResponse response)
               throws PortletException,
                      java.io.IOException
Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.EDIT mode

Parameters:
request -
response -
Throws:
PortletException
java.io.IOException

doHelp

protected void doHelp(net.sf.jportlet.portlet.PortletRequest request,
                      net.sf.jportlet.portlet.PortletResponse response)
               throws PortletException,
                      java.io.IOException
Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.HELP mode

Parameters:
request -
response -
Throws:
PortletException
java.io.IOException

doView

protected void doView(net.sf.jportlet.portlet.PortletRequest request,
                      net.sf.jportlet.portlet.PortletResponse response)
               throws PortletException,
                      java.io.IOException
Renders the portlet in net.sf.jportlet.portlet.Portlet.Model.VIEW mode

Parameters:
request -
response -
Throws:
PortletException
java.io.IOException

getLastModified

public long getLastModified(net.sf.jportlet.portlet.PortletRequest request)
Description copied from class: Portlet
Returns the time the response of the Portlet object was last modified, in milliseconds since midnight January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default).

Portlets that can quickly determine their last modification time should override this method. This makes browser and proxy caches work more effectively, reducing the load on server and network resources

Specified by:
getLastModified in class Portlet
Parameters:
request -
Returns:
long
See Also:
Portlet.getLastModified(net.sf.jportlet.portlet.PortletRequest)

getLog

public net.sf.jportlet.portlet.PortletLog getLog()

getPortletContext

public net.sf.jportlet.portlet.PortletContext getPortletContext()
Returns:
PortletContext

getText

public java.lang.String getText(java.lang.String key,
                                java.util.Locale locale)
Returns the value of a localized text. This method call PortletContext.getText(java.lang.String, java.util.Locale)


include

public void include(java.lang.String path,
                    net.sf.jportlet.portlet.PortletRequest request,
                    net.sf.jportlet.portlet.PortletResponse response)
             throws PortletException,
                    java.io.IOException
Include a file into the PortletResponse. This method call PortletContext.include(java.lang.String, net.sf.jportlet.portlet.PortletRequest, net.sf.jportlet.portlet.PortletResponse)

PortletException
java.io.IOException

login

public void login(net.sf.jportlet.portlet.PortletRequest request)
           throws PortletException
Description copied from class: Portlet
Called by the portlet container to ask the portlet to initialize a personalized user experience

Specified by:
login in class Portlet
Parameters:
request -
Throws:
PortletException
See Also:
Portlet.login(net.sf.jportlet.portlet.PortletRequest)

logout

public void logout(net.sf.jportlet.portlet.PortletRequest request)
            throws PortletException
Description copied from class: Portlet
Called by the portlet container to indicate that a concrete portlet instance is being removed

Specified by:
logout in class Portlet
Parameters:
request -
PortletException
See Also:
Portlet.logout(net.sf.jportlet.portlet.PortletRequest)

service

public void service(net.sf.jportlet.portlet.PortletRequest request,
                    net.sf.jportlet.portlet.PortletResponse response)
             throws PortletException,
                    java.io.IOException
Description copied from class: Portlet
This function is invoke by the container in order to render the portlet

Specified by:
service in class Portlet
Parameters:
request - current request
response - current response
Throws:
PortletException - if any other error
java.io.IOException - if any IO error occurs


Copyright © 2002 Herve Tchepannou. All Rights Reserved.