com.microstrategy.web.beans.WebComponent |
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
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
addChild(String key, WebComponent child)
adds a child WebComponent instance on the current WebComponent.
| ||||||||||
abstract void |
addChildStateInfo(ParameterBuilder paramBldr)
Adds children state information into an existing
ParameterBuilder instance. | ||||||||||
abstract void |
addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
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(String key)
Returns the child WebComponent instance specified by the key.
| ||||||||||
abstract WebComponent |
getChild(int index)
Returns the child WebComponent instance specified by the index.
| ||||||||||
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(String key)
removes a child WebComponent instance on the current WebComponent.
| ||||||||||
abstract WebComponent |
removeChild(WebComponent component)
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)
Sets the changed state of the component.
| ||||||||||
abstract void |
setChanged(boolean value, boolean forceRecurse)
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. |
adds a child WebComponent instance on the current WebComponent.
key | the key mapped to the child WebComponent. |
---|---|
child | the child WebComponent to add. |
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()
.
paramBldr | The ParameterBuilder instance which has child state information added to it. |
---|
Adds children state information into an existing ParameterBuilder
instance. It is up
to the supplied ParameterBuilder
to determine how this information is serialized.
paramBldr | The ParameterBuilder instance which has child state information added to it. |
---|---|
howMuchState | How much state is added. (see EnumWebPersistableState for details). |
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.
WebBeanException | thrown if there is any error collecting data. |
---|
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.
WebBeanException | thrown if an error occurs during this operation. |
---|
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)
).
MarkupOutput
object.
Returns an instance of BeanContext
.
BeanContext
.
Returns the child WebComponent instance specified by the key.
key | the key mapped to the child WebComponent. |
---|
Returns the child WebComponent instance specified by the index.
index | position of the instance of the collection to return. |
---|
Returns the child WebComponent instance specified by the class.
className | the className mapped to the WebComponent class name. |
---|
Returns the child WebComponent instance specified by the component type(EnumWebTransformableType
).
childType | the childType mapped to the WebComponent child type, a value from EnumWebTransformableType . |
---|
Returns the total number of children on the current WebComponent.
Returns a collection of children specified by the class name
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 |
Returns the default state level for the WebComponent. This value will come
from EnumWebPersistableState
.
EnumWebPersistableState
which indicates the default state level.
Return the WebFeatures implementation associated with this WebComponent
Returns the maximum state level that is supported by the WebComponent. This value will come
from EnumWebPersistableState
.
EnumWebPersistableState
which indicates the maximum state level
supported.
Returns the name of the current WebComponent.
Returns the output format of EnumBeanOutputFormat
of the current WebComponent.
EnumBeanOutputFormat
.
Returns the parent WebComponent of the current WebComponent.
Returns the path from the root WebComponent to the current WebComponent.
Returns the persist flag (EnumBeanPersistMode
) of the current WebComponent.
EnumBeanPersistMode
) of the current WebComponent.
returns the rendering filter.
Returns the root of the current WebComponent.
Get the target bean associated with this instance
WebComponent
instance associated with this bean.String
value with the name of the bean
defined to be associated with this instance, if any.Returns the WebEventHandler
instance associated with the current WebComponent.
WebEventHandler
instance.
This method returns the EnumRequestStatus
status of the current Component.
EnumRequestStatus
of the current page.
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.
keys | the RequestKeys instance. |
---|
WebBeanError
instance.WebException | if the any thing wrong in the RequestKeys , which is
not expected by this component or its event handlers.
|
---|
Verifies the state of the component has changed
true
if the component state has been changed.Verifies if the component has just been opened. This would mean that the current event processed would be an event to open this component.
true
if the component state has been opened.Initialize the component after it's created and its properties initialized
Invalidates the cached URL and hidden INPUT states of all the components, including the current component, along the path to the root component.
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
Verifies the feature provided is accesible based on the properties of this WebComponent
featureID | the name of the feature to check |
---|
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.
removes a child WebComponent instance on the current WebComponent.
key | the key mapped to the child WebComponent. |
---|
WebComponent
to be removed.removes a child WebComponent instance on the current WebComponent.
component | The reference to the component that needs to be removed. |
---|
WebComponent
to be removed.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.
key | the path to the child to be searched. |
---|
Sets an instance of BeanContext
on the current WebBean.
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 |
Sets an instance of BeanContext
on the current WebBean.
beanContext | the BeanContext instance to set.
|
---|
Sets the changed state of the component.
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) |
---|
Sets the changed state of the component
value | a boolean value indicating whether the component is changed |
---|---|
forceRecurse | boolean to indicate whether the value needs to be propogated to child components. |
Sets the default state level for the WebComponent. This value should come
from EnumWebPersistableState
.
stateLevel | A value from EnumWebPersistableState which indicates the default state level to use.
|
---|
Associate a WebFeatures implementation with this WebComponent
featuresManager | a WebFeatures object.
|
---|
Sets the name on the current WebComponent.
name | the name on the current WebComponent. |
---|
Sets the output format of EnumBeanOutputFormat
of the current WebComponent.
outputFormat | the output format of EnumBeanOutputFormat to set.
|
---|
Sets the parent WebComponent of the current WebComponent.
parent | the parent WebComponent of the current WebComponent. |
---|
Sets the persist flag (EnumBeanPersistMode
) of the current WebComponent.
persistFlag | the persist flag (EnumBeanPersistMode ) of the current
WebComponent.
|
---|
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.
renderingFilter | a Set of Strings representing beanNames |
---|
Set the target bean that will be associated with this instance.
bean | WebComponent instance to be associated with this bean. |
---|
Define the base bean for this instance.
beanName | String with the name of the bean (with path information
if necessary) to be set as the base
bean for this instance. |
---|
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.
handler | the WebEventHandler .
|
---|