org.apache.myfaces.portlet

Class MyFacesGenericPortlet


public class MyFacesGenericPortlet
extends GenericPortlet

This portlet initializes MyFaces and converts portlet requests into JSF requests.
Version:
$Revision: 279594 $ $Date: 2005-09-08 19:52:24 +0200 (Thu, 08 Sep 2005) $
Author:
Stan Silvert (latest modification by $Author: ssilvert $)

Field Summary

protected static String
CURRENT_FACES_CONTEXT
protected static String
DEFAULT_VIEW
protected static String
DEFAULT_VIEW_SELECTOR
protected static String
FACES_INIT_DONE
static String
VIEW_ID
protected String
defaultView
protected DefaultViewSelector
defaultViewSelector
protected FacesContextFactory
facesContextFactory
protected Lifecycle
lifecycle
protected PortletContext
portletContext

Constructor Summary

MyFacesGenericPortlet()
Creates a new instance of MyFacesPortlet

Method Summary

void
destroy()
Portlet lifecycle.
protected void
doEdit(RenderRequest request, RenderResponse response)
Helper method to serve up the edit mode.
protected void
doHelp(RenderRequest request, RenderResponse response)
Helper method to serve up the edit mode.
protected void
doView(RenderRequest request, RenderResponse response)
Helper method to serve up the view mode.
protected FacesContext
facesContext(PortletRequest request, PortletResponse response)
protected void
facesRender(RenderRequest request, RenderResponse response)
Render a JSF view.
protected String
getLifecycleId()
protected void
handleExceptionFromLifecycle(Throwable e)
void
init()
Portlet lifecycle.
protected void
initMyFaces()
protected void
logException(Throwable e, String msgPrefix)
protected ReleaseableExternalContext
makeExternalContext(PortletRequest request, PortletResponse response)
protected void
nonFacesRequest(RenderRequest request, RenderResponse response)
This method follows JSF Spec section 2.1.1.
protected void
nonFacesRequest(RenderRequest request, RenderResponse response, String view)
This method follows JSF Spec section 2.1.1.
void
processAction(ActionRequest request, ActionResponse response)
Called by the portlet container to allow the portlet to process an action request.
protected String
selectDefaultView(RenderRequest request, RenderResponse response)
protected boolean
sessionTimedOut(PortletRequest request)
protected void
setContentType(RenderRequest request, RenderResponse response)
protected void
setDefaultView()
protected void
setDefaultViewSelector()
protected void
setPortletRequestFlag(PortletRequest request)

Field Details

CURRENT_FACES_CONTEXT

protected static final String CURRENT_FACES_CONTEXT

DEFAULT_VIEW

protected static final String DEFAULT_VIEW

DEFAULT_VIEW_SELECTOR

protected static final String DEFAULT_VIEW_SELECTOR

FACES_INIT_DONE

protected static final String FACES_INIT_DONE

VIEW_ID

public static final String VIEW_ID

defaultView

protected String defaultView

defaultViewSelector

protected DefaultViewSelector defaultViewSelector

facesContextFactory

protected FacesContextFactory facesContextFactory

lifecycle

protected Lifecycle lifecycle

portletContext

protected PortletContext portletContext

Constructor Details

MyFacesGenericPortlet

public MyFacesGenericPortlet()
Creates a new instance of MyFacesPortlet

Method Details

destroy

public void destroy()
Portlet lifecycle.

doEdit

protected void doEdit(RenderRequest request,
                      RenderResponse response)
            throws PortletException,
                   IOException
Helper method to serve up the edit mode. Can be overridden to add the edit mode concept to a JSF application.

doHelp

protected void doHelp(RenderRequest request,
                      RenderResponse response)
            throws PortletException,
                   IOException
Helper method to serve up the edit mode. Can be overridden to add the help mode concept to a JSF application.

doView

protected void doView(RenderRequest request,
                      RenderResponse response)
            throws PortletException,
                   IOException
Helper method to serve up the view mode.

facesContext

protected FacesContext facesContext(PortletRequest request,
                                    PortletResponse response)

facesRender

protected void facesRender(RenderRequest request,
                           RenderResponse response)
            throws PortletException,
                   java.io.IOException
Render a JSF view.

getLifecycleId

protected String getLifecycleId()

handleExceptionFromLifecycle

protected void handleExceptionFromLifecycle(Throwable e)
            throws PortletException,
                   IOException

init

public void init()
            throws PortletException,
                   UnavailableException
Portlet lifecycle.

initMyFaces

protected void initMyFaces()

logException

protected void logException(Throwable e,
                            String msgPrefix)

makeExternalContext

protected ReleaseableExternalContext makeExternalContext(PortletRequest request,
                                                         PortletResponse response)

nonFacesRequest

protected void nonFacesRequest(RenderRequest request,
                               RenderResponse response)
            throws PortletException
This method follows JSF Spec section 2.1.1. It renders the default view from a non-faces request.
Parameters:
request - The portlet render request.
response - The portlet render response.

nonFacesRequest

protected void nonFacesRequest(RenderRequest request,
                               RenderResponse response,
                               String view)
            throws PortletException
This method follows JSF Spec section 2.1.1. It renders a view from a non-faces request. This is useful for a default view as well as for views that need to be rendered from the portlet's edit and help buttons.
Parameters:
request - The portlet render request.
response - The portlet render response.
view - The name of the view that needs to be rendered.

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
            throws PortletException,
                   IOException
Called by the portlet container to allow the portlet to process an action request.

selectDefaultView

protected String selectDefaultView(RenderRequest request,
                                   RenderResponse response)
            throws PortletException

sessionTimedOut

protected boolean sessionTimedOut(PortletRequest request)

setContentType

protected void setContentType(RenderRequest request,
                              RenderResponse response)

setDefaultView

protected void setDefaultView()
            throws UnavailableException

setDefaultViewSelector

protected void setDefaultViewSelector()
            throws UnavailableException

setPortletRequestFlag

protected void setPortletRequestFlag(PortletRequest request)