The
Apache Trinidad JSF framework supports the concept of a
ChangeManager--a service for automatically persisting
changes to components during the Session or persistently across sessions. Applications typically don't call the ChangeManager directly, rather they configure the ChangeManager once in
web.xml:
<context-param>
<description>
This parameter turns on the session change persistence.
</description>
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
<param-value>session</param-value>
</context-param>
and rely on the built in support for the ChangeManager in the various UIComponents.
Components typically write changes made to UIComponent attributes as a result of user interaction. For example, a tab controls remember the currently selected tab and splitters remember the splitter position. More complicated components, such as tables use the ChangeManager to support column reordering.
Out-of-the-box, Trinidad supplies one ChangeManager--the
SessionChangeManager, which remember changes for the lifetime of the current user Session. Custom implementations may be specified by specifying the fully-qualified class name of a ChangeManager implementation for the
<param-value>
<context-param>
<description>
Store my changes in GMail. Just because.
</description>
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
<param-value>org.example.GMailChangeManager</param-value>
</context-param>
Oracle
ADF Faces ships with an additional ChangeManager implementation, that stores changes across Sessions using the
Oracle Metadata Services. We will discuss how to configure the MDS change manager in part 2.
No comments:
Post a Comment