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 KeyedListallElementsprotected WebXMLBuilderdeltaprotected com.microstrategy.web.objects.WebExpressionImpldomainExpressionprotected KeyedListelementsprotected WebObjectsFactoryfactoryprotected booleanisLocalprotected java.lang.StringlinkedObjectName-
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 WebDerivedElementacceptChanges(WebDerivedElement de)Generates deltas for changes made to a given elementvoidacceptVisibleChanges()Generates deltas for visibility changes made to derived elementvoidadd(WebDerivedElement de, int position)Adds new derived element to a collectionWebDerivedElementaddSortDerivedElement()voidapplyChanges(WebDerivedElements target)Applies accumulated changes to the target template derived elementsvoidclear()Removes all Derived Elements from the collection.voidcommitChanges()Clears deltas.booleancontains(java.lang.String id)Returns true if the Derived Element with the given id exists in the collection.voidconvertToLocalDerivedElement()Converts stand-alone derived elements to local derived elements.java.util.Enumerationelements()Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.WebDerivedElementget(int index)Returns the Derived Element object with the given index.WebDerivedElementget(java.lang.String id)Returns a Derived Element object with the given id, if it exists.KeyedListgetAllElements()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 KeyedListgetCreateAllElements()static java.lang.StringgetDisplayString(WebDerivedElement de)WebExpressiongetDomainExpression()intgetInsertPosition()java.lang.StringgetLinkedObjectName()booleanhasChanges()Returns true if anything changedbooleanhasVisibleList()Indicates whether the template attribute has a list of visible derived elements.voidimportDerivedElement(java.lang.String deId)Import standalone derived element.intindexOf(java.lang.String id)Finds the index of Derived Element with the given id.booleanisEditable()booleanisLinked()booleanisSort()voidmoveTo(java.lang.String id, int position)Moves spesified Derived Element to specify positionWebDerivedElementnewDerivedElement(int type)Creates new derived elementvoidpopulate(WebDerivedElements src)Copies information from the template attribute derived elementsWebDerivedElementremove(int index)Removes a derived element located in theindexposition.WebDerivedElementremove(java.lang.String id)Removes the Derived Element object with the given id from the collection;booleanrestoreState(SAXSupport parser, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)Restores current statevoidsaveXMLState(XMLStateSerializer stateBuilder, int howMuchState)Saves current stateprotected voidsaveXMLState(WebXMLBuilder builder, int howMuchState)protected voidsaveXMLState(java.lang.StringBuffer buf, int howMuchState)voidsetIsEditable(boolean editable)Deprecated.usesetIsLinked(boolean)instead.voidsetIsLinked(boolean isLinked)voidsetName(java.lang.String value)intsize()Returns the number of elements currently in the collection.KeyedListtoKeyedList()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:
hasVisibleListin 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:
addin 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:
restoreStatein 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:
trueto indicate a successful restoration. Otherwise,falsewill 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:
isEditablein interfaceWebDerivedElements
-
getLinkedObjectName
public java.lang.String getLinkedObjectName()
- Specified by:
getLinkedObjectNamein interfaceWebDerivedElements
-
isLinked
public boolean isLinked()
- Specified by:
isLinkedin 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:WebDerivedElementsReturns the Derived Element object with the given index.- Specified by:
getin 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:WebDerivedElementsReturns a Derived Element object with the given id, if it exists.- Specified by:
getin 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:WebDerivedElementsFinds the index of Derived Element with the given id.- Specified by:
indexOfin 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:WebDerivedElementsRemoves a derived element located in theindexposition.- Specified by:
removein 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:WebDerivedElementsMoves spesified Derived Element to specify position- Specified by:
moveToin interfaceWebDerivedElements- Parameters:
id- element IDposition- new position
-
remove
public WebDerivedElement remove(java.lang.String id) throws java.lang.UnsupportedOperationException
Description copied from interface:WebDerivedElementsRemoves the Derived Element object with the given id from the collection;- Specified by:
removein interfaceWebDerivedElements- Parameters:
id- The element id.- Throws:
java.lang.UnsupportedOperationException
-
clear
public void clear() throws java.lang.UnsupportedOperationExceptionDescription copied from interface:WebDerivedElementsRemoves all Derived Elements from the collection.- Specified by:
clearin interfaceWebDerivedElements- Throws:
java.lang.UnsupportedOperationException
-
size
public int size()
Description copied from interface:WebDerivedElementsReturns the number of elements currently in the collection.- Specified by:
sizein interfaceWebDerivedElements- Returns:
- The current number of elements in the collection.
-
contains
public boolean contains(java.lang.String id)
Description copied from interface:WebDerivedElementsReturns true if the Derived Element with the given id exists in the collection.- Specified by:
containsin 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:WebDerivedElementsReturns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.- Specified by:
elementsin interfaceWebDerivedElements- Returns:
- An Enumeration which allows iteration through the collection.
-
getDomainExpression
public WebExpression getDomainExpression()
- Specified by:
getDomainExpressionin interfaceWebDerivedElements
-
getInsertPosition
public int getInsertPosition()
- Specified by:
getInsertPositionin interfaceWebDerivedElements
-
isSort
public boolean isSort()
- Specified by:
isSortin interfaceWebDerivedElements
-
saveXMLState
protected void saveXMLState(java.lang.StringBuffer buf, int howMuchState)- Overrides:
saveXMLStatein classAbstractPersistable
-
saveXMLState
protected void saveXMLState(WebXMLBuilder builder, int howMuchState)
-
-