com.sas.dataselectors.ranking
Class Util

com.sas.dataselectors.ranking.Util

public class Util

Utility class to contain common methods used by the Ranking Selector.

Since:
3.1

Constructor Summary
Util()
           
 
Method Summary
static java.util.Map businessModeldataItemNames(com.sas.iquery.metadata.business.BusinessModel dataModel, com.sas.iquery.metadata.business.StructureOfDataItem structureType)
          Returns the list of the names and IDs of the DataItems of a specific type contained in a BusinessModel.
static java.util.Map dataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel, com.sas.iquery.metadata.business.StructureOfDataItem structureType)
          Returns the list of the names and IDs of the DataItems of a specific type contained in a BusinessQuery.
static java.util.Map dataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel, com.sas.iquery.metadata.business.StructureOfDataItem structureType, java.lang.Integer expressionType)
          Returns the list of the names and IDs of the DataItems of a specific structure type and expression type contained in a BusinessQuery.
static java.lang.String getMeasureLabel(com.sas.iquery.metadata.business.BusinessModel dataModel, java.lang.String measureUniqueName)
          Deprecated. no more used
static java.util.Map getRankEnabledDataItemNames(java.util.Collection dataItemIds, com.sas.iquery.metadata.business.BusinessQuery dataModel)
          Given a collection of DataItem ids in a BusinessQuery returns the list of the ids and labels of those DataItems that are rank enabled.
static boolean isRankSupported(com.sas.iquery.intelligentquery.BusinessQueryProviderInterface bqProvider)
          Checks if a BusinessQueryProviderInterface like a BusinessQueryToOLAPDataSetAdapter or a BusinessQueryAdapter can be ranked.
static java.util.Map OLAPDataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel)
          Returns the list of the names and IDs of the OLAP DataItems contained in a BusinessQuery.
static java.util.Map OLAPDataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel, com.sas.iquery.metadata.business.DataItemActionType actionType)
          Returns the list of the names and IDs of the OLAP DataItems contained in a BusinessQuery that support a specific action.
 

Constructor Detail

Util

public Util()
Method Detail

dataItemNames

public static java.util.Map dataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel,
                                          com.sas.iquery.metadata.business.StructureOfDataItem structureType,
                                          java.lang.Integer expressionType)
                                   throws com.sas.iquery.metadata.InvalidIDException
Returns the list of the names and IDs of the DataItems of a specific structure type and expression type contained in a BusinessQuery.

Parameters:
dataModel - the data model
structureType - the StructureOfDataItem object, valid values are StructureOfDataItem.STRUCTURE_COLUMN, StructureOfDataItem.STRUCTURE_DIMENSION, StructureOfDataItem.STRUCTURE_HIERARCHY, StructureOfDataItem.STRUCTURE_LEVEL, StructureOfDataItem.STRUCTURE_MEASURE.
expressionType - the expression type see ExpressionTypes for valid values
Returns:
the list of the names and IDs of the DataItems of a specific type contained in the BusinessQuery. In the Map there's one element for each rankable measure, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
Throws:
com.sas.iquery.metadata.InvalidIDException - if cannot get the dataitem id
See Also:
BusinessQuery, DataItem

dataItemNames

public static java.util.Map dataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel,
                                          com.sas.iquery.metadata.business.StructureOfDataItem structureType)
                                   throws com.sas.iquery.metadata.InvalidIDException
Returns the list of the names and IDs of the DataItems of a specific type contained in a BusinessQuery.

Parameters:
dataModel - the data model
structureType - the StructureOfDataItem object, valid values are StructureOfDataItem.STRUCTURE_COLUMN, StructureOfDataItem.STRUCTURE_DIMENSION, StructureOfDataItem.STRUCTURE_HIERARCHY, StructureOfDataItem.STRUCTURE_LEVEL, StructureOfDataItem.STRUCTURE_MEASURE.
Returns:
the list of the names and IDs of the DataItems of a specific type contained in the BusinessQuery. In the Map there's one element for each rankable measure, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
Throws:
com.sas.iquery.metadata.InvalidIDException - if cannot get the dataitem id
See Also:
BusinessQuery, DataItem

businessModeldataItemNames

public static java.util.Map businessModeldataItemNames(com.sas.iquery.metadata.business.BusinessModel dataModel,
                                                       com.sas.iquery.metadata.business.StructureOfDataItem structureType)
                                                throws com.sas.iquery.metadata.InvalidIDException
Returns the list of the names and IDs of the DataItems of a specific type contained in a BusinessModel.

Parameters:
dataModel - the data model
structureType - the StructureOfDataItem object, valid values are StructureOfDataItem.STRUCTURE_COLUMN, StructureOfDataItem.STRUCTURE_DIMENSION, StructureOfDataItem.STRUCTURE_HIERARCHY, StructureOfDataItem.STRUCTURE_LEVEL, StructureOfDataItem.STRUCTURE_MEASURE.
Returns:
the list of the names and IDs of the DataItems of a specific type contained in the BusinessModel. In the Map there's one element for each rankable measure, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
Throws:
com.sas.iquery.metadata.InvalidIDException - if cannot get the dataitem id
See Also:
BusinessModel, DataItem

OLAPDataItemNames

public static java.util.Map OLAPDataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel)
                                       throws com.sas.iquery.metadata.InvalidIDException
Returns the list of the names and IDs of the OLAP DataItems contained in a BusinessQuery. A DataItem is considered to be OLAP if it's one of the following types StructureOfDataItem.STRUCTURE_DIMENSION, StructureOfDataItem.STRUCTURE_HIERARCHY, StructureOfDataItem.STRUCTURE_LEVEL.

Parameters:
dataModel - the data model
Returns:
the list of the names and IDs of the OLAP DataItems contained in the BusinessQuery. In the Map there's one element for each DataItem, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
Throws:
com.sas.iquery.metadata.InvalidIDException - if cannot get the DataItem id
See Also:
BusinessQuery, DataItem

OLAPDataItemNames

public static java.util.Map OLAPDataItemNames(com.sas.iquery.metadata.business.BusinessQuery dataModel,
                                              com.sas.iquery.metadata.business.DataItemActionType actionType)
                                       throws com.sas.iquery.metadata.InvalidIDException
Returns the list of the names and IDs of the OLAP DataItems contained in a BusinessQuery that support a specific action. A DataItem is considered to be OLAP if it's one of the following types StructureOfDataItem.STRUCTURE_DIMENSION, StructureOfDataItem.STRUCTURE_HIERARCHY, StructureOfDataItem.STRUCTURE_LEVEL.

Parameters:
dataModel - the data model
actionType - the DataItemActionType object, if it's null no checking for the support of the action occurs,
Returns:
Map the list of the names and IDs of the OLAP DataItems contained in the BusinessQuery that support a specific action. In the Map there's one element for each DataItem, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
Throws:
com.sas.iquery.metadata.InvalidIDException
See Also:
BusinessQuery, DataItem, DataItemActionType

getMeasureLabel

public static java.lang.String getMeasureLabel(com.sas.iquery.metadata.business.BusinessModel dataModel,
                                               java.lang.String measureUniqueName)
Deprecated. no more used

Given a Business Model and the unique name of a measure Data Item, returns the label of the measure Data Item in the Business Model.

Parameters:
dataModel - the data model
measureUniqueName - the unique name of a measure Data Item
Returns:
String the label of the measure Data Item in the Business Model, null if the measure Data Item is not found in the Business Model

isRankSupported

public static boolean isRankSupported(com.sas.iquery.intelligentquery.BusinessQueryProviderInterface bqProvider)
Checks if a BusinessQueryProviderInterface like a BusinessQueryToOLAPDataSetAdapter or a BusinessQueryAdapter can be ranked. The BusinessQueryProviderInterface can be ranked if at least one of the DataItems contained in its BusinessQuery can be ranked.

Parameters:
bqProvider - the BusinessQueryProviderInterface object
Returns:
boolean true if the BusinessQueryProviderInterface can be ranked, false otherwise
See Also:
BusinessQueryProviderInterface, BusinessQueryToOLAPDataSetAdapter, BusinessQueryAdapter, BusinessQuery, DataItem

getRankEnabledDataItemNames

public static java.util.Map getRankEnabledDataItemNames(java.util.Collection dataItemIds,
                                                        com.sas.iquery.metadata.business.BusinessQuery dataModel)
Given a collection of DataItem ids in a BusinessQuery returns the list of the ids and labels of those DataItems that are rank enabled.

Parameters:
dataItemIds - the collection of DataItem ids
dataModel - the BusinessQuery object
Returns:
Map the list of ids and labels for those DataItems that are rank enabled In the Map there's one element for each DataItem, for each element in the map its key is the DataItem label and its value is the DataItem id. An empty Map in returned in case of errors.
See Also:
BusinessQuery, DataItem



Copyright © 2009 SAS Institute Inc. All Rights Reserved.