dev@jsf-extensions.java.net

New support for FacesEvent added

From: Ed Burns <ed.burns_at_sun.com>
Date: Fri, 4 Aug 2006 14:07:54 -0700

* IMPORTANT! Two more name changes:

  DynaFaces.fireEvent() has been renamed to DynaFaces.fireAjaxTransaction().

  DynaFaces.installDeferredEvent() has been renamed to
  DynaFaces.installDeferredAjaxTransaction()

  These changes make sense in light of the changes below.

* This change-bundle renames the existing "event" feature to be a
  "methodName" feature since it was not really an event feature. It was
  just a way to invoke a component (or renderer) method at one of two
  places during the lifecycle. In addition to renaming the feature, I
  removed the "immediate" flag, replacing it instead with a more
  flexible phaseId option.

* This change bundle also adds a true Ajax enabled FacesEvent feature
  where arbitrary FacesEvent subclasses can be queued in the client and
  sent to the server for processing in the JSF lifecycle.

* Documentation for these features has been added to the xdocs for the site.

A + assembly/THIRD_PARTY_LICENSE.txt

- Any third party licenses for code required by jsf-extensions goes here.

D run-time/samples/j1/src/main/java/com/enverio/jsf/render/ClientSuggestRenderer.java

- removed this from the demo. Unused.

M run-time/samples/j1/src/main/java/com/enverio/jsf/UISuggest.java

- This no longer implement PhaseListener

- add a broadcast() method that takes the argument FacesEvent and tests if
  it is a SuggestEvent. If so, it gets the renderer for this component.
  If one is found, it calls its onSuggest() method.

A + run-time/samples/j1/src/main/java/com/enverio/jsf/SuggestEvent.java

 * <p>Instances of this event indicate that the UISuggest component
 * listed as the <code>source</code> of this event should perform a
 * component specific "suggestion" action, possibly rendering some
 * content to the response.</p>

M run-time/samples/j1/src/main/resources/com.enverio.js

- remove "event" from the set of options

- add Enverio.Suggest event, make it extend DynaFaces.FacesEvent.

- Use the new DynaFaces.queueFacesEvent() function to queue this event
  so that when the DynaFaces.fireAjaxTransaction() happens, the event
  gets delivered.

M run-time/samples/j1/src/main/resources/faces-config.xml
M run-time/samples/j1/src/main/resources/enverio.taglib.xml

- remove unused ClientSuggest renderer and tag

M run-time/samples/j1/src/main/webapp/eg.orderentry.xhtml
M run-time/samples/j1/src/main/webapp/eg.detailview.xhtml
M run-time/samples/j1/src/main/webapp/home.xhtml
M run-time/samples/cardemo/src/main/models/carDetail.graffle
M run-time/samples/cardemo/src/main/webapp/description/images/carDetail.jpg
M run-time/samples/jmaki/src/main/webapp/result-set.jsp
M src/site/diagrams/FireEvent.graffle
M src/site/diagrams/InstallDeferredEvent.graffle
M src/site/xdoc/reference-ajax.xml

- DynaFaces renames

M run-time/samples/j1/src/main/webapp/WEB-INF/web.xml

- Tell the system about the custom SuggestEvent.

+ <context-param>
+ <param-name>com.sun.faces.extensions.avatar.FacesEvents</param-name>
+ <param-value>SuggestEvent:com.enverio.jsf.SuggestEvent:com.enverio.jsf.UISuggest</param-value>
+ </context-param>

M run-time/samples/blank-facelets/src/main/webapp/WEB-INF/web.xml

- Comment out the taglib example, since there is none bundled with the
  blank app.

A + run-time/samples/simple-events
A + run-time/samples/simple-events/src
A + run-time/samples/simple-events/src/main
A + run-time/samples/simple-events/src/main/java
A + run-time/samples/simple-events/src/main/java/com
A + run-time/samples/simple-events/src/main/java/com/sun
A + run-time/samples/simple-events/src/main/java/com/sun/faces
A + run-time/samples/simple-events/src/main/java/com/sun/faces/simple_event
A + run-time/samples/simple-events/src/main/java/com/sun/faces/simple_event/SimpleEventBean.java
A + run-time/samples/simple-events/src/main/java/com/sun/faces/simple_event/SpecialOutputTextRenderer.java
A + run-time/samples/simple-events/src/main/resources
A + run-time/samples/simple-events/src/main/resources/simple_events.taglib.xml
A + run-time/samples/simple-events/src/main/webapp
A + run-time/samples/simple-events/src/main/webapp/valueChangeEvent.xhtml
A + run-time/samples/simple-events/src/main/webapp/home.xhtml
A + run-time/samples/simple-events/src/main/webapp/_template.xhtml
A + run-time/samples/simple-events/src/main/webapp/WEB-INF
A + run-time/samples/simple-events/src/main/webapp/WEB-INF/faces-config.xml
A + run-time/samples/simple-events/src/main/webapp/WEB-INF/web.xml
A + run-time/samples/simple-events/src/main/webapp/index.html
A + run-time/samples/simple-events/src/main/webapp/actionEvent.xhtml
A + run-time/samples/simple-events/src/main/webapp/methodName.xhtml
A + run-time/samples/simple-events/pom.xml

- Sample app showing event features

M run-time/common/src/main/java/com/sun/faces/extensions/common/util/Util.java

- add getPhaseIdFromString() and getRenderKit().

M run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/lifecycle/AsyncResponse.java

- remove event functionality. This has been moved to new class EventParser.

A + run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/event/ComponentMethodCallback.java

- properly named replacement for EventCallback class.

A + run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/event/ConstructorWrapper.java

 * This "struct"-like JavaClass fills a gap in the feature set of
 * <code>Constructor</code>: provide the runtime capability to query the
 * paramater list for this ctor instance.

A + run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/event/DynaFacesContextListener.java

 * <p>This listener, declared in the TLD for jsf-extensions-avatar, is
 * responsible for parsing the value of the
 * <code>com.sun.faces.extensions.avatar.FacesEvents</code>
 * <code><init-param></code> per the algorithm described in {_at_link
 * #contextInitialized}.</p>

D run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/event/EventCallback.java

- renamed to ComponentMethodCallback.

A + run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/event/EventParser.java

 * <p>Convenience methods for extracting <code>FacesEvent</code> related
 * information from the incoming request.</p>

M run-time/avatar/src/main/java/com/sun/faces/extensions/avatar/components/PartialTraversalViewRoot.java

- Don't deal with events directly, just use EventParser.

- in processDecodes(), after doing the partial traversal processing,
  call EventParser.queueFacesEvents().

- define a broadcastEvents() that extends the (now protected)
  UIViewRoot.broadcastEvents(). This will call super.broadcastEvents()
  and then do EventParser.invokeComponentMethodCallbackForPhase(). The
  "super" call will process real FacesEvent instances for this phase,
  and the invokeComponentMethodCallbackForPhase will call the component
  method, if any, that has been requested for this transaction.

- add in a call to broadcastEvents in the encodeAll(), after we have
  done the partial traversal render. This is how the template aware
  suggest event works.

M run-time/avatar/src/main/resources/com_sun_faces_ajax.js

- rename gEvent to gMethodName

- add gFacesEvent

- rename "event" option to "methodName"

- add "phaseId" option to replace the "immediate" flag thingy on the old
  "event" option (now known as the "methodName" option).

- Add simple eventQueue that DynaFaces can use to publish instances of
  FacesEvent subclasses to the lifecyle.

- Add DynaFaces.PhaseId class of constants.

- Add DynaFaces.queueEvent.

- DynaFaces.fireEvent() has been renamed to DynaFaces.fireAjaxTransaction().

  DynaFaces.installDeferredEvent() has been renamed to
  DynaFaces.installDeferredAjaxTransaction()

M run-time/avatar/src/main/resources/jsf-ext-dynafaces.tld

- add listener for setting up event instance info

M pom.xml

- add jsf-simple-events sample app

-- 
| ed.burns_at_sun.com  | {home: 407 869 9587, office: 408 884 9519 OR x31640}
| homepage:         | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com