Sometimes I try to do things but it just doesn't work out the way I want it to, and I get real frustrated and then like I try hard to do it, and I like, take my time but it just doesn't work out the way I want it to. Its like, I concentrate on it real hard, but it just doesn't work out. And everything I do and everything I try, it never turns out. Its like, I need time to figure these things out.
--Institutionalized by Suicidal Tendencies
This blog is for people who feel this way about JSF. Or who just want a Pepsi.

Wednesday, March 31, 2010

Changes Part 1--The Trinidad ChangeManager

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