public interface

WebComponent

com.microstrategy.web.beans.WebComponent
Known Indirect Subclasses

Class Overview

The WebComponent interface abstracts every component of a Web application. A page could be a WebComponent, so is a Servlet, a WebBean, etc. Except the root component, each individual WebComponent has a single parent WebComponent. Therefore each WebComponent has a unique path from the root to itself in a Web application.

In a Web application, a user interaction could be abstracted as a WebEvent. Each individual WebComponent may have a WebEventHandler associated with it. The WebEventHandler is capable of generating and handling a set of WebEvent. If necessary, a WebComponent itself can be designed to handle a WebEvent.

Summary

Public Methods
abstract void addChild(String key, WebComponent child)
adds a child WebComponent instance on the current WebComponent.
abstract void addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
Adds children state information into an existing ParameterBuilder instance.
abstract void addChildStateInfo(ParameterBuilder paramBldr)
Adds children state information into an existing ParameterBuilder instance.
abstract void collectData()
Triggers execution to the back end no matter whether it is synchronous or asynchronous.
abstract void collectMinimalData()
This is similar to collectData() except data collected is minimal.
abstract MarkupOutput generateOutput()
This is the generic method to ask the WebComponent to generate some output for the client.
abstract BeanContext getBeanContext()
Returns an instance of BeanContext.
abstract WebComponent getChild(int index)
Returns the child WebComponent instance specified by the index.
abstract WebComponent getChild(String key)
Returns the child WebComponent instance specified by the key.
abstract WebComponent getChildByClass(Class className)
Returns the child WebComponent instance specified by the class.
abstract WebComponent getChildByType(int childType)
Returns the child WebComponent instance specified by the component type(EnumWebTransformableType).
abstract int getChildCount()
Returns the total number of children on the current WebComponent.
abstract void getChildrenByClass(Class className, HashList retList, boolean recursive)
Returns a collection of children specified by the class name
abstract int getDefaultStateLevel()
Returns the default state level for the WebComponent.
abstract WebFeatures getFeaturesManager()
Return the WebFeatures implementation associated with this WebComponent
abstract int getMaximumStateLevel()
Returns the maximum state level that is supported by the WebComponent.
abstract String getName()
Returns the name of the current WebComponent.
abstract int getOutputFormat()
Returns the output format of EnumBeanOutputFormat of the current WebComponent.
abstract WebComponent getParent()
Returns the parent WebComponent of the current WebComponent.
abstract String getPath()
Returns the path from the root WebComponent to the current WebComponent.
abstract int getPersistMode()
Returns the persist flag (EnumBeanPersistMode) of the current WebComponent.
abstract Set getRenderingFilter()
returns the rendering filter.
abstract WebComponent getRoot()
Returns the root of the current WebComponent.
abstract WebComponent getTargetBean()
Get the target bean associated with this instance
abstract String getTargetBeanPath()
abstract WebEvent getWebEvent(int event, boolean recurse)
Returns the WebEvent instance with the specified event ID.
abstract WebEvent getWebEvent(int event)
Returns the WebEvent instance with the specified event ID.
abstract WebEventHandler getWebEventHandler()
Returns the WebEventHandler instance associated with the current WebComponent.
abstract int getXMLStatus()
This method returns the EnumRequestStatus status of the current Component.
abstract boolean handleRequest(RequestKeys keys)
Handles a request.
abstract boolean hasChanged()
Verifies the state of the component has changed
abstract boolean hasJustOpened()
Verifies if the component has just been opened.
abstract void initBean()
Initialize the component after it's created and its properties initialized
abstract 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.
abstract boolean isBeanContextEmpty()
Verifies if a bean context exists for the current WebComponent.
abstract boolean isFeatureAvailable(String featureID)
Verifies the feature provided is accesible based on the properties of this WebComponent
abstract 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.
abstract WebComponent removeChild(WebComponent component)
removes a child WebComponent instance on the current WebComponent.
abstract WebComponent removeChild(String key)
removes a child WebComponent instance on the current WebComponent.
abstract WebComponent searchChild(String key)
Returns the child WebComponent instance specified by the key.
abstract void setBeanContext(BeanContext beanContext, boolean propagate)
Sets an instance of BeanContext on the current WebBean.
abstract void setBeanContext(BeanContext beanContext)
Sets an instance of BeanContext on the current WebBean.
abstract void setChanged(boolean value, boolean forceRecurse)
Sets the changed state of the component
abstract void setChanged(boolean value)
Sets the changed state of the component.
abstract void setDefaultStateLevel(int stateLevel)
Sets the default state level for the WebComponent.
abstract void setFeaturesManager(WebFeatures featuresManager)
Associate a WebFeatures implementation with this WebComponent
abstract void setName(String name)
Sets the name on the current WebComponent.
abstract void setOutputFormat(int outputFormat)
Sets the output format of EnumBeanOutputFormat of the current WebComponent.
abstract void setParent(WebComponent parent)
Sets the parent WebComponent of the current WebComponent.
abstract void setPersistMode(int persistFlag)
Sets the persist flag (EnumBeanPersistMode) of the current WebComponent.
abstract void setRenderingFilter(Set renderingFilter)
Sets the list of beans to render.
abstract void setTargetBean(WebComponent bean)
Set the target bean that will be associated with this instance.
abstract void setTargetBeanPath(String beanName)
Define the base bean for this instance.
abstract void setWebEventHandler(WebEventHandler handler)
Sets a WebEventHandler on this component.

Public Methods

public abstract void addChild (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.

public abstract 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).

public abstract 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.

public abstract void collectData ()

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 getErrorInfo() for details.

Throws
WebBeanException thrown if there is any error collecting data.

public abstract void collectMinimalData ()

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 getErrorInfo() for details.

Throws
WebBeanException thrown if an error occurs during this operation.

public abstract 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

public abstract BeanContext getBeanContext ()

Returns an instance of BeanContext.

Returns

public abstract 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.

public abstract WebComponent getChild (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.

public abstract WebComponent getChildByClass (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.

public abstract 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.

public abstract int getChildCount ()

Returns the total number of children on the current WebComponent.

Returns
  • the number of child WebComponent.

public abstract void getChildrenByClass (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

public abstract int getDefaultStateLevel ()

Returns the default state level for the WebComponent. This value will come from EnumWebPersistableState.

Returns

public abstract WebFeatures getFeaturesManager ()

Return the WebFeatures implementation associated with this WebComponent

Returns
  • a WebFeatures instance

public abstract int getMaximumStateLevel ()

Returns the maximum state level that is supported by the WebComponent. This value will come from EnumWebPersistableState.

Returns

public abstract String getName ()

Returns the name of the current WebComponent.

Returns
  • the name of the current WebComponent.

public abstract int getOutputFormat ()

Returns the output format of EnumBeanOutputFormat of the current WebComponent.

Returns

public abstract WebComponent getParent ()

Returns the parent WebComponent of the current WebComponent.

Returns
  • the parent WebComponent of the current WebComponent.

public abstract String getPath ()

Returns the path from the root WebComponent to the current WebComponent.

Returns
  • the path from the root WebComponent to the current WebComponent.

public abstract int getPersistMode ()

Returns the persist flag (EnumBeanPersistMode) of the current WebComponent.

Returns

public abstract Set getRenderingFilter ()

returns the rendering filter.

Returns
  • rendering filter.

public abstract WebComponent getRoot ()

Returns the root of the current WebComponent.

Returns
  • root web component

public abstract WebComponent getTargetBean ()

Get the target bean associated with this instance

Returns

public abstract String getTargetBeanPath ()

Returns
  • a String value with the name of the bean defined to be associated with this instance, if any.

public abstract 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

public abstract WebEvent getWebEvent (int event)

Returns the WebEvent instance with the specified event ID.

Parameters
event the event ID of a WebEvent instance
Returns

public abstract WebEventHandler getWebEventHandler ()

Returns the WebEventHandler instance associated with the current WebComponent.

Returns

public abstract int getXMLStatus ()

This method returns the EnumRequestStatus status of the current Component.

Returns

public abstract boolean handleRequest (RequestKeys keys)

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.

public abstract boolean hasChanged ()

Verifies the state of the component has changed

Returns
  • true if the component state has been changed.

public abstract 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.

public abstract void initBean ()

Initialize the component after it's created and its properties initialized

public abstract 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.

public abstract 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

public abstract boolean isFeatureAvailable (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

public abstract 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.

public abstract 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.

public abstract WebComponent removeChild (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.

public abstract WebComponent searchChild (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.

public abstract 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

public abstract void setBeanContext (BeanContext beanContext)

Sets an instance of BeanContext on the current WebBean.

Parameters
beanContext the BeanContext instance to set.

public abstract 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.

public abstract 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)

public abstract 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.

public abstract void setFeaturesManager (WebFeatures featuresManager)

Associate a WebFeatures implementation with this WebComponent

Parameters
featuresManager a WebFeatures object.

public abstract void setName (String name)

Sets the name on the current WebComponent.

Parameters
name the name on the current WebComponent.

public abstract void setOutputFormat (int outputFormat)

Sets the output format of EnumBeanOutputFormat of the current WebComponent.

Parameters
outputFormat the output format of EnumBeanOutputFormat to set.

public abstract void setParent (WebComponent parent)

Sets the parent WebComponent of the current WebComponent.

Parameters
parent the parent WebComponent of the current WebComponent.

public abstract void setPersistMode (int persistFlag)

Sets the persist flag (EnumBeanPersistMode) of the current WebComponent.

Parameters
persistFlag the persist flag (EnumBeanPersistMode) of the current WebComponent.

public abstract void setRenderingFilter (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

public abstract 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.

public abstract void setTargetBeanPath (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.

public abstract 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.