|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.BaseFacesBean
public class BaseFacesBean
Base class for all faces managed beans. Can be used as a parent class for client managed beans.
Field Summary | |
---|---|
protected static String |
DATA_BINDING_CLIENTS
The String key for storing the map of data binding clients. |
protected static String |
OUTCOME_ERROR
Outcome for failed action |
protected static String |
OUTCOME_OK
Outcome for successful action |
protected Map |
resourcesProviders
Map of resource providers with Locale as the keys. |
Constructor Summary | |
---|---|
BaseFacesBean()
Default constructor |
Method Summary | |
---|---|
protected MethodBinding |
createMethodBinding(String expression,
Class[] args)
Shortcut method for getFacesContext().getApplication().createMethodBinding(expression, args) |
protected ValueBinding |
createValueBinding(String expression)
Shortcut method for getFacesContext().getApplication().createValueBinding(expression) |
protected void |
error(FacesMessage.Severity severity,
String message,
String details)
Adds an error message to the faces context. |
protected void |
error(String message)
Adds an error message to the faces context. |
protected void |
error(String message,
String details)
Adds an error message to the faces context. |
protected void |
error(String message,
Throwable throwable)
Adds an error message to the faces context. |
protected void |
error(Throwable throwable)
Adds an error message to the faces context. |
protected Object |
getBean(String beanName)
Returns reference to the managed bean with the given name |
protected FacesContext |
getFacesContext()
Returns current faces context |
protected Locale |
getLocale()
Returns locale for the current request/response. |
protected static InputStream |
getResourceInputStream(String relPath)
Returns an InputStream for a resource at the given path |
protected IContentProvider |
getResources(String baseName)
Deprecated. |
protected ResourceBundleContentProvider |
getResourcesProvider(String baseName)
Returns ResourceBundleContentProvider for the current locale and baseName. |
Throwable |
getRootCause(Throwable ex)
Returns root expception for the given exception |
protected String |
getStackTrace(Throwable t)
Returns stack trace of the given exception |
protected Object |
getTreeAttribute(String key)
Retrieves an Object from the tree's attribute map. |
protected boolean |
isUserInRole(String roleName)
Checks if the current user is in specified local/logical role. |
protected void |
log(String message)
Logs a message |
protected void |
log(String message,
Throwable throwable)
Logs an exception |
protected void |
log(Throwable throwable)
Logs an exception |
protected void |
putTreeAttribute(String key,
Object value)
Places an Object on the tree's attribute map. |
protected void |
resetDataBindingClients()
Resets data binding flags for the current request. |
protected boolean |
resolveDataBinding(String[][] bindingExpressions,
Object bean,
String varName)
Shortcut method |
protected boolean |
resolveDataBinding(String[][] bindingExpressions,
Object bean,
String varName,
boolean forceResolve,
boolean cacheRightValues)
Data Flow execution. |
protected Object |
resolveExpression(String expression)
Return the result of the resolved value binding expression. |
protected boolean |
setValue(String expression,
Object value)
Sets value using given JSF value binding expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String OUTCOME_OK
protected static final String OUTCOME_ERROR
protected Map resourcesProviders
Map
of resource providers with Locale
as the keys.
protected static final String DATA_BINDING_CLIENTS
String
key for storing the map of data binding clients.
Constructor Detail |
---|
public BaseFacesBean()
Method Detail |
---|
protected ValueBinding createValueBinding(String expression)
getFacesContext().getApplication().createValueBinding(expression)
expression
- value binding expression
protected MethodBinding createMethodBinding(String expression, Class[] args)
getFacesContext().getApplication().createMethodBinding(expression, args)
expression
- method binding expressionargs
- method argument types
protected Object resolveExpression(String expression)
BaseFacesBean.getFacesContext()
must return a valid context for the
current thread.
expression
- JSF value binding expression
protected boolean setValue(String expression, Object value)
expression
- JSF value binding expressionvalue
- new value to assign
protected void putTreeAttribute(String key, Object value)
key
- attribute keyvalue
- attribute valueprotected Object getTreeAttribute(String key)
key
- the attribute key
protected boolean resolveDataBinding(String[][] bindingExpressions, Object bean, String varName)
BaseFacesBean.resolveDataBinding(String[][], Object, String, boolean, boolean)
protected boolean resolveDataBinding(String[][] bindingExpressions, Object bean, String varName, boolean forceResolve, boolean cacheRightValues)
Data Flow execution. The flow is a set of data assigments and action calls.
The varName
parameter can be used to access java bean specified as bean
parameter.
For example, if varName=this, then
binding expression can use "#{this.myproperty}" to access myproperty on the bean
instance.
If the bean implements IRefreshableContentProvider
and IRefreshable.isAutoRefresh()
is true
then it automatically calls IRefreshable.refresh()
method if any of the right expressions differ from the values previously set on the bean.
By default bindings are evaluted once per request (action or render). Specifying forceResolve
parameters
as true will force the resolution.
If right expression returns null
the previously cached value of that expression will be used,
if cacheRightValues
parameter is true. If null is a valid value, then use false for cacheRightValues
bindingExpressions
- two dimentional array of left expression=right expression, or method expression.bean
- java bean instance, can be a managed bean instance, can be null.varName
- optional variable name that will point to the bean instance. Can be null.forceResolve
- set to true to force the resolution. If false it only happens once per request (action or render)cacheRightValues
- set to true if want cache non-null right expressions values and use them whenever right expression returns null. Set
to false, if null is a valid value.
protected void resetDataBindingClients()
protected Object getBean(String beanName)
beanName
- the name of the managed bean
protected static InputStream getResourceInputStream(String relPath)
relPath
- relative to the web application root path to the resource
protected void log(Throwable throwable)
throwable
- the exceptionprotected void log(String message, Throwable throwable)
message
- the messagethrowable
- the exceptionprotected void log(String message)
message
- the messageprotected String getStackTrace(Throwable t)
t
- the exception
protected void error(FacesMessage.Severity severity, String message, String details)
severity
- severity of the messagemessage
- the messagedetails
- the details for the messageprotected void error(String message, String details)
message
- the messagedetails
- the details for the messageprotected void error(String message)
message
- the messageprotected void error(Throwable throwable)
throwable
- the error exceptionprotected void error(String message, Throwable throwable)
message
- the messagethrowable
- the error exceptionpublic Throwable getRootCause(Throwable ex)
ex
- the exception
protected FacesContext getFacesContext()
protected boolean isUserInRole(String roleName)
roleName
- local/logical role name defined in this web or portlet application
protected IContentProvider getResources(String baseName)
BaseFacesBean.getResourcesProvider(String)
protected ResourceBundleContentProvider getResourcesProvider(String baseName)
ResourceBundleContentProvider
for the current locale and baseName.
The locale is specified by UIViewRoot
.
If message bundle is not specified or cannot be loaded the returned provider is empty.
baseName
- resource bundle base name
protected Locale getLocale()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |