Package com.microstrategy.web.app.beans
Class AdminServletEventHandler
- java.lang.Object
-
- com.microstrategy.web.beans.GenericEventHandler
-
- com.microstrategy.web.beans.SysEventHandler
-
- com.microstrategy.web.app.beans.AdminServletEventHandler
-
- All Implemented Interfaces:
EnumAppComponentEvents
,WebEventHandler
,WebEventTags
,java.lang.Cloneable
public class AdminServletEventHandler extends SysEventHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.web.beans.GenericEventHandler
GenericEventHandler.GenericEventKeys
-
-
Field Summary
Fields Modifier and Type Field Description protected AppContext
_appContext
-
Fields inherited from class com.microstrategy.web.beans.SysEventHandler
DEFAULT_CONFIG_PATH
-
Fields inherited from class com.microstrategy.web.beans.GenericEventHandler
_extraEvents, layerOfHandleRequest, MULTIPLE_EVENT_SOURCE_SUFFIX, NO_EVENT_ID
-
Fields inherited from interface com.microstrategy.web.app.beans.EnumAppComponentEvents
WebEventArgumentLeftPosition, WebEventArgumentTopPosition, WebEventSetTopLeftPosition
-
Fields inherited from interface com.microstrategy.web.beans.WebEventTags
ATT_ARGUMENT_ENUMERATOR, ATT_ARGUMENT_ID, ATT_ARGUMENT_INDEX, ATT_ARGUMENT_NAME, ATT_ARGUMENT_REQUIRED, ATT_ARGUMENT_TYPE, ATT_ARGUMENT_VALIDATOR, ATT_ARGUMENT_VALUE, ATT_EVENT_DEPRECATED, ATT_EVENT_ENUMERATOR, ATT_EVENT_HANDLER_ENUMERATOR, ATT_EVENT_HANDLER_NAME, ATT_EVENT_HANDLER_TYPE, ATT_EVENT_ID, ATT_EVENT_NAME, ATT_EVENT_TARGET, TAG_ARGUMENT, TAG_ARGUMENTS, TAG_EVENT, TAG_EVENT_HANDLER, TAG_EVENT_HANDLERS, TAG_EVENTS
-
-
Constructor Summary
Constructors Constructor Description AdminServletEventHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addEvent(org.w3c.dom.Element eventNode)
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 fieldGenericWebEvent.URL_SOURCE_NAME
.protected AppComponent
getAppComponent()
protected java.lang.String
getArgumentValue(WebEvent event, int argID)
Utility method to obtain the value of a given event argumentprotected int
getCurrentEventID()
ComponentInitializationContext
getInitializationContext()
Returns a wrapper object holdiong a reference to the beans that have been initialized for the current requestjava.lang.Class
getSupportedWebComponentType()
Returns theWebComponent
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.protected boolean
handleSetTopLeftPosition(RequestKeys keys)
Utility method for processing a location change request, by manipulating the top and left properties of the instanceboolean
isCSRFCheckRequired(java.lang.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 emptyboolean
isEventWait()
Get the flag which indicate whether we make sure bean status is ready before executing the next eventprotected 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.void
processExtraEvents()
boolean
processRequest(RequestKeys keys)
handle request as specified by the RequestKeysvoid
setEventWait(boolean evtWait)
Set the flag which indicate whether we make sure bean status is ready before executing the next eventvoid
setWebComponent(WebComponent component)
set the corresponding web component (should be of ServletWebComponent type) for this event handler-
Methods inherited from class com.microstrategy.web.beans.SysEventHandler
getCatalog, getWebEvents, initEvents, initEvents, newWebEvent
-
Methods inherited from class com.microstrategy.web.beans.GenericEventHandler
addEvent, addEvents, addEventsFromRequestKeys, addEventsFromXML, appendRemainingEvent, clone, getEventID, getEventTarget, getHandlerType, getName, getNextSourceName, getNextSourceName, getOrderedEvents, getPendingEvents, getWebComponent, getWebEvent, getWebEvent, getWebEventsFromRequest, isInitialized, isMyEvent, markInitailized, processMultipleEvents, processMultipleEvents, setHandlerType, setName, validateRequiredArgument
-
-
-
-
Field Detail
-
_appContext
protected AppContext _appContext
-
-
Method Detail
-
isCSRFCheckRequired
public boolean isCSRFCheckRequired(java.lang.String pageName) throws WebException
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- Returns:
- Throws:
WebException
-
handleRequest
public boolean handleRequest(RequestKeys keys) throws WebException
This is the main method. It handles the events in the request.
First it calls thegetEventsFromRequest
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:- creating the target page of the event (with the
createPage
method) - processing the page (with the
processPage
method).
saveReturnToPage
method, which combined with theReturnTo
event supports to go back to the last visited page.
Also, if the page is in succesful state, it callssaveLastSuccesfulPage
, this combined with the fact that if at the end the page is in cancelled state the servlet callsrestoreLastSuccesfulPage
, provide support for cancelling beans execution.- Specified by:
handleRequest
in interfaceWebEventHandler
- Overrides:
handleRequest
in classGenericEventHandler
- Parameters:
keys
- the keys with the request information- Returns:
- true
- Throws:
WebException
- if an unknown exception happens or if the page cannot be created.
- creating the target page of the event (with the
-
processExtraEvents
public void processExtraEvents() throws WebException
- Overrides:
processExtraEvents
in classGenericEventHandler
- Throws:
WebException
-
processRequest
public boolean processRequest(RequestKeys keys) throws WebException
handle request as specified by the RequestKeys- Specified by:
processRequest
in interfaceWebEventHandler
- Parameters:
keys
- input request- Returns:
- true means some event is handled, false means nothing is handled
- Throws:
WebException
- if an exception is found.- See Also:
GenericEventHandler.processRequest(RequestKeys)
-
delegateRequest
public boolean delegateRequest(RequestKeys keys)
Description copied from class:GenericEventHandler
The default implementation of this method simply delegates the event to the next source component specified in the static fieldGenericWebEvent.URL_SOURCE_NAME
.- Specified by:
delegateRequest
in interfaceWebEventHandler
- Overrides:
delegateRequest
in classGenericEventHandler
- 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. - See Also:
GenericEventHandler.delegateRequest(RequestKeys)
-
setWebComponent
public void setWebComponent(WebComponent component)
set the corresponding web component (should be of ServletWebComponent type) for this event handler- Specified by:
setWebComponent
in interfaceWebEventHandler
- Parameters:
component
- the input web component
-
addEvent
public void addEvent(org.w3c.dom.Element eventNode)
Deprecated.The GenericEventHandler is not responsible to read the xml structure.Extends the addEvent method by creating the ServletEvent instead of a GenericWebEvent.- Overrides:
addEvent
in classGenericEventHandler
- Parameters:
eventNode
- an xml node with the event information- See Also:
WebEventHandlerFactory
-
newDefaultEventInstance
protected WebEvent newDefaultEventInstance()
Description copied from class:SysEventHandler
This method is called to create a concrete new instance of a WebEvent when the event-class has not specified in the EventInfo.- Overrides:
newDefaultEventInstance
in classSysEventHandler
-
getWebEvent
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.- Specified by:
getWebEvent
in interfaceWebEventHandler
- Overrides:
getWebEvent
in classSysEventHandler
- Parameters:
eventID
- the event id of typeEnumServletEvents
.- Returns:
- the
WebEvent
object supported. null if not supported.
-
getSupportedWebComponentType
public java.lang.Class getSupportedWebComponentType()
Description copied from class:GenericEventHandler
Returns theWebComponent
class by default. Subclasses should override this to return their respectiveWebComponent
orWebBean
int.- Specified by:
getSupportedWebComponentType
in interfaceWebEventHandler
- Overrides:
getSupportedWebComponentType
in classGenericEventHandler
- Returns:
- the
Class
of theWebComponent
this event handler is associated with. - See Also:
WebEventHandler.getSupportedWebComponentType()
-
getInitializationContext
public ComponentInitializationContext getInitializationContext()
Returns a wrapper object holdiong a reference to the beans that have been initialized for the current request- Since:
- MicroStrategy Web 8.0.0
-
setEventWait
public void setEventWait(boolean evtWait)
Set the flag which indicate whether we make sure bean status is ready before executing the next event- Parameters:
evtWait
-
-
isEventWait
public boolean isEventWait()
Get the flag which indicate whether we make sure bean status is ready before executing the next event- Returns:
- boolean
-
getAppComponent
protected AppComponent getAppComponent()
- Returns:
AppComponent
instance associated to this event handler
-
getCurrentEventID
protected int getCurrentEventID()
- Returns:
- integer value corresponding to the event currently being handled
-
getArgumentValue
protected java.lang.String getArgumentValue(WebEvent event, int argID)
Utility method to obtain the value of a given event argument- Parameters:
event
-WebEvent
to analyzeargID
- integer identifier of the argument to search for- Returns:
- String instance with the value of the requested event argument
- Since:
- MicroStrategy Web 8.0.1
-
handleSetTopLeftPosition
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
-
-