org.apache.empire.jsf2.app
Class FacesApplication

java.lang.Object
  extended by javax.faces.application.Application
      extended by com.sun.faces.application.ApplicationImpl
          extended by org.apache.empire.jsf2.app.FacesApplication

public abstract class FacesApplication
extends com.sun.faces.application.ApplicationImpl


Field Summary
static String APPLICATION_ATTRIBUTE
           
protected  TextResolver[] textResolvers
           
 
Fields inherited from class com.sun.faces.application.ApplicationImpl
defaultRenderKitId, THIS_LIBRARY
 
Constructor Summary
protected FacesApplication()
           
protected FacesApplication(AppStartupListener startupListener)
           
 
Method Summary
 void addJavascriptCall(javax.faces.context.FacesContext fc, String function)
           
static javax.faces.component.UIComponent findChildComponent(javax.faces.component.UIComponent parent, String componentId)
          finds a child component with the given id that is located below the given parent component
 javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext fc, String componentId, javax.faces.component.UIComponent nearComponent)
          finds the component with the given id that is located in the same NamingContainer as a given component
protected abstract  DataSource getAppDataSource(DBDatabase db)
           
protected  Connection getConnection(DBDatabase db)
          returns a connection from the connection pool
 Connection getConnectionForRequest(javax.faces.context.FacesContext fc, DBDatabase db)
          returns a connection for the current Request
 Locale getContextLocale(javax.faces.context.FacesContext ctx)
          returns the active locale for a given FacesContext
 String getDefaultControlType(DataType dataType)
          returns the default input control type for a given data Type
 String getPartialSubmitComponentId(javax.faces.context.FacesContext fc)
          returns the componentId for which a partial submit has been performed.
 ResourceBundle getResourceBundle(javax.faces.context.FacesContext fc, String var)
           
 TextResolver getTextResolver(javax.faces.context.FacesContext ctx)
           
 TextResolver getTextResolver(Locale locale)
           
 String getWebRoot()
          returns the web context path as returned from ServletContext.getContextPath()
 boolean hasError(javax.faces.context.FacesContext fc)
          checks if the current context contains an error
protected abstract  void init(javax.servlet.ServletContext fc)
           
protected  void initComplete(javax.servlet.ServletContext servletContext)
           
protected  void initTextResolvers()
           
 boolean isPartialSubmit(javax.faces.context.FacesContext fc)
          returns true if a form input element has been partially submitted
 void onChangeView(javax.faces.context.FacesContext fc, String viewId)
           
 void releaseAllConnections(javax.faces.context.FacesContext fc)
           
 void releaseAllConnections(javax.faces.context.FacesContext fc, boolean commit)
          releases the current request connection
protected  void releaseConnection(DBDatabase db, Connection conn, boolean commit)
          releases a connection from the connection pool
 void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db)
           
 void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db, boolean commit)
           
 
Methods inherited from class com.sun.faces.application.ApplicationImpl
addBehavior, addComponent, addConverter, addConverter, addDefaultValidatorId, addELContextListener, addELResolver, addValidator, createBehavior, createComponent, createComponent, createComponent, createComponent, createComponent, createComponent, createConverter, createConverter, createConverterBasedOnClass, createMethodBinding, createValidator, createValueBinding, evaluateExpressionGet, getActionListener, getApplicationELResolvers, getBehaviorIds, getComponentTypes, getConverterIds, getConverterTypes, getDefaultLocale, getDefaultRenderKitId, getDefaultValidatorInfo, getELContextListeners, getELResolver, getExpressionFactory, getMessageBundle, getNavigationHandler, getProjectStage, getPropertyResolver, getResourceHandler, getStateManager, getSupportedLocales, getValidatorIds, getVariableResolver, getViewHandler, newConverter, newThing, publishEvent, publishEvent, removeELContextListener, setActionListener, setDefaultLocale, setDefaultRenderKitId, setMessageBundle, setNavigationHandler, setPropertyResolver, setResourceHandler, setStateManager, setSupportedLocales, setVariableResolver, setViewHandler, subscribeToEvent, subscribeToEvent, unsubscribeFromEvent, unsubscribeFromEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_ATTRIBUTE

public static String APPLICATION_ATTRIBUTE

textResolvers

protected TextResolver[] textResolvers
Constructor Detail

FacesApplication

protected FacesApplication(AppStartupListener startupListener)

FacesApplication

protected FacesApplication()
Method Detail

getAppDataSource

protected abstract DataSource getAppDataSource(DBDatabase db)

init

protected abstract void init(javax.servlet.ServletContext fc)

initComplete

protected void initComplete(javax.servlet.ServletContext servletContext)

onChangeView

public void onChangeView(javax.faces.context.FacesContext fc,
                         String viewId)

addJavascriptCall

public void addJavascriptCall(javax.faces.context.FacesContext fc,
                              String function)

getWebRoot

public String getWebRoot()
returns the web context path as returned from ServletContext.getContextPath()


getContextLocale

public Locale getContextLocale(javax.faces.context.FacesContext ctx)
returns the active locale for a given FacesContext


hasError

public boolean hasError(javax.faces.context.FacesContext fc)
checks if the current context contains an error

Parameters:
fc - the FacesContext
Returns:
true if the context has an error set or false otherwise

isPartialSubmit

public boolean isPartialSubmit(javax.faces.context.FacesContext fc)
returns true if a form input element has been partially submitted

Parameters:
fc - the Faces Context
Returns:
the componentId or null if no partial submit was been performed

getPartialSubmitComponentId

public String getPartialSubmitComponentId(javax.faces.context.FacesContext fc)
returns the componentId for which a partial submit has been performed.

Parameters:
fc - the Faces Context
Returns:
the componentId or null if no partial submit was been performed

findComponent

public javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext fc,
                                                       String componentId,
                                                       javax.faces.component.UIComponent nearComponent)
finds the component with the given id that is located in the same NamingContainer as a given component

Parameters:
fc - the FacesContext
componentId - the component id
nearComponent - a component within the same naming container from which to start the search (optional)
Returns:
the component or null if no component was found

findChildComponent

public static javax.faces.component.UIComponent findChildComponent(javax.faces.component.UIComponent parent,
                                                                   String componentId)
finds a child component with the given id that is located below the given parent component

Parameters:
parent - the parent
componentId - the component id
Returns:
the component or null if no component was found

getDefaultControlType

public String getDefaultControlType(DataType dataType)
returns the default input control type for a given data Type

Parameters:
dataType -
Returns:
an Input Cnotrol type
See Also:
InputControlManager

initTextResolvers

protected void initTextResolvers()

getTextResolver

public TextResolver getTextResolver(Locale locale)

getTextResolver

public TextResolver getTextResolver(javax.faces.context.FacesContext ctx)

getResourceBundle

public ResourceBundle getResourceBundle(javax.faces.context.FacesContext fc,
                                        String var)
Overrides:
getResourceBundle in class com.sun.faces.application.ApplicationImpl
See Also:
Application.getResourceBundle(javax.faces.context.FacesContext, String)

getConnection

protected Connection getConnection(DBDatabase db)
returns a connection from the connection pool

Returns:

releaseConnection

protected void releaseConnection(DBDatabase db,
                                 Connection conn,
                                 boolean commit)
releases a connection from the connection pool


getConnectionForRequest

public Connection getConnectionForRequest(javax.faces.context.FacesContext fc,
                                          DBDatabase db)
returns a connection for the current Request


releaseAllConnections

public void releaseAllConnections(javax.faces.context.FacesContext fc,
                                  boolean commit)
releases the current request connection

Parameters:
fc - the FacesContext
commit - when true changes are committed otherwise they are rolled back

releaseAllConnections

public void releaseAllConnections(javax.faces.context.FacesContext fc)

releaseConnection

public void releaseConnection(javax.faces.context.FacesContext fc,
                              DBDatabase db,
                              boolean commit)

releaseConnection

public void releaseConnection(javax.faces.context.FacesContext fc,
                              DBDatabase db)


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.