Package com.microstrategy.web.objects
Interface WebTemplateMetric
-
- All Superinterfaces:
WebHyperLinkContainer
,WebThresholdsContainer
public interface WebTemplateMetric extends WebHyperLinkContainer, WebThresholdsContainer
The WebTemplateMetric class represents a metric which currently exists on a template. It gives access to the key and position of the metric on the template, and allows the user to determine whether a metric is set to be the current element, or set the current element. Finally, it can return the reference to theWebMetric
object which it contains.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description WebThresholds
getAlerts()
Return aWebThresholds
collection which represents the list of 'delivery' thresholds.java.lang.String
getAlias()
Returns the alias of the template metric.WebFormatContainer
getFormatContainer()
Returns the format container on this metric, which contains the twoWebFormat
objects.java.lang.String
getFormula()
For derived metrics, this specifies the string representation of the metric formula.int
getKey()
Returns the key of the metric on the template.WebMetric
getMetric()
Returns theWebMetric
object which this WebTemplateMetric object refers to.WebObjectInfo
getMetricPrompt()
Deprecated.Never implemented on the Intelligence Server.WebExpression
getOrCreateUnitLimit()
int
getPosition()
Returns the position of the metric within the metrics collection.WebPrompt
getPrompt()
Returns theWebPrompt
object which this WebTemplateMetric object refers to.WebTemplateMetricSubtotals
getSubtotals()
Deprecated.Subtotals are no longer defined at the template metrics level.java.util.Enumeration
getTemplateSubtotals()
Returns a collection ofWebTemplateSubtotal
objects that are applicable to this metric.java.lang.String
getTemplateUnitPropertyValue(java.lang.String propertySetName, java.lang.String propertyName)
Gets the value of a specific property.WebTransactableUnit
getTransactableUnit()
WebExpression
getUnitLimit()
boolean
hasDynamicAlias()
boolean
hasThreshold()
boolean
hasUnitLimit()
java.lang.Boolean
isAggFromBase()
boolean
isCurrentElement()
Returns true if this WebTemplateMetric object is designated as the current element.boolean
isDerived()
Specifies if this represents a derived metric.boolean
isFormulaTokenStream()
Check whether the formula is a token streamboolean
isLocked()
Returns whether the template unit is locked.boolean
isSmartMetric()
Indicate if a metric itself is the smart metricboolean
isSmartMetricCalculatedInBase()
Indicate if it is smart on template metric levelvoid
makeCurrentElement()
Sets the current metric to be designated as the current element of the metrics axis.void
makeCurrentElement(int elementStatus)
Sets the current metric to be designated as the current element of the metrics axis, using the specific element status.void
removeUnitLimit()
void
setAggFromBase(java.lang.Boolean afb)
void
setAlias(java.lang.String alias)
Sets the alias of the template metric.void
setAlias(java.lang.String alias, boolean isDynamic)
Sets the alias of the template metric.void
setDefaultForTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName)
Sets the value for the given property to be the default value for the property.void
setFormula(java.lang.String formula)
Allows the user to set the formula of a derived metric.void
setFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream)
Allows the user to set the formula of a derived metric.void
setFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream, boolean isPassThrough)
void
setFormula(java.lang.String formula, java.lang.Boolean aggFromBase)
Allows the user to set the formula of a derived metric.void
setFormula(java.lang.String formula, java.lang.Boolean aggFromBase, boolean isPassThrough)
void
setShowThresholds(boolean show)
void
setTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName, java.lang.String propertyValue)
Sets the value of a specific property.void
setUnitLimit(WebExpression expr)
void
setUnitLimit(WebExpression expr, boolean blockAutoSync)
-
Methods inherited from interface com.microstrategy.web.objects.WebHyperLinkContainer
getHyperLinks, newHyperLink
-
Methods inherited from interface com.microstrategy.web.objects.WebThresholdsContainer
getFormat, getID, getName, getObjectType, getThresholds, getTransactions, getType, initElementSource
-
-
-
-
Method Detail
-
getAlias
java.lang.String getAlias()
Returns the alias of the template metric. This may or may not be the same as the metric's name.- Returns:
- The alias of the current metric.
- See Also:
setAlias(java.lang.String)
-
setAlias
void setAlias(java.lang.String alias) throws java.lang.UnsupportedOperationException
Sets the alias of the template metric.- Parameters:
alias
- The alias to use for the metric.- Throws:
java.lang.UnsupportedOperationException
- Thrown if this object refers to a metric prompt.- See Also:
getAlias()
-
setAlias
void setAlias(java.lang.String alias, boolean isDynamic) throws java.lang.UnsupportedOperationException
Sets the alias of the template metric.- Parameters:
alias
- The alias to use for the metric, isDynamic The boolean to identify dynamic alias- Throws:
java.lang.UnsupportedOperationException
- Thrown if this object refers to a metric prompt.- See Also:
getAlias()
-
getKey
int getKey()
Returns the key of the metric on the template.- Returns:
- The key of the metric.
-
getPosition
int getPosition()
Returns the position of the metric within the metrics collection. This position is 1-based.- Returns:
- The position of the metric within the collection.
-
getMetric
WebMetric getMetric()
Returns theWebMetric
object which this WebTemplateMetric object refers to.- Returns:
- A
WebMetric
object.
-
getPrompt
WebPrompt getPrompt()
-
isCurrentElement
boolean isCurrentElement()
Returns true if this WebTemplateMetric object is designated as the current element.- Returns:
- Whether the current metric is the current element of the metrics collection.
-
makeCurrentElement
void makeCurrentElement() throws java.lang.UnsupportedOperationException
Sets the current metric to be designated as the current element of the metrics axis.- Throws:
java.lang.UnsupportedOperationException
- Thowwn if this object refers to a metric prompt.
-
isDerived
boolean isDerived()
Specifies if this represents a derived metric.- Returns:
- True if this is a derived metric, false otherwise.
-
getFormula
java.lang.String getFormula() throws java.lang.UnsupportedOperationException
For derived metrics, this specifies the string representation of the metric formula.- Returns:
- The formula of the metric.
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the metric is not derived, and thus the formula is not available, or this object refers to a metric prompt.- See Also:
setFormula(java.lang.String, java.lang.Boolean)
-
setFormula
void setFormula(java.lang.String formula, java.lang.Boolean aggFromBase) throws java.lang.UnsupportedOperationException
Allows the user to set the formula of a derived metric.- Parameters:
formula
- The formula to use for the metric.aggFromBase
- whether the formula aggregate from base- Throws:
java.lang.UnsupportedOperationException
- Thrown if the metric is not derived, and thus the formula cannot be changed, or if this object refers to a metric prompt.- See Also:
getFormula()
-
setFormula
void setFormula(java.lang.String formula, java.lang.Boolean aggFromBase, boolean isPassThrough) throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
setFormula
void setFormula(java.lang.String formula) throws java.lang.UnsupportedOperationException
Allows the user to set the formula of a derived metric.- Parameters:
formula
- The formula to use for the metric.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the metric is not derived, and thus the formula cannot be changed, or if this object refers to a metric prompt.- See Also:
getFormula()
-
setFormula
void setFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream) throws java.lang.UnsupportedOperationException
Allows the user to set the formula of a derived metric.- Parameters:
formula
- The formula to use for the metric.aggFromBase
- whether the formula aggregate from basestFromBase
- whether the formula subtotal from baseisTokenStream
- flag to indicate whether the formula is a token stream.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the metric is not derived, and thus the formula cannot be changed, or if this object refers to a metric prompt.- See Also:
getFormula()
-
setFormula
void setFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream, boolean isPassThrough) throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
isFormulaTokenStream
boolean isFormulaTokenStream()
Check whether the formula is a token stream- Returns:
- whether the formula is a token stream
-
getFormatContainer
WebFormatContainer getFormatContainer() throws java.lang.UnsupportedOperationException
Returns the format container on this metric, which contains the twoWebFormat
objects.- Returns:
- The container for the two
WebFormat
objects, an object of typeWebFormatContainer
. - Throws:
java.lang.UnsupportedOperationException
- Thrown if this object refers to a metric prompt.
-
getSubtotals
WebTemplateMetricSubtotals getSubtotals() throws java.lang.UnsupportedOperationException
Deprecated.Subtotals are no longer defined at the template metrics level. They are now defined at the template level. UseWebTemplate.getSubtotals()
Returns the subtotals collection, which describes the subtotals set on this metric.- Returns:
- A
WebTemplateMetricSubtotals
object, which can be used to add/remove subtotals from this metric. - Throws:
java.lang.UnsupportedOperationException
- Thrown if this object refers to a metric prompt.
-
getMetricPrompt
WebObjectInfo getMetricPrompt() throws java.lang.UnsupportedOperationException
Deprecated.Never implemented on the Intelligence Server.Returns the metric prompt associated with the WebTemplateMetric object.- Returns:
- A
WebObjectInfo
object, which describes the metric prompt associated with the WebTemplateMetric. - Throws:
java.lang.UnsupportedOperationException
- Thrown if this object does not refer to a metric prompt.
-
makeCurrentElement
void makeCurrentElement(int elementStatus) throws java.lang.UnsupportedOperationException
Sets the current metric to be designated as the current element of the metrics axis, using the specific element status.- Parameters:
elementStatus
- A value inEnumDSSXMLCurrentElementStatus
.- Throws:
java.lang.UnsupportedOperationException
- Thowwn if this object refers to a metric prompt.
-
isLocked
boolean isLocked()
Returns whether the template unit is locked. A locked template unit serves as a hint that the report designer did not want the user to remove this unit. Note that locking is not enforced by the Intelligence Server, instead allowing the API user to determine whether to enforce the lock state.- Returns:
- True if the template unit is locked, false otherwise.
- Since:
- MicroStrategy Web 8.0.0
-
setShowThresholds
void setShowThresholds(boolean show)
- Parameters:
show
- whether to thresholds associated with this template metric- Since:
- MicroStrategy Web 9.0.0
-
getTemplateSubtotals
java.util.Enumeration getTemplateSubtotals()
Returns a collection ofWebTemplateSubtotal
objects that are applicable to this metric.- Returns:
- An
Enumeration
ofWebTemplateSubtotal
objects - Since:
- MicroStrategy Web 9.0.0
-
getAlerts
WebThresholds getAlerts()
Return aWebThresholds
collection which represents the list of 'delivery' thresholds. These thresholds are used to indicate that they are used in creating an alert subscription.- Since:
- MicroStrategy Web 9.0.0
-
getUnitLimit
WebExpression getUnitLimit()
- Since:
- MicroStrategy Web 9.0.0
-
getOrCreateUnitLimit
WebExpression getOrCreateUnitLimit()
- Since:
- MicroStrategy Web 9.0.0
-
setUnitLimit
void setUnitLimit(WebExpression expr)
- Since:
- MicroStrategy Web 9.0.0
-
setUnitLimit
void setUnitLimit(WebExpression expr, boolean blockAutoSync)
- Since:
- MicroStrategy Web 11.3.1
-
removeUnitLimit
void removeUnitLimit()
- Since:
- MicroStrategy Web 9.0.0
-
hasUnitLimit
boolean hasUnitLimit()
- Since:
- MicroStrategy Web 9.0.0
-
hasThreshold
boolean hasThreshold()
-
getTransactableUnit
WebTransactableUnit getTransactableUnit()
-
isSmartMetric
boolean isSmartMetric()
Indicate if a metric itself is the smart metric
- Returns:
- true if this metric is a smart metric.
-
isSmartMetricCalculatedInBase
boolean isSmartMetricCalculatedInBase()
Indicate if it is smart on template metric level
- Returns:
- true if it is smart
-
hasDynamicAlias
boolean hasDynamicAlias()
-
isAggFromBase
java.lang.Boolean isAggFromBase()
-
setAggFromBase
void setAggFromBase(java.lang.Boolean afb)
-
setTemplateUnitProperty
void setTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName, java.lang.String propertyValue) throws WebObjectsException, java.lang.IllegalArgumentException
Sets the value of a specific property.
- Parameters:
propertySetName
- the property set namepropertyName
- the property namepropertyValue
- the property value- Throws:
WebObjectsException
- if there is a problem setting the new valuejava.lang.IllegalArgumentException
- if no property set name or property name is specified, or they don't exist
-
getTemplateUnitPropertyValue
java.lang.String getTemplateUnitPropertyValue(java.lang.String propertySetName, java.lang.String propertyName) throws WebObjectsException, java.lang.IllegalArgumentException
Gets the value of a specific property.
- Parameters:
propertySetName
- the property set namepropertyName
- the property name- Returns:
- Property string value
- Throws:
WebObjectsException
java.lang.IllegalArgumentException
-
setDefaultForTemplateUnitProperty
void setDefaultForTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName) throws java.lang.IllegalArgumentException, WebObjectsException
Sets the value for the given property to be the default value for the property.- Parameters:
propertySetName
- the name of the property set which contains the property to changepropertyName
- the name of the property to change- Throws:
java.lang.IllegalArgumentException
- if the property set name or property name is empty or does not existWebObjectsException
- if an error occurs when setting the property value
-
-