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 StringCURRENT_FACES_CONTEXT
protected StringdefaultView
protected DefaultViewSelectordefaultViewSelector
protected static StringDEFAULT_VIEW
protected static StringDEFAULT_VIEW_SELECTOR
protected FacesContextFactoryfacesContextFactory
protected static StringFACES_INIT_DONE
protected Lifecyclelifecycle
protected PortletContextportletContext
static StringVIEW_ID
Constructor Summary
MyFacesGenericPortlet()
Creates a new instance of MyFacesPortlet
Method Summary
voiddestroy()
Portlet lifecycle.
protected voiddoEdit(RenderRequest request, RenderResponse response)
Helper method to serve up the edit mode.
protected voiddoHelp(RenderRequest request, RenderResponse response)
Helper method to serve up the edit mode.
protected voiddoView(RenderRequest request, RenderResponse response)
Helper method to serve up the view mode.
protected FacesContextfacesContext(PortletRequest request, PortletResponse response)
protected voidfacesRender(RenderRequest request, RenderResponse response)
Render a JSF view.
protected StringgetLifecycleId()
protected voidhandleExceptionFromLifecycle(Throwable e)
voidinit()
Portlet lifecycle.
protected voidinitMyFaces()
protected voidlogException(Throwable e, String msgPrefix)
protected ReleaseableExternalContextmakeExternalContext(PortletRequest request, PortletResponse response)
protected voidnonFacesRequest(RenderRequest request, RenderResponse response)
This method follows JSF Spec section 2.1.1.
protected voidnonFacesRequest(RenderRequest request, RenderResponse response, String view)
This method follows JSF Spec section 2.1.1.
voidprocessAction(ActionRequest request, ActionResponse response)
Called by the portlet container to allow the portlet to process an action request.
protected StringselectDefaultView(RenderRequest request, RenderResponse response)
protected booleansessionTimedOut(PortletRequest request)
protected voidsetContentType(RenderRequest request, RenderResponse response)
protected voidsetDefaultView()
protected voidsetDefaultViewSelector()
protected voidsetPortletRequestFlag(PortletRequest request)

Field Detail

CURRENT_FACES_CONTEXT

protected static final String CURRENT_FACES_CONTEXT

defaultView

protected String defaultView

defaultViewSelector

protected DefaultViewSelector defaultViewSelector

DEFAULT_VIEW

protected static final String DEFAULT_VIEW

DEFAULT_VIEW_SELECTOR

protected static final String DEFAULT_VIEW_SELECTOR

facesContextFactory

protected FacesContextFactory facesContextFactory

FACES_INIT_DONE

protected static final String FACES_INIT_DONE

lifecycle

protected Lifecycle lifecycle

portletContext

protected PortletContext portletContext

VIEW_ID

public static final String VIEW_ID

Constructor Detail

MyFacesGenericPortlet

public MyFacesGenericPortlet()
Creates a new instance of MyFacesPortlet

Method Detail

destroy

public void destroy()
Portlet lifecycle.

doEdit

protected void doEdit(RenderRequest request, RenderResponse response)
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)
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)
Helper method to serve up the view mode.

facesContext

protected FacesContext facesContext(PortletRequest request, PortletResponse response)

facesRender

protected void facesRender(RenderRequest request, RenderResponse response)
Render a JSF view.

getLifecycleId

protected String getLifecycleId()

handleExceptionFromLifecycle

protected void handleExceptionFromLifecycle(Throwable e)

init

public void init()
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)
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)
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)
Called by the portlet container to allow the portlet to process an action request.

selectDefaultView

protected String selectDefaultView(RenderRequest request, RenderResponse response)

sessionTimedOut

protected boolean sessionTimedOut(PortletRequest request)

setContentType

protected void setContentType(RenderRequest request, RenderResponse response)

setDefaultView

protected void setDefaultView()

setDefaultViewSelector

protected void setDefaultViewSelector()

setPortletRequestFlag

protected void setPortletRequestFlag(PortletRequest request)