|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.faces.IlvFacesUtil
public final class IlvFacesUtil
Various JViews Faces utilities.
| Field Summary | |
|---|---|
static int |
APPLICATION_SESSION_SCOPE
The session portlet scope. |
static int |
PORTLET_SESSION_SCOPE
The session portlet scope. |
| Method Summary | |
|---|---|
static String |
buildAbsoluteId(UIComponent component)
Returns the fully qualified id of the component. |
static String |
encodeJavaScriptVariables(String jsAction)
This method allows to namespace encode the marked IDs of component in the JavaScript string passed as parameter. |
static String |
getAbsoluteId(UIComponent refComponent,
String id)
Returns the absolute ID of a component with a reference component and a relative ID. |
static Logger |
getLogger()
Returns the logger registered on this package. |
static Object |
getPrimitivePropertyValue(UIComponent component,
String property,
Object localValue)
Returns the local value, if set, or the object described by the property from the model if the component has a value binding registered for this property, null otherwise. |
static Object |
getPropertyValue(UIComponent component,
String property,
Object localValue)
Returns the local value if not null or the object described by the property from the model if the component has a value binding registered for this property, null otherwise. |
static Object |
getPropertyValue(UIComponent component,
String property,
Object localValue,
boolean valueSet)
Deprecated. Beginning with JViews 8.1 use getPrimitivePropertyValue(UIComponent, String, Object)} instead. |
static Object |
getRequestAttribute(String name)
Returns an attribute in the request. |
static String |
getRequestHeader(String name)
Returns the header value of the current HTTP request for the given name. |
static Object |
getSessionAttribute(String name)
Returns an attribute in the session. |
static Object |
getSessionAttribute(String name,
int scope)
Returns an attribute in the session. |
static boolean |
isValueBinding(String expr)
Returns true if the expression is a value binding expression. |
static void |
log(Object o,
String message)
Logs a message prefixed by the short name of the class of the object. |
static void |
log(String message)
Logs a message at the INFO level. |
static void |
log(String message,
Level level)
Logs a message at the specified level. |
static void |
log(Throwable e)
Logs an exception at the INFO level if the 'logExceptions' flag is set in the configuration file. |
static void |
log(Throwable e,
Level level)
Logs an exception at the specified level if the 'logExceptions' flag is set in the configuration file. |
static void |
logAnyway(String message)
Logs a message at the INFO level. |
static void |
logAnyway(String message,
Level level)
Logs a message. |
static void |
logAnyway(Throwable e)
Logs an exception with no configuration file control at the INFO level. |
static void |
logAnyway(Throwable e,
Level level)
Logs an exception with no configuration file control at the specified level. |
static void |
setPrimitiveLocalValueSet(UIComponent component,
String property)
Marks the specified property as locally changed. |
static void |
setRequestAttribute(String name,
Object value)
Binds an object to the current request, using the name specified. |
static void |
setSessionAttribute(String name,
Object value)
Binds an object to this session, using the name specified. |
static void |
setSessionAttribute(String name,
Object value,
int scope,
boolean create)
Binds an object to the current session, using the name specified. |
static void |
storeNamespaceInSession(FacesContext context)
Stores the portlet namespace in the session with the IlvFacesConstants.PORTLET_NAMESPACE key. |
static void |
updateModelFromPrimitiveValue(FacesContext context,
UIComponent component,
String property,
Object localValue)
Updates the model with the local value if a value binding on the property is registered on the component and the local value has changed. |
static void |
updateModelFromValue(FacesContext context,
UIComponent component,
String property,
Object localValue)
Updates the model with the local value if a value binding on the property is registered on the component and the local value has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int APPLICATION_SESSION_SCOPE
setSessionAttribute(String, Object, int, boolean),
getSessionAttribute(String, int),
Constant Field Valuespublic static final int PORTLET_SESSION_SCOPE
setSessionAttribute(String, Object, int, boolean),
getSessionAttribute(String, int),
Constant Field Values| Method Detail |
|---|
public static String encodeJavaScriptVariables(String jsAction)
${} pattern.
For example if the current portlet namespace is _ns_,
the string ${view}.setInteractor(${interactor})
will be converted into _ns_view.setInteractor(_ns_interactor).
jsAction - The JavaScript action whose IDs must be namespace encoded.
IllegalArgumentException - This exception is thrown if an ID is
empty or no correct pattern has been found.
public static String getAbsoluteId(UIComponent refComponent,
String id)
componentRef is the base component of the relative path. If
the component does not exist, the refComponent is considered
a sibling of the the component designed by the specified id in the
computing process.
refComponent - The base component whose id is to be resolved.id - The identity (relative or absolute) of the component
public static String buildAbsoluteId(UIComponent component)
component - The component.
public static void updateModelFromValue(FacesContext context,
UIComponent component,
String property,
Object localValue)
context - The current faces context.component - The component linked to the model.property - The property of the model to update.localValue - The value with which to update the model.
public static void updateModelFromPrimitiveValue(FacesContext context,
UIComponent component,
String property,
Object localValue)
context - The current faces context.component - The component linked to the model.property - The property of the model to update.localValue - The value with which to update the model.public static Logger getLogger()
public static void log(Object o,
String message)
o - The object to which the message relates.message - The message to log.public static void log(String message)
message - The message to log.
public static void log(String message,
Level level)
message - The message to log.level - the level to log the message.public static void logAnyway(String message)
message - The message to log.
public static void logAnyway(String message,
Level level)
message - The message to log.level - the level to log the message.public static void log(Throwable e)
e - The exception to log.
public static void log(Throwable e,
Level level)
e - The exception to log.level - the level to log the message.public static void logAnyway(Throwable e)
e - The exception to log.
public static void logAnyway(Throwable e,
Level level)
e - The exception to log.level - The level to log the exception.
public static Object getPropertyValue(UIComponent component,
String property,
Object localValue)
component - The component processed.property - The property processed.localValue - The local value to return if not null.
public static Object getPropertyValue(UIComponent component,
String property,
Object localValue,
boolean valueSet)
getPrimitivePropertyValue(UIComponent, String, Object)} instead.
null otherwise.
component - The component processed.property - The property processed.localValue - The local value to return if the value set flag is set to
true.valueSet - The value set flag that indicates that the local value is
valid and must be returned.
public static void setPrimitiveLocalValueSet(UIComponent component,
String property)
This flag is used in:
getPrimitivePropertyValue(UIComponent, String, Object) method to determine whether
returning the local object or the model one.updateModelFromPrimitiveValue(FacesContext, UIComponent, String, Object) method to determine
if the model object should be updated by the local value in th update model value phase of the JSF lifecycle.
component - The component.property - The property
public static Object getPrimitivePropertyValue(UIComponent component,
String property,
Object localValue)
null otherwise.
This method has to be used instead of getPropertyValue(UIComponent, String) for
primitive values.
This method determines if the local values has changed if the setPrimitiveLocalValueSet(UIComponent, String)
method has been called with this component and property.
component - The component processed.property - The property processed.localValue - The local value to return if the value set flag is set to
true.
public static void setRequestAttribute(String name,
Object value)
name - The name to which the object is bound; cannot be null.value - The object to be bound.public static Object getRequestAttribute(String name)
name - A string specifying the name of the object.
public static void setSessionAttribute(String name,
Object value,
int scope,
boolean create)
name - The name to which the object is bound; cannot be null.value - The object to be bound.scope - The scope of the value (used in portlets only).
Valid values are IlvFacesUtil.PORTLET_SESSION_SCOPE and
IlvFacesUtil.PORTLET_APPLICATION_SCOPE.create - -True - to create a new session for this request if
necessary; false to return null if there's no current session
public static void setSessionAttribute(String name,
Object value)
name - The name to which the object is bound; cannot be null.value - The object to be bound.public static Object getSessionAttribute(String name)
name - A string specifying the name of the object.
IllegalStateException - if this method is called on an invalidated
session.
public static Object getSessionAttribute(String name,
int scope)
throws IllegalStateException
name - A string specifying the name of the object.scope - The scope of the stored attribute in the portlet context.
Valid values are IlvFacesUtil.PORTLET_SESSION_SCOPE and
IlvFacesUtil.PORTLET_APPLICATION_SCOPE.
IllegalStateException - if this method is called on an invalidated
session.public static void storeNamespaceInSession(FacesContext context)
IlvFacesConstants.PORTLET_NAMESPACE key.
context - The current faces context.public static boolean isValueBinding(String expr)
expr.startsWith("#{") && expr.endsWith("}").
If the expr parameter is null returns false.
expr - The expression to test.
true if the expression is a value binding or false otherwise.public static String getRequestHeader(String name)
null if not found.
name - The name of the header
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||