public class

AdminServletEventHandler

extends SysEventHandler
implements EnumAppComponentEvents
java.lang.Object
   ↳ com.microstrategy.web.beans.GenericEventHandler
     ↳ com.microstrategy.web.beans.SysEventHandler
       ↳ com.microstrategy.web.app.beans.AdminServletEventHandler

Summary

[Expand]
Inherited Constants
From class com.microstrategy.web.beans.SysEventHandler
From class com.microstrategy.web.beans.GenericEventHandler
From interface com.microstrategy.web.app.beans.EnumAppComponentEvents
From interface com.microstrategy.web.beans.WebEventTags
Fields
protected AppContext _appContext
[Expand]
Inherited Fields
From class com.microstrategy.web.beans.GenericEventHandler
Public Constructors
AdminServletEventHandler()
Public Methods
void addEvent(Element eventNode)
This method is deprecated. The GenericEventHandler is not responsible to read the xml structure.
boolean delegateRequest(RequestKeys keys)
The default implementation of this method simply delegates the event to the next source component specified in the static field GenericWebEvent.URL_SOURCE_NAME.
ComponentInitializationContext getInitializationContext()
Returns a wrapper object holdiong a reference to the beans that have been initialized for the current request
Class getSupportedWebComponentType()
Returns the WebComponent class by default.
WebEvent getWebEvent(int eventID)
Extends the getWebEvent by making sure the WebEventOpenPage, WebEventOpenHome and WebEventCancel events always return a non-null value.
boolean handleRequest(RequestKeys keys)
This is the main method.
boolean isCSRFCheckRequired(String pageName)
Check if we need to do the CSRF check for the target page, the check is based on whether the page is login required, and whether the request query string is empty@return
boolean isEventWait()
Get the flag which indicate whether we make sure bean status is ready before executing the next event
void processExtraEvents()
boolean processRequest(RequestKeys keys)
handle request as specified by the RequestKeys
void setEventWait(boolean evtWait)
Set the flag which indicate whether we make sure bean status is ready before executing the next event
void setWebComponent(WebComponent component)
set the corresponding web component (should be of ServletWebComponent type) for this event handler
Protected Methods
AppComponent getAppComponent()
String getArgumentValue(WebEvent event, int argID)
Utility method to obtain the value of a given event argument
int getCurrentEventID()
boolean handleSetTopLeftPosition(RequestKeys keys)
Utility method for processing a location change request, by manipulating the top and left properties of the instance
WebEvent newDefaultEventInstance()
This method is called to create a concrete new instance of a WebEvent when the event-class has not specified in the EventInfo.
[Expand]
Inherited Methods
From class com.microstrategy.web.beans.SysEventHandler
From class com.microstrategy.web.beans.GenericEventHandler
From class java.lang.Object
From interface com.microstrategy.web.beans.WebEventHandler

Fields

protected AppContext _appContext

Public Constructors

public AdminServletEventHandler ()

Public Methods

public void addEvent (Element eventNode)

This method is deprecated.
The GenericEventHandler is not responsible to read the xml structure.

Extends the addEvent method by creating the ServletEvent instead of a GenericWebEvent.

Parameters
eventNode an xml node with the event information

public boolean delegateRequest (RequestKeys keys)

The default implementation of this method simply delegates the event to the next source component specified in the static field GenericWebEvent.URL_SOURCE_NAME.

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.

public ComponentInitializationContext getInitializationContext ()

Returns a wrapper object holdiong a reference to the beans that have been initialized for the current request

public Class getSupportedWebComponentType ()

Returns the WebComponent class by default. Subclasses should override this to return their respective WebComponent or WebBean int.

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

public WebEvent getWebEvent (int eventID)

Extends the getWebEvent by making sure the WebEventOpenPage, WebEventOpenHome and WebEventCancel events always return a non-null value. These events are critical to the servlet exectuion.

Parameters
eventID the event id of type EnumServletEvents.
Returns
  • the WebEvent object supported. null if not supported.

public boolean handleRequest (RequestKeys keys)

This is the main method. It handles the events in the request.
First it calls the getEventsFromRequest method to get an ordered list of the events that needs to be handled, then it process each one of the events. The process of each event consists on:

  1. creating the target page of the event (with the createPage method)
  2. processing the page (with the processPage method).
At the end it checks if the page needs to be tracked and if so calls the saveReturnToPage method, which combined with the ReturnTo event supports to go back to the last visited page.
Also, if the page is in succesful state, it calls saveLastSuccesfulPage, this combined with the fact that if at the end the page is in cancelled state the servlet calls restoreLastSuccesfulPage, provide support for cancelling beans execution.

Parameters
keys the keys with the request information
Returns
  • true
Throws
WebException if an unknown exception happens or if the page cannot be created.

public boolean isCSRFCheckRequired (String pageName)

Check if we need to do the CSRF check for the target page, the check is based on whether the page is login required, and whether the request query string is empty@return

Throws
WebException

public boolean isEventWait ()

Get the flag which indicate whether we make sure bean status is ready before executing the next event

Returns
  • boolean

public void processExtraEvents ()

Throws
WebException

public boolean processRequest (RequestKeys keys)

handle request as specified by the RequestKeys

Parameters
keys input request
Returns
  • true means some event is handled, false means nothing is handled
Throws
WebException
See Also
  • processRequest(RequestKeys)

public void setEventWait (boolean evtWait)

Set the flag which indicate whether we make sure bean status is ready before executing the next event

public void setWebComponent (WebComponent component)

set the corresponding web component (should be of ServletWebComponent type) for this event handler

Parameters
component the input web component

Protected Methods

protected AppComponent getAppComponent ()

Returns

protected String getArgumentValue (WebEvent event, int argID)

Utility method to obtain the value of a given event argument

Parameters
event WebEvent to analyze
argID integer identifier of the argument to search for
Returns
  • String instance with the value of the requested event argument

protected int getCurrentEventID ()

Returns
  • integer value corresponding to the event currently being handled

protected boolean handleSetTopLeftPosition (RequestKeys keys)

Utility method for processing a location change request, by manipulating the top and left properties of the instance

Parameters
keys RequestKeys from where the event, top and left information will be retrieved
Returns
  • boolean value indicating whether the request was processed successfully

protected WebEvent newDefaultEventInstance ()

This method is called to create a concrete new instance of a WebEvent when the event-class has not specified in the EventInfo.