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 theWebMetricobject 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 WebThresholdsgetAlerts()Return aWebThresholdscollection which represents the list of 'delivery' thresholds.java.lang.StringgetAlias()Returns the alias of the template metric.WebFormatContainergetFormatContainer()Returns the format container on this metric, which contains the twoWebFormatobjects.java.lang.StringgetFormula()For derived metrics, this specifies the string representation of the metric formula.intgetKey()Returns the key of the metric on the template.WebMetricgetMetric()Returns theWebMetricobject which this WebTemplateMetric object refers to.WebObjectInfogetMetricPrompt()Deprecated.Never implemented on the Intelligence Server.WebExpressiongetOrCreateUnitLimit()intgetPosition()Returns the position of the metric within the metrics collection.WebPromptgetPrompt()Returns theWebPromptobject which this WebTemplateMetric object refers to.WebTemplateMetricSubtotalsgetSubtotals()Deprecated.Subtotals are no longer defined at the template metrics level.java.util.EnumerationgetTemplateSubtotals()Returns a collection ofWebTemplateSubtotalobjects that are applicable to this metric.java.lang.StringgetTemplateUnitPropertyValue(java.lang.String propertySetName, java.lang.String propertyName)Gets the value of a specific property.WebTransactableUnitgetTransactableUnit()WebExpressiongetUnitLimit()booleanhasDynamicAlias()booleanhasThreshold()booleanhasUnitLimit()java.lang.BooleanisAggFromBase()booleanisCurrentElement()Returns true if this WebTemplateMetric object is designated as the current element.booleanisDerived()Specifies if this represents a derived metric.booleanisFormulaTokenStream()Check whether the formula is a token streambooleanisLocked()Returns whether the template unit is locked.booleanisSmartMetric()Indicate if a metric itself is the smart metricbooleanisSmartMetricCalculatedInBase()Indicate if it is smart on template metric levelvoidmakeCurrentElement()Sets the current metric to be designated as the current element of the metrics axis.voidmakeCurrentElement(int elementStatus)Sets the current metric to be designated as the current element of the metrics axis, using the specific element status.voidremoveUnitLimit()voidsetAggFromBase(java.lang.Boolean afb)voidsetAlias(java.lang.String alias)Sets the alias of the template metric.voidsetAlias(java.lang.String alias, boolean isDynamic)Sets the alias of the template metric.voidsetDefaultForTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName)Sets the value for the given property to be the default value for the property.voidsetFormula(java.lang.String formula)Allows the user to set the formula of a derived metric.voidsetFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream)Allows the user to set the formula of a derived metric.voidsetFormula(java.lang.String formula, int aggFromBase, int stFromBase, java.lang.Boolean isTokenStream, boolean isPassThrough, java.lang.String metricFormatType)voidsetFormula(java.lang.String formula, java.lang.Boolean aggFromBase)Allows the user to set the formula of a derived metric.voidsetFormula(java.lang.String formula, java.lang.Boolean aggFromBase, boolean isPassThrough)voidsetShowThresholds(boolean show)voidsetTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName, java.lang.String propertyValue)Sets the value of a specific property.voidsetUnitLimit(WebExpression expr)voidsetUnitLimit(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.UnsupportedOperationExceptionSets 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.UnsupportedOperationExceptionSets 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 theWebMetricobject which this WebTemplateMetric object refers to.- Returns:
- A
WebMetricobject.
-
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.UnsupportedOperationExceptionSets 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.UnsupportedOperationExceptionFor 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.UnsupportedOperationExceptionAllows 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.UnsupportedOperationExceptionAllows 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.UnsupportedOperationExceptionAllows 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, java.lang.String metricFormatType) 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 twoWebFormatobjects.- Returns:
- The container for the two
WebFormatobjects, an object of typeWebFormatContainer. - Throws:
java.lang.UnsupportedOperationException- Thrown if this object refers to a metric prompt.
-
getSubtotals
@Deprecated 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
WebTemplateMetricSubtotalsobject, 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
@Deprecated WebObjectInfo getMetricPrompt() throws java.lang.UnsupportedOperationException
Deprecated.Never implemented on the Intelligence Server.Returns the metric prompt associated with the WebTemplateMetric object.- Returns:
- A
WebObjectInfoobject, 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.UnsupportedOperationExceptionSets 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 ofWebTemplateSubtotalobjects that are applicable to this metric.- Returns:
- An
EnumerationofWebTemplateSubtotalobjects - Since:
- MicroStrategy Web 9.0.0
-
getAlerts
WebThresholds getAlerts()
Return aWebThresholdscollection 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.IllegalArgumentExceptionSets 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.IllegalArgumentExceptionGets the value of a specific property.
- Parameters:
propertySetName- the property set namepropertyName- the property name- Returns:
- Property string value
- Throws:
WebObjectsExceptionjava.lang.IllegalArgumentException
-
setDefaultForTemplateUnitProperty
void setDefaultForTemplateUnitProperty(java.lang.String propertySetName, java.lang.String propertyName) throws java.lang.IllegalArgumentException, WebObjectsExceptionSets 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
-
-