Interface PageByUnit


  • public interface PageByUnit

    The PageByUnit is the interface used by the PageByBean to represent a single unit.

    A page-by unit controls the data displayed to the end-user: when a report or document is executed each unit is displayed with a combo-box that lists its elements; the data is automatically filtered based on the currently selected element.

    Although conceptually the same, the underlying WebApi object used for the page-by axis and the group-by section are different. This interface allows the application to abstract their differences and handle a single object.

    End users can manipulate the page-by units by selecting their current element, changing their arrangement (pivoting), and sorting them. Not all functionality is always available (for example, sorting is not available for reports). Methods like isSortAvailable() are used by the Transform to identify what functionality is.

    The PageByUnit uses the PageByElementList for the list of elements the user can select to filter the data. Although typically it only has one, a unit may have more PageByElementList objects; getElementLists() returns the enumeration of PageByElementList objects available for this unit.

    Since:
    MicroStrategy Web 8.0.0
    See Also:
    PageByBean, PageByElementList, PageByElement
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getAlias()
      This method returns the alias for this unit.
      WebAttributeForms getDisplayAttrForms()  
      int getDisplayType()  
      java.util.Enumeration getElementLists()
      Returns the enumeration of PageByElementList available for this unit.
      java.lang.String getKey()
      The key is used to uniquely identify the Page-by unit within the units collection.
      PageByUnit getNext()
      This method is used to navigate across the collection of page-by units.
      PageByUnit getPrevious()
      This method is used to navigate across the collection of page-by units.
      java.lang.String getRenameKey()
      This method returns the key used by the rename dialog to identify this unit within the working set.
      int getSortType()
      Returns the current sort of this unit.
      WebObjectInfo getTarget()
      This returns the WebObjectInfo associated with this unit (if any).
      WebComponent getTargetBean()
      returns the target component bean (Report Bean or RW Bean).
      WebTitle getTitle()
      Returns the underlying title object associated with this unit.
      java.lang.Object getUnit()
      Returns the underlying WebApi object associated with this unit.
      int getUnitType()
      It returns the EnumDSSXMLTemplateUnitType associated with this unit.
      boolean isDeleteAvailable()
      Indicates if the current unit can be deleted from the list of working set of objects.
      boolean isFirst()
      Indicates if this is the first unit in the collection of page-by units.
      boolean isLast()
      Indicates if this is the last unit in the collection of page-by units.
      boolean isPivotAvailable()
      Helper method that checks whether any pivot is available.
      boolean isPivotAvailable​(int axis)
      Indicates if pivoting to the corresponding axis is available for this unit.
      boolean isPropertiesEditorAvailable()
      Indicates if the user can open the properties editor for this unit.
      boolean isRemoveAvailable()
      Indicates if the current unit can be removed from the list of page-by units.
      boolean isRenameAvailable()
      Indicates if the current unit alias can be changed.
      boolean isSortAvailable()
      Indicates if sorting is available for this unit.
    • Method Detail

      • getAlias

        java.lang.String getAlias()
        This method returns the alias for this unit. The alias is the name of the unit displayed to the end user, typically the object of the underlying WebObjectInfo.

        The alias might be different from the object's name, as end-users can change the alias in the working set.

        In some ocassions, the unit its not linked to a WebObjectInfo (for example users can move the "Metrics" axis to the page-by), in these cases the PageByUnit selects a descriptor as its alias.
        Returns:
        The alias that this unit should display.
      • getTarget

        WebObjectInfo getTarget()
        This returns the WebObjectInfo associated with this unit (if any). In case the unit is the Metrics-axis, it will have no target associated.
        Returns:
        The WebObjectInfo linked to this unit; null if none.
      • getUnitType

        int getUnitType()
        It returns the EnumDSSXMLTemplateUnitType associated with this unit. This is only meaningful in the case of reports as documents don't use WebTemplateUnits.
        Returns:
        The EnumDSSXMLTemplateUnitType associated with this unit.
      • getKey

        java.lang.String getKey()
        The key is used to uniquely identify the Page-by unit within the units collection. This key is used in events to indicate which unit is being manipulated.
        Returns:
        The key to recognize this unit in the collection for pivoting and other manipulations.
      • getUnit

        java.lang.Object getUnit()
        Returns the underlying WebApi object associated with this unit. For reports it returns an instance of a WebTemplateUnit; for documents it returns a RWGroupByUnit.
        Returns:
        The underlying WebApi object associated with this unit.
      • getTitle

        WebTitle getTitle()
        Returns the underlying title object associated with this unit. for documents it returns null;.
        Returns:
        The underlying title object associated with this unit.
        Since:
        MicroStrategy Web 9.0.0
      • isFirst

        boolean isFirst()
        Indicates if this is the first unit in the collection of page-by units.
        Returns:
        true if this is the first unit of the list.
      • isLast

        boolean isLast()
        Indicates if this is the last unit in the collection of page-by units.
        Returns:
        true if this is the last unit of the list.
      • getPrevious

        PageByUnit getPrevious()
        This method is used to navigate across the collection of page-by units. It returns the previous PageByUnit; if this is the first one, it returns null.
        Returns:
        PageByUnit the previous PageByUnit in the units collection.
      • getNext

        PageByUnit getNext()
        This method is used to navigate across the collection of page-by units. It returns the next PageByUnit; if this is the last one, it returns null.
        Returns:
        PageByUnit the next PageByUnit in the units collection.
      • isSortAvailable

        boolean isSortAvailable()
        Indicates if sorting is available for this unit. For example, reports don't support sorting on page-by units.
        Returns:
        true if the document can be sorted for this unit
      • isPivotAvailable

        boolean isPivotAvailable​(int axis)
        Indicates if pivoting to the corresponding axis is available for this unit. For example, documents support pivoting only to the page-by axis. This method also checks for privileges and returns false if a user doesn't have enough.
        Parameters:
        axis - the axis for which this unit would be pivoted.
        Returns:
        true if this unit can be pivoted to the corresponding axis.
      • isPivotAvailable

        boolean isPivotAvailable()
        Helper method that checks whether any pivot is available. This method also checks for privileges and returns false if a user doesn't have enough.
        Returns:
        true if this unit can be pivoted to any axis.
      • isRemoveAvailable

        boolean isRemoveAvailable()
        Indicates if the current unit can be removed from the list of page-by units. This method would return false if the unit is locked. It also checks for privileges and returns false if a user doesn't have enough.
        Returns:
        true if this unit can be removed from the page-by section of this report/document,
      • isDeleteAvailable

        boolean isDeleteAvailable()

        Indicates if the current unit can be deleted from the list of working set of objects. When you simply remove an object from the page-by, the object can still be used in other parts of the report/document definition. When you deleted from the working-set, though, the report definition changes, the unit is not available anymore and the report gets re-executed with the new definition.

        This method should check for privileges and other factors that might prevent changing the report/document defition and returns false if the unit cannot be removed.

        Returns:
        true if this unit can be removed from this report/document definition.
        Since:
        MicroStrategy Web 8.0.1
      • isRenameAvailable

        boolean isRenameAvailable()
        Indicates if the current unit alias can be changed. This method would return false if the unit cannot be renamed. It also checks for privileges and returns false if a user doesn't have enough.
        Returns:
        true if this unit can be renamed in this report/document
      • isPropertiesEditorAvailable

        boolean isPropertiesEditorAvailable()
        Indicates if the user can open the properties editor for this unit. This feature is only available for documents..
        Returns:
        true if the properties editor is available for this unit.
      • getRenameKey

        java.lang.String getRenameKey()
        This method returns the key used by the rename dialog to identify this unit within the working set. This is only meaningful if the unit can be renamed.
        Returns:
        The key used by the rename dialog to identify this unit.
      • getElementLists

        java.util.Enumeration getElementLists()

        Returns the enumeration of PageByElementList available for this unit. A PageByElementList represents the list of elements the user can select to filter the data. Although typically it only has one, a unit may have more PageByElementList objects.

        When the bean is in design mode, the PageByElementLists are not available and this method will return an empty enumeration.

        Returns:
        The enumeration of all possible PageByElementList associated with this unit.
      • getTargetBean

        WebComponent getTargetBean()
        returns the target component bean (Report Bean or RW Bean).
        Since:
        MicroStrategy Web 9.0.0
      • getDisplayType

        int getDisplayType()