public class

WebDerivedElementsEditorObject

extends AbstractPersistable
implements WebDerivedElements EnumDSSXMLReportManipulationMethod
java.lang.Object
   ↳ com.microstrategy.utils.serialization.AbstractPersistable
     ↳ com.microstrategy.web.objects.WebDerivedElementsEditorObject

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
From interface com.microstrategy.webapi.EnumDSSXMLReportManipulationMethod
Fields
protected KeyedList allElements
protected WebXMLBuilder delta
protected WebExpressionImpl domainExpression
protected KeyedList elements
protected WebObjectsFactory factory
protected boolean isLocal
protected String linkedObjectName
Public Constructors
WebDerivedElementsEditorObject(WebAttribute _att)
Public Methods
WebDerivedElement acceptChanges(WebDerivedElement de)
Generates deltas for changes made to a given element
void acceptVisibleChanges()
Generates deltas for visibility changes made to derived element
void add(WebDerivedElement de, int position)
Adds new derived element to a collection
WebDerivedElement addSortDerivedElement()
void applyChanges(WebDerivedElements target)
Applies accumulated changes to the target template derived elements
void clear()
Removes all Derived Elements from the collection.
void commitChanges()
Clears deltas.
boolean contains(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.
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(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.
static String getDisplayString(WebDerivedElement de)
WebExpression getDomainExpression()
int getInsertPosition()
String getLinkedObjectName()
boolean hasChanges()
Returns true if anything changed
boolean hasVisibleList()
Indicates whether the template attribute has a list of visible derived elements.
void importDerivedElement(String deId)
Import standalone derived element.
int indexOf(String id)
Finds the index of Derived Element with the given id.
boolean isEditable()
boolean isLinked()
boolean isSort()
void moveTo(String id, int position)
Moves spesified Derived Element to specify position
WebDerivedElement newDerivedElement(int type)
Creates new derived element
void populate(WebDerivedElements src)
Copies information from the template attribute derived elements
WebDerivedElement remove(String id)
Removes the Derived Element object with the given id from the collection;
WebDerivedElement remove(int index)
Removes a derived element located in the index position.
boolean restoreState(SAXSupport parser, String uri, String localName, String qName, Attributes attrs)
Restores current state
void saveXMLState(XMLStateSerializer stateBuilder, int howMuchState)
Saves current state
void setIsEditable(boolean editable)
This method is deprecated. use setIsLinked(boolean) instead.
void setIsLinked(boolean isLinked)
void setName(String value)
int size()
Returns the number of elements currently in the collection.
KeyedList toKeyedList()
Returns KeyedList of active derived elements
Protected Methods
KeyedList getCreateAllElements()
void saveXMLState(WebXMLBuilder builder, int howMuchState)
void saveXMLState(StringBuffer buf, int howMuchState)
[Expand]
Inherited Methods
From class com.microstrategy.utils.serialization.AbstractPersistable
From class java.lang.Object
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.objects.WebDerivedElements

Fields

protected KeyedList allElements

protected WebXMLBuilder delta

protected WebExpressionImpl domainExpression

protected KeyedList elements

protected WebObjectsFactory factory

protected boolean isLocal

protected String linkedObjectName

Public Constructors

public WebDerivedElementsEditorObject (WebAttribute _att)

Public Methods

public WebDerivedElement acceptChanges (WebDerivedElement de)

Generates deltas for changes made to a given element

Parameters
de WebDerivedElement
Throws
IllegalArgumentException Thrown if element does not exist in the collection

public void acceptVisibleChanges ()

Generates deltas for visibility changes made to derived element

public void add (WebDerivedElement de, int position)

Adds new derived element to a collection

Parameters
de element
position position

public WebDerivedElement addSortDerivedElement ()

public void applyChanges (WebDerivedElements target)

Applies accumulated changes to the target template derived elements

public void clear ()

Removes all Derived Elements from the collection.

Throws
UnsupportedOperationException

public void commitChanges ()

Clears deltas. (We can do this only after we are sure that applying changes on the report or document succeeded).

public boolean contains (String id)

Returns true if the Derived Element with the given id exists in the collection.

Parameters
id The Derived Element ID.
Returns
  • Whether the element with the given id exists in the collection.

public void convertToLocalDerivedElement ()

Converts stand-alone derived elements to local derived elements.

public Enumeration elements ()

Returns a java.util.Enumeration which can be used to iterate through the list of elements in the collection.

Returns
  • An Enumeration which allows iteration through the collection.

public WebDerivedElement get (int index)

Returns the Derived Element object with the given index.

Parameters
index The index of the element in the collection.
Returns
  • The Derived Element object corresponding to the given index in the collection.
Throws
IndexOutOfBoundsException

public WebDerivedElement get (String id)

Returns a Derived Element object with the given id, if it exists.

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
IllegalArgumentException

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.

public static String getDisplayString (WebDerivedElement de)

public WebExpression getDomainExpression ()

public int getInsertPosition ()

public String getLinkedObjectName ()

public boolean hasChanges ()

Returns true if anything changed

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.

public void importDerivedElement (String deId)

Import standalone derived element. The imported element replaces all existing derived elements.

public int indexOf (String id)

Finds the index of Derived Element with the given id.

Parameters
id String
Returns
  • index or -1 if element not found.

public boolean isEditable ()

public boolean isLinked ()

public boolean isSort ()

public void moveTo (String id, int position)

Moves spesified Derived Element to specify position

Parameters
id element ID
position new position

public WebDerivedElement newDerivedElement (int type)

Creates new derived element

public void populate (WebDerivedElements src)

Copies information from the template attribute derived elements

public WebDerivedElement remove (String id)

Removes the Derived Element object with the given id from the collection;

Parameters
id The element id.
Throws
UnsupportedOperationException

public WebDerivedElement remove (int index)

Removes a derived element located in the index position.

Parameters
index position
Returns
  • Removed derived element
Throws
UnsupportedOperationException
IndexOutOfBoundsException

public boolean restoreState (SAXSupport parser, String uri, String localName, String qName, Attributes attrs)

Restores current state

Parameters
parser a SAX parser processing the XML representation of a state
uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
localName The local name (without prefix), or the empty string if Namespace processing is not being performed
qName The qualified name (with prefix), or the empty string if qualified names are not available
attrs 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.

public void saveXMLState (XMLStateSerializer stateBuilder, int howMuchState)

Saves current state

public void setIsEditable (boolean editable)

This method is deprecated.
use setIsLinked(boolean) instead.

public void setIsLinked (boolean isLinked)

public void setName (String value)

public int size ()

Returns the number of elements currently in the collection.

Returns
  • The current number of elements in the collection.

public KeyedList toKeyedList ()

Returns KeyedList of active derived elements

Protected Methods

protected KeyedList getCreateAllElements ()

protected void saveXMLState (WebXMLBuilder builder, int howMuchState)

protected void saveXMLState (StringBuffer buf, int howMuchState)