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 voidaddEvent(org.w3c.dom.Element eventNode)Deprecated.The GenericEventHandler is not responsible to read the xml structure.booleandelegateRequest(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 AppComponentgetAppComponent()protected java.lang.StringgetArgumentValue(WebEvent event, int argID)Utility method to obtain the value of a given event argumentprotected intgetCurrentEventID()ComponentInitializationContextgetInitializationContext()Returns a wrapper object holdiong a reference to the beans that have been initialized for the current requestjava.lang.ClassgetSupportedWebComponentType()Returns theWebComponentclass by default.WebEventgetWebEvent(int eventID)Extends the getWebEvent by making sure the WebEventOpenPage, WebEventOpenHome and WebEventCancel events always return a non-null value.booleanhandleRequest(RequestKeys keys)This is the main method.protected booleanhandleSetTopLeftPosition(RequestKeys keys)Utility method for processing a location change request, by manipulating the top and left properties of the instancebooleanisCSRFCheckRequired(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 emptybooleanisEventWait()Get the flag which indicate whether we make sure bean status is ready before executing the next eventprotected WebEventnewDefaultEventInstance()This method is called to create a concrete new instance of a WebEvent when the event-class has not specified in the EventInfo.voidprocessExtraEvents()booleanprocessRequest(RequestKeys keys)handle request as specified by the RequestKeysvoidsetEventWait(boolean evtWait)Set the flag which indicate whether we make sure bean status is ready before executing the next eventvoidsetWebComponent(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 WebExceptionCheck 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 thegetEventsFromRequestmethod 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
createPagemethod) - processing the page (with the
processPagemethod).
saveReturnToPagemethod, which combined with theReturnToevent 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:
handleRequestin interfaceWebEventHandler- Overrides:
handleRequestin 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:
processExtraEventsin classGenericEventHandler- Throws:
WebException
-
processRequest
public boolean processRequest(RequestKeys keys) throws WebException
handle request as specified by the RequestKeys- Specified by:
processRequestin 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:GenericEventHandlerThe default implementation of this method simply delegates the event to the next source component specified in the static fieldGenericWebEvent.URL_SOURCE_NAME.- Specified by:
delegateRequestin interfaceWebEventHandler- Overrides:
delegateRequestin classGenericEventHandler- Parameters:
keys- the RequestKeys object containing event ID, sources, and any other information.- Returns:
- true if handling succeeds in
processRequestor 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:
setWebComponentin interfaceWebEventHandler- Parameters:
component- the input web component
-
addEvent
@Deprecated 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:
addEventin classGenericEventHandler- Parameters:
eventNode- an xml node with the event information- See Also:
WebEventHandlerFactory
-
newDefaultEventInstance
protected WebEvent newDefaultEventInstance()
Description copied from class:SysEventHandlerThis method is called to create a concrete new instance of a WebEvent when the event-class has not specified in the EventInfo.- Overrides:
newDefaultEventInstancein 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:
getWebEventin interfaceWebEventHandler- Overrides:
getWebEventin classSysEventHandler- Parameters:
eventID- the event id of typeEnumServletEvents.- Returns:
- the
WebEventobject supported. null if not supported.
-
getSupportedWebComponentType
public java.lang.Class getSupportedWebComponentType()
Description copied from class:GenericEventHandlerReturns theWebComponentclass by default. Subclasses should override this to return their respectiveWebComponentorWebBeanint.- Specified by:
getSupportedWebComponentTypein interfaceWebEventHandler- Overrides:
getSupportedWebComponentTypein classGenericEventHandler- Returns:
- the
Classof theWebComponentthis 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:
AppComponentinstance 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-WebEventto 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-RequestKeysfrom where the event, top and left information will be retrieved- Returns:
- boolean value indicating whether the request was processed successfully
-
-