public abstract class

AbstractAppComponent

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

Class Overview

Title: AbstractAppComponent.

Description: This class provides a skeleton for all WebComponent objects implemented in the com.microstrategy.web.app.beans package.

These objects represent the different beans available to the application that interact with the web componenets provided by the com.microstrategy.web.beans package. The application web components generaly represent editors, toolbars and containers that aid the user in the presentation and manipulation of web components such as the ReportBean, FolderBean, DocumentBean, etc. The class' intention is to facilitate the implementation of the application's web components and support the common functionality these objects must provide.

Among the methods provided by this class we can find:

  • collectData(), responsible for calling the doCollectData() method that should be implemented on each application web component, and cascading down a this invocation to all children on the component's hierarchy.
  • setBaseBean(String beanName)/getBaseBean(), where you can indicate the bean, usually a ReportBean or DocumentBean, the application web component is associated with.
  • setTargetBean(WebComponent bean)/getTargetBean(), similar to the baseBean property described, but accepts and return the actual instance of the associated web component, not just its name.
  • generateOutput(), when called, this call will trigger the rendering of the web component, using its default transform. A transform can become the bean's default transform by using the setDefault() method present in the TransformInstance interface or by being the first transform set to the web component, either through code or through the pageConfig.xml file.

Summary

[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
AbstractAppComponent()
Public Methods
void addChildStateInfo(ParameterBuilder paramBldr)
Adds children state information into an existing ParameterBuilder instance.
void collectData()
Triggers execution to the back end no matter whether it is synchronous or asynchronous.
void collectMinimalData()
Triggers execution to the back end no matter whether it is synchronous or asynchronous.
void doCollectData()
Call the required methods so the data is collected for this instance
void doCollectMinimalData()

By default this method simply invokes doCollectData(), i.e.

MarkupOutput generateOutput()
Generates the output of a bean.
AppContext getAppContext()
This method returns the application context object associated with this component.
String getContactInfo()
This method is deprecated. Use Preferences.getValue(EnumWebPreferences.WebPreferenceAdminInfo) instead.
String getDescriptor(int key)
Retrieve the descriptor when the key is an integer value...
String getDescriptor(String key)
Retrieve the descriptor when the key is a string
EventManager getEventManager()
This method returns the application EventManager used to generates events.
String getExtraInput()
Get any extra input form information to be used when generating form information on the transforms associated with this instance.
String getExtraUrl()
Get any extra url information to be used when generating link information on the transforms associated with this instance.
WebFeatures getFeaturesManager()
Return the WebFeatures implementation associated with this WebComponent
int getLeft()
Get the left position where the bean should be displayed by the transform if applicable
int getResultFilterMode()
WebComponent getTargetBean()
Get the target bean associated with this instance
int getTop()
Get the top position where the bean should be displayed by the transform if applicable
int getType()
Returns the transformable type as in EnumWebTransformableType.
int getXMLStatus()
Returns the EnumRequestStatus status of the component.
boolean hasChanged()
Verifies the state of the component has changed
boolean isDialog()
Returns true if this bean should be treated as a dialog
boolean isForcedChildrenStateSaving()
Return wheter the bean's children will be save their states or not despite it's open or closed state.
boolean isModal()
The property is used to determine wheter the component will be displayed as a floating (popup) dialog with modal property.
boolean isModalOpen()
indicates whether there is a Modal AppComponent open in the hierarchy
boolean isOpen()
Returns a boolean value indicating if the instance is marked as opened or closed.
void setExtraInput(String newValue)
Set any extra input form information to be used when generating form information on the transforms associated with this instance.
void setExtraUrl(String newValue)
Set any extra url information to be used when generating link information on the transforms associated with this instance.
void setForcedChildrenStateSaving(boolean value)
Forces the bean to propagate its children to save state despite it's open or closed state.
void setHasJustOpened(boolean value)
Sets whether the component has just been opened.
void setIsDialog(boolean value)
Set method for defining if the instance is to be defined as a Dialog or not.
void setIsModal(boolean value)
Set method for defining if the instance is to be defined as a Modal interface or not.
void setIsOpen(boolean value)
Set the current instance as opened.
void setLeft(int x)
Set the left position where the bean should be displayed by the transform if applicable.
void setOutputFormat(int outputFormat)
Sets the output format of EnumBeanOutputFormat for the current WebComponent.
void setTop(int y)
Set the top osition where the bean should be displayed by the transform if applicable.
Protected Methods
boolean compareChildsTargetWithCurrent()
The implementing class should implement this method to return true if it wants to always call the current object's targetBean#hasChanged method in #hasTargetBeanChanged method.
TransformInstance createTransformInstance(Transform transform)
ContainerServices getContainerServices()
Convenience method to retrieve the connected Container Services object.
WebObjectSource getObjectSource()
WebIServerSession getSession()
static WebObjectsFactory getWebObjectsFactory(WebBean wb)
Utility method for obtaining a WebObjectsFactory instance
WebObjectsFactory getWebObjectsFactory()
boolean hasTargetBeanChanged()
When this method is called, we have already checked the children and each of the children has returned with hasChanged() as false.
boolean haveChildrenChanged()
WebComponent initComponent(WebComponent bean, String suffix)
Initialize a WebComponent as child of this FrameBean.
void internalCollectData()
This method is called internally by the transform() method to ensure collectData has been triggered and the bean is ready to transform.
boolean isIFrameRequest()
Utility method that determines if it's an IFrame type of request.
BeanContext newDefaultBeanContext()
This method is called by getBeanContext() to automatically create an instance of a BeanContext if one has not been explicitly set.
ParameterBuilder newHiddenInputBuilder()
Convenience method to retrieve a new instance of a Hidden Input Builder from the connected Container Services object.
NamespaceEncoder newNamespaceEncoder()
Convenience method to retrieve a new instance of a Namespace Encoder from the connected Container Services object.
StyleRequestContext newStyleRequestContext()
ParameterBuilder newURIBuilder()
Convenience method to retrieve a new instance of a URI Builder from the connected Container Services object.
[Expand]
Inherited Methods
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.Transformable
From interface com.microstrategy.web.beans.WebComponent

Public Constructors

public AbstractAppComponent ()

Public Methods

public 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 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. If isOpen(), this method will first perform a doCollectData(), then proceeds to call collectData() on all child components getChild(int).

public void collectMinimalData ()

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. If isOpen(), this method will first perform a doCollectMinimalData(), then proceeds to call collectMinimalData() on all child components getChild(int).

public void doCollectData ()

Call the required methods so the data is collected for this instance

public void doCollectMinimalData ()

By default this method simply invokes doCollectData(), i.e. by default it will retrieve as much data as doCollectData() is defined to do so. It is strongly recommended to override this method, and provide an implementation that retrieves the minimal amount of data.

The purpose of this method is to allow this component to be subjected to the normal workflow, but not entail retrieving any more than the minimal amount of data.

For example, there are scenarios when a change is made on a page, but the user then temporarily switches to another page before returning to the original page. While the user is on the other page, we can perform a minimal collect data of the components from the original page since we would not need the data.

public MarkupOutput generateOutput ()

Generates the output of a bean. It transforms the bean

Returns
  • the bean's output

public AppContext getAppContext ()

This method returns the application context object associated with this component. To set this context, use setBeanContext(BeanContext) passing in an application context object.

Returns

public String getContactInfo ()

This method is deprecated.
Use Preferences.getValue(EnumWebPreferences.WebPreferenceAdminInfo) instead.

Returns the administrator contact info as defined in the EnumWebPreferences.WebPreferenceAdminInfo preferences. If the preference is null or the beanContext is not set, it returns an empty string.

Returns
  • The admin contact info.

public String getDescriptor (int key)

Retrieve the descriptor when the key is an integer value...

Parameters
key The key of the string to use
Returns
  • the corresponding descriptor

public String getDescriptor (String key)

Retrieve the descriptor when the key is a string

Parameters
key The key of the string to use
Returns
  • the corresponding descriptor

public EventManager getEventManager ()

This method returns the application EventManager used to generates events.

Returns

public String getExtraInput ()

Get any extra input form information to be used when generating form information on the transforms associated with this instance.

Returns
  • String with any extra input form information to use

public String getExtraUrl ()

Get any extra url information to be used when generating link information on the transforms associated with this instance.

Returns
  • String with any extra url information to use

public WebFeatures getFeaturesManager ()

Return the WebFeatures implementation associated with this WebComponent

Returns
  • a WebFeatures instance

public int getLeft ()

Get the left position where the bean should be displayed by the transform if applicable

Returns
  • integer where the coordinate to use is saved

public int getResultFilterMode ()

public WebComponent getTargetBean ()

Get the target bean associated with this instance

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 first WEB_BEAN_REPORT, WEB_BEAN_DOCUMENT or WEB_BEAN_RW instance found.

public int getTop ()

Get the top position where the bean should be displayed by the transform if applicable

Returns
  • integer where the coordinate to use is saved

public int getType ()

Returns the transformable type as in EnumWebTransformableType.

Returns
  • the transformable type.

public int getXMLStatus ()

Returns the EnumRequestStatus status of the component. The status determined by by the status of its children with the following precedence.

  • WebBeanRequestEndsInError
  • WebBeanRequestCanceled
  • WebBeanRequestProcessing
  • WebBeanRequestNotInitiated
  • WebBeanRequestWaitingForUserInput
  • WebBeanRequestSuccessful

  • Returns

    public boolean hasChanged ()

    Verifies the state of the component has changed

    Returns
    • boolean value indicating if the current instance or its base bean (if any defined) has been marked as changed.

    public boolean isDialog ()

    Returns true if this bean should be treated as a dialog

    Returns
    • boolean value indicating if the instance has been defined as a Dialog or not.

    public boolean isForcedChildrenStateSaving ()

    Return wheter the bean's children will be save their states or not despite it's open or closed state. However whether to save its own state or not is up to individual children bean to decide.

    public boolean isModal ()

    The property is used to determine wheter the component will be displayed as a floating (popup) dialog with modal property. When a modal dialog is open the user will not be able to click anywehre in the interface other that the dialog until the dialog is cloesed. the

    Returns
    • boolean value indicating if the instance has been defined as a Modal interface (True) or not.

    public boolean isModalOpen ()

    indicates whether there is a Modal AppComponent open in the hierarchy

    Returns
    • boolean. true is a Modal AppComponent is open in the hierarchy

    public boolean isOpen ()

    Returns a boolean value indicating if the instance is marked as opened or closed.

    Returns
    • boolean value of True if the instance is marked as opened, it will return False otherwise. By default, instances not marked as dialogs (isDialog() property returning False) will have a browser setting associated with them that should indicate if they are opened or closed. The parent hierarchy is also tested to be in opened state as well as dependent beans not to be in error.

    public void setExtraInput (String newValue)

    Set any extra input form information to be used when generating form information on the transforms associated with this instance.

    Parameters
    newValue String with any extra input form information to use

    public void setExtraUrl (String newValue)

    Set any extra url information to be used when generating link information on the transforms associated with this instance.

    Parameters
    newValue String with any extra url information to use

    public void setForcedChildrenStateSaving (boolean value)

    Forces the bean to propagate its children to save state despite it's open or closed state. However whether to save its own state or not is up to individual children bean to decide.

    public void setHasJustOpened (boolean value)

    Sets whether the component has just been opened.

    Parameters
    value hasJustOpend or not

    public void setIsDialog (boolean value)

    Set method for defining if the instance is to be defined as a Dialog or not.

    Parameters
    value boolean value indicating if the instance will be handled as a Dialog (True) or not.

    public void setIsModal (boolean value)

    Set method for defining if the instance is to be defined as a Modal interface or not. By default, if the instance is marked as Modal, it will also be defined as a Dialog.

    Parameters
    value boolean value indicating if the instance will be handled as Modal (True) or not.

    public void setIsOpen (boolean value)

    Set the current instance as opened. This method will have no effect if the instance is defined as a dialog (isDialog() property should return False).

    Parameters
    value boolean value indicating if the instance should be defined as opened (True) or closed (False).

    public void setLeft (int x)

    Set the left position where the bean should be displayed by the transform if applicable.

    Parameters
    x Coordinate indicating the new left position of the bean

    public void setOutputFormat (int outputFormat)

    Sets the output format of EnumBeanOutputFormat for the current WebComponent.

    Parameters
    outputFormat the output format of EnumBeanOutputFormat.

    public void setTop (int y)

    Set the top osition where the bean should be displayed by the transform if applicable.

    Parameters
    y Coordinate indicating the new top position of the bean

    Protected Methods

    protected boolean compareChildsTargetWithCurrent ()

    The implementing class should implement this method to return true if it wants to always call the current object's targetBean#hasChanged method in #hasTargetBeanChanged method.

    Returns
    • a boolean to compare the children's target with the current target.

    protected TransformInstance createTransformInstance (Transform transform)

    protected ContainerServices getContainerServices ()

    Convenience method to retrieve the connected Container Services object. If anything fails along the way, returns null.

    Returns
    • The ContainerServices instance.

    protected WebObjectSource getObjectSource ()

    protected WebIServerSession getSession ()

    protected static WebObjectsFactory getWebObjectsFactory (WebBean wb)

    Utility method for obtaining a WebObjectsFactory instance

    Parameters
    wb WebBean from where the factory is to be obtained.
    Returns

    protected WebObjectsFactory getWebObjectsFactory ()

    protected boolean hasTargetBeanChanged ()

    When this method is called, we have already checked the children and each of the children has returned with hasChanged() as false. If #compareChildsTargetWithCurrent method returns true, then we check if any of the child's target bean is same as this object's target bean and return true if this is the case. If you want to check the targetbean of this component, then override compareChildsTargetWithCurrent to return true

    protected boolean haveChildrenChanged ()

    protected WebComponent initComponent (WebComponent bean, String suffix)

    Initialize a WebComponent as child of this FrameBean. It inherits common properties, such as BeanContext, and output format. It also adds it as a child

    Parameters
    bean The bean to initialize
    suffix the name to add to the bean. This name will be prefixed with the name of the bean
    Returns
    • the same bean, but now initialized.

    protected void internalCollectData ()

    This method is called internally by the transform() method to ensure collectData has been triggered and the bean is ready to transform.

    Throws
    WebBeanException thrown if there is severe errors when collecting data

    protected boolean isIFrameRequest ()

    Utility method that determines if it's an IFrame type of request.

    Returns
    • boolean value indicating if the request is of type IFrame or not. By default it is based only on information available on the RequestKeys associated with this instance.

    protected BeanContext newDefaultBeanContext ()

    This method is called by getBeanContext() to automatically create an instance of a BeanContext if one has not been explicitly set.

    protected ParameterBuilder newHiddenInputBuilder ()

    Convenience method to retrieve a new instance of a Hidden Input Builder from the connected Container Services object. If anything fails along the way, returns null.

    Returns
    • The ParameterBuilder instance to use for building Hidden Input strings.

    protected NamespaceEncoder newNamespaceEncoder ()

    Convenience method to retrieve a new instance of a Namespace Encoder from the connected Container Services object. If anything fails along the way, returns null.

    Returns
    • The NamespaceEncoder instance to use for encoding names.

    protected StyleRequestContext newStyleRequestContext ()

    protected ParameterBuilder newURIBuilder ()

    Convenience method to retrieve a new instance of a URI Builder from the connected Container Services object. If anything fails along the way, returns null.

    Returns
    • The ParameterBuilder instance to use for building URIs.