Class EventManager


  • public class EventManager
    extends java.lang.Object
    EventManager Provides utility functions related to WebEvent
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Field Detail

      • FORM_METHOD_POST

        public static final java.lang.String FORM_METHOD_POST
        Constant for specifying the post form method
        See Also:
        Constant Field Values
      • FORM_METHOD_GET

        public static final java.lang.String FORM_METHOD_GET
        Constant for specifying the get form method
        See Also:
        Constant Field Values
      • DEFAULT_FORM_NAME

        public static final java.lang.String DEFAULT_FORM_NAME
        Constant for specifying the default form name
        See Also:
        Constant Field Values
      • DEFAULT_FORM_METHOD

        public static final java.lang.String DEFAULT_FORM_METHOD
        Constant for specifying the default form method
        See Also:
        Constant Field Values
      • GLOBAL_LINK_CSS

        public static final java.lang.String GLOBAL_LINK_CSS
        Constant for specifying the default global css class for links
        See Also:
        Constant Field Values
    • Constructor Detail

      • EventManager

        public EventManager​(WebComponent webComponent)
        Class constructor.
        Parameters:
        webComponent - WebComponent object from where to initialize this instance.
      • EventManager

        public EventManager​(BeanContext beanContext)
        Class constructor.
        Parameters:
        beanContext - BeanContext object from where to initialize this instance.
      • EventManager

        public EventManager​(AppContext appContext)
        Class constructor.
        Parameters:
        appContext - AppContext object from where to initialize this instance.
      • EventManager

        public EventManager​(boolean useDhtml,
                            boolean useIframe)
        Simple class constructor.
        Parameters:
        useDhtml - boolean value indicating if the DHTML environment is enabled
        useIframe - boolean value indicating if IFrames are enabled
      • EventManager

        public EventManager​(WebComponent webComponent,
                            java.lang.String extraURL,
                            java.lang.String extraInputs)
        Class constructor
        Parameters:
        webComponent - WebComponent object from where to initialize this instance.
        extraURL - String value with any extra URL information to be added to the links generated by this manager
        extraInputs - String value with any extra inputs to be added to the form-related information generated by this manager
    • Method Detail

      • generateDynamicEventLink

        public java.lang.String generateDynamicEventLink​(WebEvent event)
        Deprecated.
        Generate the link information according to the event provided as argument.
        Parameters:
        event - WebEvent instance from where to obtain the information to generate as URL
        Returns:
        String value with the URL resulting from the information provided as arguments to this method. By default no child state information will be included.
      • getEventLink

        public java.lang.String getEventLink​(WebEvent e)
        Generate the link information according to the event provided as argument.
        Parameters:
        e - WebEvent instance from where to obtain the information to generate as URL
        Returns:
        String value with the URL resulting from the information provided as arguments to this method. By default minimal child state information will be included unless on a DHTML environment.
      • getEventLink

        public java.lang.String getEventLink​(WebEvent e,
                                             int stateLevel)
        Generate the link information according to the event provided as argument.
        Parameters:
        e - WebEvent instance from where to obtain the information to generate as URL
        stateLevel - value from the EnumWebStateLevel enumeration indicating if or how much state information should be included.
        Returns:
        String value with the URL resulting from the information provided as arguments to this method. If the environment is DHTML, no child state will be included (for optimization), otherwise it will be as specified on the stateLevel argument.
      • getEventLink

        public java.lang.String getEventLink​(WebEvent e,
                                             java.lang.String extraUrl,
                                             int stateLevel)
        Generate the link information according to the event provided as argument
        Parameters:
        e - WebEvent instance from where to obtain the information to generate as URL
        extraUrl - String value with any extra url information to add to the resulting link
        stateLevel - value from the EnumWebStateLevel enumeration indicating if or how much state information should be included.
        Returns:
        String value with the URL resulting from the information provided as arguments to this method.
        Since:
        MicroStrategy Web 8.0.0
      • generateIframeOpenAnchor

        public void generateIframeOpenAnchor​(MarkupOutput mo,
                                             WebEvent e)
        Generate an anchor for an IFrame event. By default it will not include child state since this one will be handled by an onclick call to the submitLink JavaScript method.
        Parameters:
        mo - MarkupOutput instance where the html output will be saved
        e - WebEvent event for which the link will be generated
      • generateIframeOpenAnchor

        public void generateIframeOpenAnchor​(MarkupOutput mo,
                                             WebEvent e,
                                             boolean bSubmitForm)
        Generates anchor for IFrame open event. This is an overloaded function that takes an extra parameter for indicating not to submit HTML form. It's required for some components such as Prompt's tree where selecting a hierarchy or Attribute doesn't refresh IFrame.
        Parameters:
        mo - MarkupOutput instance where the html output will be saved
        e - WebEvent event for which the link will be generated
        bSubmitForm - boolean true indicates to submit form with an onclick call to the submitLink JavaScript method.
        Since:
        MicroStrategy Web 8.0.0
      • generateIframeOpenAnchor

        public void generateIframeOpenAnchor​(MarkupOutput mo,
                                             java.lang.String url,
                                             java.lang.String extraLink,
                                             java.lang.String extraAttributes)
        Deprecated.
        Generate an anchor for an iframe related event
        Parameters:
        mo - MarkupOutput instance where the html generated will be saved
        url - String string with url information to use on the link
        extraLink - String extra arguments to add to the link
        extraAttributes - String extra attributes to add to the anchor
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       WebEvent e)
        Generates an open anchor for an event. By default calls the generateAnchor(WebEvent) method and gets the open tag for it.
        Parameters:
        mo - MarkupOutput instance where the html to generate will be saved
        e - WebEvent event from where to generate the link
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       WebEvent e,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generates an open anchor for an event.
        Parameters:
        mo - MarkupOutput instance where the html to generate will be saved
        e - WebEvent event from where to generate the link
        extraLink - String with any extra string information to add to the HREF attribute of the anchor
        extraAttributes - String with any extra attribute information to add to the anchor tag
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       WebEvent e,
                                       int stateLevel,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generates an open anchor for an event.
        Parameters:
        mo - MarkupOutput instance where the html to generate will be saved
        e - WebEvent event from where to generate the link
        extraLink - String with any extra string information to add to the HREF attribute of the anchor
        extraAttributes - String with any extra attribute information to add to the anchor tag
        stateLevel - value from the EnumWebStateLevel enumeration indicating if or how much state information should be included.
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       java.lang.String url)
        Deprecated.
        Generates an open anchor.
        Parameters:
        mo - MarkupOutput instance where the HTML generated will be saved.
        url - String value with the URL to define for the HREF attribute of the anchor
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       java.lang.String url,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generates an open anchor.
        Parameters:
        mo - MarkupOutput instance where the HTML generated will be saved.
        url - String value with the URL to define for the HREF attribute of the anchor.
        extraLink - String value with any extra URL information to add to the anchor.
        extraAttributes - String with any extra attribute information to add to the anchor tag.
      • generateOpenAnchor

        public void generateOpenAnchor​(MarkupOutput mo,
                                       java.lang.String url,
                                       boolean addDynamicState,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generates an open anchor.
        Parameters:
        mo - MarkupOutput instance where the HTML generated will be saved.
        url - String value with the URL to define for the HREF attribute of the anchor.
        extraLink - String value with any extra URL information to add to the anchor.
        extraAttributes - String with any extra attribute information to add to the anchor tag.
        addDynamicState - boolean value indicating if the state of the children should be added dynamically as part of an onclick method call to the submitLink JavaScript method.
      • generateOpenAnchor

        public void generateOpenAnchor​(java.lang.StringBuffer sb,
                                       WebEvent e,
                                       int stateLevel,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generates an open anchor.
        Parameters:
        sb - StringBuffer instance where the HTML output will be saved.
        e - WebEvent instance from where to obtain the URL information to use for the anchor
        stateLevel - value from the EnumWebStateLevel enumeration indicating if or how much state information should be included.
        extraLink - String value with any extra URL information to add to the anchor.
        extraAttributes - String with any extra attribute information to add to the anchor tag.
      • generateForm

        public Tag generateForm()
        Returns:
        a Tag instance for a form HTML tag. The value for its method attribute will be by default post, for action it will be the root parent of the WebComponent instance used for initializing this event manager instance, by default it will not support iframes, but if on DHTML environment, the child state will be added with the appendPageState JavaScript method.
        Since:
        MicroStrategy Web 8.0.0
      • generateForm

        public Tag generateForm​(WebComponent bean)
        Parameters:
        bean - WebComponent instance to be used for initializing the form information.
        Returns:
        a Tag instance for a form HTML tag. The value for its method attribute will be by default post, for action it will be the root parent of the WebComponent instance provided as argument, by default it will not support iframes, but if on DHTML environment, the child state will be added with the appendPageState JavaScript method.
        Since:
        MicroStrategy Web 8.0.0
      • generateForm

        public Tag generateForm​(WebComponent bean,
                                boolean enableIframe)
        Parameters:
        bean - WebComponent instance to be used for initializing the form information.
        enableIframe - boolean value indicating if the form will be working on an iframe environment or not.
        Returns:
        a Tag instance for a form HTML tag. The value for its method attribute will be by default post, for action it will be the root parent of the WebComponent instance provided as argument, if supporting iframes the target will be adjusted to the application's frameManager and if on DHTML environment, the child state will be added with the appendPageState JavaScript method.
        Since:
        MicroStrategy Web 8.0.0
      • generateAnchor

        public AnchorTag generateAnchor​(WebEvent e)
        Generate an AnchorTag instance.
        Parameters:
        e - WebEvent instance from where the anchor information will be initialized.
        Returns:
        AnchorTag initialized instance, with link information as provided by the WebEvent instance, if on DHTML environment then the child information will be submitted by an onclick JavaScript method call to submitLink or otherwise it will be their minimal state.
        Since:
        MicroStrategy Web 8.0.0
      • generateAnchor

        public Tag generateAnchor​(WebEvent e,
                                  boolean enableIframe)
        Generate an AnchorTag instance.
        Parameters:
        e - WebEvent instance from where the anchor information will be initialized.
        enableIframe - boolean value indicating if iframe shall be enabled for this anchor tag.
        Returns:
        AnchorTag initialized instance, with link information as provided by the WebEvent instance, if on DHTML environment then the child information will be submitted by an onclick JavaScript method call to submitLink or otherwise it will be their minimal state. If iframe is enabled, then the target and url information will be adjusted accordingly.
        Since:
        MicroStrategy Web 8.0.0
      • generateOpenAnchor

        public void generateOpenAnchor​(java.lang.StringBuffer sb,
                                       java.lang.String url,
                                       java.lang.String extraLink,
                                       java.lang.String extraAttributes)
        Deprecated.
        Generate an open anchor tag.
        Parameters:
        sb - StringBuffer instance where the HTML output will be saved.
        url - String with the url information to use on the anchor tag to generate
        extraLink - String value with any extra URL information to add to the anchor.
        extraAttributes - String with any extra attribute information to add to the anchor tag.
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   WebEvent event)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   WebEvent event,
                                                   java.lang.String name,
                                                   java.lang.String method)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   WebEvent event,
                                                   java.lang.String name,
                                                   java.lang.String method,
                                                   boolean appendState)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
        appendState - boolean
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   WebEvent event,
                                                   java.lang.String name,
                                                   java.lang.String method,
                                                   java.lang.String extraLink,
                                                   java.lang.String extraAttributes,
                                                   boolean appendState)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
        extraLink - String
        extraAttributes - String
        appendState - boolean
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   java.lang.String action)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        action - String
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   java.lang.String action,
                                                   java.lang.String name,
                                                   java.lang.String method)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        action - String
        name - String
        method - String
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   java.lang.String action,
                                                   java.lang.String name,
                                                   java.lang.String method,
                                                   boolean appendState)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        action - String
        name - String
        method - String
        appendState - boolean
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   java.lang.String action,
                                                   java.lang.String name,
                                                   java.lang.String method,
                                                   java.lang.String extraLink,
                                                   java.lang.String extraAttributes)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        action - String
        name - String
        method - String
        extraLink - String
        extraAttributes - String
      • generateIframeOpenFormForEvent

        public void generateIframeOpenFormForEvent​(MarkupOutput mo,
                                                   int indent,
                                                   java.lang.String action,
                                                   java.lang.String name,
                                                   java.lang.String method,
                                                   java.lang.String extraLink,
                                                   java.lang.String extraAttributes,
                                                   boolean appendState)
        Generate an open form tag for an IFrame event
        Parameters:
        mo - MarkupOutput
        indent - int
        action - String
        name - String
        method - String
        extraLink - String
        extraAttributes - String
        appendState - boolean
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             WebEvent event)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
      • generateGetOpenFormForEvent

        public void generateGetOpenFormForEvent​(MarkupOutput mo,
                                                int indent,
                                                WebEvent event)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             WebEvent event,
                                             java.lang.String name,
                                             java.lang.String method)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             WebEvent event,
                                             java.lang.String name,
                                             java.lang.String method,
                                             boolean appendState)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
        appendState - boolean
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             WebEvent event,
                                             java.lang.String name,
                                             java.lang.String method,
                                             java.lang.String extraLink,
                                             java.lang.String extraAttributes)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
        extraLink - String
        extraAttributes - String
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             WebEvent event,
                                             java.lang.String name,
                                             java.lang.String method,
                                             java.lang.String extraLink,
                                             java.lang.String extraAttributes,
                                             boolean appendState)
        Generate an open form tag for an event
        Parameters:
        mo - MarkupOutput
        indent - int
        event - WebEvent
        name - String
        method - String
        extraLink - String
        extraAttributes - String
        appendState - boolean
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             java.lang.String action)
        Generate an open tag for a form.
        Parameters:
        mo - MarkupOutput instance where the HTML content generated will be saved
        indent - value for indentation consideration when generating the HTML
        action - String with the value to assign to the action attribute of the tag.
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             java.lang.String action,
                                             java.lang.String name,
                                             java.lang.String method)
        Generate an open tag for a form.
        Parameters:
        mo - MarkupOutput instance where the HTML content generated will be saved
        indent - value for indentation consideration when generating the HTML
        action - String with the value to assign to the action attribute of the tag.
        name - String with the name to assign to the form
        method - String with the method to use for the form (for example, post or get)
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             java.lang.String action,
                                             java.lang.String name,
                                             java.lang.String method,
                                             boolean appendState)
        Generate an open tag for a form.
        Parameters:
        mo - MarkupOutput instance where the HTML content generated will be saved
        indent - value for indentation consideration when generating the HTML
        action - String with the value to assign to the action attribute of the tag.
        name - String with the name to assign to the form
        method - String with the method to use for the form (for example, post or get)
        appendState - boolean indicating if the child state should be appended to the form information using DHTML - provided DHTML is enabled.
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             java.lang.String action,
                                             java.lang.String name,
                                             java.lang.String method,
                                             java.lang.String extraLink,
                                             java.lang.String extraAttributes)
        Generate an open tag for a form.
        Parameters:
        mo - MarkupOutput instance where the HTML content generated will be saved
        indent - value for indentation consideration when generating the HTML
        action - String with the value to assign to the action attribute of the tag.
        name - String with the name to assign to the form
        method - String with the method to use for the form (for example, post or get)
        extraLink - String with any extra value information to be added to the action attribute
        extraAttributes - String with any other extra attributes to be added to the tag definition
      • generateOpenFormForEvent

        public void generateOpenFormForEvent​(MarkupOutput mo,
                                             int indent,
                                             java.lang.String action,
                                             java.lang.String name,
                                             java.lang.String method,
                                             java.lang.String extraLink,
                                             java.lang.String extraAttributes,
                                             boolean appendState)
        Generate an open tag for a form.
        Parameters:
        mo - MarkupOutput instance where the HTML content generated will be saved
        indent - value for indentation consideration when generating the HTML
        action - String with the value to assign to the action attribute of the tag.
        name - String with the name to assign to the form
        method - String with the method to use for the form (for example, post or get)
        extraLink - String with any extra value information to be added to the action attribute
        extraAttributes - String with any other extra attributes to be added to the tag definition
        appendState - boolean indicating if the child state should be appended to the form information using DHTML - provided DHTML is enabled.
      • fixUrl

        public void fixUrl​(ParameterBuilder url)
        Method for adjusting the ParameterBuilder instance information for handling environments where cookies are not supported.
        Parameters:
        url - ParameterBuilder instance to update
        Since:
        MicroStrategy Web 8.0.0
      • fixUrl

        public java.lang.String fixUrl​(java.lang.String url)
        Deprecated.
        use fixUrl(ParameterBuilder) instead.
        Method for adjusting the url information for handling environments where cookies are not supported.
        Parameters:
        url - the original url information
        Returns:
        the updated url string
      • setExtraUrl

        public void setExtraUrl​(java.lang.String newValue)
        Set any extra url information that shall be added to the links generated by this instance
        Parameters:
        newValue - String with the url information to add to the links
      • getExtraUrl

        public java.lang.String getExtraUrl()
        Returns:
        String value with the extra url information defined to be added to the links generated by this instance.
      • setExtraInput

        public void setExtraInput​(java.lang.String newValue)
        Set any extra input information that shall be added to the forms generated by this instance
        Parameters:
        newValue - String with the input information to add to the forms
      • getExtraInput

        public java.lang.String getExtraInput()
        Returns:
        String value with the extra input information defined to be added to the forms generated by this instance.
      • setUseIframe

        public void setUseIframe​(boolean useIframe)
        Specify if this instance should handle the links and forms as on an iframe environment.
        Parameters:
        useIframe - boolean value indicating if iframes are handled by this instance or not.
      • isUseIframe

        public boolean isUseIframe()
        Returns:
        boolean value indicating if iframes are handled by this instance or not.
      • setUseDhtml

        public void setUseDhtml​(boolean useDhtml)
        Specify if this instance should handle the links and forms as on a DHTML environment.
        Parameters:
        useDhtml - boolean value indicating if DHTML is handled by this instance or not.
      • setUseCss

        public void setUseCss​(boolean useCss)
        Deprecated.
        The css property should be specified after the anchor information tag has been generated.
        Defines whether to use the default cssClass ("mstrLink") when generating the link
        Parameters:
        useCss - true if the link should use the "mstrLink" class
      • isUseCss

        public boolean isUseCss()
        Deprecated.
        The css property should be specified after the anchor information tag has been generated.
        Returns whether to links generated will use the default cssClass ("mstrLink")
        Returns:
        true if the link will use the "mstrLink" class
      • setLinkCss

        public void setLinkCss​(java.lang.String linkCss)
        Deprecated.
        The css property should be specified after the anchor information tag has been generated.
        Defines user defined CSS for the link. Will be used only if the useCSS is set to true
        Parameters:
        linkCss - CSS for the link
        Since:
        MicroStrategy Web 7.5.0
      • getLinkCss

        public java.lang.String getLinkCss()
        Deprecated.
        The css property should be specified after the anchor information tag has been generated.
        Returns user defined CSS for the link. Will be used only if the useCSS is set to true
        Returns:
        the value of the link css property for this instance.
        Since:
        MicroStrategy Web 7.5.0
      • newURIBuilder

        protected ParameterBuilder newURIBuilder()
        Convenience method to retrieve a new instance of a URI Builder from the connected ContainerServices object. If anything fails along the way, returns a null object.
        Returns:
        the ParameterBuilder instance to use for building URIs.
        Since:
        MicroStrategy Web 8.0.0
      • newNamespaceEncoder

        protected NamespaceEncoder newNamespaceEncoder()
        Convenience method to retrieve a new instance of a NamespaceEncoder from the connected ContainerServices object. If anything fails along the way, returns a null object.
        Returns:
        The NamespaceEncoder instance to use for encoding names.
        Since:
        MicroStrategy Web 8.0.0
      • getUseCookie

        public boolean getUseCookie()
        Deprecated.
        - cookieless mode is no longer supported.
        Since:
        MicroStrategy Web 8.1.1