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 theWebComponentinterface 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_featuresRepresents aWebFeaturesprotected 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.protectedAbstractWebComponent(boolean needEventHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(java.lang.String key, WebComponent child)Adds a child component to the currentWebComponent.voidaddChildStateInfo(ParameterBuilder paramBldr)Adds children state information into an existingParameterBuilderinstance.voidaddChildStateInfo(ParameterBuilder paramBldr, int howMuchState)Adds children state information into an existingParameterBuilderinstance.protected voidaddChildStateInfo(ParameterBuilder paramBldr, WebComponent wc)voidaddChildStateInfo(ParameterBuilder paramBldr, java.lang.String state)voidaddChildStateInfo(ParameterBuilder paramBldr, java.lang.String state, int howMuchState)Adds children state information into an existingParameterBuilderinstance.protected voidaddStateInfo(ParameterBuilder paramBldr, int howMuchState)protected java.util.CollectionchildValues()voidclearChildren()Removes all the child component instances from this component.protected voidclearStateCache(int howMuchToClear)Clears the cached state for the current component only, without touching any child component's state.voidcollectData()Triggers execution to the back end no matter whether it is synchronous or asynchronous.voidcollectMinimalData()This is similar toWebComponent.collectData()except data collected is minimal.protected java.lang.StringgetCachedState(int whatState)Return the cached state specified by thewhatState.WebComponentgetChild(int index)Returns the childWebComponentspecified by the index.WebComponentgetChild(java.lang.String path)Returns the bottom child component at the specified path.WebComponentgetChildByClass(java.lang.Class classInstance)Returns the child WebComponent instance specified by the class.WebComponentgetChildByType(int childType)Returns the child WebComponent instance specified by the type.intgetChildCount()Returns the total number of child component in the current WebComponent.voidgetChildrenByClass(java.lang.Class classInstance, HashList retList, boolean recursive)Returns the child WebComponent instance specified by the class.intgetDefaultStateLevel()Returns the default state level.WebFeaturesgetFeaturesManager()Return the WebFeatures implementation associated with this WebComponentintgetMaximumStateLevel()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.StringgetName()Returns the name of the current component.intgetOutputFormat()Returns the output format ofEnumBeanOutputFormatof the current WebComponent.WebComponentgetParent()Returns the parent component of this component.java.lang.StringgetPath()Returns the path, starting from the root component to this component.intgetPersistMode()Returns the persist flag (EnumBeanPersistMode) of the current WebComponent.java.util.SetgetRenderingFilter()returns the rendering filter.WebComponentgetRoot()Returns the root component reachable from the current component.WebComponentgetTargetBean()Get the target bean associated with this instancejava.lang.StringgetTargetBeanPath()WebEventgetWebEvent(int eventID)Returns theWebEventdenoted by the event ID.WebEventgetWebEvent(int eventID, boolean recurse)Returns theWebEventdenoted by the event ID.WebEventHandlergetWebEventHandler()Returns theWebEventHandlerinstance associated with this component.booleanhandleRequest(RequestKeys keys)Handles the request specified by theRequestKeysinstance.booleanhasChanged()Verifies the state of the component has changedbooleanhasJustOpened()Verifies if the component has just been opened.protected booleanhaveChildrenChanged()voidinitBean()Initialize the component after it's created and its properties initializedvoidinvalidateChildrenState()Invalidates the cached state of a component and its children.booleanisBeanContextEmpty()Verifies if a bean context exists for the current WebComponent.protected booleanisChangeComparisonFlagSet(int stateFlag)booleanisFeatureAvailable(java.lang.String featureList)Verifies if the corresponding feature(s) is accesible based on the properties of this WebComponent.protected WebEventHandlernewDefaultEventHandler()protected StyleRequestContextnewStyleRequestContext()voidprepareForReuse()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.WebComponentremoveChild(WebComponent component)Removes the specified child component from the current component.WebComponentremoveChild(java.lang.String key)Removes the specified child component from the current component.booleanrestoreState(java.lang.String state)Restores a component based on its saved state.booleanrestoreStateFromRequest(RequestKeys rk)Restores this component from the saved state keyed by this component's name in theRequestKeysobject.booleanrestoreStateFromRequest(RequestKeys rk, java.lang.String keyName)Restores this component from the saved state keyed by keyName in theRequestKeysobject.protected voidsaveXMLState(XMLStateSerializer builder, int howMuchState)Saves the component stateprotected voidsaveXMLState(XMLStateSerializer builder, int howMuchState, int stateFlag)Saves the component stateprotected voidsaveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)Saves the component state in the providedStringBufferWebComponentsearchChild(java.lang.String key)Searches whole hierarchy rooted at the current component for the child component specified the key and returns the search result.voidsetBeanContext(BeanContext beanContext)Sets an instance ofBeanContexton the current WebBean.voidsetBeanContext(BeanContext beanContext, boolean forceUpdateChildren)Sets an instance ofBeanContexton the current WebBean.voidsetChanged(boolean value)Sets the changed state of the componentvoidsetChanged(boolean value, boolean recurse)Sets the changed state of the componentvoidsetDefaultStateLevel(int stateLevel)Set the default state level.voidsetFeaturesManager(WebFeatures featuresManager)Associates a WebFeatures implementation with this WebComponentvoidsetName(java.lang.String name)Sets the name for the current component.voidsetOutputFormat(int outputFormat)Sets the output format ofEnumBeanOutputFormatfor the current WebComponent.voidsetParent(WebComponent parentComponent)Sets the parent component for the current componentvoidsetPersistMode(int persistFlag)Sets the persist flag (EnumBeanPersistMode) of the current WebComponent.voidsetRenderingFilter(java.util.Set renderingFilter)Sets the list of beans to render.protected voidsetStateCache(int whatState, java.lang.String stateToSave)Caches the state specified by whatState.voidsetTargetBean(WebComponent bean)Set the target bean that will be associated with this instance.voidsetTargetBeanPath(java.lang.String beanName)Define the base bean for this instance.voidsetWebEventHandler(WebEventHandler eventHandler)Associate with this component aWebEventHandlerinstance.-
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:
getNamein interfaceWebComponent- Returns:
- the name of this component.
-
collectData
public void collectData() throws WebBeanExceptionTriggers 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:
collectDatain interfaceWebComponent- Throws:
WebBeanException- thrown if there is any exception
-
collectMinimalData
public void collectMinimalData() throws WebBeanExceptionDescription copied from interface:WebComponentThis 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:
collectMinimalDatain 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:
setNamein interfaceWebComponent- Parameters:
name- the name of the current component.
-
getParent
public WebComponent getParent()
Returns the parent component of this component.- Specified by:
getParentin interfaceWebComponent- Returns:
- the parent component.
-
setParent
public void setParent(WebComponent parentComponent)
Sets the parent component for the current component- Specified by:
setParentin interfaceWebComponent- Parameters:
parentComponent- the parent component.
-
setBeanContext
public void setBeanContext(BeanContext beanContext)
Description copied from class:AbstractTransformableSets an instance ofBeanContexton the current WebBean.- Specified by:
setBeanContextin interfaceTransformable- Specified by:
setBeanContextin interfaceWebComponent- Overrides:
setBeanContextin classAbstractTransformable- Parameters:
beanContext- theBeanContextinstance 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:WebComponentSets an instance ofBeanContexton the current WebBean.- Specified by:
setBeanContextin interfaceWebComponent- Parameters:
beanContext- theBeanContextinstance 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:
setTargetBeanPathin interfaceWebComponent- Parameters:
beanName-Stringwith 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:
getTargetBeanPathin interfaceWebComponent- Returns:
- a
Stringvalue 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:
setTargetBeanin interfaceWebComponent- Parameters:
bean-WebComponentinstance 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:
getTargetBeanin interfaceWebComponent- Returns:
WebComponentinstance 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_DOCUMENTorEnumWebTransformableType.WEB_BEAN_RWinstance found.- Since:
- MicroStrategy Web 9.0.0
-
isBeanContextEmpty
public boolean isBeanContextEmpty()
Description copied from interface:WebComponentVerifies 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:
isBeanContextEmptyin 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:
getRootin 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:
getPathin interfaceWebComponent- Returns:
- the path to the current component, reachable from the root component.
-
getWebEvent
public WebEvent getWebEvent(int eventID)
Returns theWebEventdenoted 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:
getWebEventin 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 theWebEventdenoted 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:
getWebEventin 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 theWebEventHandlerinstance associated with this component.- Specified by:
getWebEventHandlerin interfaceWebComponent- Returns:
- the WebEventHandler; null if it does not exist.
-
setWebEventHandler
public void setWebEventHandler(WebEventHandler eventHandler)
Associate with this component aWebEventHandlerinstance.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:
setWebEventHandlerin interfaceWebComponent- Parameters:
eventHandler- the WebEventHandler instance to set.
-
handleRequest
public boolean handleRequest(RequestKeys keys) throws WebException
Handles the request specified by theRequestKeysinstance. The RequestKeys object might contain all information sent from the Web browser along with any cookies, session variables, etc. Most importantly, it containsWebEventrelated 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:
handleRequestin interfaceWebComponent- Parameters:
keys- theRequestKeysobject.- 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:
getChildCountin interfaceWebComponent- Returns:
- the number of children.
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
Adds children state information into an existingParameterBuilderinstance. It is up to the suppliedParameterBuilderto determine how this information is serialized.- Specified by:
addChildStateInfoin interfaceWebComponent- Parameters:
paramBldr- TheParameterBuilderinstance which has child state information added to it.howMuchState- How much state is added. (seeEnumWebPersistableStatefor details).- Since:
- MicroStrategy Web 8.0.0
-
addChildStateInfo
public void addChildStateInfo(ParameterBuilder paramBldr)
Description copied from interface:WebComponentAdds children state information into an existingParameterBuilderinstance. It is up to the suppliedParameterBuilderto determine how this information is serialized. EachWebComponentthe hierarchy serializes its state according to its ownWebComponent.getDefaultStateLevel().- Specified by:
addChildStateInfoin interfaceWebComponent- Parameters:
paramBldr- TheParameterBuilderinstance 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 existingParameterBuilderinstance. It is up to the suppliedParameterBuilderto determine how this information is serialized.- Parameters:
paramBldr- TheParameterBuilderinstance 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:
getChildByTypein 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:
getChildByClassin 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. Ifrecursiveis true, recursively searchs for children components.- Specified by:
getChildrenByClassin interfaceWebComponent- Parameters:
classInstance- theClassinstance mapped to the WebComponent class instance.retList- aHashListto store the resultrecursive-truemeans 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.key3says that the root component is key1 and component key3 is one of the grand children of key1.- Specified by:
getChildin 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 childWebComponentspecified by the index.- Specified by:
getChildin 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:
searchChildin 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:
addChildin 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:
removeChildin 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:
removeChildin 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:
setPersistModein interfaceWebComponent- Parameters:
persistFlag- the persist flag (EnumBeanPersistMode).
-
getPersistMode
public int getPersistMode()
Returns the persist flag (EnumBeanPersistMode) of the current WebComponent.- Specified by:
getPersistModein interfaceWebComponent- Returns:
- the persist flag of the current WebComponent.
-
getOutputFormat
public int getOutputFormat()
Returns the output format ofEnumBeanOutputFormatof the current WebComponent.- Specified by:
getOutputFormatin 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:
getMaximumStateLevelin 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:
getDefaultStateLevelin 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:
setDefaultStateLevelin interfaceWebComponent- Parameters:
stateLevel-
-
setOutputFormat
public void setOutputFormat(int outputFormat)
Sets the output format ofEnumBeanOutputFormatfor the current WebComponent.- Specified by:
setOutputFormatin interfaceWebComponent- Parameters:
outputFormat- the output format ofEnumBeanOutputFormat.
-
invalidateChildrenState
public void invalidateChildrenState()
Invalidates the cached state of a component and its children.- Specified by:
invalidateChildrenStatein interfaceWebComponent
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState, int stateFlag)Saves the component state in the providedStringBuffer- Overrides:
saveXMLStatein classAbstractPersistable- Parameters:
buf- aStringBufferobjecthowMuchState- 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- aXMLStateSerializerobjecthowMuchState- how much state to save (EnumWebPersistableState)
-
saveXMLState
protected void saveXMLState(XMLStateSerializer builder, int howMuchState, int stateFlag)
Saves the component state- Parameters:
builder- aXMLStateSerializerobjecthowMuchState- 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 theRequestKeysobject. 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 theRequestKeysobject. 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:PersistableRestores a component based on its saved state.- Specified by:
restoreStatein interfacePersistable- Overrides:
restoreStatein 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:
isFeatureAvailablein interfaceWebComponent- Parameters:
featureList- a semi-colon separated list of feature ids to check.- Returns:
trueindicating if the compound feature is accesible or not
-
hasChanged
public boolean hasChanged()
Verifies the state of the component has changed- Specified by:
hasChangedin interfaceWebComponent- Returns:
trueif 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:
hasJustOpenedin interfaceWebComponent- Returns:
trueif 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:
setChangedin 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:WebComponentSets the changed state of the component- Specified by:
setChangedin 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:
setFeaturesManagerin interfaceWebComponent- Parameters:
featuresManager- aWebFeaturesobject.
-
getFeaturesManager
public WebFeatures getFeaturesManager()
Return the WebFeatures implementation associated with this WebComponent- Specified by:
getFeaturesManagerin 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 ofEnumWebPersistableStateindicating 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 theEnumWebPersistableStateindicating 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 theEnumWebPersistableStateindicating 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:WebComponentSets 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:
setRenderingFilterin 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:WebComponentreturns the rendering filter.- Specified by:
getRenderingFilterin interfaceWebComponent- Returns:
- rendering filter.
- Since:
- MicroStrategy Web 8.1.0
-
prepareForReuse
public void prepareForReuse()
Description copied from interface:WebComponentIf 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:
prepareForReusein interfaceWebComponent- Since:
- MicroStrategy Web 9.0.0
-
newDefaultEventHandler
protected WebEventHandler newDefaultEventHandler()
- Since:
- MicroStrategy Web 9.0.0
-
newStyleRequestContext
protected StyleRequestContext newStyleRequestContext()
- Overrides:
newStyleRequestContextin 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:WebComponentInitialize the component after it's created and its properties initialized- Specified by:
initBeanin interfaceWebComponent
-
-