public interface

ExpressionBean

implements WebBean
com.microstrategy.web.beans.ExpressionBean
Known Indirect Subclasses

Class Overview

The ExpressionBean interface represents a bean which can be used to edit an expression. It can represent either filter of a report, and can also represent an expression prompt. It has a state variable, ExpressionEditMode, which tells whether the ExpressionBean is in an editing mode or not. If the mode is Default, then it is not in editing mode.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
Public Methods
abstract void acceptChange()
Accepts the change that is currently being worked upon.
abstract boolean canSelectElements(WebAttribute webAttribute)
Returns true if Select Elements option can be used for the attribute
abstract WebAttributeForm chooseDefaultForm(WebAttribute attr)
abstract WebObjectInfo getActiveObject()
Returns the active object, the object being qualified upon.
abstract int getActiveOperatorNodeKey()
Returns the current active operator node key.
abstract WebElementSource getElementSource(WebAttribute att)
Returns properly initialized element source for a given attribute.
abstract WebExpression getExpression()
Returns the internal expression object.
abstract int getExpressionBeanType()
Returns the expression bean type, from EnumExpressionBeanType.
abstract int getExpressionEditMode()
Returns the current expression edit mode of the bean, from EnumExpressionEditMode.
abstract Scrollable getIncrementalFetch()
Returns a Scrollable interface, which can be used to set the incremental fetch window for an attribute elements qualification.
abstract boolean getMatchCase()
Returns the match case flag, used in searching element browsing request.
abstract WebObjectInfo getRHS()
Returns the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparison
abstract String getUserSearchPattern()
Returns the search pattern that will be applied to any element browsing request.
abstract WebBeanError getValidationErrorInfo()
This can hold a validation error which came about from the validate call.
abstract boolean isEditable()
Returns whether the Expression bean is editable.
abstract boolean isEditable(WebNode node)
Returns whether the given node can be edited properly under the current context of the application.
abstract boolean isModified()
Returns whether this filter is modified from the filter object that it synchronizes with.
abstract void populateObject(WebObjectInfo oi)
abstract void resetChanges()
Undoes all changes since the last synchronize call.
abstract void setActiveOperatorNodeKey(int key, boolean isNew)
Sets the current active operator node key.
abstract void setContext(ExpressionBeanContext context)
abstract void setExpressionEditMode(int mode)
Sets the current expression edit mode of the bean, from EnumExpressionEditMode.
abstract void setIsEditable(boolean value)
Sets whether the expression bean is editable.
abstract void setMatchCase(boolean matchCase)
Sets the match case flag, which determines whether the user search pattern must match case or not.
abstract void setRHS(WebObjectInfo rhs)
Set the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparison
abstract void setUserSearchPattern(String pattern)
Sets the search pattern that will be applied to any element browsing request.
abstract void setValidationErrorInfo(WebBeanError err)
abstract boolean shallSelectElements(WebAttribute webAttribute)
This method is used to decide what Attribute subexpression to create in a given context.
abstract void synchronize()
Synchronizes any changes that have been made to this expression to the owner expression accessible on the WebReportInstance or WebPrompt object.
abstract void undoChange()
Undoes the change that is currently being worked upon.
abstract boolean validate()
Attempts to perform validation on the expression.
abstract boolean validateOperands(WebNode node)
Returns whether the given node and its children are valid.
[Expand]
Inherited Methods
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.beans.RequestPersistable
From interface com.microstrategy.web.beans.Transformable
From interface com.microstrategy.web.beans.WebBean
From interface com.microstrategy.web.beans.WebComponent

Public Methods

public abstract void acceptChange ()

Accepts the change that is currently being worked upon. The mode is set back to Default, and the active object and active operator node are set to null. This effectively makes the expression such that the undoChange method no longer does anything - it effectively means that the user accepted the single change they made.

public abstract boolean canSelectElements (WebAttribute webAttribute)

Returns true if Select Elements option can be used for the attribute

Parameters
webAttribute attribute
Returns
  • true if Select Elements option can be used for the attribute

public abstract WebAttributeForm chooseDefaultForm (WebAttribute attr)

Throws
IndexOutOfBoundsException
WebBeanException
WebException
WebObjectsException

public abstract WebObjectInfo getActiveObject ()

Returns the active object, the object being qualified upon. This will be null if the mode is SelectUnit or Default, or if the active operator node is set incorrectly.

Returns
  • The active object of the expression.

public abstract int getActiveOperatorNodeKey ()

Returns the current active operator node key. Note that this will not be a valid value if the mode is SelectUnit or Default.

Returns
  • The key of the operator node being edited.

public abstract WebElementSource getElementSource (WebAttribute att)

Returns properly initialized element source for a given attribute.

Parameters
att attribute
Returns
  • properly initialized element source for a given attribute.
Throws
WebObjectsException
WebBeanException
WebBeanException
WebObjectsException

public abstract WebExpression getExpression ()

Returns the internal expression object. This expression can be used to make changes to the structure of the expression.

Returns

public abstract int getExpressionBeanType ()

Returns the expression bean type, from EnumExpressionBeanType.

Returns

public abstract int getExpressionEditMode ()

Returns the current expression edit mode of the bean, from EnumExpressionEditMode. This represents the current state of the bean.

Returns

public abstract Scrollable getIncrementalFetch ()

Returns a Scrollable interface, which can be used to set the incremental fetch window for an attribute elements qualification.

Returns
  • A Scrollable object, which refers to the incremental fetch window.

public abstract boolean getMatchCase ()

Returns the match case flag, used in searching element browsing request.

Returns
  • The current value of the match case flag.

public abstract WebObjectInfo getRHS ()

Returns the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparison

Returns
  • WebObjectInfo the RHS unit(attribute form/metric)

public abstract String getUserSearchPattern ()

Returns the search pattern that will be applied to any element browsing request.

Returns
  • The current user search pattern for element browsing.

public abstract WebBeanError getValidationErrorInfo ()

This can hold a validation error which came about from the validate call.

Returns
  • Any exception which came about from the validate call.

public abstract boolean isEditable ()

Returns whether the Expression bean is editable.

Returns
  • True if the bean is editable, false otherwise.

public abstract boolean isEditable (WebNode node)

Returns whether the given node can be edited properly under the current context of the application. If this is false, then the expression should be kept as-is in the current expression context, only allowing moving and removal of the expression. Note that this does not indicate that the subexpression is invalid; instead, it only checks whether it is possible to edit the subexpression in the current context.

Parameters
node The WebNode object which is being checked.
Returns
  • True if the expression can be edited as-is, false if it cannot.

public abstract boolean isModified ()

Returns whether this filter is modified from the filter object that it synchronizes with. For example, if the filter has changed from the base filter on the WebReportInstance object exposed on a parent Report Bean. Calling synchronize or undo will re-baseline, setting isModified back to false.

Returns
  • Whether the current expression has been modified.

public abstract void populateObject (WebObjectInfo oi)

public abstract void resetChanges ()

Undoes all changes since the last synchronize call. This method will ensure that the edit mode of the bean is default, and that all non-synchronized changes are undone, even if they were accepted previously via acceptChange.

public abstract void setActiveOperatorNodeKey (int key, boolean isNew)

Sets the current active operator node key. The isNew variable must be passed in correctly - if the node is newly created, isNew should be true, if it already existed before this edit operation, it should be false. If isNew is incorrect, then the undoChange method will not work properly.

Parameters
key The key of the current active operator node key.
isNew Whether the active operator node key is new or existing.

public abstract void setContext (ExpressionBeanContext context)

Sets the ExpressionBeanContext. If this is set, then the expression bean will obtain the original expression that is being edited from that context.

Parameters
context The context to use to obtain the expression to be edited/displayed.

public abstract void setExpressionEditMode (int mode)

Sets the current expression edit mode of the bean, from EnumExpressionEditMode. Note that this operation is only valid if moving between SelectUnit and Default, or from one node editing mode to another.

Parameters
mode The mode to change to, from EnumExpressionEditMode.

public abstract void setIsEditable (boolean value)

Sets whether the expression bean is editable.

Parameters
value True if the expression bean should be editable, false otherwise.

public abstract void setMatchCase (boolean matchCase)

Sets the match case flag, which determines whether the user search pattern must match case or not.

Parameters
matchCase The new value of the match case flag.

public abstract void setRHS (WebObjectInfo rhs)

Set the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparison

Parameters
rhs the RHS unit(attribute form/metric)

public abstract void setUserSearchPattern (String pattern)

Sets the search pattern that will be applied to any element browsing request.

Parameters
pattern The user search pattern to use for element browsing.

public abstract void setValidationErrorInfo (WebBeanError err)

public abstract boolean shallSelectElements (WebAttribute webAttribute)

This method is used to decide what Attribute subexpression to create in a given context. It returns true if getting list of available elements for a given attribute will be chip, for example because corresponding data set is already executed and cached.

Returns
  • true if getting list of available elements for a given attribute will be chip

public abstract void synchronize ()

Synchronizes any changes that have been made to this expression to the owner expression accessible on the WebReportInstance or WebPrompt object. This effectively means that the reset operation will no longer do anything, and that something should be done to the owner object to submit the synchronized expression to the Intelligence Server. Note that if this bean is not in Default mode, then what is synchronized is the version of the tree excluding the changes that were made to the active operator node. The changes to the active operator node are not lost, but are not propagated to the main expression either. This method will not change the edit mode of the bean.

public abstract void undoChange ()

Undoes the change that is currently being worked upon. If the state is Default, then nothing happens. If the state is SelectUnit, it is set back to default. Otherwise, any changes made to the active operator node or it's children since the editing operation began are undone, either by removing the active operator node (if it is new) or by rolling its state back to the state it was in when it was set as the active operator node. This will also set the mode back to default.

public abstract boolean validate ()

Attempts to perform validation on the expression. Returns false and sets the validation error (retrievable via the getValidationErrorInfo} method.

Returns
  • Whether the validation has succeeded.

public abstract boolean validateOperands (WebNode node)

Returns whether the given node and its children are valid. The primary use of this is to ensure that the given node is valid within the given RW context.

Parameters
node The WebNode object which will be validated. If null is passed, then the validation will start at the root. Note that all children will be validated as well.
Returns
  • True if the expression is valid, false if it is not.