Class EventInfo

  • All Implemented Interfaces:
    ConfigurationElement, ConfigurationFile, java.lang.Cloneable

    public class EventInfo
    extends AbstractConfigurationElement
    This class represents the "event" node from the XML. Each event is identified by its id and holds a list of all the arguments associated with the event. Children : The arguments node which holds the list of all the arguments. Attributes: "id" - The event id "name" - The name of the event "target" - The target for the event "event-class" - A fully qualified class name of the concrete WebEvent that should be instantiated for this event. Key : "id" attribute.
    Since:
    MicroStrategy Web 9.0.0
    • Constructor Detail

      • EventInfo

        public EventInfo()
        Default constructor. Set the node name and register the child element
      • EventInfo

        public EventInfo​(int id)
        Constructor: Set the id field for the event
        Parameters:
        id - The event "id" for this object
      • EventInfo

        public EventInfo​(int id,
                         java.lang.String name)
        Set the id and name for the event
        Parameters:
        id - The event "id" for this object
        name - The event "name" for this object
      • EventInfo

        public EventInfo​(int id,
                         java.lang.String name,
                         java.lang.String target)
        Set the id, name and target for the event
        Parameters:
        id - The event "id" for this object
        name - The event "name" for this object
        target - The event "target" for this object
    • Method Detail

      • getKeyAttribute

        protected java.lang.String getKeyAttribute()
        Description copied from class: AbstractConfigurationElement
        This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
        Specified by:
        getKeyAttribute in class AbstractConfigurationElement
      • getID

        public int getID()
        Return the id field value. The id uniquely identifies the event across the application.
        Returns:
        The "id" associated with this event
      • setID

        public void setID​(int id)
        Sets the id field value. The id most be unique across the application.
        Parameters:
        id - The new value for the "id" attribute
      • getName

        public java.lang.String getName()
        Returns the name field value. The name can be used to identify the action associated with the event
        Returns:
        The "name" associated with this event
      • setName

        public void setName​(java.lang.String name)
        Sets the name field value. Set the name to identify the action associated with this event.
        Parameters:
        name - The new value for the "name" attribute
      • getTarget

        public java.lang.String getTarget()
        Returns the target field value. The target indicates the bean (if other than the source bean) who should handle the request for this event.
        Returns:
        The "target" associated with this event
      • setTarget

        public void setTarget​(java.lang.String target)
        Set the target field value. The target indicates the bean (if other than the source bean) who should handle the request for this event.
        Parameters:
        target - The new value for the "target" attribute
      • getWindow

        public java.lang.String getWindow()
        Returns the window attribute value. The window identifies the browser's window name where the event should be open when triggered.
      • setWindow

        public void setWindow​(java.lang.String value)
        Set the window attribute. The window identifies the browser's window name where the event should be open when triggered. To always open in a new window, use "_blank"; if no value is specified it opens in the current window.
      • setDeprecated

        public void setDeprecated​(java.lang.String message)
        Sets the deprecated field value. When an event is marked as deprecated and the events is used, the deprecated message is log as a warning. The event will still be executed.
        Parameters:
        message - The message to display indicating the event has been deprecated.
      • getDeprecated

        public java.lang.String getDeprecated()
        Returns the deprecated field value. When an event is marked as deprecated and the events is used, the deprecated message is log as a warning. The event will still be executed. If the event is not deprecated, this method returns null
      • setEventClass

        public void setEventClass​(java.lang.String value)
        Indicates the fully qualified class name of the a class that implements WebEvent and that should be instantiated when creating concrete WebEvent instances for this EventInfo.
      • getEventClass

        public java.lang.String getEventClass()
        Returns the fully qualified class name of the a class that implements WebEvent and that should be instantiated when creating concrete WebEvent instances for this EventInfo. If an event-class is not specified, is up to the EventHandler to decide what class to use (typically GenericWebEvent).
      • getArgument

        public EventArgumentInfo getArgument​(int argID)
        Return the event argument with the given id from the arguments list
        Parameters:
        argID - The id for the argument to be returned
        Returns:
        The event argument with the given id
      • deleteArgument

        public void deleteArgument​(int id)
        Delete the argument with the given id. This is a shortcut to EventArgumentInfoList#deleteArgument()
        Parameters:
        id - The id of the argument to be deleted
      • newArgument

        public EventArgumentInfo newArgument​(int id)
        Create a new argument and add it to the arguments list. This is a shortcut method to EventArgumentInfoList#newArgument()
        Parameters:
        id - The id (key) for the new argument to be created
        Returns:
        The new argument created and added to the list with the given id
      • getArguments

        public EventArgumentInfoList getArguments()
        Return the list of arguments associated with this event
        Returns:
        The arguments list for this event