public interface

WebTemplateMetrics

com.microstrategy.web.objects.WebTemplateMetrics

Class Overview

The WebTemplateMetrics object represents the metrics collection which exists on a template. This object contains a collection of metrics, ordered by position. The WebTemplateMetrics object can be used to add, remove, and examine metrics on the template.

Summary

Public Methods
abstract WebTemplateMetric add(WebObjectInfo object, boolean copyFormatting)
abstract WebTemplateMetric add(WebObjectInfo object, int beforeKey)
Adds the given object to the metrics collection before the object with the given key.
abstract WebTemplateMetric add(WebObjectInfo object)
Adds the given object to the end of the metrics collection.
abstract void addSubtotal(int subtotalType, int subtotalStyle, int axisIndex)
This method is deprecated. Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use activateAxisSubtotal(int, int, int) instead.
abstract boolean canToggleThresholds()
Indicates whether thresholds display can be turned on/off
abstract void clear(boolean isDisableOnly)
Clears all metrics from the collection.
abstract void clear()
Clears all metrics from the collection.
abstract boolean contains(WebObjectInfo object)
Searches for the WebTemplateMetric object which refers to the given WebObjectInfo object in the metrics collection.
abstract boolean containsKey(int key)
Returns whether the given key exists in the metrics collection.
abstract Enumeration elements()
Returns a java.util.Enumeration, which can be used to iterate through the WebTemplateMetric objects in the collection in position ordering.
abstract WebTemplateMetric get(int index)
Returns the WebTemplateMetric object with the given index.
abstract WebTemplateMetric getItemById(String id)
Finds a template metric based on metric DSS ID.
abstract WebTemplateMetric getItemByKey(int key)
Returns the WebTemplateMetric object with the given key.
abstract WebTemplateUnit getTemplateUnit()
Returns the WebTemplateUnit which this object is associated with.
abstract boolean hasThresholds()
Indicates whether there are any thresholds defined on the underlying metrics
abstract int indexOf(String id)
Returns an index of the template metric for specified metric DSS ID or -1 if it is not found.
abstract boolean isEmpty()
Returns true if the collection has no metrics in it.
abstract boolean isThresholdsDisplayEnabled()
Indicates whether at least one of the thresholds defined on the underlying metrics is enabled
abstract int keyOf(WebObjectInfo object)
Searches for the WebTemplateMetric object which refers to the given WebObjectInfo object in the metrics collection, and returns the key of that object.
abstract void move(int fromPosition, int toPosition)
Moves the WebTemplateMetric object at the given position in the collection to the new position.
abstract void remove(int index)
Removes the WebTemplateMetric object at the given index from the collection.
abstract void remove(int index, boolean isDisableOnly)
Removes the WebTemplateMetric object at the given index from the collection.
abstract void removeAllSubtotals()
This method is deprecated. Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use deActivateAll() instead.
abstract void removeItemByKey(int key, boolean isDisableOnly)
Removes the WebTemplateMetric object with the given key from the collection.
abstract void removeItemByKey(int key)
Removes the WebTemplateMetric object with the given key from the collection.
abstract void removeSubtotal(int subtotalType)
This method is deprecated. Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use deActivate(int) instead.
abstract void setShowThresholds(boolean show)
Set or clear all threasholds of all metrics.
abstract int size()
Returns the number of WebTemplateMetric objects in the metrics collection.

Public Methods

public abstract WebTemplateMetric add (WebObjectInfo object, boolean copyFormatting)

Throws
IllegalArgumentException
UnsupportedOperationException

public abstract WebTemplateMetric add (WebObjectInfo object, int beforeKey)

Adds the given object to the metrics collection before the object with the given key. This object must be of type DssXmlTypeMetric.

Parameters
object The metric to add to the collection.
beforeKey The key of another metric in the collection, which the new metric will be placed before.
Returns
Throws
UnsupportedOperationException Signals that the template is marked read-only.
IllegalArgumentException Signals that the object passed to this method is not of type metric, or if the key is not found in the metrics collection.

public abstract WebTemplateMetric add (WebObjectInfo object)

Adds the given object to the end of the metrics collection. This object must be of type DssXmlTypeMetric.

Parameters
object The metric to add to the collection.
Returns
Throws
UnsupportedOperationException Signals that the template is marked read-only.
IllegalArgumentException Signals that the object passed to this method is not of type metric.

public abstract void addSubtotal (int subtotalType, int subtotalStyle, int axisIndex)

This method is deprecated.
Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use activateAxisSubtotal(int, int, int) instead.

Adds a subtotal of the given type, with the given style, to the given index. This is done for all metrics on the report.

Parameters
subtotalType The type of subtotal to add, from EnumDSSXMLMetricType.
subtotalStyle The style of subtotal to add, from EnumDSSXMLSubtotalStyle.
axisIndex The axis to add the subtotal to, from EnumDSSXMLAxisName.
Throws
IllegalArgumentException Thrown if one of the parameters are invalid.

public abstract boolean canToggleThresholds ()

Indicates whether thresholds display can be turned on/off

Returns
  • whether thresholds display can be turned on/off
Throws
WebObjectsException
WebObjectsException

public abstract void clear (boolean isDisableOnly)

Clears all metrics from the collection. Equivalent to calling remove on every object in the collection.

Parameters
isDisableOnly Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
Throws
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract void clear ()

Clears all metrics from the collection. Equivalent to calling remove on every object in the collection.

Throws
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract boolean contains (WebObjectInfo object)

Searches for the WebTemplateMetric object which refers to the given WebObjectInfo object in the metrics collection.

Parameters
object The WebObjectInfo object to search for in the metrics collection.
Returns
  • True if the collection contains the given object, false otherwise.

public abstract boolean containsKey (int key)

Returns whether the given key exists in the metrics collection.

Parameters
key The key whose existence we're verifying.
Returns
  • True if the given key exists in the collection; false otherwise

public abstract Enumeration elements ()

Returns a java.util.Enumeration, which can be used to iterate through the WebTemplateMetric objects in the collection in position ordering.

Returns
  • A java.util.Enumeration which will iterate through the metrics collection and return WebTemplateMetric objects.

public abstract WebTemplateMetric get (int index)

Returns the WebTemplateMetric object with the given index.

Parameters
index The index of the object to return from the collection.
Returns
Throws
IndexOutOfBoundsException Thrown if the index is outside the bounds of the collection.

public abstract WebTemplateMetric getItemById (String id)

Finds a template metric based on metric DSS ID. Returns null if metric not found.

Parameters
id metric DSS ID
Returns
  • template metric.

public abstract WebTemplateMetric getItemByKey (int key)

Returns the WebTemplateMetric object with the given key.

Parameters
key The key of the object to search for in the collection.
Returns
Throws
IllegalArgumentException Thrown if the key is not found in the metrics collection.

public abstract WebTemplateUnit getTemplateUnit ()

Returns the WebTemplateUnit which this object is associated with.

Returns

public abstract boolean hasThresholds ()

Indicates whether there are any thresholds defined on the underlying metrics

Returns
  • boolean

public abstract int indexOf (String id)

Returns an index of the template metric for specified metric DSS ID or -1 if it is not found.

Parameters
id metric DSS ID
Returns
  • an index of the template metric

public abstract boolean isEmpty ()

Returns true if the collection has no metrics in it.

Returns
  • Whether the metrics collection is empty.

public abstract boolean isThresholdsDisplayEnabled ()

Indicates whether at least one of the thresholds defined on the underlying metrics is enabled

Returns
  • boolean

public abstract int keyOf (WebObjectInfo object)

Searches for the WebTemplateMetric object which refers to the given WebObjectInfo object in the metrics collection, and returns the key of that object.

Parameters
object The WebObjectInfo object whose key should be returned.
Returns
Throws
IllegalArgumentException Signals that the given object was not found in the collection.

public abstract void move (int fromPosition, int toPosition)

Moves the WebTemplateMetric object at the given position in the collection to the new position. Note that position is a 1-based index on the collection. Note that elements will be shifted as follows:
If fromPosition < toPosition then objects between the two given positions will be shifted to the left.
If fromPosition > toPosition then objects between the two given positions will be shifted to the right

Parameters
fromPosition The position of the WebTemplateMetric object in the metrics collection.
toPosition The position to move the WebTemplateMetric object to.
Throws
IllegalArgumentException Thrown if either position given to this method does not exist in the collection.
UnsupportedOperationException Thrown if the template which the metrics collection exists upon is marked read-only.

public abstract void remove (int index)

Removes the WebTemplateMetric object at the given index from the collection.

Parameters
index The index of the object to remove from the collection.
Throws
IndexOutOfBoundsException Thrown if the given index is out of the bounds of the collection.
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract void remove (int index, boolean isDisableOnly)

Removes the WebTemplateMetric object at the given index from the collection.

Parameters
index The index of the object to remove from the collection.
isDisableOnly Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
Throws
IndexOutOfBoundsException Thrown if the given index is out of the bounds of the collection.
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract void removeAllSubtotals ()

This method is deprecated.
Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use deActivateAll() instead.

Removes all subtotals from all metrics on the report.

public abstract void removeItemByKey (int key, boolean isDisableOnly)

Removes the WebTemplateMetric object with the given key from the collection.

Parameters
key The key of the object to remove from the collection.
isDisableOnly Indicate if it is a 'disable from grid' or 'remove from grid' for RWD
Throws
IllegalArgumentException Thrown if the key is not found in the metrics collection.
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract void removeItemByKey (int key)

Removes the WebTemplateMetric object with the given key from the collection.

Parameters
key The key of the object to remove from the collection.
Throws
IllegalArgumentException Thrown if the key is not found in the metrics collection.
UnsupportedOperationException Thrown if the template which this collection resides upon is marked to be read-only.

public abstract void removeSubtotal (int subtotalType)

This method is deprecated.
Subtotals are no longer defined at the template metrics level. They are now defined at the template level. Use deActivate(int) instead.

Removes the subtotal with the given type from all metrics it is set on.

Parameters
subtotalType The type of the subtotal to remove, from EnumDSSXMLMetricType.
Throws
IllegalArgumentException Thrown if the subtotal type is invalid.

public abstract void setShowThresholds (boolean show)

Set or clear all threasholds of all metrics. To see the changes in data, applyChanges() need to be called to retrieve another instance, which will have the changed data.

Parameters
show boolean to indicate whether to show or to hide all thresholds.

public abstract int size ()

Returns the number of WebTemplateMetric objects in the metrics collection.

Returns
  • The size of the metrics collection.