java.lang.Object | |
↳ | com.microstrategy.web.objects.WebMDXReportLimitHelper |
A subclass of the WebExpressionHelper that provides special functionality for editing limit expressions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WebMDXReportLimitHelper(WebReportInstance ri, WebExpression owner) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | addUnitLimit(WebNode node) | ||||||||||
boolean | canEditExpression() | ||||||||||
boolean |
canGroup(int firstKey, int secondKey)
Check whether it is possible to call group() on the two nodes with the given keys.
| ||||||||||
boolean |
canGroup(WebNode firstNode, WebNode secondNode)
Check whether it is possible to call group() on the two given nodes.
| ||||||||||
boolean |
canSwapWithNext(int nodeKey)
Checks whether it is possible to call swapWithNext() on the node with the given key.
| ||||||||||
boolean |
canSwapWithNext(WebNode node)
Checks whether it is possible to call swapWithNext() on the given node.
| ||||||||||
boolean |
canSwapWithPrevious(WebNode node)
Checks whether it is possible to call swapWithPrevious() on the given node.
| ||||||||||
boolean |
canSwapWithPrevious(int nodeKey)
Checks whether it is possible to call swapWithPrevious() on the node with the given key.
| ||||||||||
boolean |
canUngroup(int firstKey, int secondKey)
Check whether it is possible to call ungroup() on the two nodes with the given keys.
| ||||||||||
boolean |
canUngroup(WebNode firstNode, WebNode secondNode)
Check whether it is possible to call ungroup() on the two given nodes.
| ||||||||||
boolean |
compareTo(WebExpression anotherExp)
Compares two WebExpression.
| ||||||||||
void |
consolidateTree()
Consolidates the whole expression tree.
| ||||||||||
void |
delete(int nodeKey)
Delete the node with the given key from the expression.
| ||||||||||
void |
delete(WebNode node)
Delete the specified node from the expression.
| ||||||||||
WebNode |
findUnitNode(String unitId)
Finds a root node of the unit limit expression
| ||||||||||
boolean |
getAutoConsolidation()
Return the current setting for the auto-consolidation option.
| ||||||||||
WebOperatorNode |
getNewRootNode()
Creates a new root node for the specified
WebExpression . | ||||||||||
String |
getNodeGroupId(WebNode node)
Returns limit group ID of the given node
| ||||||||||
int |
getNodeLimitType(WebNode node)
Returns limit type
EnumWebLimitSummaryFlags of the given node | ||||||||||
String |
getNodeUnitId(WebNode node)
Returns unit ID of the given node
| ||||||||||
WebNode |
getUnitNode(WebNode node)
Gets a root node of the unit limit expression for a given expression node
| ||||||||||
WebNode |
group(int firstKey, int secondKey)
Group two nodes in the expression together.
| ||||||||||
WebNode |
group(WebNode firstNode, WebNode secondNode)
Group two nodes in the expression together.
| ||||||||||
boolean |
hasFilterOn(WebObjectInfo oi)
Returns whether the expression contains an qualification on specified object
| ||||||||||
boolean |
hasUnussignedPrompts(WebNode node)
Returns true if the given node contains unresolved prompts.
| ||||||||||
boolean |
isEqual(WebNode n1, WebNode n2)
Checks whether two WebNode are equal.
| ||||||||||
WebExpression |
removeEmptyFilters()
This method will take the current expression tree and attempt to remove any empty filters
in the expression.
| ||||||||||
void | removeLimits() | ||||||||||
void |
removeUnitLimit(String unitId)
Removes unit limit
| ||||||||||
void | replaceUnitLimit(WebNode node) | ||||||||||
void |
setAutoConsolidation(boolean auto)
Sets the auto-consolidation option on this instance.
| ||||||||||
void | setXdaInfo(String _xdaDimensionId, String _xdaHierarchyId) | ||||||||||
void |
swap(int firstKey, int secondKey)
Swap two nodes in the expression.
| ||||||||||
void |
swap(WebNode firstNode, WebNode secondNode)
Swap two nodes in the expression.
| ||||||||||
void |
swapWithNext(int nodeKey)
Swaps the node with the given key with its next sibling.
| ||||||||||
void |
swapWithNext(WebNode node)
Swap with next sibling.
| ||||||||||
void |
swapWithPrevious(int nodeKey)
Swaps the node with the given key with the previous sibling.
| ||||||||||
void |
swapWithPrevious(WebNode node)
Swap with previous sibling.
| ||||||||||
void |
toggleFunction(int firstKey, int secondKey, int toggleFunction)
Change the function between the two nodes with the given keys to the specified function.
| ||||||||||
void |
toggleFunction(WebNode firstNode, WebNode secondNode, int toggleFunction)
Change the function between the two given nodes to the specified function.
| ||||||||||
void |
ungroup(WebNode firstNode, WebNode secondNode)
Ungroup two nodes in the expression.
| ||||||||||
void |
ungroup(int firstKey, int secondKey)
Ungroup two nodes in the expression.
| ||||||||||
boolean |
validateOperands(WebNode node, RWDataSet ds)
Returns whether the given node and its children are valid.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | consolidateUnitLimit(WebExpressionImpl unitLimit) | ||||||||||
WebNode | findSecondSwapNode(WebNode node) | ||||||||||
WebObjectInfoImpl | findTarget(WebNode node) | ||||||||||
WebObjectInfoImpl | getTarget(WebNode node) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Check whether it is possible to call group() on the two nodes with the given keys.
firstKey | The key of the first node. |
---|---|
secondKey | The key of the second node. |
IllegalArgumentException |
---|
Check whether it is possible to call group() on the two given nodes.
firstNode | The first node. |
---|---|
secondNode | The second node. |
IllegalArgumentException |
---|
Checks whether it is possible to call swapWithNext() on the node with the given key.
nodeKey | The key of the node to be swapped. |
---|
IllegalArgumentException |
---|
Checks whether it is possible to call swapWithNext() on the given node.
node | The node to be swapped. |
---|
IllegalArgumentException |
---|
Checks whether it is possible to call swapWithPrevious() on the given node.
node | The node to be swapped. |
---|
IllegalArgumentException |
---|
Checks whether it is possible to call swapWithPrevious() on the node with the given key.
nodeKey | The key of the node to be swapped. |
---|
IllegalArgumentException |
---|
Check whether it is possible to call ungroup() on the two nodes with the given keys.
firstKey | The key of the first node. |
---|---|
secondKey | The key of the second node. |
IllegalArgumentException |
---|
Check whether it is possible to call ungroup() on the two given nodes.
firstNode | The first node. |
---|---|
secondNode | The second node. |
IllegalArgumentException |
---|
Compares two WebExpression. The comparison is based on the structure of each root node in the expressions.
Note that this method is currently used to compare the expressions which are used in derived elements editor.
anotherExp | the WebExpression to be compared.. |
---|
Consolidates the whole expression tree.
Consolidation rules:
Delete the node with the given key from the expression. If it is the root node of the expression, this method will do nothing.
nodeKey | The key of the node to be deleted. |
---|
IllegalArgumentException |
---|
Delete the specified node from the expression. If it is the root node of the expression, this method will do nothing.
node | The node to be deleted. |
---|
IllegalArgumentException |
---|
Finds a root node of the unit limit expression
unitId | an ID of the working set unit |
---|
Return the current setting for the auto-consolidation option. When the auto-consolidation setting is on, a consolidation of the expression tree will be done after every other manipulation on this interface. See the consolidateTree method for the effects of a consolidation operation. By default, this option is true.
Creates a new root node for the specified WebExpression
.
The new root node has function
EnumDSSXMLFunction.DssXmlFunctionAnd
and
expression type
EnumDSSXMLExpressionType.DssXmlFilterBranchQual
.
If the specified WebExpression
has any sub expression
originally, the sub expression becomes the first child of the new root
node after the method call returns.
Returns limit group ID of the given node
node | node |
---|
Returns limit type EnumWebLimitSummaryFlags
of the given node
node | node |
---|
Returns unit ID of the given node
node | node |
---|
Gets a root node of the unit limit expression for a given expression node
node | expression node |
---|
Group two nodes in the expression together. This method is used to identify the nodes by the key of the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT). This method will create a new node, which will have the same function (AND or OR) as the original parent of these two nodes. The new node is inserted at the position of the first given node, and the two given nodes will be set as child nodes of the newly created node.
firstKey | The key of the first node. |
---|---|
secondKey | The key of the second node. the parent node must be a NOT node, and that node must share a parent with the firstNode. |
IllegalArgumentException | |
---|---|
WebObjectsException |
Group two nodes in the expression together. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT). This method will create a new node, which will have the same function (AND or OR) as the original parent of these two nodes. The new node is inserted at the position of the first given node, and the two given nodes will be set as child nodes of the newly created node.
firstNode | The first input parameter, which must share a parent with secondNode |
---|---|
secondNode | The second input parameter, which must either share a parent with firstNode or the parent node must be a NOT node, and that node must share a parent with the firstNode. |
IllegalArgumentException | |
---|---|
WebObjectsException |
Returns whether the expression contains an qualification on specified object
Returns true if the given node contains unresolved prompts. In this case we don't know what unit to ussign this limit to.
Checks whether two WebNode are equal.
Note that this method is currently used to compare the expressions which are used in derived elements editor.
n1 | the first WebNode to check equality |
---|---|
n2 | the second WebNode to check equality |
This method will take the current expression tree and attempt to remove any empty filters in the expression. After doing that, it will consolidate the new expression. This method, if it is necessary to change the expresssion, will return a copy of the current expression; the expression that belongs to this WebExpressionHelper object will never be modified.
Removes unit limit
unitId | unit ID |
---|
Sets the auto-consolidation option on this instance. When the auto-consolidation setting is on, a consolidation of the expression tree will be done after every other manipulation on this interface. See the consolidateTree method for the effects of a consolidation operation.
auto | The desired setting for auto-consolidation. |
---|
Swap two nodes in the expression. These two nodes can be anywhere in the expression tree. After calling this method, the two nodes' locations will be swapped.
firstKey | The key of the first node to be swapped. |
---|---|
secondKey | The key of the second node to be swapped. |
IllegalArgumentException |
---|
Swap two nodes in the expression. These two nodes can be anywhere in the expression tree. After calling this method, the two nodes' locations will be swapped.
firstNode | The first node to be swapped. |
---|---|
secondNode | The second node to be swapped. |
IllegalArgumentException |
---|
Swaps the node with the given key with its next sibling. This only works if the given node is not the last child of it's parent node.
There are two special cases:
nodeKey | The key of the node to be swapped. |
---|
IllegalArgumentException | |
---|---|
WebObjectsException |
Swap with next sibling. If the node is the last child, it can not be moved backward further. Exception: If parent node is NOT node, swap with the NOT's next sibling If next sibling is NOT node, swap with its child
node | The node to be swapped. |
---|
IllegalArgumentException | |
---|---|
WebObjectsException |
Swaps the node with the given key with the previous sibling. This only works if the given node is not the first child of it's parent node.
There are two special cases:
nodeKey | The key of the node to be swapped. |
---|
IllegalArgumentException | |
---|---|
WebObjectsException |
Swap with previous sibling. If the node is the first child, it can not be moved forward further. Exception: If parent node is NOT node, swap with the NOT's previous sibling If previous sibling is NOT node, swap with its child
node | The node to be swapped. |
---|
IllegalArgumentException | |
---|---|
WebObjectsException |
Change the function between the two nodes with the given keys to the specified function. The functions
which are available come from EnumWebToggleFunction
. Note that if AND NOT or OR NOT
are the original operator, the node directly under the NOT node should be specified as
the second argument to this method.
These two nodes either should be the direct children of the same parent, or the second node must have a NOT node
as its parent which shares a parent with the first argument.
For example, if there were an AND node, with children firstNode and a NOT node which has the secondNode as a child node, then the original function is considered to be AND NOT.
Each time, this function will add a new node for the new toggleFunction first. Then if the auto consolidation is set, it may remove the original function node (the shared parent of the two input nodes).
firstKey | The key of the first node whose parent operator will be toggled. |
---|---|
secondKey | The key of the second node whose parent operator will be toggled. |
toggleFunction | The function to toggle to, which is a value from EnumWebToggleFunction . |
IllegalArgumentException | |
---|---|
WebObjectsException |
Change the function between the two given nodes to the specified function. The functions
which are available come from EnumWebToggleFunction
. Note that if AND NOT or OR NOT
are the original operator, the node directly under the NOT node should be specified as
the second argument to this method.
These two nodes either should be the direct children of the same parent, or the second node must have a NOT node
as its parent which shares a parent with the first argument.
For example, if there were an AND node, with children firstNode and a NOT node which has the secondNode as a child node, then the original function is considered to be AND NOT.
Each time, this function will add a new node for the new toggleFunction first. Then if the auto consolidation is set, it may remove the original function node (the shared parent of the two input nodes).
firstNode | The first node whose parent operator will be toggled. |
---|---|
secondNode | The second node whose parent operator will be toggled. |
toggleFunction | The function to toggle to, which is a value from EnumWebToggleFunction . |
IllegalArgumentException | |
---|---|
WebObjectsException |
Ungroup two nodes in the expression. The parent of both given nodes, which is an operator node, will be removed and the two child nodes will be moved to the removed node's position in the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT).
firstNode | The first node to be ungrouped. |
---|---|
secondNode | The second node to be ungrouped. |
IllegalArgumentException | |
---|---|
WebObjectsException |
Ungroup two nodes in the expression. This method allows the user to specify the nodes to be ungrouped by their keys. The parent of both given nodes, which is an operator node, will be removed and the two child nodes will be moved to the removed node's position in the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT).
firstKey | The key of first node to be ungrouped. |
---|---|
secondKey | The key of second node to be ungrouped. |
IllegalArgumentException | |
---|---|
WebObjectsException |
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.
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. |
---|---|
ds | The dataset which is used to validate if it contains the operand objects |