com.sas.dataselectors.dataitems
Class OLAPTableRoles

com.sas.dataselectors.dataitems.OLAPTableRoles
All Implemented Interfaces:
DataItemSelectorInterface, com.sas.util.RoleProviderInterface

public class OLAPTableRoles

Defines and manages the roles for an OLAP, or multi-dimensional, query.

Since:
3.1

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sas.dataselectors.dataitems.TableRoles
TableRoles.Role
 
Field Summary
static java.lang.String BOOK
          Constant for the name of the book role.
static java.lang.String CHAPTER
          Constant for the name of the chapter role.
static java.lang.String PAGE
          Constant for the name of the page role.
static java.lang.String ROW
          Constant for the name of the row role.
static java.lang.String SECTION
          Constant for the name of the section role.
 
Fields inherited from class com.sas.dataselectors.dataitems.TableRoles
_businessModel, COLUMN, dataItemRefList, FILTER, iMap, originalItemList, queryType, RB_KEY, RB_KEY2, selectedItems, SLICER
 
Fields inherited from interface com.sas.dataselectors.dataitems.DataItemSelectorInterface
DISPLAY_DETAIL_VALUES, GROUP_BY_CATEGORY_VALUES
 
Constructor Summary
OLAPTableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
          Constructor.
OLAPTableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery, com.sas.iquery.metadata.business.InformationMap imap)
           
 
Method Summary
 java.util.List getAvailableEnabledNodeIds(java.lang.String selectedRole)
          Returns a list of the item ids for the items available for selection for the selected role.
 java.util.List getAvailableItemInfoList(java.lang.String selectedRole)
          Returns a list of DataItemTreeNodeInfo objects, representing the list of items available for the selected role.
protected  java.util.List getAvailableRoleItems(com.sas.util.RoleInterface role)
          Return the list of items available to add to the role
 javax.swing.tree.TreeModel getAvailableTreeModel(com.sas.util.transforms.TransformInterface transform, java.lang.String selectedRole)
          Creates a TreeModel representation of the available items for the BusinessModel.
 java.util.List getSelectedItemInfoList(java.lang.String selectedRole)
          Returns a list of DataItemTreeNodeInfo objects, representing the list of items assigned to the selected role.
 boolean hasValidRoles()
          Checks that the data represented by this object satisfies the rules of the BusinessQuery.
protected  boolean isValidRole(java.lang.String name)
          Checks that the role identified by the name parameter is one of the roles supported by this implementation.
 
Methods inherited from class com.sas.dataselectors.dataitems.TableRoles
addRole, allQueryItemsAreDetailUsage, cleanUp, dumpThisItemList, getAllAvailableNodeIds, getBaseItemId, getDataItemMap, getID, getItemFromItemMap, getLocale, getMoveTargetRoles, getOriginalItemList, getQueryType, getRole, getRoleItems, getRoleItems, getRoles, getRolesList, getSelectedTreeModel, getStatusMessage, isCalculatedItemSelected, isItemMoveDownValid, isItemMoveUpValid, isThisItemAReferenceInItemMap, isThisItemInAvailableList, isThisItemInRoleRefList, mapDataSource, queryItemsSupportDetailUsage, removeAllRoles, removeCalculatedItemBaseItems, removeDuplicateItems, removeItemsNotSupportingDetail, removeNotUsableItems, revertRefsToBaseItems, setDataItemMap, setLocale, setOriginalItemList, setQueryType, setSelectedItems, setSelectedItemsQueryType
 

Field Detail

ROW

public static final java.lang.String ROW
Constant for the name of the row role.

See Also:
PAGE, CHAPTER, SECTION, BOOK, Constant Field Values

PAGE

public static final java.lang.String PAGE
Constant for the name of the page role.

See Also:
ROW, CHAPTER, SECTION, BOOK, Constant Field Values

CHAPTER

public static final java.lang.String CHAPTER
Constant for the name of the chapter role.

See Also:
ROW, PAGE, SECTION, BOOK, Constant Field Values

SECTION

public static final java.lang.String SECTION
Constant for the name of the section role.

See Also:
ROW, PAGE, CHAPTER, BOOK, Constant Field Values

BOOK

public static final java.lang.String BOOK
Constant for the name of the book role.

See Also:
ROW, PAGE, CHAPTER, SECTION, Constant Field Values
Constructor Detail

OLAPTableRoles

public OLAPTableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
Constructor.

Parameters:
dataSelection -

OLAPTableRoles

public OLAPTableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
                      com.sas.iquery.metadata.business.InformationMap imap)
Method Detail

hasValidRoles

public boolean hasValidRoles()
Checks that the data represented by this object satisfies the rules of the BusinessQuery. Returns true if: The number of roles is zero Each role assignment satisfies the minimum and maximum items rule At least one measure is assigned to a role

Overrides:
hasValidRoles in class TableRoles

isValidRole

protected boolean isValidRole(java.lang.String name)
Checks that the role identified by the name parameter is one of the roles supported by this implementation. Returns true if the role is row, page, chapter, section, or book.

Overrides:
isValidRole in class TableRoles
Parameters:
name - - the role name to check for validity
Returns:
true if one of the valid roles, otherwise false

getAvailableTreeModel

public javax.swing.tree.TreeModel getAvailableTreeModel(com.sas.util.transforms.TransformInterface transform,
                                                        java.lang.String selectedRole)
Creates a TreeModel representation of the available items for the BusinessModel. The resulting TreeModel will contain nodes of type javax.swing.tree.DefaultMutableTreeNode if no transform object is passed to the method. If a transform is used, the resulting TreeModel will contain nodes of the type created by the tranform.

Specified by:
getAvailableTreeModel in interface DataItemSelectorInterface
Overrides:
getAvailableTreeModel in class TableRoles
Parameters:
transform - A transform object to transform the tree nodes to a different type.
role - The current role of interest
Returns:
javax.swing.tree.TreeModel

getAvailableItemInfoList

public java.util.List getAvailableItemInfoList(java.lang.String selectedRole)
Description copied from interface: DataItemSelectorInterface
Returns a list of DataItemTreeNodeInfo objects, representing the list of items available for the selected role.

Specified by:
getAvailableItemInfoList in interface DataItemSelectorInterface
Overrides:
getAvailableItemInfoList in class TableRoles
Returns:
items The list of available items
See Also:
DataItemTreeNodeInfo

getSelectedItemInfoList

public java.util.List getSelectedItemInfoList(java.lang.String selectedRole)
Description copied from interface: DataItemSelectorInterface
Returns a list of DataItemTreeNodeInfo objects, representing the list of items assigned to the selected role.

Specified by:
getSelectedItemInfoList in interface DataItemSelectorInterface
Overrides:
getSelectedItemInfoList in class TableRoles
Parameters:
selectedRole - The role of interest
Returns:
The list of available items
See Also:
DataItemTreeNodeInfo

getAvailableEnabledNodeIds

public java.util.List getAvailableEnabledNodeIds(java.lang.String selectedRole)
Description copied from interface: DataItemSelectorInterface
Returns a list of the item ids for the items available for selection for the selected role.

Specified by:
getAvailableEnabledNodeIds in interface DataItemSelectorInterface
Overrides:
getAvailableEnabledNodeIds in class TableRoles
Parameters:
selectedRole - - the currently selected role
Returns:
the list of available item ids

getAvailableRoleItems

protected java.util.List getAvailableRoleItems(com.sas.util.RoleInterface role)
Return the list of items available to add to the role

Overrides:
getAvailableRoleItems in class TableRoles
Parameters:
role - - the role object
Returns:
- the list of available items



Copyright © 2009 SAS Institute Inc. All Rights Reserved.