Interface PageByUnit
-
public interface PageByUnit
The
PageByUnit
is the interface used by thePageByBean
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 thePageByElementList
for the list of elements the user can select to filter the data. Although typically it only has one, a unit may have morePageByElementList
objects;getElementLists()
returns the enumeration ofPageByElementList
objects available for this unit.- Since:
- MicroStrategy Web 8.0.0
- See Also:
PageByBean
,PageByElementList
,PageByElement
-
-
Field Summary
Fields Modifier and Type Field Description static int
SORT_ASCENDING
Constant used bygetSortType()
to indicate the unit is sorted ascending.static int
SORT_DEFAULT
Constant used bygetSortType()
to indicate the unit is using its default sort.static int
SORT_DESCENDING
Constant used bygetSortType()
to indicate the unit is sorted descending.static int
SORT_EMPTY
Constant used bygetSortType()
to indicate the unit is not sorted.
-
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 ofPageByElementList
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 theWebObjectInfo
associated with this unit (if any).WebComponent
getTargetBean()
returns the target component bean (Report Bean or RW Bean).WebTitle
getTitle()
Returns the underlyingtitle
object associated with this unit.java.lang.Object
getUnit()
Returns the underlyingWebApi
object associated with this unit.int
getUnitType()
It returns theEnumDSSXMLTemplateUnitType
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.
-
-
-
Field Detail
-
SORT_EMPTY
static final int SORT_EMPTY
Constant used bygetSortType()
to indicate the unit is not sorted.- See Also:
- Constant Field Values
-
SORT_DEFAULT
static final int SORT_DEFAULT
Constant used bygetSortType()
to indicate the unit is using its default sort.- See Also:
- Constant Field Values
-
SORT_ASCENDING
static final int SORT_ASCENDING
Constant used bygetSortType()
to indicate the unit is sorted ascending.- See Also:
- Constant Field Values
-
SORT_DESCENDING
static final int SORT_DESCENDING
Constant used bygetSortType()
to indicate the unit is sorted descending.- See Also:
- Constant Field Values
-
-
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 underlyingWebObjectInfo
.
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 aWebObjectInfo
(for example users can move the "Metrics" axis to the page-by), in these cases thePageByUnit
selects a descriptor as its alias.- Returns:
- The alias that this unit should display.
-
getTarget
WebObjectInfo getTarget()
This returns theWebObjectInfo
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 theEnumDSSXMLTemplateUnitType
associated with this unit. This is only meaningful in the case of reports as documents don't useWebTemplateUnits
.- 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 underlyingWebApi
object associated with this unit. For reports it returns an instance of aWebTemplateUnit
; for documents it returns aRWGroupByUnit
.- Returns:
- The underlying
WebApi
object associated with this unit.
-
getTitle
WebTitle getTitle()
Returns the underlyingtitle
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 previousPageByUnit
; if this is the first one, it returnsnull
.- 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 nextPageByUnit
; if this is the last one, it returnsnull
.- 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 returnsfalse
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 returnsfalse
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 returnfalse
if the unit is locked. It also checks for privileges and returnsfalse
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 returnfalse
if the unit cannot be renamed. It also checks for privileges and returnsfalse
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.
-
getSortType
int getSortType()
Returns the current sort of this unit. This is only meaningful if the unit can be sorted. It returns one of the following values:- Returns:
- The current sort order.
-
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. APageByElementList
represents the list of elements the user can select to filter the data. Although typically it only has one, a unit may have morePageByElementList
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()
-
getDisplayAttrForms
WebAttributeForms getDisplayAttrForms()
-
-