Package com.microstrategy.web.beans
Interface WebEventHandler
-
- All Known Implementing Classes:
AbstractObjectExplorerEventHandler
,AccordionTabManagerEventHandler
,AddDataSetObjectExplorerEventHandler
,AdminBeanEventHandler
,AdminServletEventHandler
,AggregatedAppEventHandler
,AggregatedEventHandler
,AggregatedFolderEventHandler
,AggregatedReportSavePropertiesEventHandler
,AttributeEventHandler
,DatasetObjectExplorerEventHandler
,DerivedElementEventHandler
,DerivedElementsBrowserEventHandler
,DiagnosticsBeanEventHandler
,ExpressionPromptEventHandlerImpl
,FilterEventHandler
,FolderFrameEventHandler
,FolderObjectExplorerEventHandler
,GenericEventHandler
,ImportDerivedElementsEventHandler
,PageSetupHTMLEditorEventHandler
,ProjectBrowserEventHandler
,ReportPageEventHandler
,RibbonEventHandlerImpl
,RWBeanHTML5VIEventHandler
,RWGraphDropZonesEditorEventHandlerImpl
,SecurityFilterEventHandler
,SecurityRoleEventHandler
,SysEventHandler
,ViewFilterElementPanelEventHandler
,ViewReportObjectExplorerEventHandler
,XDADataExplorerEventHandler
public interface WebEventHandler
This interface generates and handles a set ofWebEvent
. AWebEventHandler
retrieves any event-related information, such as event id and argument values, from theRequestKeys
object.A instance of
WebEventHandler
is usually attached to aWebComponent
, the brick for building a Web application. Web applications are allowed to dynamically add aWebEvent
to aWebEventHandler
instance at the run time by providing the XML representation of theWebEvent
.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEvent(WebEvent event)
AddsWebEvent
into the current event handler.void
addEventsFromXML(java.lang.String eventsXML)
Adds one or moreWebEvent
into the current event handler.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.boolean
delegateRequest(RequestKeys keys)
This method encapsulates the mechanism by which a request is delegated to child WebComponents.int
getHandlerType()
Returns thetype
of the currentWebEventHandle
.SimpleList
getPendingEvents()
Returns the list of events that were not processed.java.lang.Class
getSupportedWebComponentType()
Returns theClass
type of theWebComponent
this event handler is associated with.WebComponent
getWebComponent()
Returns theWebComponent
object associated with the current event handler.WebEvent
getWebEvent(int eventID)
Returns the specifiedWebEvent
instance which this event handler supports.java.util.Enumeration
getWebEvents()
Returns an enumeration over theWebEvent
objects suppored by this event handler.java.util.Enumeration
getWebEventsFromRequest(RequestKeys keys)
Returns an enumeration over theWebEvent
suppored by this event handler that are present in the request keys provided.boolean
handleRequest(RequestKeys keys)
Handles theWebEvent
specified in theRequestKeys
object.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 (seeprocessRequest(RequestKeys)
).void
setWebComponent(WebComponent component)
Sets aWebComponent
instance on this WebEventHandler.
-
-
-
Method Detail
-
getWebEvent
WebEvent getWebEvent(int eventID)
Returns the specifiedWebEvent
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.
-
handleRequest
boolean handleRequest(RequestKeys keys) throws WebException
Handles theWebEvent
specified in theRequestKeys
object. By default, this method invokesprocessRequest(RequestKeys)
followed bydelegateRequest(RequestKeys)
. In most cases, onlyprocessRequest
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.
-
processRequest
boolean processRequest(RequestKeys keys) throws WebException
This method encapsulates the logic to process incoming events without regard as to how it was triggered or be concerned with delegation the request (seeprocessRequest(RequestKeys)
). Normally, this is invoked byhandleRequest(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.
-
delegateRequest
boolean delegateRequest(RequestKeys keys) throws WebException
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 byprocessRequest(RequestKeys)
. Normally, this is invoked byhandleRequest(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.
-
getWebComponent
WebComponent getWebComponent()
Returns theWebComponent
object associated with the current event handler.- Returns:
- the WebComponent object.
-
setWebComponent
void setWebComponent(WebComponent component)
Sets aWebComponent
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 ofWebEventHandler
, and the event handler instance previously associate the specifiedWebComponent
should have a nullWebComponent
.- Parameters:
component
- a new WebComponent object.
-
addEventsFromXML
void addEventsFromXML(java.lang.String eventsXML)
Adds one or moreWebEvent
into the current event handler.- Parameters:
eventsXML
- the XML representation of web events.
-
addEvent
void addEvent(WebEvent event)
AddsWebEvent
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
-
getHandlerType
int getHandlerType()
Returns thetype
of the currentWebEventHandle
.- Returns:
- the type of the current event handler.
-
getWebEvents
java.util.Enumeration getWebEvents()
Returns an enumeration over theWebEvent
objects suppored by this event handler. TheWebEvent
objects are returned in no particular order.- Returns:
- an Enumeration over the
WebEvent
objects supported.
-
getWebEventsFromRequest
java.util.Enumeration getWebEventsFromRequest(RequestKeys keys)
Returns an enumeration over theWebEvent
suppored by this event handler that are present in the request keys provided. TheWebEvent
are returned in no particular order.- Parameters:
keys
- theRequestKeys
object.- Returns:
- an Enumeration over the
WebEvent
supported.
-
getSupportedWebComponentType
java.lang.Class getSupportedWebComponentType()
Returns theClass
type of theWebComponent
this event handler is associated with.- Returns:
- the
Class
of theWebComponent
this event handler is associated with.
-
getPendingEvents
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()
. IfhandelRequest()
was not invoked, it returns null.
-
appendRemainingEvent
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
- theWebEvent
object.
-
-