|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.dataselectors.dataitems.TableRoles
public class TableRoles
Defines and manages the roles for a relational, or two-dimensional, query.
Nested Class Summary | |
---|---|
protected class |
TableRoles.Role
|
Field Summary | |
---|---|
protected com.sas.iquery.metadata.business.BusinessModel |
_businessModel
|
static java.lang.String |
COLUMN
Constant for the name of the column role. |
protected java.util.List |
dataItemRefList
|
static java.lang.String |
FILTER
Constant for the name of the filter role. |
protected com.sas.iquery.metadata.business.InformationMap |
iMap
|
protected java.util.List |
originalItemList
|
protected java.lang.String |
queryType
|
static java.lang.String |
RB_KEY
Key used to look up resources in the resource bundle |
static java.lang.String |
RB_KEY2
|
protected java.lang.String[] |
selectedItems
|
static java.lang.String |
SLICER
Constant for the name of the slicer role. |
Fields inherited from interface com.sas.dataselectors.dataitems.DataItemSelectorInterface |
---|
DISPLAY_DETAIL_VALUES, GROUP_BY_CATEGORY_VALUES |
Constructor Summary | |
---|---|
TableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
Constructor. |
|
TableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
com.sas.iquery.metadata.business.InformationMap imap)
|
Method Summary | |
---|---|
void |
addRole(java.lang.String name,
java.lang.String label,
java.lang.String description,
int minRoleItemCount,
int maxRoleItemCount)
Adds a role with the given criteria. |
boolean |
allQueryItemsAreDetailUsage()
Indicates if all items selected for each role are set to detail usage. |
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 |
dumpThisItemList(java.util.List items)
Debugging method for examining lists of dataitems |
java.util.List |
getAllAvailableNodeIds(boolean useOriginalIds)
Returns a list of the ids for all items in the available list. |
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 tree model representing the available items for the business model. |
java.lang.String |
getBaseItemId(java.lang.String itemid)
Returns the base item id of the DataItemReference in the stored dataItem map identified by itemid. |
java.util.Map |
getDataItemMap()
Returns the map of DataItems stored by their id |
static java.lang.String |
getID(java.lang.Object object)
Gets a unique String identifier for the given Object. |
java.lang.Object |
getItemFromItemMap(java.lang.String itemid)
Returns the data item in the stored itemmap that corresponds to the itemid. |
java.util.Locale |
getLocale()
Returns the locale object |
java.util.List |
getMoveTargetRoles()
Returns a list of RoleInterface objects that the items contained in the selectedItems parameter can be moved to. |
protected java.util.List |
getOriginalItemList()
Returns the list of items stored in the business model before any references were created by this adapter. |
java.lang.String |
getQueryType()
Returns the current query type |
com.sas.util.RoleInterface |
getRole(java.lang.String name,
java.lang.String label)
Returns the role with the name and label specified. |
java.util.List |
getRoleItems()
Returns all the items that can be assigned to the roles. |
protected java.util.List |
getRoleItems(boolean isFilterRole)
|
com.sas.util.RoleInterface[] |
getRoles()
Returns the available roles. |
protected java.util.ArrayList |
getRolesList()
|
java.util.List |
getSelectedItemInfoList(java.lang.String selectedRole)
Returns a list of DataItemTreeNodeInfo objects, representing the list of items assigned to the selected role. |
javax.swing.tree.TreeModel |
getSelectedTreeModel(com.sas.util.transforms.TransformInterface transform,
java.lang.String selectedRole)
Creates a tree model representing the selected items for the business model. |
java.lang.String |
getStatusMessage()
Checks for basic validity/completeness of the adapter and returns a status message indicating what is wrong with the adapter. |
protected boolean |
hasValidRoles()
|
boolean |
isCalculatedItemSelected()
Indicates if a calculated item is selected for any of the assigned roles. |
boolean |
isItemMoveDownValid()
Returns true if the items contained in the selectedItems parameter can be moved down in the model order. |
boolean |
isItemMoveUpValid()
Returns true if the items contained in the selectedItems parameter can be moved up in the model order. |
boolean |
isThisItemAReferenceInItemMap(java.lang.String itemid)
Convenience method that indicates if the item in the stored dataitem map identified by the passed in id is a DataItemReference. |
boolean |
isThisItemInAvailableList(java.lang.String itemid,
com.sas.util.RoleInterface role)
Convenience method to determine if the data item identified by the passed in item id is available for selection for the indicated role. |
boolean |
isThisItemInRoleRefList(java.lang.String itemid,
com.sas.util.RoleInterface role)
Indicates if the item identified by the passed in item id is in the list of DataItemReferences created by addRoleItem for the indicated role. |
protected boolean |
isValidRole(java.lang.String name)
Checks the role to see if a role with name is valid within this model Subclasses can override this method to allow other role types to be added. |
void |
mapDataSource()
Creates a map of selected items with their item id as the key. |
boolean |
queryItemsSupportDetailUsage()
Indicates if all items selected for each role support the detail usage. |
void |
removeAllRoles()
Removes all roles. |
protected java.util.List |
removeCalculatedItemBaseItems(java.util.List listOfItems)
Convenience method to remove the base DataItems of all calculated DataItemReferences from the passed in list of items. |
protected java.util.List |
removeDuplicateItems(java.util.List allDataItems)
Convenience method to create a list of DataItems such that each item in the list has a unique base DataItem. |
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 java.util.List |
revertRefsToBaseItems(java.util.List allDataItems)
Convenience method to create a list such that for every item in the input list that is a DataItemReference, return its baseDataitem. |
void |
setDataItemMap(java.util.Map map)
Sets the map map of DataItems stored by their id |
void |
setLocale(java.util.Locale locale)
Sets the locale object to ensure that all messages returned are properly translated. |
protected void |
setOriginalItemList(java.util.List allItems)
Stores the items in the business model |
void |
setQueryType(java.lang.String queryType)
Sets the value for the query type for relational queries. |
void |
setSelectedItems(java.lang.String[] items)
Sets the array of selected data items. |
void |
setSelectedItemsQueryType(java.lang.String queryType)
Sets the DataItem usage for each of the selected items. |
Field Detail |
---|
public static final java.lang.String COLUMN
SLICER
,
FILTER
,
Constant Field Valuespublic static final java.lang.String SLICER
COLUMN
,
FILTER
,
Constant Field Valuespublic static final java.lang.String FILTER
COLUMN
,
SLICER
,
Constant Field Valuesprotected com.sas.iquery.metadata.business.BusinessModel _businessModel
protected java.util.List dataItemRefList
protected java.util.List originalItemList
protected java.lang.String queryType
protected java.lang.String[] selectedItems
public static final java.lang.String RB_KEY
public static final java.lang.String RB_KEY2
protected com.sas.iquery.metadata.business.InformationMap iMap
Constructor Detail |
---|
public TableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
businessquery
- - the data model to query for the adapter informationpublic TableRoles(com.sas.iquery.metadata.business.BusinessQuery businessQuery, com.sas.iquery.metadata.business.InformationMap imap)
Method Detail |
---|
public void addRole(java.lang.String name, java.lang.String label, java.lang.String description, int minRoleItemCount, int maxRoleItemCount)
name
- the name of the role,
must be either COLUMN
. SLICER
or FILTER
label
- the role's labeldescription
- the role's descriptionminRoleItemCount
- the minimum number of items that must be assigned to the rolemaxRoleItemCount
- the maximum number of items that may be assigned to the role,
zero if unlimitedremoveAllRoles()
protected boolean isValidRole(java.lang.String name)
name
- the name of the role
must be either COLUMN
. SLICER
or FILTER
protected java.util.ArrayList getRolesList()
public void removeAllRoles()
addRole(java.lang.String, java.lang.String, java.lang.String, int, int)
public com.sas.util.RoleInterface[] getRoles()
addRole()
.
getRoles
in interface com.sas.util.RoleProviderInterface
addRole(java.lang.String, java.lang.String, java.lang.String, int, int)
public java.util.List getRoleItems()
getRoleItems
in interface com.sas.util.RoleProviderInterface
protected java.util.List getRoleItems(boolean isFilterRole)
protected java.util.List removeItemsNotSupportingDetail(java.util.List items)
items
- - a list of DataItems
protected java.util.List removeDuplicateItems(java.util.List allDataItems)
allDataItems
- - a list of DataItems
protected java.util.List revertRefsToBaseItems(java.util.List allDataItems)
allDataItems
- - the list of data items (DataItems and/or DataItemReferences)
public void mapDataSource()
public java.lang.Object getItemFromItemMap(java.lang.String itemid)
DataItemSelectorInterface
getItemFromItemMap
in interface DataItemSelectorInterface
itemid
- - the id of the item to return
public java.lang.String getBaseItemId(java.lang.String itemid)
DataItemSelectorInterface
getBaseItemId
in interface DataItemSelectorInterface
itemid
- - the id of the DataItemReference to find in the map
public boolean isThisItemAReferenceInItemMap(java.lang.String itemid)
DataItemSelectorInterface
isThisItemAReferenceInItemMap
in interface DataItemSelectorInterface
itemid
- - the id of the item to search for in the dataitem map
public boolean isThisItemInAvailableList(java.lang.String itemid, com.sas.util.RoleInterface role)
DataItemSelectorInterface
isThisItemInAvailableList
in interface DataItemSelectorInterface
itemid
- - the id of the item in the available listrole
- - the role of interest
public boolean isThisItemInRoleRefList(java.lang.String itemid, com.sas.util.RoleInterface role)
DataItemSelectorInterface
isThisItemInRoleRefList
in interface DataItemSelectorInterface
itemid
- - the id of the DataItemrole
- - the role of interest
protected java.util.List getOriginalItemList()
public java.util.Map getDataItemMap()
DataItemSelectorInterface
getDataItemMap
in interface DataItemSelectorInterface
public void setDataItemMap(java.util.Map map)
map
- the dataitem mappublic static java.lang.String getID(java.lang.Object object)
object
- the Object to get an ID for
public void setSelectedItemsQueryType(java.lang.String queryType)
setSelectedItemsQueryType
in interface DataItemSelectorInterface
queryType
- - The query type string. This should be "group" or "detail".DataItemActionType
protected java.util.List removeNotUsableItems(java.util.List allDataItems)
allDataItems
- - a list of DataItems
public javax.swing.tree.TreeModel getAvailableTreeModel(com.sas.util.transforms.TransformInterface transform, java.lang.String selectedRole)
DataItemSelectorInterface
getAvailableTreeModel
in interface DataItemSelectorInterface
transform
- - an optional transform objectselectedRole
- - the currently selected role
protected void dumpThisItemList(java.util.List items)
protected void setOriginalItemList(java.util.List allItems)
public java.util.List getAvailableEnabledNodeIds(java.lang.String selectedRole)
DataItemSelectorInterface
getAvailableEnabledNodeIds
in interface DataItemSelectorInterface
selectedRole
- - the currently selected role
public void cleanUp(java.lang.String mode)
DataItemSelectorInterface
cleanUp
in interface DataItemSelectorInterface
mode
- - an optional mode identifier (this can be null)public java.util.List getAllAvailableNodeIds(boolean useOriginalIds)
DataItemSelectorInterface
getAllAvailableNodeIds
in interface DataItemSelectorInterface
protected java.util.List removeCalculatedItemBaseItems(java.util.List listOfItems)
listOfItems
- - a list of DataItems
public java.util.List getAvailableItemInfoList(java.lang.String selectedRole)
DataItemSelectorInterface
getAvailableItemInfoList
in interface DataItemSelectorInterface
DataItemTreeNodeInfo
public java.util.List getSelectedItemInfoList(java.lang.String selectedRole)
DataItemSelectorInterface
getSelectedItemInfoList
in interface DataItemSelectorInterface
selectedRole
- The role of interest
DataItemTreeNodeInfo
public javax.swing.tree.TreeModel getSelectedTreeModel(com.sas.util.transforms.TransformInterface transform, java.lang.String selectedRole)
DataItemSelectorInterface
getSelectedTreeModel
in interface DataItemSelectorInterface
transform
- - an optional transform objectselectedRole
- - the currently selected role
protected java.util.List getAvailableRoleItems(com.sas.util.RoleInterface role)
public com.sas.util.RoleInterface getRole(java.lang.String name, java.lang.String label)
name
- the name of the role,label
- the role's label
addRole(java.lang.String, java.lang.String, java.lang.String, int, int)
protected boolean hasValidRoles()
public java.lang.String getStatusMessage()
DataItemSelectorInterface
getStatusMessage
in interface DataItemSelectorInterface
public java.util.Locale getLocale()
DataItemSelectorInterface
getLocale
in interface DataItemSelectorInterface
public void setLocale(java.util.Locale locale)
DataItemSelectorInterface
setLocale
in interface DataItemSelectorInterface
locale
- - the locale objectpublic boolean isCalculatedItemSelected()
DataItemSelectorInterface
isCalculatedItemSelected
in interface DataItemSelectorInterface
public boolean queryItemsSupportDetailUsage()
DataItemSelectorInterface
queryItemsSupportDetailUsage
in interface DataItemSelectorInterface
DataItemActionType
public boolean allQueryItemsAreDetailUsage()
DataItemSelectorInterface
allQueryItemsAreDetailUsage
in interface DataItemSelectorInterface
DataItemActionType
public void setQueryType(java.lang.String queryType)
DataItemSelectorInterface
setQueryType
in interface DataItemSelectorInterface
public java.lang.String getQueryType()
DataItemSelectorInterface
getQueryType
in interface DataItemSelectorInterface
public boolean isItemMoveUpValid()
DataItemSelectorInterface
isItemMoveUpValid
in interface DataItemSelectorInterface
public boolean isItemMoveDownValid()
DataItemSelectorInterface
isItemMoveDownValid
in interface DataItemSelectorInterface
public java.util.List getMoveTargetRoles()
DataItemSelectorInterface
getMoveTargetRoles
in interface DataItemSelectorInterface
public void setSelectedItems(java.lang.String[] items)
DataItemSelectorInterface
setSelectedItems
in interface DataItemSelectorInterface
items
- The array of selected items
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |