public interface

WebEventHandler

com.microstrategy.web.beans.WebEventHandler
Known Indirect Subclasses

Class Overview

This interface generates and handles a set of WebEvent. A WebEventHandler retrieves any event-related information, such as event id and argument values, from the RequestKeys object.

A instance of WebEventHandler is usually attached to a WebComponent, the brick for building a Web application. Web applications are allowed to dynamically add a WebEvent to a WebEventHandler instance at the run time by providing the XML representation of the WebEvent.

Summary

Public Methods
abstract void addEvent(WebEvent event)
Adds WebEvent into the current event handler.
abstract void addEventsFromXML(String eventsXML)
Adds one or more WebEvent into the current event handler.
abstract void appendRemainingEvent(WebEvent event)
Append an remaining event at the end of the remaining events' list.
abstract boolean delegateRequest(RequestKeys keys)
This method encapsulates the mechanism by which a request is delegated to child WebComponents.
abstract int getHandlerType()
Returns the type of the current WebEventHandle.
abstract SimpleList getPendingEvents()
Returns the list of events that were not processed.
abstract Class getSupportedWebComponentType()
Returns the Class type of the WebComponent this event handler is associated with.
abstract WebComponent getWebComponent()
Returns the WebComponent object associated with the current event handler.
abstract WebEvent getWebEvent(int eventID)
Returns the specified WebEvent instance which this event handler supports.
abstract Enumeration getWebEvents()
Returns an enumeration over the WebEvent objects suppored by this event handler.
abstract Enumeration getWebEventsFromRequest(RequestKeys keys)
Returns an enumeration over the WebEvent suppored by this event handler that are present in the request keys provided.
abstract boolean handleRequest(RequestKeys keys)
Handles the WebEvent specified in the RequestKeys object.
abstract boolean processRequest(RequestKeys keys)
This method encapsulates the logic to process incoming events without regard as to how it was triggered or be concerned with delegation the request (see processRequest(RequestKeys)).
abstract void setWebComponent(WebComponent component)
Sets a WebComponent instance on this WebEventHandler.

Public Methods

public abstract void addEvent (WebEvent event)

Adds WebEvent into the current event handler. If there is an event already defined with the id of the event that is passed in, then it is overwritten

Parameters
event the event to be added

public abstract void addEventsFromXML (String eventsXML)

Adds one or more WebEvent into the current event handler.

Parameters
eventsXML the XML representation of web events.

public abstract void appendRemainingEvent (WebEvent event)

Append an remaining event at the end of the remaining events' list.
Such remaining event will be processed at the end.

Parameters
event the WebEvent object.

public abstract boolean delegateRequest (RequestKeys keys)

This method encapsulates the mechanism by which a request is delegated to child WebComponents. By default, the request will be delegated to the child WebComponent along the event source path irrespective of what was returned by processRequest(RequestKeys). Normally, this is invoked by handleRequest(RequestKeys). The request keys must also define an event ID otherwise the event will not be propagated.

Parameters
keys the RequestKeys object containing event ID, sources, and any other information.
Returns
  • true if handling succeeds in processRequest or one of its children.
Throws
WebException thrown if handling of the request fails.

public abstract int getHandlerType ()

Returns the type of the current WebEventHandle.

Returns
  • the type of the current event handler.

public abstract SimpleList getPendingEvents ()

Returns the list of events that were not processed.
While handling the request, if after processing an event the page is not in Succesfull state, the EventHandler stops processing the rest of the events. This list resturns those events that remain pending.

Returns
  • a List with the events that were not processed during handleRequest(). If handelRequest() was not invoked, it returns null.

public abstract Class getSupportedWebComponentType ()

Returns the Class type of the WebComponent this event handler is associated with.

Returns
  • the Class of the WebComponent this event handler is associated with.

public abstract WebComponent getWebComponent ()

Returns the WebComponent object associated with the current event handler.

Returns
  • the WebComponent object.

public abstract WebEvent getWebEvent (int eventID)

Returns the specified WebEvent instance which this event handler supports.

Parameters
eventID the event id of the WebEvent.
Returns
  • the specified WebEvent; null if the event is not supported by this event handler.

public abstract Enumeration getWebEvents ()

Returns an enumeration over the WebEvent objects suppored by this event handler. The WebEvent objects are returned in no particular order.

Returns
  • an Enumeration over the WebEvent objects supported.

public abstract Enumeration getWebEventsFromRequest (RequestKeys keys)

Returns an enumeration over the WebEvent suppored by this event handler that are present in the request keys provided. The WebEvent are returned in no particular order.

Parameters
keys the RequestKeys object.
Returns
  • an Enumeration over the WebEvent supported.

public abstract boolean handleRequest (RequestKeys keys)

Handles the WebEvent specified in the RequestKeys object. By default, this method invokes processRequest(RequestKeys) followed by delegateRequest(RequestKeys). In most cases, only processRequest is implemented (or overridden) to provide the event processing logic.

Parameters
keys the RequestKeys object containing event ID, sources, and any other information.
Returns
  • true if handling succeeds in processRequest or one of its children.
Throws
WebException thrown if handling of the request fails.

public abstract boolean processRequest (RequestKeys keys)

This method encapsulates the logic to process incoming events without regard as to how it was triggered or be concerned with delegation the request (see processRequest(RequestKeys)). Normally, this is invoked by handleRequest(RequestKeys).

Parameters
keys the RequestKeys object containing event ID, sources, and any other information.
Returns
  • true if handling succeeds; false if the event is ignored and not handled.
Throws
WebException thrown if handling of the request fails.

public abstract void setWebComponent (WebComponent component)

Sets a WebComponent instance on this WebEventHandler. A WebComponent must maintain a one-one relationship with an event handler instance. After this method call, the WebComponent previously associated with this event handler should have a null instance of WebEventHandler, and the event handler instance previously associate the specified WebComponent should have a null WebComponent.

Parameters
component a new WebComponent object.