Class AbstractWebComponent
- java.lang.Object
-
- com.microstrategy.utils.serialization.AbstractPersistable
-
- com.microstrategy.web.beans.AbstractTransformable
-
- com.microstrategy.web.beans.AbstractWebComponent
-
- All Implemented Interfaces:
EnumWebPersistableState
,Persistable
,Transformable
,WebComponent
- Direct Known Subclasses:
AbstractAppComponent
,AbstractLimitExpressionBean
,AssociatedSchedulesBeanImpl
,DerivedElementBeanImpl
,ThresholdExpressionBeanImpl
public abstract class AbstractWebComponent extends AbstractTransformable implements WebComponent
This class provides a skeletal implementation of theWebComponent
interface to minimize the effort required to implement this interface.A WebComponent maintains a cache of component state for itself. Any structural modification to the component should invalidate this cached state.
- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected WebFeatures
_features
Represents aWebFeatures
protected boolean
_hasJustOpened
-
Fields inherited from class com.microstrategy.web.beans.AbstractTransformable
_beanContext
-
Fields inherited from class com.microstrategy.utils.serialization.AbstractPersistable
scriptEndTagEncoder
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractWebComponent()
Default constructor, setting the component name to 'wc' followed a unique id.protected
AbstractWebComponent(boolean needEventHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(java.lang.String key, WebComponent child)
Adds a child component to the currentWebComponent
.void
addChildStateInfo(ParameterBuilder paramBldr)
Adds children state information into an existingParameterBuilder
instance.void
addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
Adds children state information into an existingParameterBuilder
instance.protected void
addChildStateInfo(ParameterBuilder paramBldr, WebComponent wc)
void
addChildStateInfo(ParameterBuilder paramBldr, java.lang.String state)
void
addChildStateInfo(ParameterBuilder paramBldr, java.lang.String state, int howMuchState)
Adds children state information into an existingParameterBuilder
instance.protected void
addStateInfo(ParameterBuilder paramBldr, int howMuchState)
protected java.util.Collection
childValues()
void
clearChildren()
Removes all the child component instances from this component.protected void
clearStateCache(int howMuchToClear)
Clears the cached state for the current component only, without touching any child component's state.void
collectData()
Triggers execution to the back end no matter whether it is synchronous or asynchronous.void
collectMinimalData()
This is similar toWebComponent.collectData()
except data collected is minimal.protected java.lang.String
getCachedState(int whatState)
Return the cached state specified by thewhatState
.WebComponent
getChild(int index)
Returns the childWebComponent
specified by the index.WebComponent
getChild(java.lang.String path)
Returns the bottom child component at the specified path.WebComponent
getChildByClass(java.lang.Class classInstance)
Returns the child WebComponent instance specified by the class.WebComponent
getChildByType(int childType)
Returns the child WebComponent instance specified by the type.int
getChildCount()
Returns the total number of child component in the current WebComponent.void
getChildrenByClass(java.lang.Class classInstance, HashList retList, boolean recursive)
Returns the child WebComponent instance specified by the class.int
getDefaultStateLevel()
Returns the default state level.WebFeatures
getFeaturesManager()
Return the WebFeatures implementation associated with this WebComponentint
getMaximumStateLevel()
Returns either the default state level of the current component or the maximum state level among the current component and its child components, whichever is greater.java.lang.String
getName()
Returns the name of the current component.int
getOutputFormat()
Returns the output format ofEnumBeanOutputFormat
of the current WebComponent.WebComponent
getParent()
Returns the parent component of this component.java.lang.String
getPath()
Returns the path, starting from the root component to this component.int
getPersistMode()
Returns the persist flag (EnumBeanPersistMode
) of the current WebComponent.java.util.Set
getRenderingFilter()
returns the rendering filter.WebComponent
getRoot()
Returns the root component reachable from the current component.WebComponent
getTargetBean()
Get the target bean associated with this instancejava.lang.String
getTargetBeanPath()
WebEvent
getWebEvent(int eventID)
Returns theWebEvent
denoted by the event ID.WebEvent
getWebEvent(int eventID, boolean recurse)
Returns theWebEvent
denoted by the event ID.WebEventHandler
getWebEventHandler()
Returns theWebEventHandler
instance associated with this component.boolean
handleRequest(RequestKeys keys)
Handles the request specified by theRequestKeys
instance.boolean
hasChanged()
Verifies the state of the component has changedboolean
hasJustOpened()
Verifies if the component has just been opened.protected boolean
haveChildrenChanged()
void
initBean()
Initialize the component after it's created and its properties initializedvoid
invalidateChildrenState()
Invalidates the cached state of a component and its children.boolean
isBeanContextEmpty()
Verifies if a bean context exists for the current WebComponent.protected boolean
isChangeComparisonFlagSet(int stateFlag)
boolean
isFeatureAvailable(java.lang.String featureList)
Verifies if the corresponding feature(s) is accesible based on the properties of this WebComponent.protected WebEventHandler
newDefaultEventHandler()
protected StyleRequestContext
newStyleRequestContext()
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.WebComponent
removeChild(WebComponent component)
Removes the specified child component from the current component.WebComponent
removeChild(java.lang.String key)
Removes the specified child component from the current component.boolean
restoreState(java.lang.String state)
Restores a component based on its saved state.boolean
restoreStateFromRequest(RequestKeys rk)
Restores this component from the saved state keyed by this component's name in theRequestKeys
object.boolean
restoreStateFromRequest(RequestKeys rk, java.lang.String keyName)
Restores this component from the saved state keyed by keyName in theRequestKeys
object.protected void
saveXMLState(XMLStateSerializer builder, int howMuchState)
Saves the component stateprotected void
saveXMLState(XMLStateSerializer builder, int howMuchState, int stateFlag)
Saves the component stateprotected void
saveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)
Saves the component state in the providedStringBuffer
WebComponent
searchChild(java.lang.String key)
Searches whole hierarchy rooted at the current component for the child component specified the key and returns the search result.void
setBeanContext(BeanContext beanContext)
Sets an instance ofBeanContext
on the current WebBean.void
setBeanContext(BeanContext beanContext, boolean forceUpdateChildren)
Sets an instance ofBeanContext
on the current WebBean.void
setChanged(boolean value)
Sets the changed state of the componentvoid
setChanged(boolean value, boolean recurse)
Sets the changed state of the componentvoid
setDefaultStateLevel(int stateLevel)
Set the default state level.void
setFeaturesManager(WebFeatures featuresManager)
Associates a WebFeatures implementation with this WebComponentvoid
setName(java.lang.String name)
Sets the name for the current component.void
setOutputFormat(int outputFormat)
Sets the output format ofEnumBeanOutputFormat
for the current WebComponent.void
setParent(WebComponent parentComponent)
Sets the parent component for the current componentvoid
setPersistMode(int persistFlag)
Sets the persist flag (EnumBeanPersistMode
) of the current WebComponent.void
setRenderingFilter(java.util.Set renderingFilter)
Sets the list of beans to render.protected void
setStateCache(int whatState, java.lang.String stateToSave)
Caches the state specified by whatState.void
setTargetBean(WebComponent bean)
Set the target bean that will be associated with this instance.void
setTargetBeanPath(java.lang.String beanName)
Define the base bean for this instance.void
setWebEventHandler(WebEventHandler eventHandler)
Associate with this component aWebEventHandler
instance.-
Methods inherited from class com.microstrategy.web.beans.AbstractTransformable
addTransform, addTransform, addTransformByClass, addTransformByStyle, addTransformByStyle, clearTransforms, createTransformInstance, createTransformInstance, getBeanContext, getDefaultTransform, getMessageString, getMyTransformInstances, getTransformInstance, getTransformInstance, getTransformInstances, hasTransform, hasTransform, internalCollectData, internalCollectData, internalCollectData, invalidateTransformCache, isTransformSuitable, newDefaultBeanContext, transform, transform, transform, transform
-
Methods inherited from class com.microstrategy.utils.serialization.AbstractPersistable
doFlatState, doFlatState, getStateHandler, isXMLStateZipped, restoreState, restoreXMLState, saveState, saveState, saveState, saveState, saveXMLState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
getType
-
Methods inherited from interface com.microstrategy.web.beans.WebComponent
generateOutput, getBeanContext, getXMLStatus
-
-
-
-
Field Detail
-
_hasJustOpened
protected boolean _hasJustOpened
- Since:
- MicroStrategy Web 8.1.1
-
_features
protected WebFeatures _features
Represents aWebFeatures
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the current component.- Specified by:
getName
in interfaceWebComponent
- Returns:
- the name of this component.
-
collectData
public 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.- Specified by:
collectData
in interfaceWebComponent
- Throws:
WebBeanException
- thrown if there is any exception
-
collectMinimalData
public void collectMinimalData() throws WebBeanException
Description copied from interface:WebComponent
This is similar toWebComponent.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, seeWebComponent.getXMLStatus()
andWebBean.getErrorInfo()
for details.- Specified by:
collectMinimalData
in interfaceWebComponent
- Throws:
WebBeanException
- thrown if an error occurs during this operation.- Since:
- MicroStrategy Web 9.0.0
-
setName
public void setName(java.lang.String name)
Sets the name for the current component.- Specified by:
setName
in interfaceWebComponent
- Parameters:
name
- the name of the current component.
-
getParent
public WebComponent getParent()
Returns the parent component of this component.- Specified by:
getParent
in interfaceWebComponent
- Returns:
- the parent component.
-
setParent
public void setParent(WebComponent parentComponent)
Sets the parent component for the current component- Specified by:
setParent
in interfaceWebComponent
- Parameters:
parentComponent
- the parent component.
-
setBeanContext
public void setBeanContext(BeanContext beanContext)
Description copied from class:AbstractTransformable
Sets an instance ofBeanContext
on the current WebBean.- Specified by:
setBeanContext
in interfaceTransformable
- Specified by:
setBeanContext
in interfaceWebComponent
- Overrides:
setBeanContext
in classAbstractTransformable
- Parameters:
beanContext
- theBeanContext
instance to set.- Since:
- MicroStrategy Web 9.0.0
- See Also:
WebComponent.setBeanContext(com.microstrategy.web.beans.BeanContext)
-
setBeanContext
public void setBeanContext(BeanContext beanContext, boolean forceUpdateChildren)
Description copied from interface:WebComponent
Sets an instance ofBeanContext
on the current WebBean.- Specified by:
setBeanContext
in interfaceWebComponent
- Parameters:
beanContext
- theBeanContext
instance to set.forceUpdateChildren
- 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
-
setTargetBeanPath
public void setTargetBeanPath(java.lang.String beanName)
Define the base bean for this instance.- Specified by:
setTargetBeanPath
in interfaceWebComponent
- 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
public java.lang.String getTargetBeanPath()
- Specified by:
getTargetBeanPath
in interfaceWebComponent
- 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
public void setTargetBean(WebComponent bean)
Set the target bean that will be associated with this instance.- Specified by:
setTargetBean
in interfaceWebComponent
- Parameters:
bean
-WebComponent
instance to be associated with this bean.- Since:
- MicroStrategy Web 9.0.0
-
getTargetBean
public WebComponent getTargetBean()
Get the target bean associated with this instance- Specified by:
getTargetBean
in interfaceWebComponent
- Returns:
WebComponent
instance associated with this bean. By default if the base bean property has been defined, the target bean to return is the corresponding instance associated with the name and path specified. If nothing has been specified then it will return the firstEnumWebTransformableType.WEB_BEAN_REPORT
,EnumWebTransformableType.WEB_BEAN_DOCUMENT
orEnumWebTransformableType.WEB_BEAN_RW
instance found.- Since:
- MicroStrategy Web 9.0.0
-
isBeanContextEmpty
public boolean isBeanContextEmpty()
Description copied from interface:WebComponent
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- Specified by:
isBeanContextEmpty
in interfaceWebComponent
- Since:
- MicroStrategy Web 9.0.0
- See Also:
WebComponent.isBeanContextEmpty()
-
getRoot
public WebComponent getRoot()
Returns the root component reachable from the current component. This method returns itself if it does not have any parent.- Specified by:
getRoot
in interfaceWebComponent
- Returns:
- the root component; itself if there is not parent.
-
getPath
public java.lang.String getPath()
Returns the path, starting from the root component to this component. The path is reprensented by component names and separated by the character dot.- Specified by:
getPath
in interfaceWebComponent
- Returns:
- the path to the current component, reachable from the root component.
-
getWebEvent
public WebEvent getWebEvent(int eventID)
Returns theWebEvent
denoted by the event ID. This method queries the current component first, and then turns to ask for its parent component if the current component does not support the specified event, until it reaches the root component.- Specified by:
getWebEvent
in interfaceWebComponent
- Parameters:
eventID
- the event ID associated with aWebEvent
.- Returns:
- a WebEvent denoted by the event ID. null if there is no such an event.
-
getWebEvent
public WebEvent getWebEvent(int eventID, boolean recurse)
Returns theWebEvent
denoted by the event ID. This method queries the current component first, and then turns to ask for its parent component if the current component does not support the specified event, until it reaches the root component. If the event is still not found and the parameter recurse istrue
, then it starts to search the whole hierarchy in depth-first pattern.- Specified by:
getWebEvent
in interfaceWebComponent
- Parameters:
eventID
- the event id to search.recurse
- true if the search is recursive.- Returns:
- the specified WebEvent; null if there is no such an event existing.
-
getWebEventHandler
public WebEventHandler getWebEventHandler()
Returns theWebEventHandler
instance associated with this component.- Specified by:
getWebEventHandler
in interfaceWebComponent
- Returns:
- the WebEventHandler; null if it does not exist.
-
setWebEventHandler
public void setWebEventHandler(WebEventHandler eventHandler)
Associate with this component aWebEventHandler
instance.A WebComponent has one to one relationship with a WebEventHandler instance. This method first removes any existing handler associated with this component, and then sets the new one on it.
This method calls the method
WebEventHandler.setWebComponent(com.microstrategy.web.beans.WebComponent)
. Therefore, the WebEventHandler implementator should be careful to avoid cyclic reference to each other between this component and the event handler.- Specified by:
setWebEventHandler
in interfaceWebComponent
- Parameters:
eventHandler
- the WebEventHandler instance to set.
-
handleRequest
public boolean handleRequest(RequestKeys keys) throws WebException
Handles the request specified by theRequestKeys
instance. The RequestKeys object might contain all information sent from the Web browser along with any cookies, session variables, etc. Most importantly, it containsWebEvent
related information. If this instance in the namespace of the src request key attribute, it will forward the request to its associated event handler.- Specified by:
handleRequest
in interfaceWebComponent
- Parameters:
keys
- theRequestKeys
object.- Returns:
- true if the request is successfully handled; false if the request or event is not supported.
- Throws:
WebException
- thrown if there is any error occurred when handling the request.
-
getChildCount
public int getChildCount()
Returns the total number of child component in the current WebComponent.- Specified by:
getChildCount
in interfaceWebComponent
- Returns:
- the number of children.
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
Adds children state information into an existingParameterBuilder
instance. It is up to the suppliedParameterBuilder
to determine how this information is serialized.- Specified by:
addChildStateInfo
in interfaceWebComponent
- Parameters:
paramBldr
- TheParameterBuilder
instance which has child state information added to it.howMuchState
- How much state is added. (seeEnumWebPersistableState
for details).- Since:
- MicroStrategy Web 8.0.0
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr)
Description copied from interface:WebComponent
Adds children state information into an existingParameterBuilder
instance. It is up to the suppliedParameterBuilder
to determine how this information is serialized. EachWebComponent
the hierarchy serializes its state according to its ownWebComponent.getDefaultStateLevel()
.- Specified by:
addChildStateInfo
in interfaceWebComponent
- Parameters:
paramBldr
- TheParameterBuilder
instance which has child state information added to it.- Since:
- MicroStrategy Web 9.0.0
-
addChildStateInfo
protected void addChildStateInfo(ParameterBuilder paramBldr, WebComponent wc)
- Since:
- MicroStrategy Web 9.0.1
-
addStateInfo
protected void addStateInfo(ParameterBuilder paramBldr, int howMuchState)
- Since:
- MicroStrategy Web 9.0.0
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr, java.lang.String state, int howMuchState)
Adds children state information into an existingParameterBuilder
instance. It is up to the suppliedParameterBuilder
to determine how this information is serialized.- Parameters:
paramBldr
- TheParameterBuilder
instance which has child state information added to it.state
- The actual state string to add for this component.howMuchState
- The amount of state to add for each child component. to return from its children.- Since:
- MicroStrategy Web 8.0.0
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr, java.lang.String state)
- Since:
- MicroStrategy Web 9.0.0
-
getChildByType
public WebComponent getChildByType(int childType)
Returns the child WebComponent instance specified by the type.- Specified by:
getChildByType
in interfaceWebComponent
- Parameters:
childType
- the childType mapped to the WebComponent child type.- Returns:
- the child WebComponent instance; null if the childType is not mapped to any child WebComponent.
-
getChildByClass
public WebComponent getChildByClass(java.lang.Class classInstance)
Returns the child WebComponent instance specified by the class.- Specified by:
getChildByClass
in interfaceWebComponent
- Parameters:
classInstance
- the classInstance mapped to the WebComponent class instance.- Returns:
- the child WebComponent instance; null if the classInstance is not mapped to any child WebComponent.
- Since:
- MicroStrategy Web 8.0.0
-
getChildrenByClass
public void getChildrenByClass(java.lang.Class classInstance, HashList retList, boolean recursive)
Returns the child WebComponent instance specified by the class. Ifrecursive
is true, recursively searchs for children components.- Specified by:
getChildrenByClass
in interfaceWebComponent
- Parameters:
classInstance
- theClass
instance mapped to the WebComponent class instance.retList
- aHashList
to store the resultrecursive
-true
means searching recursively.- Since:
- MicroStrategy Web 8.0.0
-
getChild
public WebComponent getChild(java.lang.String path)
Returns the bottom child component at the specified path. The path starts from the root WebComponent all the way down the bottom child in the hierarchy. Each component appearing in the path is represented by its name and all components are separated by the character dot. For example, the pathkey1.key2.key3
says that the root component is key1 and component key3 is one of the grand children of key1.- Specified by:
getChild
in interfaceWebComponent
- Parameters:
path
- the path to the child WebComponent.- Returns:
- the bottom child component along the path; null if the child is not found.
-
getChild
public WebComponent getChild(int index)
Returns the childWebComponent
specified by the index.- Specified by:
getChild
in interfaceWebComponent
- Parameters:
index
- position of the child component in the current component.- Returns:
- the child component at the specified position; null if the index is out of bounds.
-
searchChild
public WebComponent searchChild(java.lang.String key)
Searches whole hierarchy rooted at the current component for the child component specified the key and returns the search result. The search starts with the immediate children of the current component, if not found, then it propagate to its grand children in depth-first manner.- Specified by:
searchChild
in interfaceWebComponent
- Parameters:
key
- the key mapped to the child component to be searched.- Returns:
- the child WebComponent; null if there is no such a component existing in the hierarchy.
-
addChild
public void addChild(java.lang.String key, WebComponent child)
Adds a child component to the currentWebComponent
. This call invalidates the cached states.- Specified by:
addChild
in interfaceWebComponent
- Parameters:
key
- the key mapped to the child component.child
- the child component to add.
-
removeChild
public WebComponent removeChild(java.lang.String key)
Removes the specified child component from the current component. This call invalidates the cached states.- Specified by:
removeChild
in interfaceWebComponent
- Parameters:
key
- the key mapped to the child component.- Returns:
- the removed child component.
-
removeChild
public WebComponent removeChild(WebComponent component)
Removes the specified child component from the current component.- Specified by:
removeChild
in interfaceWebComponent
- Parameters:
component
- the child component to be removed.- Returns:
- the removed child component.
-
clearChildren
public void clearChildren()
Removes all the child component instances from this component. This call invalidates the cached states.
-
setPersistMode
public void setPersistMode(int persistFlag)
Sets the persist flag (EnumBeanPersistMode
) of the current WebComponent.- Specified by:
setPersistMode
in interfaceWebComponent
- Parameters:
persistFlag
- the persist flag (EnumBeanPersistMode
).
-
getPersistMode
public int getPersistMode()
Returns the persist flag (EnumBeanPersistMode
) of the current WebComponent.- Specified by:
getPersistMode
in interfaceWebComponent
- Returns:
- the persist flag of the current WebComponent.
-
getOutputFormat
public int getOutputFormat()
Returns the output format ofEnumBeanOutputFormat
of the current WebComponent.- Specified by:
getOutputFormat
in interfaceWebComponent
- Returns:
- the output format of this component.
-
getMaximumStateLevel
public int getMaximumStateLevel()
Returns either the default state level of the current component or the maximum state level among the current component and its child components, whichever is greater.- Specified by:
getMaximumStateLevel
in interfaceWebComponent
- Returns:
- the maximum state level.
-
getDefaultStateLevel
public int getDefaultStateLevel()
Returns the default state level. If not set, the default state level isEnumWebPersistableState.MINIMAL_STATE_INFO
.- Specified by:
getDefaultStateLevel
in interfaceWebComponent
- Returns:
- the defautl state level.
-
setDefaultStateLevel
public void setDefaultStateLevel(int stateLevel)
Set the default state level. If not set, the default state level isEnumWebPersistableState.MINIMAL_STATE_INFO
.- Specified by:
setDefaultStateLevel
in interfaceWebComponent
- Parameters:
stateLevel
-
-
setOutputFormat
public void setOutputFormat(int outputFormat)
Sets the output format ofEnumBeanOutputFormat
for the current WebComponent.- Specified by:
setOutputFormat
in interfaceWebComponent
- Parameters:
outputFormat
- the output format ofEnumBeanOutputFormat
.
-
invalidateChildrenState
public void invalidateChildrenState()
Invalidates the cached state of a component and its children.- Specified by:
invalidateChildrenState
in interfaceWebComponent
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)
Saves the component state in the providedStringBuffer
- Overrides:
saveXMLState
in classAbstractPersistable
- Parameters:
buf
- aStringBuffer
objecthowMuchState
- how much state to save (EnumWebPersistableState
)- Since:
- MicroStrategy Web 9.0.0
-
saveXMLState
protected void saveXMLState(XMLStateSerializer builder, int howMuchState)
Saves the component state- Parameters:
builder
- aXMLStateSerializer
objecthowMuchState
- how much state to save (EnumWebPersistableState
)
-
saveXMLState
protected void saveXMLState(XMLStateSerializer builder, int howMuchState, int stateFlag)
Saves the component state- Parameters:
builder
- aXMLStateSerializer
objecthowMuchState
- how much state to save (EnumWebPersistableState
)stateFlag
- TODO- Since:
- MicroStrategy Web 9.0.0
-
restoreStateFromRequest
public boolean restoreStateFromRequest(RequestKeys rk)
Restores this component from the saved state keyed by this component's name in theRequestKeys
object. When restoring its own state, this component may delegate restoration to its child components. This method is equivalent to callrestoreStateFromRequest(rk, getName())
.- Parameters:
rk
- the RequestKeys object containing the saved state of this component.- Returns:
- true if restoration is successful; false otherwise.
-
restoreStateFromRequest
public boolean restoreStateFromRequest(RequestKeys rk, java.lang.String keyName)
Restores this component from the saved state keyed by keyName in theRequestKeys
object. When restoring its own state, this component may delegate restoration to its child components.- Parameters:
rk
- the RequestKeys object containing the saved state of this component.keyName
- the key whose corresponding value contains the saved state of this component.- Returns:
- true if restoration is successful; false otherwise.
-
restoreState
public boolean restoreState(java.lang.String state)
Description copied from interface:Persistable
Restores a component based on its saved state.- Specified by:
restoreState
in interfacePersistable
- Overrides:
restoreState
in classAbstractPersistable
- Parameters:
state
- the state of a component- Returns:
- true if restoration succeeds.
- Since:
- MicroStrategy Web 8.0.0
-
isFeatureAvailable
public boolean isFeatureAvailable(java.lang.String featureList)
Verifies if the corresponding feature(s) is accesible based on the properties of this WebComponent.
This method receives a semi-colon (i.e.
FeatureArray.FEATURE_ARRAY_DELIMITER_STRING
) separated list of features to validate. Each feature can be prefixed with "!" to indicate the return value should be negated. For example, if the following value is received as argument:
will return true if and only if:a;!b;c
- a is available
- b is not available
- c is available.
- Specified by:
isFeatureAvailable
in interfaceWebComponent
- Parameters:
featureList
- a semi-colon separated list of feature ids to check.- Returns:
true
indicating if the compound feature is accesible or not
-
hasChanged
public boolean hasChanged()
Verifies the state of the component has changed- Specified by:
hasChanged
in interfaceWebComponent
- Returns:
true
if the component is changed- Since:
- MicroStrategy Web 8.0.0
-
haveChildrenChanged
protected boolean haveChildrenChanged()
- Since:
- MicroStrategy Web 9.0.0
-
hasJustOpened
public 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.- Specified by:
hasJustOpened
in interfaceWebComponent
- Returns:
true
if the component has just been opened.- Since:
- MicroStrategy Web 8.0.0
-
setChanged
public void setChanged(boolean value)
Sets the changed state of the component- Specified by:
setChanged
in interfaceWebComponent
- Parameters:
value
- a boolean value indicating whether the component is changed.- Since:
- MicroStrategy Web 8.0.0
-
setChanged
public void setChanged(boolean value, boolean recurse)
Description copied from interface:WebComponent
Sets the changed state of the component- Specified by:
setChanged
in interfaceWebComponent
- Parameters:
value
- a boolean value indicating whether the component is changedrecurse
- boolean to indicate whether the value needs to be propogated to child components.- Since:
- MicroStrategy Web 9.0.0
-
setFeaturesManager
public void setFeaturesManager(WebFeatures featuresManager)
Associates a WebFeatures implementation with this WebComponent- Specified by:
setFeaturesManager
in interfaceWebComponent
- Parameters:
featuresManager
- aWebFeatures
object.
-
getFeaturesManager
public WebFeatures getFeaturesManager()
Return the WebFeatures implementation associated with this WebComponent- Specified by:
getFeaturesManager
in interfaceWebComponent
- Returns:
- a WebFeatures instance
-
clearStateCache
protected void clearStateCache(int howMuchToClear)
Clears the cached state for the current component only, without touching any child component's state.Since typical state usually contains information saved in the minimum state, clearing minimum state should invalidate the cached typical state too, but not vice versa.
- Parameters:
howMuchToClear
- a flag ofEnumWebPersistableState
indicating how much state to clear.
-
setStateCache
protected void setStateCache(int whatState, java.lang.String stateToSave)
Caches the state specified by whatState.- Parameters:
whatState
- a value from theEnumWebPersistableState
indicating what state to return.stateToSave
- the component's state to be cached
-
getCachedState
protected java.lang.String getCachedState(int whatState)
Return the cached state specified by thewhatState
. Only typical and minimum states are cached.- Parameters:
whatState
- a value from theEnumWebPersistableState
indicating what state to return.- Returns:
- the cached state. null if the cache is invalid.
-
childValues
protected java.util.Collection childValues()
- Since:
- MicroStrategy Web 8.1.0
-
setRenderingFilter
public void setRenderingFilter(java.util.Set renderingFilter)
Description copied from interface: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.- Specified by:
setRenderingFilter
in interfaceWebComponent
- Parameters:
renderingFilter
- a Set of Strings representing beanNames- Since:
- MicroStrategy Web 8.1.0
-
getRenderingFilter
public java.util.Set getRenderingFilter()
Description copied from interface:WebComponent
returns the rendering filter.- Specified by:
getRenderingFilter
in interfaceWebComponent
- Returns:
- rendering filter.
- Since:
- MicroStrategy Web 8.1.0
-
prepareForReuse
public void prepareForReuse()
Description copied from interface:WebComponent
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.- Specified by:
prepareForReuse
in interfaceWebComponent
- Since:
- MicroStrategy Web 9.0.0
-
newDefaultEventHandler
protected WebEventHandler newDefaultEventHandler()
- Since:
- MicroStrategy Web 9.0.0
-
newStyleRequestContext
protected StyleRequestContext newStyleRequestContext()
- Overrides:
newStyleRequestContext
in classAbstractTransformable
- Since:
- MicroStrategy Web 9.0.0
-
isChangeComparisonFlagSet
protected boolean isChangeComparisonFlagSet(int stateFlag)
- Since:
- MicroStrategy Web 9.0.0
-
initBean
public void initBean()
Description copied from interface:WebComponent
Initialize the component after it's created and its properties initialized- Specified by:
initBean
in interfaceWebComponent
-
-