org.apache.cocoon.portlet
Class CocoonPortlet

java.lang.Object
  extended byjavax.portlet.GenericPortlet
      extended byorg.apache.cocoon.portlet.CocoonPortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig

public class CocoonPortlet
extends javax.portlet.GenericPortlet

This is the entry point for Cocoon execution as an JSR-168 Portlet.

Version:
$Id: CocoonPortlet.java 326465 2005-10-19 08:25:07Z cziegeler $

Nested Class Summary
protected static class CocoonPortlet.PortletBootstrapEnvironment
           
 
Field Summary
protected  Cocoon cocoon
          The Cocoon instance
static String CONTEXT_PORTLET_CONFIG
          Application Context Key for the portlet configuration
protected  CoreUtil coreUtil
          CoreUtil
protected  int defaultSessionScope
          Default scope for the session attributes, either PortletSession.PORTLET_SCOPE or PortletSession.APPLICATION_SCOPE.
protected  Context environmentContext
           
protected  Exception exception
          Holds exception happened during initialization (if any)
protected  javax.portlet.PortletContext portletContext
           
protected  String portletContextPath
          This is the path to the portlet context (or the result of calling getRealPath('/') on the PortletContext.
protected  String portletContextURL
          This is the url to the portlet context directory
protected static String PROCESSED_BY
           
protected  RequestFactory requestFactory
          The RequestFactory is responsible for wrapping multipart-encoded forms and for handing the file payload of incoming requests
protected  String servletPath
          Value to be used as servletPath in the request.
protected  Settings settings
          Settings
protected  boolean storeSessionPath
          Store pathInfo in session
 
Constructor Summary
CocoonPortlet()
           
 
Method Summary
 void destroy()
          Dispose Cocoon when portlet is destroyed
protected  Environment getEnvironment(String servletPath, String pathInfo, String uri, javax.portlet.ActionRequest req, javax.portlet.ActionResponse res)
          Create the environment for the request
protected  Environment getEnvironment(String servletPath, String pathInfo, String uri, javax.portlet.RenderRequest req, javax.portlet.RenderResponse res)
          Create the environment for the request
 String getInitParameter(String name)
          Get an initialisation parameter.
protected  Logger getLogger()
           
 void init(javax.portlet.PortletConfig conf)
          Initialize this CocoonPortlet instance.
protected  void manageException(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res, Environment env, String uri, String title, String message, String description, Exception e)
           
protected  void manageException(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res, Environment env, String uri, String title, String message, String description, Exception e)
           
 void processAction(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res)
          Process the specified ActionRequest producing output on the specified ActionResponse.
 void render(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res)
          Process the specified RenderRequest producing output on the specified RenderResponse.
 
Methods inherited from class javax.portlet.GenericPortlet
doDispatch, doEdit, doHelp, doView, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_PORTLET_CONFIG

public static final String CONTEXT_PORTLET_CONFIG
Application Context Key for the portlet configuration

Since:
2.1.3
See Also:
Constant Field Values

PROCESSED_BY

protected static final String PROCESSED_BY

cocoon

protected Cocoon cocoon
The Cocoon instance


exception

protected Exception exception
Holds exception happened during initialization (if any)


portletContext

protected javax.portlet.PortletContext portletContext

portletContextPath

protected String portletContextPath
This is the path to the portlet context (or the result of calling getRealPath('/') on the PortletContext. Note, that this can be null.


portletContextURL

protected String portletContextURL
This is the url to the portlet context directory


requestFactory

protected RequestFactory requestFactory
The RequestFactory is responsible for wrapping multipart-encoded forms and for handing the file payload of incoming requests


servletPath

protected String servletPath
Value to be used as servletPath in the request. Provided via configuration parameter, if missing, defaults to the '/portlets/' + portletName.


defaultSessionScope

protected int defaultSessionScope
Default scope for the session attributes, either PortletSession.PORTLET_SCOPE or PortletSession.APPLICATION_SCOPE. This corresponds to default-session-scope parameter, with default value portlet.

See Also:
PortletSession

storeSessionPath

protected boolean storeSessionPath
Store pathInfo in session


coreUtil

protected CoreUtil coreUtil
CoreUtil


settings

protected Settings settings
Settings


environmentContext

protected Context environmentContext
Constructor Detail

CocoonPortlet

public CocoonPortlet()
Method Detail

init

public void init(javax.portlet.PortletConfig conf)
          throws javax.portlet.PortletException
Initialize this CocoonPortlet instance.

Uses the following parameters: portlet-logger enable-uploads autosave-uploads overwrite-uploads upload-max-size show-time container-encoding form-encoding manage-exceptions servlet-path

Parameters:
conf - The PortletConfig object from the portlet container.
Throws:
javax.portlet.PortletException

destroy

public void destroy()
Dispose Cocoon when portlet is destroyed


processAction

public void processAction(javax.portlet.ActionRequest req,
                          javax.portlet.ActionResponse res)
                   throws javax.portlet.PortletException,
                          IOException
Process the specified ActionRequest producing output on the specified ActionResponse.

Throws:
javax.portlet.PortletException
IOException

render

public void render(javax.portlet.RenderRequest req,
                   javax.portlet.RenderResponse res)
            throws javax.portlet.PortletException,
                   IOException
Process the specified RenderRequest producing output on the specified RenderResponse.

Throws:
javax.portlet.PortletException
IOException

manageException

protected void manageException(javax.portlet.ActionRequest req,
                               javax.portlet.ActionResponse res,
                               Environment env,
                               String uri,
                               String title,
                               String message,
                               String description,
                               Exception e)
                        throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

manageException

protected void manageException(javax.portlet.RenderRequest req,
                               javax.portlet.RenderResponse res,
                               Environment env,
                               String uri,
                               String title,
                               String message,
                               String description,
                               Exception e)
                        throws IOException,
                               javax.portlet.PortletException
Throws:
IOException
javax.portlet.PortletException

getEnvironment

protected Environment getEnvironment(String servletPath,
                                     String pathInfo,
                                     String uri,
                                     javax.portlet.ActionRequest req,
                                     javax.portlet.ActionResponse res)
                              throws Exception
Create the environment for the request

Throws:
Exception

getEnvironment

protected Environment getEnvironment(String servletPath,
                                     String pathInfo,
                                     String uri,
                                     javax.portlet.RenderRequest req,
                                     javax.portlet.RenderResponse res)
                              throws Exception
Create the environment for the request

Throws:
Exception

getInitParameter

public String getInitParameter(String name)
Get an initialisation parameter. The value is trimmed, and null is returned if the trimmed value is empty.


getLogger

protected Logger getLogger()


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.