com.sas.dataselectors.dataitems
Class DataItemSelectorModel

com.sas.dataselectors.dataitems.DataItemSelectorModel
All Implemented Interfaces:
DataItemSelectorInterface, SelectorCommitInterface, SelectorProcessInterface, com.sas.util.RoleProviderInterface
Direct Known Subclasses:
DataItemSelectorModelOLAPTable, DataItemSelectorModelRelationalTable

public class DataItemSelectorModel

This class extends the base DataItemSelector model to provide data logic specific to the BusinessModel/BusinessQuery API. Subclasses of this model can exist to provide specific sets of roles for a given entity such as a relational table or a bar chart.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sas.dataselectors.dataitems.BaseDataItemSelectorModel
BaseDataItemSelectorModel.Role
 
Field Summary
protected  com.sas.iquery.metadata.business.BusinessModel _businessModel
           
protected  com.sas.iquery.metadata.business.InformationMap iMap
           
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.dataselectors.dataitems.BaseDataItemSelectorModel
_dataItemMap, _locale, _rolesList, action, CANCEL_MODE, CHANGE_QUERY_TYPE, CHANGE_ROLE, COMMIT, COMMIT_MODE, data, MOVE_ITEM_DOWN, MOVE_ITEM_TO_POSITION, MOVE_ITEM_UP, MOVE_ITEMS, originalItemList, positionToMoveTo, PROCESS_MODE, queryType, role, selectedItems, SHOW_MODE, SORT_ITEMS, unselectedItems, UPDATE_ITEMS
 
Fields inherited from interface com.sas.dataselectors.dataitems.DataItemSelectorInterface
DISPLAY_DETAIL_VALUES, GROUP_BY_CATEGORY_VALUES
 
Fields inherited from interface com.sas.dataselectors.SelectorCommitInterface
EXCEPTION_OCCURRED
 
Constructor Summary
DataItemSelectorModel()
           
DataItemSelectorModel(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
          Constructor.
DataItemSelectorModel(com.sas.iquery.metadata.business.BusinessQuery businessQuery, com.sas.iquery.metadata.business.InformationMap imap)
           
 
Method Summary
protected  void addItemToRole(java.lang.Object item, com.sas.util.RoleInterface role, java.util.List roleList, java.util.Map itemMap)
           
 void cleanUp(java.lang.String mode)
          For each added role, removes from the business model all DataItemReference objects created during processing of the selector.
protected  void createRoles()
           
protected  javax.swing.tree.TreeModel getAvailableTreeModel(java.util.List allItems, java.util.List availableItems, com.sas.util.transforms.TransformInterface transform)
           
 javax.swing.tree.TreeModel getAvailableTreeModel(com.sas.util.transforms.TransformInterface transform, java.lang.String selectedRole)
          Creates a tree model representing the available items for the business model.
protected  java.lang.Object getBaseItem(java.lang.Object item)
           
protected  java.lang.String getItemCategory(java.lang.Object item)
           
protected  java.lang.String getItemDefaultImage(java.lang.Object item)
           
protected  java.lang.String getItemDescription(java.lang.Object item)
           
protected  java.lang.String getItemDisabledImage(java.lang.Object item)
           
protected  java.lang.String getItemID(java.lang.Object item)
           
protected  java.lang.String getItemLabel(java.lang.Object item)
           
 java.util.List getMoveTargetRoles()
          Returns a list of RoleInterface objects that the items contained in the selectedItems parameter can be moved to.
 java.util.List getRoleItems()
           
protected  java.lang.String getRoleLabel(java.lang.String role)
           
 com.sas.util.RoleInterface[] getRoles()
           
protected  javax.swing.tree.TreeNode getSelectedTreeNode(com.sas.util.RoleInterface role, com.sas.util.transforms.TransformInterface transform, java.lang.String selectedRole)
           
protected  boolean isCalculatedItem(java.lang.Object item)
           
protected  boolean isDetailUsageSupported(java.lang.Object item)
           
protected  boolean isItemActionSupported(java.lang.Object item, java.lang.String queryType)
           
protected  boolean isItemAReference(java.lang.Object item)
           
protected  boolean isItemUsageDetail(java.lang.Object item)
           
protected  boolean isMeasure(java.lang.Object item)
           
protected  java.util.List removeDuplicateItems(java.util.List allItems)
          Convenience method to create a list of items such that each item in the list is unique.
protected  void removeItemFromRole(java.lang.Object item, java.util.List roleList, java.util.List refList)
           
protected  java.util.List removeItemsNotSupportingDetail(java.util.List items)
          Removes the items from the passed in list that do not support the detail usage.
protected  java.util.List removeNotUsableItems(java.util.List allDataItems)
          Convenience method that removes all items in the list that are not usable in the query for some reason.
protected  void setItemUsage(java.lang.Object item, java.lang.String queryType)
           
protected  void setOriginalItemList(java.util.List allItems)
          Maintains a list of item IDs for the specified items.
 
Methods inherited from class com.sas.dataselectors.dataitems.BaseDataItemSelectorModel
addResultItemsToQuery, adjustMoveToPosition, allQueryItemsAreDetailUsage, commit, createAddItemsList, deleteResultItemsFromQuery, deleteSortCriteriaFromQuery, findRoleForItem, getAction, getAllAvailableNodeIds, getAvailableEnabledNodeIds, getAvailableItemInfoList, getAvailableRoleItems, getBaseItemId, getData, getDataItemMap, getDropTargetRoles, getIdFromDataItemRefList, getItemFromItemMap, getItemFromReference, getItemInRolePosition, getItemPositionInRole, getLocale, getPositionToMoveTo, getPropertiesBean, getQueryType, getReason, getReasonsQueryNotValid, getRole, getRoleDetailedLabel, getSelectedItemInfoList, getSelectedItems, getSelectedTreeModel, getStatusMessage, getUnselectedItems, hasValidRoles, isCalculatedItemSelected, isItemFirstInRole, isItemLastInRole, isItemMoveDownValid, isItemMoveUpValid, isQueryActionSupported, isQueryValid, isThisItemAReferenceInItemMap, isThisItemInAvailableList, isThisItemInRoleRefList, mapDataSource, moveItemsToPosition, moveItemsToRole, moveItemsUpDown, process, queryItemsSupportDetailUsage, rollBackQuery, setAction, setData, setDataItemMap, setLocale, setPositionToMoveTo, setQueryType, setRole, setSelectedItems, setSelectedItemsQueryType, setUnselectedItems, sortItemListByRolePosition
 

Field Detail

_businessModel

protected com.sas.iquery.metadata.business.BusinessModel _businessModel

iMap

protected com.sas.iquery.metadata.business.InformationMap iMap

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

DataItemSelectorModel

public DataItemSelectorModel()

DataItemSelectorModel

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

Parameters:
businessquery - - the data model to query for the adapter information

DataItemSelectorModel

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

getRoleItems

public java.util.List getRoleItems()
Specified by:
getRoleItems in interface com.sas.util.RoleProviderInterface
Specified by:
getRoleItems in class BaseDataItemSelectorModel

getRoles

public com.sas.util.RoleInterface[] getRoles()
Specified by:
getRoles in interface com.sas.util.RoleProviderInterface
Overrides:
getRoles in class BaseDataItemSelectorModel

getAvailableTreeModel

public javax.swing.tree.TreeModel getAvailableTreeModel(com.sas.util.transforms.TransformInterface transform,
                                                        java.lang.String selectedRole)
Description copied from interface: DataItemSelectorInterface
Creates a tree model representing the available items for the business model. By default, the tree nodes are of type DefaultMutableTreeNode, but a transform can be passed in to transform the tree nodes to a different type.

Specified by:
getAvailableTreeModel in interface DataItemSelectorInterface
Overrides:
getAvailableTreeModel in class BaseDataItemSelectorModel
Parameters:
transform - - an optional transform object
selectedRole - - the currently selected role
Returns:
a TreeModel representing the available items

cleanUp

public void cleanUp(java.lang.String mode)
Description copied from interface: DataItemSelectorInterface
For each added role, removes from the business model all DataItemReference objects created during processing of the selector. This is typically done when the user cancels out of the selector to restore the business model to its original state.

Specified by:
cleanUp in interface DataItemSelectorInterface
Overrides:
cleanUp in class BaseDataItemSelectorModel
Parameters:
mode - - an optional mode identifier (this can be null)

getAvailableTreeModel

protected javax.swing.tree.TreeModel getAvailableTreeModel(java.util.List allItems,
                                                           java.util.List availableItems,
                                                           com.sas.util.transforms.TransformInterface transform)
Overrides:
getAvailableTreeModel in class BaseDataItemSelectorModel

getSelectedTreeNode

protected javax.swing.tree.TreeNode getSelectedTreeNode(com.sas.util.RoleInterface role,
                                                        com.sas.util.transforms.TransformInterface transform,
                                                        java.lang.String selectedRole)
Overrides:
getSelectedTreeNode in class BaseDataItemSelectorModel

removeNotUsableItems

protected java.util.List removeNotUsableItems(java.util.List allDataItems)
Convenience method that removes all items in the list that are not usable in the query for some reason.

Overrides:
removeNotUsableItems in class BaseDataItemSelectorModel
Parameters:
allDataItems - - a list of DataItems
Returns:
the list of usable items

removeDuplicateItems

protected java.util.List removeDuplicateItems(java.util.List allItems)
Convenience method to create a list of items such that each item in the list is unique.

Overrides:
removeDuplicateItems in class BaseDataItemSelectorModel
Parameters:
allItems - - a list of items
Returns:
the list of unique items

removeItemsNotSupportingDetail

protected java.util.List removeItemsNotSupportingDetail(java.util.List items)
Removes the items from the passed in list that do not support the detail usage.

Overrides:
removeItemsNotSupportingDetail in class BaseDataItemSelectorModel
Parameters:
items - - a list of items
Returns:
the list of items supporting detail usage

setOriginalItemList

protected void setOriginalItemList(java.util.List allItems)
Maintains a list of item IDs for the specified items.

Overrides:
setOriginalItemList in class BaseDataItemSelectorModel

getItemID

protected java.lang.String getItemID(java.lang.Object item)
Overrides:
getItemID in class BaseDataItemSelectorModel

getItemLabel

protected java.lang.String getItemLabel(java.lang.Object item)
Overrides:
getItemLabel in class BaseDataItemSelectorModel

getItemDescription

protected java.lang.String getItemDescription(java.lang.Object item)
Overrides:
getItemDescription in class BaseDataItemSelectorModel

getItemCategory

protected java.lang.String getItemCategory(java.lang.Object item)
Overrides:
getItemCategory in class BaseDataItemSelectorModel

getItemDefaultImage

protected java.lang.String getItemDefaultImage(java.lang.Object item)
Overrides:
getItemDefaultImage in class BaseDataItemSelectorModel

getItemDisabledImage

protected java.lang.String getItemDisabledImage(java.lang.Object item)
Overrides:
getItemDisabledImage in class BaseDataItemSelectorModel

isCalculatedItem

protected boolean isCalculatedItem(java.lang.Object item)
Overrides:
isCalculatedItem in class BaseDataItemSelectorModel

isDetailUsageSupported

protected boolean isDetailUsageSupported(java.lang.Object item)
Overrides:
isDetailUsageSupported in class BaseDataItemSelectorModel

isItemUsageDetail

protected boolean isItemUsageDetail(java.lang.Object item)
Overrides:
isItemUsageDetail in class BaseDataItemSelectorModel

isItemActionSupported

protected boolean isItemActionSupported(java.lang.Object item,
                                        java.lang.String queryType)
Overrides:
isItemActionSupported in class BaseDataItemSelectorModel

setItemUsage

protected void setItemUsage(java.lang.Object item,
                            java.lang.String queryType)
Overrides:
setItemUsage in class BaseDataItemSelectorModel

getBaseItem

protected java.lang.Object getBaseItem(java.lang.Object item)
Overrides:
getBaseItem in class BaseDataItemSelectorModel

getRoleLabel

protected java.lang.String getRoleLabel(java.lang.String role)
Overrides:
getRoleLabel in class BaseDataItemSelectorModel

isItemAReference

protected boolean isItemAReference(java.lang.Object item)
Overrides:
isItemAReference in class BaseDataItemSelectorModel

isMeasure

protected boolean isMeasure(java.lang.Object item)
Overrides:
isMeasure in class BaseDataItemSelectorModel

addItemToRole

protected void addItemToRole(java.lang.Object item,
                             com.sas.util.RoleInterface role,
                             java.util.List roleList,
                             java.util.Map itemMap)
Overrides:
addItemToRole in class BaseDataItemSelectorModel

removeItemFromRole

protected void removeItemFromRole(java.lang.Object item,
                                  java.util.List roleList,
                                  java.util.List refList)
Overrides:
removeItemFromRole in class BaseDataItemSelectorModel

createRoles

protected void createRoles()

getMoveTargetRoles

public java.util.List getMoveTargetRoles()
Description copied from interface: DataItemSelectorInterface
Returns a list of RoleInterface objects that the items contained in the selectedItems parameter can be moved to.

Specified by:
getMoveTargetRoles in interface DataItemSelectorInterface
Overrides:
getMoveTargetRoles in class BaseDataItemSelectorModel
Returns:
The list of roles the items can move to



Copyright © 2009 SAS Institute Inc. All Rights Reserved.