Package com.microstrategy.web.beans
Interface ExpressionBean
-
- All Superinterfaces:
EnumWebPersistableState
,Persistable
,RequestPersistable
,Transformable
,WebBean
,WebComponent
- All Known Subinterfaces:
DerivedElementBean
,ExpressionDisplayBean
,LimitExpressionBean
,RWViewExpressionBean
,SubsetUnitLimitBean
,ThresholdExpressionBean
- All Known Implementing Classes:
AbstractLimitExpressionBean
,DerivedElementBeanImpl
,ThresholdExpressionBeanImpl
public interface ExpressionBean extends WebBean
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.- Since:
- MicroStrategy Web 8.0.0
-
-
Field Summary
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acceptChange()
Accepts the change that is currently being worked upon.boolean
canSelectElements(WebAttribute webAttribute)
Returns true if Select Elements option can be used for the attributeWebAttributeForm
chooseDefaultForm(WebAttribute attr)
WebObjectInfo
getActiveObject()
Returns the active object, the object being qualified upon.int
getActiveOperatorNodeKey()
Returns the current active operator node key.WebElementSource
getElementSource(WebAttribute att)
Returns properly initialized element source for a given attribute.WebExpression
getExpression()
Returns the internal expression object.int
getExpressionBeanType()
Returns the expression bean type, fromEnumExpressionBeanType
.int
getExpressionEditMode()
Returns the current expression edit mode of the bean, fromEnumExpressionEditMode
.Scrollable
getIncrementalFetch()
Returns aScrollable
interface, which can be used to set the incremental fetch window for an attribute elements qualification.boolean
getMatchCase()
Returns the match case flag, used in searching element browsing request.WebObjectInfo
getRHS()
Returns the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparisonjava.lang.String
getUserSearchPattern()
Returns the search pattern that will be applied to any element browsing request.WebBeanError
getValidationErrorInfo()
This can hold a validation error which came about from the validate call.boolean
isEditable()
Returns whether the Expression bean is editable.boolean
isEditable(WebNode node)
Returns whether the given node can be edited properly under the current context of the application.boolean
isModified()
Returns whether this filter is modified from the filter object that it synchronizes with.void
populateObject(WebObjectInfo oi)
void
resetChanges()
Undoes all changes since the last synchronize call.void
setActiveOperatorNodeKey(int key, boolean isNew)
Sets the current active operator node key.void
setContext(ExpressionBeanContext context)
Sets theExpressionBeanContext
.void
setExpressionEditMode(int mode)
Sets the current expression edit mode of the bean, fromEnumExpressionEditMode
.void
setIsEditable(boolean value)
Sets whether the expression bean is editable.void
setMatchCase(boolean matchCase)
Sets the match case flag, which determines whether the user search pattern must match case or not.void
setRHS(WebObjectInfo rhs)
Set the unit(attribute form/metric) used on the Right Hand Side(RHS) of the filter comparisonvoid
setUserSearchPattern(java.lang.String pattern)
Sets the search pattern that will be applied to any element browsing request.void
setValidationErrorInfo(WebBeanError err)
boolean
shallSelectElements(WebAttribute webAttribute)
This method is used to decide what Attribute subexpression to create in a given context.void
synchronize()
Synchronizes any changes that have been made to this expression to the owner expression accessible on the WebReportInstance or WebPrompt object.void
undoChange()
Undoes the change that is currently being worked upon.boolean
validate()
Attempts to perform validation on the expression.boolean
validateOperands(WebNode node)
Returns whether the given node and its children are valid.-
Methods inherited from interface com.microstrategy.utils.serialization.Persistable
restoreState, restoreState, saveState, saveState, saveState, saveState
-
Methods inherited from interface com.microstrategy.web.beans.RequestPersistable
restoreStateFromRequest, restoreStateFromRequest
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
addTransform, addTransformByClass, addTransformByStyle, addTransformByStyle, clearTransforms, getBeanContext, getMessageString, getMyTransformInstances, getTransformInstance, getTransformInstance, getTransformInstances, getType, hasTransform, hasTransform, invalidateTransformCache, setBeanContext, transform, transform
-
Methods inherited from interface com.microstrategy.web.beans.WebBean
getDocument, getErrorInfo, getSessionInfo, isStale, setSessionInfo, setStale
-
Methods inherited from interface com.microstrategy.web.beans.WebComponent
addChild, addChildStateInfo, addChildStateInfo, collectData, collectMinimalData, generateOutput, getBeanContext, getChild, getChild, getChildByClass, getChildByType, getChildCount, getChildrenByClass, getDefaultStateLevel, getFeaturesManager, getMaximumStateLevel, getName, getOutputFormat, getParent, getPath, getPersistMode, getRenderingFilter, getRoot, getTargetBean, getTargetBeanPath, getWebEvent, getWebEvent, getWebEventHandler, getXMLStatus, handleRequest, hasChanged, hasJustOpened, initBean, invalidateChildrenState, isBeanContextEmpty, isFeatureAvailable, prepareForReuse, removeChild, removeChild, searchChild, setBeanContext, setBeanContext, setChanged, setChanged, setDefaultStateLevel, setFeaturesManager, setName, setOutputFormat, setParent, setPersistMode, setRenderingFilter, setTargetBean, setTargetBeanPath, setWebEventHandler
-
-
-
-
Method Detail
-
getExpression
WebExpression getExpression()
Returns the internal expression object. This expression can be used to make changes to the structure of the expression.- Returns:
- A
WebExpression
representing the expression being edited.
-
getExpressionEditMode
int getExpressionEditMode()
Returns the current expression edit mode of the bean, fromEnumExpressionEditMode
. This represents the current state of the bean.- Returns:
- The current expression edit mode of the bean, from
EnumExpressionEditMode
.
-
setExpressionEditMode
void setExpressionEditMode(int mode)
Sets the current expression edit mode of the bean, fromEnumExpressionEditMode
. 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, fromEnumExpressionEditMode
.
-
getActiveOperatorNodeKey
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.
-
setActiveOperatorNodeKey
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.
-
getActiveObject
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.
-
getUserSearchPattern
java.lang.String getUserSearchPattern()
Returns the search pattern that will be applied to any element browsing request.- Returns:
- The current user search pattern for element browsing.
-
setUserSearchPattern
void setUserSearchPattern(java.lang.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.
-
getMatchCase
boolean getMatchCase()
Returns the match case flag, used in searching element browsing request.- Returns:
- The current value of the match case flag.
-
setMatchCase
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.
-
isModified
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.
-
validate
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.
-
acceptChange
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.
-
undoChange
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.
-
synchronize
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.
-
resetChanges
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.
-
getValidationErrorInfo
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.
-
getExpressionBeanType
int getExpressionBeanType()
Returns the expression bean type, fromEnumExpressionBeanType
.- Returns:
- The expression bean type, from
EnumExpressionBeanType
.
-
getIncrementalFetch
Scrollable getIncrementalFetch()
Returns aScrollable
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.
-
validateOperands
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
- TheWebNode
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.
- Since:
- MicroStrategy Web 8.0.1
-
isEditable
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
- TheWebNode
object which is being checked.- Returns:
- True if the expression can be edited as-is, false if it cannot.
- Since:
- MicroStrategy Web 8.0.1
-
isEditable
boolean isEditable()
Returns whether the Expression bean is editable.- Returns:
- True if the bean is editable, false otherwise.
- Since:
- MicroStrategy Web 8.0.2
-
setIsEditable
void setIsEditable(boolean value)
Sets whether the expression bean is editable.- Parameters:
value
- True if the expression bean should be editable, false otherwise.- Since:
- MicroStrategy Web 8.0.2
-
populateObject
void populateObject(WebObjectInfo oi) throws WebBeanException
- Throws:
WebBeanException
- Since:
- MicroStrategy Web 8.0.2
-
setValidationErrorInfo
void setValidationErrorInfo(WebBeanError err)
- Since:
- MicroStrategy Web 9.0.0
-
setContext
void setContext(ExpressionBeanContext context)
Sets theExpressionBeanContext
. 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.- Since:
- MicroStrategy Web 9.0.0
-
getElementSource
WebElementSource getElementSource(WebAttribute att) throws WebObjectsException, WebBeanException
Returns properly initialized element source for a given attribute.- Parameters:
att
- attribute- Returns:
- properly initialized element source for a given attribute.
- Throws:
WebObjectsException
WebBeanException
- Since:
- MicroStrategy Web 9.0.0
-
canSelectElements
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
- Since:
- MicroStrategy Web 9.0.0
-
shallSelectElements
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.- Parameters:
webAttribute
-- Returns:
- true if getting list of available elements for a given attribute will be chip
- Since:
- MicroStrategy Web 9.0.0
-
chooseDefaultForm
WebAttributeForm chooseDefaultForm(WebAttribute attr) throws WebException, java.lang.IndexOutOfBoundsException, WebBeanException, WebObjectsException
- Throws:
WebException
java.lang.IndexOutOfBoundsException
WebBeanException
WebObjectsException
-
setRHS
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)
-
getRHS
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)
-
-