com.sas.dataselectors.ranking
Class OLAPRankingSelectorAdapter

com.sas.dataselectors.ranking.OLAPRankingSelectorAdapter
All Implemented Interfaces:
com.sas.dataselectors.ranking.OLAPRankingSelectorInterface, RankingSelectorInterface

public class OLAPRankingSelectorAdapter
implements com.sas.dataselectors.ranking.OLAPRankingSelectorInterface

Ranking Selector adapter for multidimensional data.

Since:
3.1

Field Summary
 
Fields inherited from class com.sas.dataselectors.ranking.BaseRankingSelectorAdapter
bundle, dataItems, dataModel, locale, model, rankStatuses, RB_KEY, valuesFromDataModel
 
Fields inherited from interface com.sas.dataselectors.ranking.RankingSelectorInterface
NO_RANK
 
Constructor Summary
OLAPRankingSelectorAdapter()
          Default constructor.
 
Method Summary
 int countRankTypeValue()
          Returns the value associated to the "Count" ranking type.
 java.lang.String dataItemRankStatus(java.lang.String dataItemID)
          Returns the localized string describing the rank status for a DataItem.
 java.lang.String[][] getLocalizedBasedOnMeasures(java.lang.String dataItemId)
          Returns the values used to populate the choice box of the "based on" measures for a specific DataItem.
 java.lang.String[][] getMeasuresWhereClauses(java.lang.String dataItemId)
          Retuns the set of the based on measures and associated where clauses for a specific DataItem.
 java.lang.String getMeasureUniqueName(java.lang.String adapterAssignedId)
          Given the id the adapter assigned to a "based on" measure, returns the unique name the measure has in the BusinessModel.
 java.lang.String getSelectedBasedOnMeasureId(java.lang.String dataItemId)
          Returns the id of the "based on" measure that have to be preselected in the choice box of the "based on" measures for a specific DataItem.
protected  void initDataItems()
          Reading from the data model fills the dataItems instance variable with the ranking attributes of all the data items in the data model.
 java.lang.String measureDataItemID(java.lang.String dataItemID)
          Deprecated. no more used
 java.util.Map rankableLevelNames()
          Returns the list of the names of the levels that can be ranked.
 java.util.Map rankableMeasureNames()
          Deprecated.  
 java.lang.String rankingLevelName()
          Returns the name of the level to rank.
 void rankingLevelName(java.lang.String levelName)
          Sets the name of the level to rank.
 java.lang.String rankingMeasureName()
          Returns the name of the measure to rank.
 void rankingMeasureName(java.lang.String measureName)
          Sets the name of the measure to rank.
 java.util.Map rankTypes()
          Returns the list of the available rank types.
 void setBasedOnMeasureId(java.lang.String basedOnMeasureId, java.lang.String dataItemId)
          In the list of the data items, for the specified data item sets the id of the based on measure.
 void setIncludeTies(java.lang.String isIncludeTies)
          Sets if the ties are included.
 void updateWhereClause(java.lang.String dataItemId, java.lang.String basedOnMeasureId, java.lang.String[] whereClause, java.lang.String[] whereValue)
          In the list of the data items, update the info of the where clause associated to a based on measure for a specific data item.
 java.lang.String[] whereClauses(java.lang.String dataItemID)
          Given the id of a data item to rank returns the associated where clauses.
 
Methods inherited from class com.sas.dataselectors.ranking.BaseRankingSelectorAdapter
dataItems, dataItems, dataModel, dataModel, getIncludeTies, getIncludeTies, getLocale, getLocalizedInfoText, getLocalizedText, getModel, getRankFilter, includeTies, includeTies, includeTies, percentageRanking, percentageRanking, rankingCount, rankingCount, rankOrder, rankStatuses, rankStatuses, rankType, rankType, rankType, rankValue, setLocale, setModel, topRanking, topRanking, valuesFromDataModel, valuesFromDataModel
 
Methods inherited from interface com.sas.dataselectors.ranking.RankingSelectorInterface
getIncludeTies, getIncludeTies, getLocale, getLocalizedInfoText, getLocalizedText, getModel, includeTies, includeTies, includeTies, percentageRanking, percentageRanking, rankingCount, rankingCount, rankOrder, rankType, rankType, rankType, rankValue, setLocale, setModel, topRanking, topRanking, valuesFromDataModel, valuesFromDataModel
 

Constructor Detail

OLAPRankingSelectorAdapter

public OLAPRankingSelectorAdapter()
Default constructor.

Method Detail

rankingMeasureName

public java.lang.String rankingMeasureName()
Description copied from interface: OLAPRankingSelectorInterface
Returns the name of the measure to rank.

Specified by:
rankingMeasureName in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Returns:
the name of the measure to rank

rankingLevelName

public java.lang.String rankingLevelName()
Description copied from interface: OLAPRankingSelectorInterface
Returns the name of the level to rank.

Specified by:
rankingLevelName in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Returns:
the name of the level to rank

rankableLevelNames

public java.util.Map rankableLevelNames()
Description copied from interface: OLAPRankingSelectorInterface
Returns the list of the names of the levels that can be ranked.

Specified by:
rankableLevelNames in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Returns:
the list of the names of the levels that can be ranked. In the Map there's one element for each rankable level, for each element in the map its key is the level label and its value is the level id

rankableMeasureNames

public java.util.Map rankableMeasureNames()
Deprecated. 

Description copied from interface: OLAPRankingSelectorInterface
Returns the list of the names of the measures that can be ranked.

Specified by:
rankableMeasureNames in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Returns:
the list of the names of the measures that can be ranked. In the Map there's one element for each rankable measure, for each element in the map its key is the measure label and its value is the measure id

rankingMeasureName

public void rankingMeasureName(java.lang.String measureName)
Description copied from interface: OLAPRankingSelectorInterface
Sets the name of the measure to rank.

Specified by:
rankingMeasureName in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface

rankingLevelName

public void rankingLevelName(java.lang.String levelName)
Description copied from interface: OLAPRankingSelectorInterface
Sets the name of the level to rank.

Specified by:
rankingLevelName in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
levelName - The name of the level to rank

rankTypes

public java.util.Map rankTypes()
Description copied from class: BaseRankingSelectorAdapter
Returns the list of the available rank types.

Specified by:
rankTypes in interface RankingSelectorInterface
Specified by:
rankTypes in class BaseRankingSelectorAdapter
Returns:
Map the rank types. In the Map there's one element for each rank type, for each element in the map its key is the rank type description and its value is the rank type value.

dataItemRankStatus

public java.lang.String dataItemRankStatus(java.lang.String dataItemID)
Description copied from class: BaseRankingSelectorAdapter
Returns the localized string describing the rank status for a DataItem.

Specified by:
dataItemRankStatus in interface RankingSelectorInterface
Specified by:
dataItemRankStatus in class BaseRankingSelectorAdapter
Parameters:
dataItemID - the DataItam id
Returns:
the localized string describing the rank status for the DataItem

initDataItems

protected void initDataItems()
Description copied from class: BaseRankingSelectorAdapter
Reading from the data model fills the dataItems instance variable with the ranking attributes of all the data items in the data model.

Specified by:
initDataItems in class BaseRankingSelectorAdapter

measureDataItemID

public java.lang.String measureDataItemID(java.lang.String dataItemID)
Deprecated. no more used

Description copied from interface: OLAPRankingSelectorInterface
Given a data item id return the id of the measure the ranking is based on.

Specified by:
measureDataItemID in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemID - the data item unique identifier
Returns:
the id of the measure the ranking is based on a null string is returned if the received dataItemID is either null or not found in the data model

whereClauses

public java.lang.String[] whereClauses(java.lang.String dataItemID)
Description copied from interface: OLAPRankingSelectorInterface
Given the id of a data item to rank returns the associated where clauses.

Specified by:
whereClauses in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemID - the data item unique identifier
Returns:
the associated where clauses in the returned array there's an element for each where clause applied the element is made in three parts separated by a RankingSelectorComponents.VALUE_SEPARATOR, the first part is the id of the data item which the where belongs like DS_0.DIR_3 (for Time) the second part is the unique name of the where clause applied to the data item like [TIME].[All TIME].[1993] the third part is a more readeable value of the where clause like [1993] null is returned if either the received dataItemID is null or not found in the data model an empty array is returned if there are no where clauses applied to the data item

countRankTypeValue

public int countRankTypeValue()
Description copied from interface: RankingSelectorInterface
Returns the value associated to the "Count" ranking type.

Specified by:
countRankTypeValue in interface RankingSelectorInterface
Overrides:
countRankTypeValue in class BaseRankingSelectorAdapter
Returns:
the value associated to the "Count" ranking type

setIncludeTies

public void setIncludeTies(java.lang.String isIncludeTies)
Description copied from interface: RankingSelectorInterface
Sets if the ties are included.

Specified by:
setIncludeTies in interface RankingSelectorInterface
Overrides:
setIncludeTies in class BaseRankingSelectorAdapter
Parameters:
isIncludeTies - valid values are: RankingSelectorComponents.INCLUDE_TIES, RankingSelectorComponents.NOT_INCLUDE_TIES, RankingSelectorComponents.TIES_NOT_APPLICABLE

getMeasureUniqueName

public java.lang.String getMeasureUniqueName(java.lang.String adapterAssignedId)
Description copied from interface: OLAPRankingSelectorInterface
Given the id the adapter assigned to a "based on" measure, returns the unique name the measure has in the BusinessModel.

Specified by:
getMeasureUniqueName in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
adapterAssignedId - the id the adapter assigned to the measure, something like "12345"
Returns:
String the unique name the measure has in the BusinessModel, something like [Measures].[ACTUAL_SUM] a null String is returned if adapterAssignedId is not found in the list of the adapter assigned ids
See Also:
BusinessModel

getLocalizedBasedOnMeasures

public java.lang.String[][] getLocalizedBasedOnMeasures(java.lang.String dataItemId)
Description copied from interface: OLAPRankingSelectorInterface
Returns the values used to populate the choice box of the "based on" measures for a specific DataItem.

Specified by:
getLocalizedBasedOnMeasures in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemId - the ID of the DataItem in the BusinessQuery
Returns:
String[][] the values used to populate the choice box of the "based on" measures, including the separation line if necessary The returned array contains tuples containing: ID - Localized description - measure label
See Also:
BusinessQuery, DataItem

getSelectedBasedOnMeasureId

public java.lang.String getSelectedBasedOnMeasureId(java.lang.String dataItemId)
Description copied from interface: OLAPRankingSelectorInterface
Returns the id of the "based on" measure that have to be preselected in the choice box of the "based on" measures for a specific DataItem. Tipically called after calling getLocalizedBasedOnMeasures()

Specified by:
getSelectedBasedOnMeasureId in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemId - the ID of the DataItem in the BusinessQuery
Returns:
String the ID of the "based on" measure that have to be preselected. It's one of the IDs returned by the getLocalizedBasedOnMeasures() method
See Also:
BusinessQuery, DataItem

setBasedOnMeasureId

public void setBasedOnMeasureId(java.lang.String basedOnMeasureId,
                                java.lang.String dataItemId)
Description copied from interface: OLAPRankingSelectorInterface
In the list of the data items, for the specified data item sets the id of the based on measure.

Specified by:
setBasedOnMeasureId in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
basedOnMeasureId - the id of the based on measure to set
dataItemId - the data item id
See Also:
DataItem

updateWhereClause

public void updateWhereClause(java.lang.String dataItemId,
                              java.lang.String basedOnMeasureId,
                              java.lang.String[] whereClause,
                              java.lang.String[] whereValue)
Description copied from interface: OLAPRankingSelectorInterface
In the list of the data items, update the info of the where clause associated to a based on measure for a specific data item.

Specified by:
updateWhereClause in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemId - the ID of the DataItem in the BusinessQuery
basedOnMeasureId - the ID of the "based on" measure which the where clause is associated to. It's one of the IDs returned by the getLocalizedBasedOnMeasures() method
whereClause - the new where clause to be applied to the based on measure of the specified data item.

Example: whereClause[0]="[All Time].[Year].[1994].[Q1].[Jan]" whereClause[1]="[All Products].[FURNITURE].[SOFA]" when whereClause contains only one empty String like whereClause[0]="" it means the where clause must be cleared for the specified based on measure for the specified data item

whereValue - the new where clause values to be displayed to the user.

Example: whereClause[0]="Jan" whereClause[1]="SOFA"

See Also:
BusinessQuery, DataItem

getMeasuresWhereClauses

public java.lang.String[][] getMeasuresWhereClauses(java.lang.String dataItemId)
Description copied from interface: OLAPRankingSelectorInterface
Retuns the set of the based on measures and associated where clauses for a specific DataItem.

Specified by:
getMeasuresWhereClauses in interface com.sas.dataselectors.ranking.OLAPRankingSelectorInterface
Parameters:
dataItemId - the ID of the DataItem in the BusinessQuery
Returns:
String[][] the set of the based on measures and associated where clauses The returned array contains tuples containing: measureID - whereClause - whereValue - whereID

measureID is the unique id assigned to the measure by the adapter, something like 505

whereClause is, separated by tabs(\t), the set of the where clauses associated to the measure, something like [All Time].[Year].[1994].[Q1].[Jan]\t[All Products].[FURNITURE].[SOFA]

whereValue is, separated by tabs(\t), the set of the where clause descriptions associated to the measure, something like Jan\tSOFA

whereID is, separated by tabs(\t), the set of the ids of the dataitems used to generate the where clauses, something like DS_0.DIR1\tDS_0.DIR3

See Also:
BusinessQuery, DataItem



Copyright © 2009 SAS Institute Inc. All Rights Reserved.