Package com.microstrategy.web.objects
Class WebDerivedElementsEditorObject
- java.lang.Object
-
- com.microstrategy.utils.serialization.AbstractPersistable
-
- com.microstrategy.web.objects.WebDerivedElementsEditorObject
-
- All Implemented Interfaces:
EnumWebPersistableState
,Persistable
,WebDerivedElements
,EnumDSSXMLReportManipulationMethod
public class WebDerivedElementsEditorObject extends AbstractPersistable
This class represents derived elements inside derived elements editor. All changes performed by a user inside the editor are kept there until user clicks OK button. Then all accumulated changes are applied to the target template attribute derived elements. To support this we accumulated all generated deltas in a local buffer.- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyedList
allElements
protected WebXMLBuilder
delta
protected com.microstrategy.web.objects.WebExpressionImpl
domainExpression
protected KeyedList
elements
protected WebObjectsFactory
factory
protected boolean
isLocal
protected java.lang.String
linkedObjectName
-
Fields inherited from class com.microstrategy.utils.serialization.AbstractPersistable
scriptEndTagEncoder
-
Fields inherited from interface com.microstrategy.webapi.EnumDSSXMLReportManipulationMethod
DssReportManipulationAddCalculationQuickGroup, DssReportManipulationAddListQuickGroup, DssReportManipulationAddPassThroughDerivedElementToManagedConsolidationObject, DssReportManipulationApplyReconciliation, DssReportManipulationCustomSortAddActions, DssReportManipulationRemoveDerivedElementFromManagedConsolidationObject, DssReportManipulationRemoveSortByIndex, DssReportManipulationSetDerivedElementPropertiesOnManagedConsolidationObject, DssReportManipulationSetRowsOfDataPreview, DssXmlFormatDerivedElementOnManagedConsolidationObject, DssXmlReportManipulationAddBaseForm, DssxmlReportManipulationAddConsolidationObject, DssXmlReportManipulationAddDerivedAttribute, DssXmlReportManipulationAddDerivedElement, DssXmlReportManipulationAddDerivedElementReference, DssXmlReportManipulationAddDerivedMetric, DssxmlReportManipulationAddDropZoneUnit, DssXmlReportManipulationAddForm, DSSXmlReportManipulationAddLimi, DSSXmlReportManipulationAddLimit, DSSXmlReportManipulationAddLimitToBase, DSSXmlReportManipulationAddLimitToView, DssXmlReportManipulationAddMetric, DssXmlReportManipulationAddPercentToTotalMetric, DssXmlReportManipulationAddQuickCalc, DssXmlReportManipulationAddQuickList, DssXmlReportManipulationAddRankMetric, DssXmlReportManipulationAddShortcutMetric, DssXmlReportManipulationAddTransformationMetric, DssXmlReportManipulationAddUnit, DssXmlReportManipulationAddUnitToBase, DssXmlReportManipulationApplyDeliveryThresholds, DssXmlReportManipulationApplyStyle, DssXmlReportManipulationApplyStyleObject, DssXmlReportManipulationAxisSubtotals, DssXmlReportManipulationAxisSubtotalsObject, DssXmlReportManipulationCancelFilterAgg, DssXmlReportManipulationChangeMapping, DssXmlReportManipulationChangeMetricDynamicAlias, DssXmlReportManipulationChangeUnitDisplayName, DssXmlReportManipulationClearDerivedElementReference, DssXmlReportManipulationClearEmmaTableStatus, DssXmlReportManipulationClearSortDEs, DssXmlReportManipulationClearTemplate, DssXmlReportManipulationClearUnit, DssXmlReportManipulationConvertIntoDerivedMetric, DssxmlReportManipulationCreateDropZone, DssxmlReportManipulationCreateDropZones, DssXmlReportManipulationCreateEmmaCubeIRRSourceTable, DssXmlReportManipulationCreateEmmaCubeSourceTable, DSSXmlReportManipulationCreateThreshold, DssXmlReportManipulationDeleteEmmaCubeSourceTable, DssXmlReportManipulationDeleteEmmaIRRCubeSourceTable, DssXmlReportManipulationEditBaseFilter, DssXmlReportManipulationEditEmmaCubeIRRSourceTable, DssXmlReportManipulationEditEmmaCubeSourceTable, DssXmlReportManipulationEditEmmaCubeTableStateInfo, DssXmlReportManipulationEditFFSSQL, DssXmlReportManipulationEditFilter, DssXmlReportManipulationEditPartitionInfo, DssXmlReportManipulationEditQuickCalc, DssXmlReportManipulationEditQuickList, DssXmlReportManipulationEditRelationship, DssXmlReportManipulationEditReportDefinition, DssXmlReportManipulationFormatAxis, DssXmlReportManipulationFormatDerivedElement, DssXmlReportManipulationFormatTemplate, DssXmlReportManipulationFormatUnit, DssXmlReportManipulationHideBanding, DssXmlReportManipulationHideSubtotals, DssXmlReportManipulationHideThresholds, DssXmlReportManipulationLockUnit, DssXmlReportManipulationMakeTabular, DssXmlReportManipulationMappingEmmaCubeSourceTable, DssXmlReportManipulationMergeEMMACube, DssXmlReportManipulationPageBy, DssXmlReportManipulationPivotUnit, DssXmlReportManipulationPutProperties, DssXmlReportManipulationRAExpand, DssXmlReportManipulationRAFilterExpand, DssXmlReportManipulationRemoveBaseForm, DssXmlReportManipulationRemoveBaseUnit, DssXmlReportManipulationRemoveDE, DssXmlReportManipulationRemoveDerivedElement, DssxmlReportManipulationRemoveDropZoneUnit, DssXmlReportManipulationRemoveForm, DSSXmlReportManipulationRemoveLimit, DSSXmlReportManipulationRemoveLimitFromBase, DSSXmlReportManipulationRemoveLimitFromView, DssXmlReportManipulationRemoveSort, DssXmlReportManipulationRemoveSubtotal, DssXmlReportManipulationRemoveSubtotals, DSSXmlReportManipulationRemoveThreshold, DssXmlReportManipulationRemoveTransactionInfoOnUnit, DssXmlReportManipulationRemoveUnit, DssXmlReportManipulationRenameEmmaSrcTable, DssXmlReportManipulationReorderThresholds, DssXmlReportManipulationResetForms, DssXmlReportManipulationSelectDerivedElementReference, DssXmlReportManipulationSetAbbreviation, DssXmlReportManipulationSetBaseFilter, DssXmlReportManipulationSetCubeReport, DssXmlReportManipulationSetDataImportInfo, DssXmlReportManipulationSetDatamart, DssXmlReportManipulationSetDerivedElementHierarchyOption, DssXmlReportManipulationSetDerivedElementProperties, DssXmlReportManipulationSetEvaluationOrder, DssXmlReportManipulationSetFileBinary, DssXmlReportManipulationSetFilter, DssXmlReportManipulationSetGraphProperties, DssXmlReportManipulationSetReportObjectProperties, DssXmlReportManipulationSetSearchIndexInEmmaCube, DssXmlReportManipulationSetSourceTable, DssXmlReportManipulationSetTransactionInfoOnUnit, DssXmlReportManipulationSetUnitData, DssXmlReportManipulationSetUnitPropertiesInTargetFolder, DssXmlReportManipulationSetWidthClear, DssXmlReportManipulationSetWidthColumnScenario, DssXmlReportManipulationSetWidthHeader, DssXmlReportManipulationSetWidthMetric, DssXmlReportManipulationSetWidthRowScenario, DssXmlReportManipulationShowBanding, DssXmlReportManipulationShowSubtotals, DssXmlReportManipulationShowThresholds, DssXmlReportManipulationSort, DssXmlReportManipulationStartFilterAgg, DssXmlReportManipulationSyncEMMACube, DssXmlReportManipulationToggleDatasetServeMode, DssXmlReportManipulationUnitSubtotals, DssXmlReportManipulationUnitSubtotalsObject, DssXmlReportManipulationUnlockUnit, DssXmlReportManipulationUnSelectDerivedElementReference, DssXmlReportManipulationUpdateDerivedAttribute, DssXmlReportManipulationUpdateDerivedElement, DssXmlReportManipulationUpdateDerivedMetric, DSSXmlReportManipulationUpdateThreshold, DssXmlReportManipulationValidateAndCleanupRelationship, DssXmlReportManipulationValidateExpression, DssXmlSetDerivedElementHierarchyOptionsOnManagedConsolidationObject
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Constructor Summary
Constructors Constructor Description WebDerivedElementsEditorObject(WebAttribute _att)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WebDerivedElement
acceptChanges(WebDerivedElement de)
Generates deltas for changes made to a given elementvoid
acceptVisibleChanges()
Generates deltas for visibility changes made to derived elementvoid
add(WebDerivedElement de, int position)
Adds new derived element to a collectionWebDerivedElement
addSortDerivedElement()
void
applyChanges(WebDerivedElements target)
Applies accumulated changes to the target template derived elementsvoid
clear()
Removes all Derived Elements from the collection.void
commitChanges()
Clears deltas.boolean
contains(java.lang.String id)
Returns true if the Derived Element with the given id exists in the collection.void
convertToLocalDerivedElement()
Converts stand-alone derived elements to local derived elements.java.util.Enumeration
elements()
Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.WebDerivedElement
get(int index)
Returns the Derived Element object with the given index.WebDerivedElement
get(java.lang.String id)
Returns a Derived Element object with the given id, if it exists.KeyedList
getAllElements()
Returns all elements including "dormant" elements, which were deleted by a user but remaind in the all elements collection because other elements have references to them.protected KeyedList
getCreateAllElements()
static java.lang.String
getDisplayString(WebDerivedElement de)
WebExpression
getDomainExpression()
int
getInsertPosition()
java.lang.String
getLinkedObjectName()
boolean
hasChanges()
Returns true if anything changedboolean
hasVisibleList()
Indicates whether the template attribute has a list of visible derived elements.void
importDerivedElement(java.lang.String deId)
Import standalone derived element.int
indexOf(java.lang.String id)
Finds the index of Derived Element with the given id.boolean
isEditable()
boolean
isLinked()
boolean
isSort()
void
moveTo(java.lang.String id, int position)
Moves spesified Derived Element to specify positionWebDerivedElement
newDerivedElement(int type)
Creates new derived elementvoid
populate(WebDerivedElements src)
Copies information from the template attribute derived elementsWebDerivedElement
remove(int index)
Removes a derived element located in theindex
position.WebDerivedElement
remove(java.lang.String id)
Removes the Derived Element object with the given id from the collection;boolean
restoreState(SAXSupport parser, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
Restores current statevoid
saveXMLState(XMLStateSerializer stateBuilder, int howMuchState)
Saves current stateprotected void
saveXMLState(WebXMLBuilder builder, int howMuchState)
protected void
saveXMLState(java.lang.StringBuffer buf, int howMuchState)
void
setIsEditable(boolean editable)
Deprecated.usesetIsLinked(boolean)
instead.void
setIsLinked(boolean isLinked)
void
setName(java.lang.String value)
int
size()
Returns the number of elements currently in the collection.KeyedList
toKeyedList()
Returns KeyedList of active derived elements-
Methods inherited from class com.microstrategy.utils.serialization.AbstractPersistable
doFlatState, doFlatState, getStateHandler, isXMLStateZipped, restoreState, restoreXMLState, saveState, saveState, saveState, saveState, saveXMLState
-
-
-
-
Field Detail
-
elements
protected KeyedList elements
-
allElements
protected KeyedList allElements
-
factory
protected WebObjectsFactory factory
-
isLocal
protected boolean isLocal
-
linkedObjectName
protected java.lang.String linkedObjectName
-
delta
protected WebXMLBuilder delta
-
domainExpression
protected com.microstrategy.web.objects.WebExpressionImpl domainExpression
-
-
Constructor Detail
-
WebDerivedElementsEditorObject
public WebDerivedElementsEditorObject(WebAttribute _att)
-
-
Method Detail
-
hasVisibleList
public boolean hasVisibleList()
Indicates whether the template attribute has a list of visible derived elements. If it doesn't then all active derived elements are visible. In this case when the first derived element becomes invisible we must add all other dervied elements to the visible list.- Specified by:
hasVisibleList
in interfaceWebDerivedElements
-
populate
public void populate(WebDerivedElements src)
Copies information from the template attribute derived elements- Parameters:
src
-
-
add
public void add(WebDerivedElement de, int position)
Adds new derived element to a collection- Specified by:
add
in interfaceWebDerivedElements
- Parameters:
de
- elementposition
- position
-
acceptChanges
public WebDerivedElement acceptChanges(WebDerivedElement de) throws java.lang.IllegalArgumentException
Generates deltas for changes made to a given element- Parameters:
de
- WebDerivedElement- Throws:
java.lang.IllegalArgumentException
- Thrown if element does not exist in the collection
-
saveXMLState
public void saveXMLState(XMLStateSerializer stateBuilder, int howMuchState)
Saves current state
-
restoreState
public boolean restoreState(SAXSupport parser, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
Restores current state- Specified by:
restoreState
in interfacePersistable
- Parameters:
parser
- a SAX parser processing the XML representation of a stateuri
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedlocalName
- The local name (without prefix), or the empty string if Namespace processing is not being performedqName
- The qualified name (with prefix), or the empty string if qualified names are not availableattrs
- The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object- Returns:
true
to indicate a successful restoration. Otherwise,false
will be returned.
-
getAllElements
public KeyedList getAllElements()
Returns all elements including "dormant" elements, which were deleted by a user but remaind in the all elements collection because other elements have references to them.
-
newDerivedElement
public WebDerivedElement newDerivedElement(int type)
Creates new derived element- Parameters:
type
-
-
addSortDerivedElement
public WebDerivedElement addSortDerivedElement() throws WebObjectsException
- Throws:
WebObjectsException
-
hasChanges
public boolean hasChanges()
Returns true if anything changed
-
applyChanges
public void applyChanges(WebDerivedElements target)
Applies accumulated changes to the target template derived elements- Parameters:
target
-
-
commitChanges
public void commitChanges()
Clears deltas. (We can do this only after we are sure that applying changes on the report or document succeeded).- Since:
- MicroStrategy Web 9.0.1
-
toKeyedList
public KeyedList toKeyedList()
Returns KeyedList of active derived elements
-
importDerivedElement
public void importDerivedElement(java.lang.String deId)
Import standalone derived element. The imported element replaces all existing derived elements.- Parameters:
deId
-
-
convertToLocalDerivedElement
public void convertToLocalDerivedElement()
Converts stand-alone derived elements to local derived elements.
-
acceptVisibleChanges
public void acceptVisibleChanges()
Generates deltas for visibility changes made to derived element
-
getDisplayString
public static java.lang.String getDisplayString(WebDerivedElement de)
-
setName
public void setName(java.lang.String value)
-
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interfaceWebDerivedElements
-
getLinkedObjectName
public java.lang.String getLinkedObjectName()
- Specified by:
getLinkedObjectName
in interfaceWebDerivedElements
-
isLinked
public boolean isLinked()
- Specified by:
isLinked
in interfaceWebDerivedElements
-
setIsLinked
public void setIsLinked(boolean isLinked)
-
setIsEditable
public void setIsEditable(boolean editable)
Deprecated.usesetIsLinked(boolean)
instead.- Parameters:
editable
-
-
get
public WebDerivedElement get(int index) throws java.lang.IndexOutOfBoundsException
Description copied from interface:WebDerivedElements
Returns the Derived Element object with the given index.- Specified by:
get
in interfaceWebDerivedElements
- Parameters:
index
- The index of the element in the collection.- Returns:
- The Derived Element object corresponding to the given index in the collection.
- Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the given index is out of the bounds of the collection.
-
get
public WebDerivedElement get(java.lang.String id) throws java.lang.IllegalArgumentException
Description copied from interface:WebDerivedElements
Returns a Derived Element object with the given id, if it exists.- Specified by:
get
in interfaceWebDerivedElements
- Parameters:
id
- The key of the element to search for in the collection.- Returns:
- A Derived Element object in the collection corresponding to the given key.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the element with the given id does not exist in the collection.
-
indexOf
public int indexOf(java.lang.String id)
Description copied from interface:WebDerivedElements
Finds the index of Derived Element with the given id.- Specified by:
indexOf
in interfaceWebDerivedElements
- Parameters:
id
- String- Returns:
- index or -1 if element not found.
-
getCreateAllElements
protected KeyedList getCreateAllElements()
-
remove
public WebDerivedElement remove(int index) throws java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException
Description copied from interface:WebDerivedElements
Removes a derived element located in theindex
position.- Specified by:
remove
in interfaceWebDerivedElements
- Parameters:
index
- position- Returns:
- Removed derived element
- Throws:
java.lang.IndexOutOfBoundsException
- if index is out of boundsjava.lang.UnsupportedOperationException
-
moveTo
public void moveTo(java.lang.String id, int position)
Description copied from interface:WebDerivedElements
Moves spesified Derived Element to specify position- Specified by:
moveTo
in interfaceWebDerivedElements
- Parameters:
id
- element IDposition
- new position
-
remove
public WebDerivedElement remove(java.lang.String id) throws java.lang.UnsupportedOperationException
Description copied from interface:WebDerivedElements
Removes the Derived Element object with the given id from the collection;- Specified by:
remove
in interfaceWebDerivedElements
- Parameters:
id
- The element id.- Throws:
java.lang.UnsupportedOperationException
-
clear
public void clear() throws java.lang.UnsupportedOperationException
Description copied from interface:WebDerivedElements
Removes all Derived Elements from the collection.- Specified by:
clear
in interfaceWebDerivedElements
- Throws:
java.lang.UnsupportedOperationException
-
size
public int size()
Description copied from interface:WebDerivedElements
Returns the number of elements currently in the collection.- Specified by:
size
in interfaceWebDerivedElements
- Returns:
- The current number of elements in the collection.
-
contains
public boolean contains(java.lang.String id)
Description copied from interface:WebDerivedElements
Returns true if the Derived Element with the given id exists in the collection.- Specified by:
contains
in interfaceWebDerivedElements
- Parameters:
id
- The Derived Element ID.- Returns:
- Whether the element with the given id exists in the collection.
-
elements
public java.util.Enumeration elements()
Description copied from interface:WebDerivedElements
Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.- Specified by:
elements
in interfaceWebDerivedElements
- Returns:
- An Enumeration which allows iteration through the collection.
-
getDomainExpression
public WebExpression getDomainExpression()
- Specified by:
getDomainExpression
in interfaceWebDerivedElements
-
getInsertPosition
public int getInsertPosition()
- Specified by:
getInsertPosition
in interfaceWebDerivedElements
-
isSort
public boolean isSort()
- Specified by:
isSort
in interfaceWebDerivedElements
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState)
- Overrides:
saveXMLState
in classAbstractPersistable
-
saveXMLState
protected void saveXMLState(WebXMLBuilder builder, int howMuchState)
-
-