Class AdminServletEventHandler

    • Field Detail

    • Constructor Detail

      • AdminServletEventHandler

        public AdminServletEventHandler()
    • 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 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.
        Specified by:
        handleRequest in interface WebEventHandler
        Overrides:
        handleRequest in class GenericEventHandler
        Parameters:
        keys - the keys with the request information
        Returns:
        true
        Throws:
        WebException - if an unknown exception happens or if the page cannot be created.
      • setWebComponent

        public void setWebComponent​(WebComponent component)
        set the corresponding web component (should be of ServletWebComponent type) for this event handler
        Specified by:
        setWebComponent in interface WebEventHandler
        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:
        addEvent in class GenericEventHandler
        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 class SysEventHandler
      • 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 interface WebEventHandler
        Overrides:
        getWebEvent in class SysEventHandler
        Parameters:
        eventID - the event id of type EnumServletEvents.
        Returns:
        the WebEvent object supported. null if not supported.
      • 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 analyze
        argID - 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