2.15 EventPhaseListener interface

 <  Day Day Up  >  

This interface is mainly for programmatic cooperative portlets. It allows developers to get control of the portlet before the portlet receives a notification of a changed property. For more information and a sample scenario of a portlet using this interface, see Chapter 13, "Advanced cooperative portlets" on page 413.

This interface provides the following methods :

  • beginEventPhase() : at any point during the event phase, a portlet may explicitly publish the value of an output property to the property broker by invoking the changedProperties() method. This is an alternative to the declaration of output parameters for actions and binding the output parameter values to the request or session when the action is invoked. This may happen in the callback method associated with the start of the event phase (beginEventPhase()), in the invocation of the setProperties() method, or in the portlet action method invocation.

    Such publish calls are dealt with by the property broker in the same manner as output parameters of actions: wires associated with output properties are examined and the property values propagated using the information in the target end of the wire. To register properties, you will use the beginEventPhase method of EventPhaseListener, because only during the event phase is it possible to register and unregister properties.

  • endEventPhase() :the property broker guarantees the completion of all property value notifications to target portlets by the end of the event phase, whether through portlet actions or through the special setProperties() method. The end of the event phase is indicated by the invocation of the endEventPhase() method.

    During the render phase of each request cycle, source portlets can write visual controls representing source data to their output stream. The end user interacts with the visual control in the response to trigger one or more actions on other portlets on the page. During the event phase of the subsequent request, the action is invoked on the corresponding target portlet or portlets.

 <  Day Day Up  >  


IBM WebSphere Portal V5 A Guide for Portlet Application Development
IBM Websphere Portal V5: A Guide for Portlet Application Development
ISBN: 0738498513
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net