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 the WebMetric object which it contains.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • 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 the WebMetric object which this WebTemplateMetric object refers to.
        Returns:
        A WebMetric object.
      • getPrompt

        WebPrompt getPrompt()
        Returns the WebPrompt object which this WebTemplateMetric object refers to. This will @return A WebPrompt object if the metric contains unresolved metric object prompt.
      • 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 base
        stFromBase - whether the formula subtotal from base
        isTokenStream - 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 two WebFormat objects.
        Returns:
        The container for the two WebFormat objects, an object of type WebFormatContainer.
        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. Use WebTemplate.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

        @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 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 in EnumDSSXMLCurrentElementStatus.
        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 of WebTemplateSubtotal objects that are applicable to this metric.
        Returns:
        An Enumeration of WebTemplateSubtotal objects
        Since:
        MicroStrategy Web 9.0.0
      • getAlerts

        WebThresholds getAlerts()
        Return a WebThresholds 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()
      • 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 name
        propertyName - the property name
        propertyValue - the property value
        Throws:
        WebObjectsException - if there is a problem setting the new value
        java.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 name
        propertyName - 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 change
        propertyName - the name of the property to change
        Throws:
        java.lang.IllegalArgumentException - if the property set name or property name is empty or does not exist
        WebObjectsException - if an error occurs when setting the property value