Interface WebComponent

    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name of the current WebComponent.
        Returns:
        the name of the current WebComponent.
      • setName

        void setName​(java.lang.String name)
        Sets the name on the current WebComponent.
        Parameters:
        name - the name on the current WebComponent.
      • getParent

        WebComponent getParent()
        Returns the parent WebComponent of the current WebComponent.
        Returns:
        the parent WebComponent of the current WebComponent.
      • setParent

        void setParent​(WebComponent parent)
        Sets the parent WebComponent of the current WebComponent.
        Parameters:
        parent - the parent WebComponent of the current WebComponent.
      • getRoot

        WebComponent getRoot()
        Returns the root of the current WebComponent.
        Returns:
        root web component
      • getPath

        java.lang.String getPath()
        Returns the path from the root WebComponent to the current WebComponent.
        Returns:
        the path from the root WebComponent to the current WebComponent.
      • getWebEvent

        WebEvent getWebEvent​(int event)
        Returns the WebEvent instance with the specified event ID.
        Parameters:
        event - the event ID of a WebEvent instance
        Returns:
        a WebEvent instance
      • getWebEvent

        WebEvent getWebEvent​(int event,
                             boolean recurse)
        Returns the WebEvent instance with the specified event ID.
        Parameters:
        event - the event ID of a WebEvent instance
        recurse - boolean indicating that all the other child components need to be searched if the search for the event in the parent fails
        Returns:
        a WebEvent instance
      • handleRequest

        boolean handleRequest​(RequestKeys keys)
                       throws WebException
        Handles a request. The RequestKeys contains information about WebEvent, such as event ID, event arguments, etc. The current WebComponent may decide to handle this request if it can, or deligate to its WebEventHandler attached.
        Parameters:
        keys - the RequestKeys instance.
        Returns:
        true if the request is handled, false if the current WebComponent decides not to handle it. Any backend error occurred in handling the request is returned as a WebBeanError instance.
        Throws:
        WebException - if the any thing wrong in the RequestKeys, which is not expected by this component or its event handlers.
      • setWebEventHandler

        void setWebEventHandler​(WebEventHandler handler)
        Sets a WebEventHandler on this component. A web component has one to one relationship with a WebEventHandler instance. After this method call, the previous WebEventHandler associated with the current component will have no web component associated with, neither will the previous component associated with handler have any WebEventHandler associated with.

        This method calls the method setWebComponent. Therefore, WebEventHandler implementator should pay attention to avoid cyclic reference to each other between this component and the event handler.

        Parameters:
        handler - the WebEventHandler.
      • getChildCount

        int getChildCount()
        Returns the total number of children on the current WebComponent.
        Returns:
        the number of child WebComponent.
      • addChildStateInfo

        void addChildStateInfo​(ParameterBuilder paramBldr,
                               int howMuchState)
        Adds children state information into an existing ParameterBuilder instance. It is up to the supplied ParameterBuilder to determine how this information is serialized.
        Parameters:
        paramBldr - The ParameterBuilder instance which has child state information added to it.
        howMuchState - How much state is added. (see EnumWebPersistableState for details).
        Since:
        MicroStrategy Web 8.0.0
      • addChildStateInfo

        void addChildStateInfo​(ParameterBuilder paramBldr)
        Adds children state information into an existing ParameterBuilder instance. It is up to the supplied ParameterBuilder to determine how this information is serialized. Each WebComponent the hierarchy serializes its state according to its own getDefaultStateLevel().
        Parameters:
        paramBldr - The ParameterBuilder instance which has child state information added to it.
        Since:
        MicroStrategy Web 9.0.0
      • getChildByType

        WebComponent getChildByType​(int childType)
        Returns the child WebComponent instance specified by the component type(EnumWebTransformableType).
        Parameters:
        childType - the childType mapped to the WebComponent child type, a value from EnumWebTransformableType.
        Returns:
        the child WebComponent instance; null if the childType is not mapped to any child WebComponent.
      • getChildByClass

        WebComponent getChildByClass​(java.lang.Class className)
        Returns the child WebComponent instance specified by the class.
        Parameters:
        className - the className mapped to the WebComponent class name.
        Returns:
        the child WebComponent instance; null if the className is not mapped to any child WebComponent.
        Since:
        MicroStrategy Web 8.0.0
      • getChild

        WebComponent getChild​(java.lang.String key)
        Returns the child WebComponent instance specified by the key.
        Parameters:
        key - the key mapped to the child WebComponent.
        Returns:
        the child WebComponent instance; null if the key is not mapped to any child WebComponent.
      • getChild

        WebComponent getChild​(int index)
        Returns the child WebComponent instance specified by the index.
        Parameters:
        index - position of the instance of the collection to return.
        Returns:
        the child WebComponent instance; null if the index is out of bounds.
      • searchChild

        WebComponent searchChild​(java.lang.String key)
        Returns the child WebComponent instance specified by the key. If the WebComponent is not found within this object's children it will propagate this to them recursively.
        Parameters:
        key - the path to the child to be searched.
        Returns:
        the child WebComponent instance; null if the index is out of bounds.
      • getChildrenByClass

        void getChildrenByClass​(java.lang.Class className,
                                HashList retList,
                                boolean recursive)
        Returns a collection of children specified by the class name
        Parameters:
        className - the className mapped to the WebComponent class name
        retList - the HashList to fill with the children
        recursive - boolean to Search the children recursively or not
        Since:
        MicroStrategy Web 8.0.0
      • addChild

        void addChild​(java.lang.String key,
                      WebComponent child)
        adds a child WebComponent instance on the current WebComponent.
        Parameters:
        key - the key mapped to the child WebComponent.
        child - the child WebComponent to add.
      • removeChild

        WebComponent removeChild​(java.lang.String key)
        removes a child WebComponent instance on the current WebComponent.
        Parameters:
        key - the key mapped to the child WebComponent.
        Returns:
        the child WebComponent to be removed.
      • removeChild

        WebComponent removeChild​(WebComponent component)
        removes a child WebComponent instance on the current WebComponent.
        Parameters:
        component - The reference to the component that needs to be removed.
        Returns:
        the child WebComponent to be removed.
      • setPersistMode

        void setPersistMode​(int persistFlag)
        Sets the persist flag (EnumBeanPersistMode) of the current WebComponent.
        Parameters:
        persistFlag - the persist flag (EnumBeanPersistMode) of the current WebComponent.
      • getPersistMode

        int getPersistMode()
        Returns the persist flag (EnumBeanPersistMode) of the current WebComponent.
        Returns:
        the persist flag (EnumBeanPersistMode) of the current WebComponent.
      • getMaximumStateLevel

        int getMaximumStateLevel()
        Returns the maximum state level that is supported by the WebComponent. This value will come from EnumWebPersistableState.
        Returns:
        A value from EnumWebPersistableState which indicates the maximum state level supported.
      • getDefaultStateLevel

        int getDefaultStateLevel()
        Returns the default state level for the WebComponent. This value will come from EnumWebPersistableState.
        Returns:
        A value from EnumWebPersistableState which indicates the default state level.
      • setDefaultStateLevel

        void setDefaultStateLevel​(int stateLevel)
        Sets the default state level for the WebComponent. This value should come from EnumWebPersistableState.
        Parameters:
        stateLevel - A value from EnumWebPersistableState which indicates the default state level to use.
      • setOutputFormat

        void setOutputFormat​(int outputFormat)
        Sets the output format of EnumBeanOutputFormat of the current WebComponent.
        Parameters:
        outputFormat - the output format of EnumBeanOutputFormat to set.
      • generateOutput

        MarkupOutput generateOutput()
        This is the generic method to ask the WebComponent to generate some output for the client. The type of output should be determined by the OutputFormat property (setOutputFormat(int)).
        Returns:
        a MarkupOutput object.
      • setBeanContext

        void setBeanContext​(BeanContext beanContext)
        Sets an instance of BeanContext on the current WebBean.
        Parameters:
        beanContext - the BeanContext instance to set.
      • setBeanContext

        void setBeanContext​(BeanContext beanContext,
                            boolean propagate)
        Sets an instance of BeanContext on the current WebBean.
        Parameters:
        beanContext - the BeanContext instance to set.
        propagate - if true, the same context is set on the bean's children, if false, the context is set only if a child bean's context is empty
        Since:
        MicroStrategy Web 9.0.0
      • invalidateChildrenState

        void invalidateChildrenState()
        Invalidates the cached URL and hidden INPUT states of all the components, including the current component, along the path to the root component.
      • collectData

        void collectData()
                  throws WebBeanException
        Triggers execution to the back end no matter whether it is synchronous or asynchronous. If this method fails to collect data, an exception is raised and saved in a WebBeanError instance. After invoking this operation, see getXMLStatus() and WebBean.getErrorInfo() for details.
        Throws:
        WebBeanException - thrown if there is any error collecting data.
      • collectMinimalData

        void collectMinimalData()
                         throws WebBeanException
        This is similar to collectData() except data collected is minimal. This is essentially a check to ensure everything is ok, but that we don't need any data. After invoking this operation, see getXMLStatus() and WebBean.getErrorInfo() for details.
        Throws:
        WebBeanException - thrown if an error occurs during this operation.
        Since:
        MicroStrategy Web 9.0.0
      • isFeatureAvailable

        boolean isFeatureAvailable​(java.lang.String featureID)
        Verifies the feature provided is accesible based on the properties of this WebComponent
        Parameters:
        featureID - the name of the feature to check
        Returns:
        boolean indicating is the feature is accesible or not
      • setFeaturesManager

        void setFeaturesManager​(WebFeatures featuresManager)
        Associate a WebFeatures implementation with this WebComponent
        Parameters:
        featuresManager - a WebFeatures object.
      • getFeaturesManager

        WebFeatures getFeaturesManager()
        Return the WebFeatures implementation associated with this WebComponent
        Returns:
        a WebFeatures instance
      • hasChanged

        boolean hasChanged()
        Verifies the state of the component has changed
        Returns:
        true if the component state has been changed.
        Since:
        MicroStrategy Web 8.0.0
      • hasJustOpened

        boolean hasJustOpened()
        Verifies if the component has just been opened. This would mean that the current event processed would be an event to open this component.
        Returns:
        true if the component state has been opened.
        Since:
        MicroStrategy Web 8.0.0
      • setChanged

        void setChanged​(boolean value)
        Sets the changed state of the component.
        Parameters:
        value - a boolean value indicating whether the component should be marked as changed. Only a value of "true" is propogated to child components. To force propogation, use setChanged(boolean, boolean)
        Since:
        MicroStrategy Web 8.0.0
      • setChanged

        void setChanged​(boolean value,
                        boolean forceRecurse)
        Sets the changed state of the component
        Parameters:
        value - a boolean value indicating whether the component is changed
        forceRecurse - boolean to indicate whether the value needs to be propogated to child components.
        Since:
        MicroStrategy Web 9.0.0
      • setRenderingFilter

        void setRenderingFilter​(java.util.Set renderingFilter)
        Sets the list of beans to render. The idea here is that, sometimes during an iframe request even though a bean has changed, there might be some beans (e.g. Toolbar) who should'nt need to render themselves just because they have this component as their targetBeanPath. renderingFilter should help control that.
        Parameters:
        renderingFilter - a Set of Strings representing beanNames
        Since:
        MicroStrategy Web 8.1.0
      • getRenderingFilter

        java.util.Set getRenderingFilter()
        returns the rendering filter.
        Returns:
        rendering filter.
        Since:
        MicroStrategy Web 8.1.0
      • isBeanContextEmpty

        boolean isBeanContextEmpty()
        Verifies if a bean context exists for the current WebComponent. This method exists because getBeanContext will automatically create a default bean context. Hence we cannot getBeanContext check if it is null
        Since:
        MicroStrategy Web 9.0.0
      • setTargetBeanPath

        void setTargetBeanPath​(java.lang.String beanName)
        Define the base bean for this instance.
        Parameters:
        beanName - String with the name of the bean (with path information if necessary) to be set as the base bean for this instance.
        Since:
        MicroStrategy Web 9.0.0
      • getTargetBeanPath

        java.lang.String getTargetBeanPath()
        Returns:
        a String value with the name of the bean defined to be associated with this instance, if any.
        Since:
        MicroStrategy Web 9.0.0
      • setTargetBean

        void setTargetBean​(WebComponent bean)
        Set the target bean that will be associated with this instance.
        Parameters:
        bean - WebComponent instance to be associated with this bean.
        Since:
        MicroStrategy Web 9.0.0
      • getTargetBean

        WebComponent getTargetBean()
        Get the target bean associated with this instance
        Returns:
        WebComponent instance associated with this bean.
        Since:
        MicroStrategy Web 9.0.0
      • prepareForReuse

        void prepareForReuse()
        If a Web Component instance is going to be reused across different requests, this API serves as a notifier to the component to do the necessary cleanup.
        Since:
        MicroStrategy Web 9.0.0
      • initBean

        void initBean()
        Initialize the component after it's created and its properties initialized