org.apache.pluto.testsuite
Class TestPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.pluto.testsuite.TestPortlet
All Implemented Interfaces:
EventPortlet, Portlet, PortletConfig, ResourceServingPortlet

public class TestPortlet
extends GenericPortlet

Pluto testsuite's test portlet.

Version:
1.0
See Also:
TestConfig, PortletTest

Constructor Summary
TestPortlet()
           
 
Method Summary
protected  void doEdit(RenderRequest request, RenderResponse response)
          Serves up the edit mode.
protected  void doHeaders(RenderRequest request, RenderResponse response)
          Used by the render method to set the response properties and headers.
protected  void doHelp(RenderRequest request, RenderResponse response)
          Serves up the help mode.
 void doView(RenderRequest request, RenderResponse response)
          Serves up the view mode.
 void init()
          Initialize the test portlet.
 void processAction(ActionRequest request, ActionResponse response)
          Called by the portlet container to allow the portlet to process an action request.
 void processEvent(EventRequest request, EventResponse response)
          Default event processing.
 void serveResource(ResourceRequest arg0, ResourceResponse arg1)
          Default resource serving.
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestPortlet

public TestPortlet()
Method Detail

init

public void init()
          throws PortletException
Initialize the test portlet. This method reads the testsuite's config files, constructs and initializes all PortletTest instances.

Overrides:
init in class GenericPortlet
Throws:
PortletException - if fail to read the configuration file.

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
                   throws PortletException,
                          IOException
Description copied from class: GenericPortlet
Called by the portlet container to allow the portlet to process an action request. This method is called if the client request was originated by a URL created (by the portlet) with the RenderResponse.createActionURL() method.

The default implementation throws an exception.

Specified by:
processAction in interface Portlet
Overrides:
processAction in class GenericPortlet
Parameters:
request - the action request
response - the action response
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to process the action at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem

doHeaders

protected void doHeaders(RenderRequest request,
                         RenderResponse response)
Description copied from class: GenericPortlet
Used by the render method to set the response properties and headers.

The portlet should override this method and set its response header using this method in order to ensure that they are set before anything is written to the output stream.

The default implemention of this method is emtpy.

Overrides:
doHeaders in class GenericPortlet

processEvent

public void processEvent(EventRequest request,
                         EventResponse response)
                  throws PortletException,
                         IOException
Description copied from class: GenericPortlet
Default event processing. Tries to dispatch to an event method with annotation
@ProcessEvent(name=) and the signature
public void (EventRequest, EventResponse) throws PortletException, java.io.IOException.

Specified by:
processEvent in interface EventPortlet
Overrides:
processEvent in class GenericPortlet
Parameters:
request - the event request
response - the event response
Throws:
PortletException - if the portlet has problems fulfilling the request
UnavailableException - if the portlet is unavailable to process the event at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem
See Also:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)

serveResource

public void serveResource(ResourceRequest arg0,
                          ResourceResponse arg1)
                   throws PortletException,
                          IOException
Description copied from class: GenericPortlet
Default resource serving.

The default implemention of this method is to call a RequestDispatcher.foward with the ResourceID of the ResourceRequest.

If no ResourceID is set on the resource URL the default implementation does nothing.

Specified by:
serveResource in interface ResourceServingPortlet
Overrides:
serveResource in class GenericPortlet
Parameters:
arg0 - the resource request
arg1 - the resource response
Throws:
PortletException - if the portlet has problems fulfilling the rendering request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem

doView

public void doView(RenderRequest request,
                   RenderResponse response)
            throws PortletException,
                   IOException
Serves up the view mode. TODO: more javadoc.

Overrides:
doView in class GenericPortlet
Parameters:
request - the protlet request.
response - the portlet response.
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem

doEdit

protected void doEdit(RenderRequest request,
                      RenderResponse response)
               throws PortletException,
                      IOException
Serves up the edit mode. This method dispatches the request and response to the edit JSP page (/jsp/edit.jsp).

Overrides:
doEdit in class GenericPortlet
Parameters:
request - the portlet request.
response - the portlet response.
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem

doHelp

protected void doHelp(RenderRequest request,
                      RenderResponse response)
               throws PortletException,
                      IOException
Serves up the help mode. This method dispatches the request and response to the help JSP page (/jsp/help.jsp).

Overrides:
doHelp in class GenericPortlet
Parameters:
request - the portlet request.
response - the portlet response.
Throws:
PortletException - if the portlet cannot fulfilling the request
UnavailableException - if the portlet is unavailable to perform render at this time
PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
IOException - if the streaming causes an I/O problem


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.