public abstract class

AbstractPersistableAppComponent

extends AbstractAppComponent
implements RequestPersistable
java.lang.Object
   ↳ com.microstrategy.utils.serialization.AbstractPersistable
     ↳ com.microstrategy.web.beans.AbstractTransformable
       ↳ com.microstrategy.web.beans.AbstractWebComponent
         ↳ com.microstrategy.web.app.beans.AbstractAppComponent
           ↳ com.microstrategy.web.app.beans.AbstractPersistableAppComponent
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Title: AbstractPersistableAppComponent.

Description: This class is the base for application components (beans) that needs to be Persistable, that is, their state should be kept between requests.
The state is represented in a string that consists of severals fields of name/value pairs. This class makes sure the beans uses the same delimiter to separate fields and the name/value combination.

Summary

Constants
String STATE_DELIMITOR
String STATE_ITEM_SEPARATOR
[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
From interface com.microstrategy.web.app.beans.AppComponent
[Expand]
Inherited Fields
From class com.microstrategy.web.beans.AbstractWebComponent
From class com.microstrategy.web.beans.AbstractTransformable
Public Constructors
AbstractPersistableAppComponent()
Protected Constructors
AbstractPersistableAppComponent(boolean needEventHandler)
Public Methods
void addChildStateInfo(ParameterBuilder paramBldr, int howMuchState)
Adds children state information into an existing ParameterBuilder instance.
String saveState()
Returns a java.lang.String representaion of a component.
String saveState(int howMuchState)
Returns a java.lang.String representaion of a component.
void saveState(StringBuffer buf, int howMuchState)
Saves and stores a component's state into a StringBuffer.
void saveState(StringBuffer buf, int howMuchState, int stateFlag)
Saves and stores a component's state into a StringBuffer.
Protected Methods
void doFlatState(FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok)
Proceses the save/restore state opperation of the AppComponent
boolean isCookieOpen(String key)
Checks if the given key is marked as opened
boolean isSaveStateEnabled()
[Expand]
Inherited Methods
From class com.microstrategy.web.app.beans.AbstractAppComponent
From class com.microstrategy.web.beans.AbstractWebComponent
From class com.microstrategy.web.beans.AbstractTransformable
From class com.microstrategy.utils.serialization.AbstractPersistable
From class java.lang.Object
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.app.beans.AppComponent
From interface com.microstrategy.web.beans.RequestPersistable
From interface com.microstrategy.web.beans.Transformable
From interface com.microstrategy.web.beans.WebComponent

Constants

protected static final String STATE_DELIMITOR

Constant Value: ";"

protected static final String STATE_ITEM_SEPARATOR

Constant Value: ":"

Public Constructors

public AbstractPersistableAppComponent ()

Protected Constructors

protected AbstractPersistableAppComponent (boolean needEventHandler)

Public Methods

public 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. It only adds children information if the bean is open.

Parameters
paramBldr The ParameterBuilder instance which has child state information added to it.
howMuchState How much state is added. (see EnumWebPersistableState for details).

public String saveState ()

Returns a java.lang.String representaion of a component. The returned state should be HTML friendly. This method call is equivalent to call saveState(EnumWebPersistableState.TYPICAL_STATE_INFO).

Returns
  • the serialized state of a component.

public String saveState (int howMuchState)

Returns a java.lang.String representaion of a component. The returned state should be HTML friendly. This method call is equivalent to call saveState(new StringBuffer(), howMuchState).

Parameters
howMuchState how much state information to save (EnumWebPersistableState).
Returns
  • the serialized state of a component.

public void saveState (StringBuffer buf, int howMuchState)

Saves and stores a component's state into a StringBuffer. The returned state should be HTML friendly.

There are generally two formats of the saved state: flat state and XML representation. The minimum state is saved in flat state format, while the typical and maximum states are saved in XML string representation.

Parameters
buf a StringBuffer to store the saved state.
howMuchState how much state information to save (EnumWebPersistableState).
Throws
UnsupportedOperationException

public void saveState (StringBuffer buf, int howMuchState, int stateFlag)

Saves and stores a component's state into a StringBuffer. The returned state should be HTML friendly.

There are generally two formats of the saved state: flat state and XML representation. The minimum state is saved in flat state format, while the typical and maximum states are saved in XML string representation.

Parameters
buf a StringBuffer to store the saved state.
howMuchState how much state information to save (EnumWebPersistableState).
stateFlag bit-wise flag to indicate additional information about the state (EnumWebStateFlags).
Throws
UnsupportedOperationException

Protected Methods

protected void doFlatState (FlatStateSerializer ser, int howMuchState, FlatStateTokenizer tok)

Proceses the save/restore state opperation of the AppComponent

Parameters
ser an instance of the FlatStateSerializer object to use
howMuchState defines how much information needs to be saved
tok an instance of the FlatStateTokenizer object to use

protected boolean isCookieOpen (String key)

Checks if the given key is marked as opened

Parameters
key String value with the key to look for on cookie values
Returns
  • true if the element is open as indicated by cookies.

protected boolean isSaveStateEnabled ()

Returns
  • boolean value indicating if the state should be saved for the current instance or not. By default it checks if the instance is marked as opened.