com.webmethods.caf.faces.portlet
Class FacesPortlet

java.lang.Object
  extended by com.webmethods.caf.faces.portlet.FacesPortlet

public class FacesPortlet
extends Object


Constructor Summary
FacesPortlet()
           
 
Method Summary
 void beforeWorkspaceLoad(FacesContext context, ActionRequest request, ActionResponse response, String navigationType)
          Portlet may override this method to process custom portlet initialization when a workspace is loaded that contains an instance of this portlet.
 void destroy()
           Release all resources acquired at startup time.
 FacesContext getFacesContext(PortletRequest request, PortletResponse response)
          Create a new CAF Faces context for the specified portlet request from portlet config or portlet context.
 FacesContextFactory getFacesContextFactory()
          Deprecated. Use PortletFacesContextFactory static methods.
 Lifecycle getLifecycle()
          Deprecated. Use PortletFacesContextFactory static methods.
 PortletConfig getPortletConfig()
          Returns the PortletConfig object.
 void init(PortletConfig portletConfig)
           Acquire the factory instance we will require.
 void processAction(ActionRequest request, ActionResponse response)
           Perform the request processing lifecycle for the specified request, up to (but not including) the Render Response phase.
 void processJSFAction(FacesContext context, ActionRequest request, ActionResponse response)
          Processes request action.
 void render(RenderRequest request, RenderResponse response)
           Perform the Render Response phase of the request processing lifecycle for the specified request.
 void renderJSF(FacesContext context, RenderRequest request, RenderResponse response)
          Renders request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesPortlet

public FacesPortlet()
Method Detail

destroy

public void destroy()

Release all resources acquired at startup time.


init

public void init(PortletConfig portletConfig)
          throws PortletException

Acquire the factory instance we will require.

Throws:
PortletException - if, for any reason, the startp of this Faces application failed. This includes errors in the config file that is parsed before or during the processing of this init() method.

getFacesContextFactory

public FacesContextFactory getFacesContextFactory()
                                           throws PortletException
Deprecated. Use PortletFacesContextFactory static methods.

Throws:
PortletException

getLifecycle

public Lifecycle getLifecycle()
                       throws PortletException
Deprecated. Use PortletFacesContextFactory static methods.

Throws:
PortletException

getPortletConfig

public PortletConfig getPortletConfig()
Returns the PortletConfig object.

Returns:
PortletConfig

getFacesContext

public FacesContext getFacesContext(PortletRequest request,
                                    PortletResponse response)
                             throws PortletException
Create a new CAF Faces context for the specified portlet request from portlet config or portlet context.

Parameters:
request - PortletRequest
response - PortletResponse
Returns:
a new FacesContext
Throws:
PortletException - if context cannot be created

beforeWorkspaceLoad

public void beforeWorkspaceLoad(FacesContext context,
                                ActionRequest request,
                                ActionResponse response,
                                String navigationType)
Portlet may override this method to process custom portlet initialization when a workspace is loaded that contains an instance of this portlet.

Parameters:
context - the JSF context
request - The portlet request we are processing
response - The portlet response we are processing
navigationType - the type of navigation. usually 'mws_lhs' or 'mws_tab'

processJSFAction

public void processJSFAction(FacesContext context,
                             ActionRequest request,
                             ActionResponse response)
                      throws IOException,
                             PortletException
Processes request action. That is the method which should be overriden instead of standard Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse) by custom JSR168 portlets implementations which extend FacesPortlet. To skip normal JSF action processing, call FacesContext#renderResponse() from this method.

Parameters:
request - The portlet request we are processing
response - The portlet response we are processing
Throws:
IOException - if an input/output error occurs
PortletException - if a portlet processing error occurs

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
                   throws IOException,
                          PortletException

Perform the request processing lifecycle for the specified request, up to (but not including) the Render Response phase.

Parameters:
request - The portlet request we are processing
response - The portlet response we are processing
Throws:
IOException - if an input/output error occurs
PortletException - if a portlet processing error occurs

renderJSF

public void renderJSF(FacesContext context,
                      RenderRequest request,
                      RenderResponse response)
               throws IOException,
                      PortletException
Renders request. That is the method which should be overriden instead of standard Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse) by custom JSR168 portlets implementations which extend FacesPortlet. To skip normal JSF rendering, call FacesContext#responseComplete() from this method.

Parameters:
request - The portlet request we are processing
response - The portlet response we are processing
Throws:
IOException - if an input/output error occurs
PortletException - if a portlet processing error occurs

render

public void render(RenderRequest request,
                   RenderResponse response)
            throws IOException,
                   PortletException

Perform the Render Response phase of the request processing lifecycle for the specified request.

Parameters:
request - The portlet request we are processing
response - The portlet response we are processing
Throws:
IOException - if an input/output error occurs
PortletException - if a portlet processing error occurs