org.alfresco.web.app.servlet
Class FacesHelper

java.lang.Object
  extended by org.alfresco.web.app.servlet.FacesHelper

public final class FacesHelper
extends java.lang.Object


Field Summary
static java.lang.String BROWSE_VIEW_ID
          Root browse screen JSF view ID
 
Method Summary
static IComponentGenerator getComponentGenerator(javax.faces.context.FacesContext context, java.lang.String generatorName)
          Retrieves the named component generator implementation.
static javax.faces.context.FacesContext getFacesContext(java.lang.Object request, java.lang.Object response, java.lang.Object context)
          Return a valid FacesContext for the specific context, request and response.
static javax.faces.context.FacesContext getFacesContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.ServletContext context)
          Return a valid FacesContext for the specific context, request and response.
static javax.faces.context.FacesContext getFacesContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.ServletContext context, java.lang.String viewRoot)
          Return a valid FacesContext for the specific context, request and response.
static java.lang.Object getManagedBean(javax.faces.context.FacesContext fc, java.lang.String name)
          Return a JSF managed bean reference.
static java.lang.String makeLegalId(java.lang.String id)
          Makes the given id a legal JSF component id by replacing illegal characters with ISO9075 encoding - which itself a subset of valid HTML ID characters.
static void setupComponentId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String id)
          Sets up the id for the given component, if the id is null a unique one is generated using the standard Faces algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROWSE_VIEW_ID

public static final java.lang.String BROWSE_VIEW_ID
Root browse screen JSF view ID

See Also:
Constant Field Values
Method Detail

getFacesContext

public static javax.faces.context.FacesContext getFacesContext(javax.servlet.ServletRequest request,
                                                               javax.servlet.ServletResponse response,
                                                               javax.servlet.ServletContext context)
Return a valid FacesContext for the specific context, request and response. The FacesContext can be constructor for Servlet use.

Parameters:
context - ServletContext
request - ServletRequest
response - ServletReponse
Returns:
FacesContext

getFacesContext

public static javax.faces.context.FacesContext getFacesContext(javax.servlet.ServletRequest request,
                                                               javax.servlet.ServletResponse response,
                                                               javax.servlet.ServletContext context,
                                                               java.lang.String viewRoot)
Return a valid FacesContext for the specific context, request and response. The FacesContext can be constructor for Servlet use.

Parameters:
context - ServletContext
request - ServletRequest
response - ServletReponse
Returns:
FacesContext

getFacesContext

public static javax.faces.context.FacesContext getFacesContext(java.lang.Object request,
                                                               java.lang.Object response,
                                                               java.lang.Object context)
Return a valid FacesContext for the specific context, request and response. The FacesContext can be constructor for Servlet use.

Parameters:
context - PortletContext
request - PortletRequest
response - PortletResponse
Returns:
FacesContext

getManagedBean

public static java.lang.Object getManagedBean(javax.faces.context.FacesContext fc,
                                              java.lang.String name)
Return a JSF managed bean reference.

Parameters:
fc - FacesContext
name - Name of the managed bean to return
Returns:
the managed bean or null if not found

setupComponentId

public static void setupComponentId(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component,
                                    java.lang.String id)
Sets up the id for the given component, if the id is null a unique one is generated using the standard Faces algorithm. If an id is present it is checked for illegal characters.

Parameters:
context - FacesContext
component - The component to set the id for
id - The id to set

makeLegalId

public static java.lang.String makeLegalId(java.lang.String id)
Makes the given id a legal JSF component id by replacing illegal characters with ISO9075 encoding - which itself a subset of valid HTML ID characters.

Parameters:
id - The id to make legal
Returns:
the legalised id

getComponentGenerator

public static IComponentGenerator getComponentGenerator(javax.faces.context.FacesContext context,
                                                        java.lang.String generatorName)
Retrieves the named component generator implementation. If the named generator is not found the TextFieldGenerator is looked up as a default, if this is also not found an AlfrescoRuntimeException is thrown.

Parameters:
context - FacesContext
generatorName - The name of the component generator to retrieve
Returns:
The component generator instance


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.