|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.iquery.util.BusinessQueryOLAPUtil
public class BusinessQueryOLAPUtil
Provides utility methods that enable consumers to obtain OLAP information such as the dimension name or dimension type of an OLAP item. The BusinessQueryOLAPUtil helps provide consumers utilizing OLAP data items set with ResourceAwareStringExpressions so that the following information can be retrieved:
Note: Not all methods in this class will work when using results from a ROLAP query. An example that is supported occurs when a user is exporting a ROLAP (relational) data source shown in a crosstab (which is an OLAP visual component) to an Excel spreadsheet. There is a high probability that IQ clients will request OLAP metadata information for non-OLAP data items when rendering or exporting a crosstab.
Field Summary | |
---|---|
protected static java.lang.String |
EXTENDED_ATTRIBUTE_IS_MEASURE
|
Constructor Summary | |
---|---|
BusinessQueryOLAPUtil()
|
Method Summary | |
---|---|
static void |
cleanUpNullRolesInQuery(BusinessQuery model)
This method applies an appropriate role to any dataItem found in a data selection where it's role contains a null value. |
static java.util.List |
filterOutRaggedDataItems(java.util.List dataItems)
Returns a List of data items that are not based on a ragged-balanced, ragged-unbalanced, or unbalanced hierarchy in an OLAP cube. |
static java.lang.String |
getCubeName(BusinessModel businessModel,
DataItem dataItem)
Get the cube name for an OLAP data item. |
static java.lang.String |
getCubeRestrictions(DataSelection dataSelection)
Returns a String representing text that can be used to establish a cube query context. |
static java.lang.String |
getDimensionName(BusinessModel businessModel,
DataItem dataItem)
Get the dimension name for an OLAP data item. |
static int |
getDimensionType(BusinessModel businessModel,
java.lang.Object obj)
Get the dimension type for an OLAP data item. |
static java.lang.String |
getHierarchyName(BusinessModel businessModel,
DataItem dataItem)
Get the fully qualified hierarchy name for an OLAP data item. |
static java.util.List |
getInvalidLabels(DataSelection ds)
Get a list of invalid Labels for a data selection. |
static java.lang.String |
getMeasureName(BusinessModel businessModel,
DataItem dataItem)
Get the measure name for an OLAP data item. |
static com.sas.storage.olap.MetadataInterface |
getMetadataInterface(java.lang.Object iqObject)
Creates and returns a new OLAP MetadataInterface object usable to query OLAP related metadata from the OLAP server used by the given SAS Query Services object. |
static com.sas.storage.olap.OLAPDataSetInterface |
getOLAPDataSet(java.lang.Object iqObject)
Creates and returns a new OLAP OLAPDataSetInterface object usable to obtain a resultSet from the OLAP server based on a given SAS Query Services object. |
static java.lang.String |
getPhysDimensionName(com.sas.iquery.metadata.physical.Dimension dimension)
Get the physical dimension name for a physical dimension. |
static java.lang.String |
getUniqueNameWithHierarchyAllMember(DataItem dataItem)
Get the unique name with hierarchy all for an OLAP data item. |
static boolean |
isInMeasureDimension(BusinessModel businessModel,
DataItem dataItem)
Get the dimension name for an OLAP data item. |
static void |
releaseMetadataInterface(com.sas.storage.olap.MetadataInterface metadataInterface)
Release a MetadataInterface object that was constructed in BusinessQueryOLAPUtil.getMetadataInterface. |
static void |
releaseOLAPDataSet(com.sas.storage.olap.OLAPDataSetInterface olapDataSet)
Release the specific OLAPDataSetInterface object that was constructed in BusinessQueryOLAPUtil.getOLAPDataSetInterface. |
Field Detail |
---|
protected static final java.lang.String EXTENDED_ATTRIBUTE_IS_MEASURE
Constructor Detail |
---|
public BusinessQueryOLAPUtil()
Method Detail |
---|
public static java.util.List getInvalidLabels(DataSelection ds)
ds
-
public static java.lang.String getCubeRestrictions(DataSelection dataSelection) throws GenerationException
dataSelection
-
GenerationException
public static void cleanUpNullRolesInQuery(BusinessQuery model) throws MetadataException
model
- BusinessQuery that contain OLAP dataItem that could contain null role definition.
MetadataException
public static java.util.List filterOutRaggedDataItems(java.util.List dataItems) throws MetadataException
The input List of data items may contain data items that are based on a ragged or unbalanced hierarchy. This is a convenience method for internal consumers to filter out ragged-balanced, ragged-unbalanced, unbalanced data items. This method should not be used by external consumers. It will probably be removed in the next release.
dataItems
- the List of data items to be checked whether any data items
contained in the list are based on a ragged-balanced hierarchy.
MetadataException
- One situation where a MetadataException can be thrown is when the OLAP server is
unresolved. In this case, the caller can determine this occurred by calling
MetadataException.hasReasonWithCodes(int reasonCode, int subreasonCode) where
reasonCode = Reason.REASON_NOT_USABLE_IN_QUERY, subreasonCode = Reason.SUBREASON_OBJECT_IS_UNRESOLVED.public static java.lang.String getCubeName(BusinessModel businessModel, DataItem dataItem) throws MetadataException
businessModel
- the containing business model object such as, an information map or data selection.dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static java.lang.String getDimensionName(BusinessModel businessModel, DataItem dataItem) throws MetadataException
Note: If the dimension name is unknown, null is returned.
businessModel
- the containing business model object such as, an information map or data selection.dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static int getDimensionType(BusinessModel businessModel, java.lang.Object obj) throws MetadataException
ExpressionInterface expr = dataItem.getExpression(); int type = getDimensionType( businessModel, expr );
Note: If the dimension type is unknown, DimensionInterface.TYPE_UNKNOWN is returned.
businessModel
- the containing business model object such as, an information map or data selection.obj
- The obj obtained from calling dataItem.getExpression() and resolving to either:
Dimension, Hierarchy, Level, Measure, or ResourceAwareStringExpression
MetadataException
public static java.lang.String getHierarchyName(BusinessModel businessModel, DataItem dataItem) throws MetadataException
Note: If the hierarchy name is unknown, null is returned.
businessModel
- the containing business model object such as, an information map or data selection.dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static java.lang.String getMeasureName(BusinessModel businessModel, DataItem dataItem) throws MetadataException
Note: If the measure name is unknown, null is returned.
businessModel
- the containing business model object such as, an information map or data selection.dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static com.sas.storage.olap.MetadataInterface getMetadataInterface(java.lang.Object iqObject) throws ExecutionException, MetadataException
This method uses a user-defined context system for managing OLAP connection resources.
The filtering state is defined as:
It can not be stated that the conversation is completely clean of all filtering -- only that it is clean of filtering for the object being input. Therefore, a "filtered" conversation would result in a restricted view of levels and members while a "unfiltered" conversation would result in a unrestricted view of levels and members.
Callers of this method must release the returned object by calling BusinessQueryOLAPUtil.releaseMetadataInterface(metadataInterface). Until a release is done, resources will remain allocated until the session context is destroyed (i.e. the user logs off).
The IQ object given must be either a BusinessQuery or BusinessModel.
iqObject
- - the object that provides the context for creating a MetadataInterface object to.
The object given must be either a BusinessQuery or BusinessModel object.
ExecutionException
- - if a problem was found and could not create a MetadataInterface object to return
MetadataException
releaseMetadataInterface
public static com.sas.storage.olap.OLAPDataSetInterface getOLAPDataSet(java.lang.Object iqObject) throws IQueryServicesException
This method uses a user-defined context system for managing OLAP connection resources.
The filtering state is defined as:
It can not be stated that the conversation is completely clean of all filtering -- only that it is clean of filtering for the object being input. Therefore, a "filtered" conversation would provide a resultSet from a restricted number levels and/or members while a "unfiltered" conversation would provide a resultSet from a unrestricted number levels and/or members.
Callers of this method must release the returned object by calling BusinessQueryOLAPUtil.releaseOLAPDataSetInterface(OLAPDataSetInterface). Until a release is done, resources will remain allocated until the session context is destroyed (i.e. the user logs off).
The IQ object given must be either a BusinessQuery or BusinessModel.
iqObject
- - the object that provides the context for creating a OLAPDataSetInterface object to.
The object given must be either a BusinessQuery or BusinessModel object.
IQueryServicesException
- - if a problem was found and could not create a OLAPDataSetInterface object to returnreleaseOLAPDataSetInterface
public static java.lang.String getPhysDimensionName(com.sas.iquery.metadata.physical.Dimension dimension)
dimension
- the com.sas.iquery.metadata.physical.dimension object.
public static java.lang.String getUniqueNameWithHierarchyAllMember(DataItem dataItem) throws MetadataException
Note: null is returned if the data item is a measure or is a calculated item that resolves to a measure.
dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static boolean isInMeasureDimension(BusinessModel businessModel, DataItem dataItem) throws MetadataException
Note: If it cannot be determined whether the dimension for the data item is in a measure, false is returned.
businessModel
- the containing business model object such as, an information map or data selection.dataItem
- dataItem containing either an OlapItem or calculated item.
MetadataException
public static void releaseMetadataInterface(com.sas.storage.olap.MetadataInterface metadataInterface)
metadataInterface
- public static void releaseOLAPDataSet(com.sas.storage.olap.OLAPDataSetInterface olapDataSet)
metadataInterface@throws
- IQueryServicesException
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |