org.apache.empire.jsf2.app
Class FacesApplication

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

public abstract class FacesApplication
extends javax.faces.application.Application


Field Summary
static String APPLICATION_ATTRIBUTE
           
protected  TextResolver[] textResolvers
           
 
Constructor Summary
protected FacesApplication()
           
 
Method Summary
 void addBehavior(String behaviorId, String behaviorClass)
           
 void addComponent(String componentType, String componentClass)
           
 void addConverter(Class<?> targetClass, String converterClass)
           
 void addConverter(String converterId, String converterClass)
           
 void addDefaultValidatorId(String validatorId)
           
 void addELContextListener(javax.el.ELContextListener listener)
           
 void addELResolver(javax.el.ELResolver resolver)
           
 void addJavascriptCall(javax.faces.context.FacesContext fc, String function)
           
 void addValidator(String validatorId, String validatorClass)
           
 javax.faces.component.behavior.Behavior createBehavior(String behaviorId)
           
 javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context, javax.faces.application.Resource componentResource)
           
 javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context, String componentType, String rendererType)
           
 javax.faces.component.UIComponent createComponent(String componentType)
           
 javax.faces.component.UIComponent createComponent(javax.faces.el.ValueBinding componentBinding, javax.faces.context.FacesContext context, String componentType)
           
 javax.faces.component.UIComponent createComponent(javax.el.ValueExpression componentExpression, javax.faces.context.FacesContext context, String componentType)
           
 javax.faces.component.UIComponent createComponent(javax.el.ValueExpression componentExpression, javax.faces.context.FacesContext context, String componentType, String rendererType)
           
 javax.faces.convert.Converter createConverter(Class<?> targetClass)
           
 javax.faces.convert.Converter createConverter(String converterId)
           
 javax.faces.el.MethodBinding createMethodBinding(String ref, Class<?>[] params)
           
 javax.faces.validator.Validator createValidator(String validatorId)
           
 javax.faces.el.ValueBinding createValueBinding(String ref)
           
<T> T
evaluateExpressionGet(javax.faces.context.FacesContext context, String expression, Class<? extends T> expectedType)
           
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
 javax.faces.event.ActionListener getActionListener()
           
protected abstract  DataSource getAppDataSource(DBDatabase db)
           
 Iterator<String> getBehaviorIds()
           
 Iterator<String> getComponentTypes()
           
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
 Iterator<String> getConverterIds()
           
 Iterator<Class<?>> getConverterTypes()
           
 String getDefaultControlType(DataType dataType)
          returns the default input control type for a given data Type
 Locale getDefaultLocale()
           
 String getDefaultRenderKitId()
           
 Map<String,String> getDefaultValidatorInfo()
           
 javax.el.ELContextListener[] getELContextListeners()
           
 javax.el.ELResolver getELResolver()
           
 javax.el.ExpressionFactory getExpressionFactory()
           
 FacesImplementation getFacesImplementation()
          return the interface for Implementation specific features that are specific for Mojarra or MyFaces
 String getMessageBundle()
           
 javax.faces.application.NavigationHandler getNavigationHandler()
           
 String getPartialSubmitComponentId(javax.faces.context.FacesContext fc)
          returns the componentId for which a partial submit has been performed.
 javax.faces.application.ProjectStage getProjectStage()
           
 javax.faces.el.PropertyResolver getPropertyResolver()
           
 ResourceBundle getResourceBundle(javax.faces.context.FacesContext fc, String var)
           
 javax.faces.application.ResourceHandler getResourceHandler()
           
 javax.faces.application.StateManager getStateManager()
           
 Iterator<Locale> getSupportedLocales()
           
 TextResolver getTextResolver(javax.faces.context.FacesContext ctx)
           
 TextResolver getTextResolver(Locale locale)
           
 Iterator<String> getValidatorIds()
           
 javax.faces.el.VariableResolver getVariableResolver()
           
 javax.faces.application.ViewHandler getViewHandler()
           
 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 servletContext)
           
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 publishEvent(javax.faces.context.FacesContext facesContext, Class<? extends javax.faces.event.SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
           
 void publishEvent(javax.faces.context.FacesContext facesContext, Class<? extends javax.faces.event.SystemEvent> systemEventClass, Object source)
           
 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)
           
 void removeELContextListener(javax.el.ELContextListener listener)
           
 void setActionListener(javax.faces.event.ActionListener listener)
           
 void setDefaultLocale(Locale locale)
           
 void setDefaultRenderKitId(String renderKitId)
           
 void setImplementation(FacesImplementation facesImpl, javax.faces.application.Application applImpl)
           
 void setMessageBundle(String bundle)
           
 void setNavigationHandler(javax.faces.application.NavigationHandler handler)
           
 void setPropertyResolver(javax.faces.el.PropertyResolver resolver)
           
 void setResourceHandler(javax.faces.application.ResourceHandler resourceHandler)
           
 void setStateManager(javax.faces.application.StateManager manager)
           
 void setSupportedLocales(Collection<Locale> locales)
           
 void setVariableResolver(javax.faces.el.VariableResolver resolver)
           
 void setViewHandler(javax.faces.application.ViewHandler handler)
           
 void subscribeToEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass, Class<?> sourceClass, javax.faces.event.SystemEventListener listener)
           
 void subscribeToEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass, javax.faces.event.SystemEventListener listener)
           
 void unsubscribeFromEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass, Class<?> sourceClass, javax.faces.event.SystemEventListener listener)
           
 void unsubscribeFromEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass, javax.faces.event.SystemEventListener listener)
           
 
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()
Method Detail

setImplementation

public void setImplementation(FacesImplementation facesImpl,
                              javax.faces.application.Application applImpl)

getAppDataSource

protected abstract DataSource getAppDataSource(DBDatabase db)

init

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

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)

getFacesImplementation

public FacesImplementation getFacesImplementation()
return the interface for Implementation specific features that are specific for Mojarra or MyFaces


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 javax.faces.application.Application
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)

addBehavior

public void addBehavior(String behaviorId,
                        String behaviorClass)
Overrides:
addBehavior in class javax.faces.application.Application

addComponent

public void addComponent(String componentType,
                         String componentClass)
Specified by:
addComponent in class javax.faces.application.Application

addConverter

public void addConverter(Class<?> targetClass,
                         String converterClass)
Specified by:
addConverter in class javax.faces.application.Application

addConverter

public void addConverter(String converterId,
                         String converterClass)
Specified by:
addConverter in class javax.faces.application.Application

addDefaultValidatorId

public void addDefaultValidatorId(String validatorId)
Overrides:
addDefaultValidatorId in class javax.faces.application.Application

addELContextListener

public void addELContextListener(javax.el.ELContextListener listener)
Overrides:
addELContextListener in class javax.faces.application.Application

addELResolver

public void addELResolver(javax.el.ELResolver resolver)
Overrides:
addELResolver in class javax.faces.application.Application

addValidator

public void addValidator(String validatorId,
                         String validatorClass)
Specified by:
addValidator in class javax.faces.application.Application

createBehavior

public javax.faces.component.behavior.Behavior createBehavior(String behaviorId)
                                                       throws javax.faces.FacesException
Overrides:
createBehavior in class javax.faces.application.Application
Throws:
javax.faces.FacesException

createComponent

public javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context,
                                                         javax.faces.application.Resource componentResource)
Overrides:
createComponent in class javax.faces.application.Application

createComponent

public javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context,
                                                         String componentType,
                                                         String rendererType)
Overrides:
createComponent in class javax.faces.application.Application

createComponent

public javax.faces.component.UIComponent createComponent(String componentType)
                                                  throws javax.faces.FacesException
Specified by:
createComponent in class javax.faces.application.Application
Throws:
javax.faces.FacesException

createComponent

public javax.faces.component.UIComponent createComponent(javax.faces.el.ValueBinding componentBinding,
                                                         javax.faces.context.FacesContext context,
                                                         String componentType)
                                                  throws javax.faces.FacesException
Specified by:
createComponent in class javax.faces.application.Application
Throws:
javax.faces.FacesException

createComponent

public javax.faces.component.UIComponent createComponent(javax.el.ValueExpression componentExpression,
                                                         javax.faces.context.FacesContext context,
                                                         String componentType)
                                                  throws javax.faces.FacesException
Overrides:
createComponent in class javax.faces.application.Application
Throws:
javax.faces.FacesException

createComponent

public javax.faces.component.UIComponent createComponent(javax.el.ValueExpression componentExpression,
                                                         javax.faces.context.FacesContext context,
                                                         String componentType,
                                                         String rendererType)
Overrides:
createComponent in class javax.faces.application.Application

createConverter

public javax.faces.convert.Converter createConverter(Class<?> targetClass)
Specified by:
createConverter in class javax.faces.application.Application

createConverter

public javax.faces.convert.Converter createConverter(String converterId)
Specified by:
createConverter in class javax.faces.application.Application

createMethodBinding

public javax.faces.el.MethodBinding createMethodBinding(String ref,
                                                        Class<?>[] params)
                                                 throws javax.faces.el.ReferenceSyntaxException
Specified by:
createMethodBinding in class javax.faces.application.Application
Throws:
javax.faces.el.ReferenceSyntaxException

createValidator

public javax.faces.validator.Validator createValidator(String validatorId)
                                                throws javax.faces.FacesException
Specified by:
createValidator in class javax.faces.application.Application
Throws:
javax.faces.FacesException

createValueBinding

public javax.faces.el.ValueBinding createValueBinding(String ref)
                                               throws javax.faces.el.ReferenceSyntaxException
Specified by:
createValueBinding in class javax.faces.application.Application
Throws:
javax.faces.el.ReferenceSyntaxException

evaluateExpressionGet

public <T> T evaluateExpressionGet(javax.faces.context.FacesContext context,
                                   String expression,
                                   Class<? extends T> expectedType)
                        throws javax.el.ELException
Overrides:
evaluateExpressionGet in class javax.faces.application.Application
Throws:
javax.el.ELException

getActionListener

public javax.faces.event.ActionListener getActionListener()
Specified by:
getActionListener in class javax.faces.application.Application

getBehaviorIds

public Iterator<String> getBehaviorIds()
Overrides:
getBehaviorIds in class javax.faces.application.Application

getComponentTypes

public Iterator<String> getComponentTypes()
Specified by:
getComponentTypes in class javax.faces.application.Application

getConverterIds

public Iterator<String> getConverterIds()
Specified by:
getConverterIds in class javax.faces.application.Application

getConverterTypes

public Iterator<Class<?>> getConverterTypes()
Specified by:
getConverterTypes in class javax.faces.application.Application

getDefaultLocale

public Locale getDefaultLocale()
Specified by:
getDefaultLocale in class javax.faces.application.Application

getDefaultRenderKitId

public String getDefaultRenderKitId()
Specified by:
getDefaultRenderKitId in class javax.faces.application.Application

getDefaultValidatorInfo

public Map<String,String> getDefaultValidatorInfo()
Overrides:
getDefaultValidatorInfo in class javax.faces.application.Application

getELContextListeners

public javax.el.ELContextListener[] getELContextListeners()
Overrides:
getELContextListeners in class javax.faces.application.Application

getELResolver

public javax.el.ELResolver getELResolver()
Overrides:
getELResolver in class javax.faces.application.Application

getExpressionFactory

public javax.el.ExpressionFactory getExpressionFactory()
Overrides:
getExpressionFactory in class javax.faces.application.Application

getMessageBundle

public String getMessageBundle()
Specified by:
getMessageBundle in class javax.faces.application.Application

getNavigationHandler

public javax.faces.application.NavigationHandler getNavigationHandler()
Specified by:
getNavigationHandler in class javax.faces.application.Application

getProjectStage

public javax.faces.application.ProjectStage getProjectStage()
Overrides:
getProjectStage in class javax.faces.application.Application

getPropertyResolver

public javax.faces.el.PropertyResolver getPropertyResolver()
Specified by:
getPropertyResolver in class javax.faces.application.Application

getResourceHandler

public javax.faces.application.ResourceHandler getResourceHandler()
Overrides:
getResourceHandler in class javax.faces.application.Application

getStateManager

public javax.faces.application.StateManager getStateManager()
Specified by:
getStateManager in class javax.faces.application.Application

getSupportedLocales

public Iterator<Locale> getSupportedLocales()
Specified by:
getSupportedLocales in class javax.faces.application.Application

getValidatorIds

public Iterator<String> getValidatorIds()
Specified by:
getValidatorIds in class javax.faces.application.Application

getVariableResolver

public javax.faces.el.VariableResolver getVariableResolver()
Specified by:
getVariableResolver in class javax.faces.application.Application

getViewHandler

public javax.faces.application.ViewHandler getViewHandler()
Specified by:
getViewHandler in class javax.faces.application.Application

publishEvent

public void publishEvent(javax.faces.context.FacesContext facesContext,
                         Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                         Class<?> sourceBaseType,
                         Object source)
Overrides:
publishEvent in class javax.faces.application.Application

publishEvent

public void publishEvent(javax.faces.context.FacesContext facesContext,
                         Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                         Object source)
Overrides:
publishEvent in class javax.faces.application.Application

removeELContextListener

public void removeELContextListener(javax.el.ELContextListener listener)
Overrides:
removeELContextListener in class javax.faces.application.Application

setActionListener

public void setActionListener(javax.faces.event.ActionListener listener)
Specified by:
setActionListener in class javax.faces.application.Application

setDefaultLocale

public void setDefaultLocale(Locale locale)
Specified by:
setDefaultLocale in class javax.faces.application.Application

setDefaultRenderKitId

public void setDefaultRenderKitId(String renderKitId)
Specified by:
setDefaultRenderKitId in class javax.faces.application.Application

setMessageBundle

public void setMessageBundle(String bundle)
Specified by:
setMessageBundle in class javax.faces.application.Application

setNavigationHandler

public void setNavigationHandler(javax.faces.application.NavigationHandler handler)
Specified by:
setNavigationHandler in class javax.faces.application.Application

setPropertyResolver

public void setPropertyResolver(javax.faces.el.PropertyResolver resolver)
Specified by:
setPropertyResolver in class javax.faces.application.Application

setResourceHandler

public void setResourceHandler(javax.faces.application.ResourceHandler resourceHandler)
Overrides:
setResourceHandler in class javax.faces.application.Application

setStateManager

public void setStateManager(javax.faces.application.StateManager manager)
Specified by:
setStateManager in class javax.faces.application.Application

setSupportedLocales

public void setSupportedLocales(Collection<Locale> locales)
Specified by:
setSupportedLocales in class javax.faces.application.Application

setVariableResolver

public void setVariableResolver(javax.faces.el.VariableResolver resolver)
Specified by:
setVariableResolver in class javax.faces.application.Application

setViewHandler

public void setViewHandler(javax.faces.application.ViewHandler handler)
Specified by:
setViewHandler in class javax.faces.application.Application

subscribeToEvent

public void subscribeToEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                             Class<?> sourceClass,
                             javax.faces.event.SystemEventListener listener)
Overrides:
subscribeToEvent in class javax.faces.application.Application

subscribeToEvent

public void subscribeToEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                             javax.faces.event.SystemEventListener listener)
Overrides:
subscribeToEvent in class javax.faces.application.Application

unsubscribeFromEvent

public void unsubscribeFromEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                                 Class<?> sourceClass,
                                 javax.faces.event.SystemEventListener listener)
Overrides:
unsubscribeFromEvent in class javax.faces.application.Application

unsubscribeFromEvent

public void unsubscribeFromEvent(Class<? extends javax.faces.event.SystemEvent> systemEventClass,
                                 javax.faces.event.SystemEventListener listener)
Overrides:
unsubscribeFromEvent in class javax.faces.application.Application


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.