|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.iquery.dataservices.IQDataServices
public class IQDataServices
Specifies an object that provides access to SAS Query Services. Currently, only a getPossibleFilterValues service is provided. This model should evolve to include other services consumers need. The IQDataServicesInterface helps define an simple API for surfacing SAS Query Services. For an example of how to use getPossibleFilterValues,
PossibleFilterValue
Field Summary | |
---|---|
static int |
FORMATTED
Used in getPossibleFilterValues() to request only formatted data should be returned. |
static int |
FORMATTED_UNFORMATTED
Used in getPossibleFilterValues() to request both formatted and unformatted data should be returned. |
static int |
REASONCODE_IDPROP_MUST_SAVE
reason code returned when trying to evaluate identity-driven properties on a map that has not been saved. |
static int |
REASONCODE_VALIDATION_WARNING_NO_RESOURCES
reason code returned when the verify throws an exception due to no resources being used. |
static int |
REASONCODE_VALIDATION_WARNING_TYPE_CAST
reason code returned when the verify throws an warning exception due to the user assigning either a Date, Time, or Timestamp type to an expression in the expression editor. |
static int |
UNFORMATTED
Used in getPossibleFilterValues() to request only unformatted data should be returned. |
Constructor Summary | |
---|---|
IQDataServices()
|
Method Summary | |
---|---|
java.util.List |
getAvailableLevels(DataItem dataItem,
BusinessQuery businessQuery)
Gets the levels that are available for a dataItem based on the business query passed in. |
com.sas.iquery.intelligentquery.QueryConnectionInterface |
getConnection()
Allows consumers to get a QueryConnector that was previously set on IQDataServices. |
java.util.List |
getMembers(DataItem dataItem,
int stepNumber)
Gets the members for a specific step set on the data item. |
java.util.List |
getMembers(DataItem dataItem,
com.sas.storage.olap.MetadataInterface metaI)
Gets the members for a specific step set on the data item. |
java.util.List |
getMembers(DataItem dataItem,
java.lang.String level,
com.sas.storage.olap.MetadataInterface metaI,
com.sas.storage.olap.TupleElementInterface[] tupleElements)
Gets the values for a data item based on the level and the business model passed in. |
java.util.List |
getPossibleFilterValues(DataItem dataItem)
Returns a list of possible values. |
java.util.List |
getPossibleFilterValues(DataItem dataItem,
Governing governing)
Returns a list of possible values. |
java.util.List |
getPossibleFilterValues(DataItem dataItem,
Governing governing,
boolean honorFilters)
Returns a list of possible values. |
java.util.List |
getPossibleFilterValues(DataItem dataItem,
Governing governing,
boolean honorFilters,
boolean ignoreFormattingForced,
int dataToReturn)
Returns a list of possible values. |
void |
setConnection(com.sas.iquery.intelligentquery.QueryConnectionInterface qc)
Allows consumers or applications to set a QueryConnector if they have one and want IQDataServices to use it. |
void |
setService(IntelligentQueryMetadataServiceInterface iqService)
Sets the service whenever a new IQDataServicesInterface is created by the factory. |
void |
verify(BusinessItem item)
This convenience method can be used to verify business items for use in a query. |
void |
verify(BusinessModel businessModel,
ExpressionInterface expression)
This convenience method can be used to verify expressions that may be used in a query. |
Field Detail |
---|
public static final int FORMATTED
public static final int FORMATTED_UNFORMATTED
public static final int REASONCODE_IDPROP_MUST_SAVE
public static final int REASONCODE_VALIDATION_WARNING_NO_RESOURCES
public static final int REASONCODE_VALIDATION_WARNING_TYPE_CAST
public static final int UNFORMATTED
Constructor Detail |
---|
public IQDataServices()
Method Detail |
---|
public java.util.List getAvailableLevels(DataItem dataItem, BusinessQuery businessQuery) throws DataServicesException
Available Levels in the cube - YEAR, QTR, MONTH
Available Levels returned - YEAR, QTR, MONTH
Available Levels in the cube - YEAR, QTR, MONTH
Available Levels returned - MONTH
This method will find the associated and appropriate session connection to the OLAP based on the BusinessQuery being passed.
A clean or "unfiltered" connection to OLAP server is made if a Parent BusinessQuery is used to construct the MetadataInterface. If a Child BusinessModel or Child BusinessQuery is used used to construct the MetadataInterface, then a "filtered" connection to the OLAP server is made.
It is the responsility of the client to release any query connection that they create.
dataItem
- data item (that is a non-measure expression) used in obtaining the desired set of level names.businessQuery
- the businessQuery that you want associated to this dataItem. If this is null, the default
businessQuery associated to this dataItem is used.
DataServicesException
public com.sas.iquery.intelligentquery.QueryConnectionInterface getConnection()
public java.util.List getMembers(DataItem dataItem, int stepNumber) throws DataServicesException
This method is only implemented for OLAP data. The implementation generates a query, and executes the query on an OLAP server. Currently, the implementation is SAS specific and will not work on other OLAP engines.
Member data is returned in a list of embedded TupleElement objects. These objects wrapper tuples so that consumers can retrieve tuple information, for example unique name, or label.
This method builds its own query and connection. If the consumer sets a QueryConnector, the RetrievalPolicy that is held by the QueryConnector will be used in making a connection to the server.
The OLAP server connection is ALWAYS based on a "parent filtered" conversation. This means that if any effective filters have been applied to the BusinessModel holding this dataItem will be honored.
dataItem
- data item used in obtaining the desired set of members for a particular step.stepNumber
- Specifies the desired step, either BASE_STEP or CURRENT_STEP.
DataServicesException
public java.util.List getMembers(DataItem dataItem, com.sas.storage.olap.MetadataInterface metaI) throws DataServicesException
This method is only implemented for OLAP data. The implementation generates a query, and executes the query on an OLAP server. Currently, the implementation is SAS specific and will not work on other OLAP engines.
Member data is returned in a list of embedded TupleElement objects. These objects wrapper tuples so that consumers can retrieve tuple information, for example unique name, or label.
This method builds its own query and connection. If the consumer sets a QueryConnector, the RetrievalPolicy that is held by the QueryConnector will be used in making a connection to the server.
This method will find the associated and appropriate session connection to the OLAP based on the MetadataInterface being passed. This means that the client will construct the metadataInterface that containes a parent filter session or a clean session based on whether the client passes in a Parent BusinessQuery or a Child BusinessQuery.
A clean or "unfiltered" connection to OLAP server is made if a parent BusinessModel or Parent BusinessQuery is used to construct the MetadataInterface.
If a Child BusinessModel or Child BusinessQuery is used used to construct the MetadataInterface, then a "filtered" connection to the OLAP server is made.level - the string value of the level that you wish get values from. businessModel - Specifies the businessModel that you want associated to this dataItem. If this is null, the default businessModel associated to this dataItem is used. &
dataItem
- what is used to get the members of.metadataInterface
- Specifies the metadatainterface that was constructed by the client using
BusinessQueryOLAPUtil.getMetadata
DataServicesException
public java.util.List getMembers(DataItem dataItem, java.lang.String level, com.sas.storage.olap.MetadataInterface metaI, com.sas.storage.olap.TupleElementInterface[] tupleElements) throws DataServicesException
[2000], [2001], [2002], [2003]
[2000].[QTR1].[January], ... [2000].[QTR4].[December], [2001].[QTR1].[January], ... [2001].[QTR4].[December], [2002].[QTR1].[January], ... [2002].[QTR4].[December], [2003].[QTR1].[January], ... [2003].[QTR4].[December]
[2001], [2002]
[20001]. [QTR4], [2002]. [QTR1]
[20001]. [QTR4].[November], [20001]. [QTR4].[December], [20002]. [QTR1].[January],[20002]. [QTR1].[February], [20002]. [QTR1].[March],
[2001]
[20001]. [QTR2]
NOTE: This is the same as Case 2 but involving a parent filter instead of a child filter.
{} (i.e. the empty set)
[20001]. [QTR4].[November], [20001]. [QTR4].[December], [20002]. [QTR1].[January], [20002]. [QTR1].[February], [20002]. [QTR1].[March],
In the above case, the code issues an MDX query for members of the OLAP expression for the current (most recent) step. Gets the hierarchical values for a data item based on the starting point of a specific level and the metadataInterface that is passed in.
This method is only implemented for OLAP data. The implementation generates a query, and executes the query on an OLAP server. Currently, the implementation is SAS specific and will not work on other OLAP engines.
Member data is returned in a list of embedded TupleElement objects. These objects wraps tuples so that consumers can retrieve tuple information, for example unique name, or label.
This method builds its own query and may build its connection. If the consumer sets a QueryConnector, the RetrievalPolicy that is held by the QueryConnector will be used in making a connection to the server.
This method will find the associated and appropriate session connection to the OLAP based on the BusinessQuery being passed.
A clean or "unfiltered" connection to OLAP server is made if a Parent BusinessQuery is used to construct the MetadataInterface.
If a Child BusinessQuery is used, then a "filtered" (based on a parent filter) connection to the OLAP server is made. If a Child BusinessModel or Child BusinessQuery is used used to construct the MetadataInterface, then a "filtered" connection to the OLAP server is made.level - the string value of the level that you wish get values from. businessModel - Specifies the businessModel that you want associated to this dataItem. If this is null, the default businessModel associated to this dataItem is used.
It is the responsibility of the client to release any query connections that they create such as the QueryConnector for this IQueryServices object.
dataItem
- data item used in obtaining the desired set of members for a particular step.level
- the string value of the level that you wish get values from.metadataInterface
- Specifies the metadatainterface that was constructed by the client using
BusinessQueryOLAPUtil.getMetadata(BusinessModel) for the displayed/selected OLAPTableViewer.tupleElements
- Specifies the "clicked cell" (crossing address of the selected cell) in the displayed/selected OLAPTableViewer. It is possbile to pass in a null for this
parameter. If a null is passed in then all of the members (irregardless of the axis location that was selected).
DataServicesException
public java.util.List getPossibleFilterValues(DataItem dataItem) throws DataServicesException
Currently, this method is only implemented for relational data. The value of getLookupType() on the DataItem will determine how the returning values are created. LookupList will use the static list of values contained in the LookupList object. LookupByDataItem will generate a query and execute the query on a data source. LookupByQuery is not supported in this release. LookupNotAllowed will return an empty list. Currently, the implementation is SAS specific and will not work on other SQL engines.
Missing or empty values will be returned using a PossibleFilterValue object where the unformatted value is equal to null. The formatted value will be equal to the current setting for missing values.
dataItem
- -
data used in obtaining a possible set of filter values
DataServicesException
public java.util.List getPossibleFilterValues(DataItem dataItem, Governing governing) throws DataServicesException
Currently, this method is only implemented for relational data. The value of getLookupType() on the DataItem will determine how the returning values are created. LookupList will use the static list of values contained in the LookupList object. LookupByDataItem will generate a query and execute the query on a data source. LookupByQuery is not supported in this release. LookupNotAllowed will return an empty list. Currently, the implementation is SAS specific and will not work on other SQL engines.
Missing or empty values will be returned using a PossibleFilterValue object where the unformatted value is equal to null. The formatted value will be equal to the current setting for missing values.
dataItem
- -
data used in obtaining a possible set of filter valuesgoverning
- -
object specifying the maximum number or records to be returned from the server. If the object is
set with a value of -1, this indicates all records should be returned from the server. If a null
value is passed in for this parameter, the query will be set to return at most 1,000 rows.
DataServicesException
public java.util.List getPossibleFilterValues(DataItem dataItem, Governing governing, boolean honorFilters) throws DataServicesException
Currently, this method is only implemented for relational data. The value of getLookupType() on the DataItem will determine how the returning values are created. LookupList will use the static list of values contained in the LookupList object. LookupByDataItem will generate a query and execute the query on a data source. LookupByQuery is not supported in this release. LookupNotAllowed will return an empty list. Currently, the implementation is SAS specific and will not work on other SQL engines.
Missing or empty values will be returned using a PossibleFilterValue object where the unformatted value is equal to null. The formatted value will be equal to the current setting for missing values.
dataItem
- -
data used in obtaining a possible set of filter valuesgoverning
- -
object specifying the maximum number or records to be returned from the server. If the object is
set with a value of -1, this indicates all records should be returned from the server. If a null
value is passed in for this parameter, the query will be set to return at most 1,000 rows.honorFilters
- -
flag specifying how to create a query. If the lookup type is LookupByDataItem and this flag is
set, then the query that is created will include the effective set of filters for the DataItem's
DataSelection. If honorFilters is true and the specified dataItem is based on a BusinessQuery
containing prompted filters, this method expects that the prompt values have been assigned and
uses them during query execution.
DataServicesException
public java.util.List getPossibleFilterValues(DataItem dataItem, Governing governing, boolean honorFilters, boolean ignoreFormattingForced, int dataToReturn) throws DataServicesException
Currently, this method is only implemented for relational data. The value of getLookupType() on the DataItem will determine how the returning values are created. LookupList will use the static list of values contained in the LookupList object. LookupByDataItem will generate a query and execute the query on a data source. LookupByQuery is not supported in this release. LookupNotAllowed will return an empty list. Currently, the implementation is SAS specific and will not work on other SQL engines.
Missing or empty values will be returned using a PossibleFilterValue object where the unformatted value is equal to null. The formatted value will be equal to the current setting for missing values.
dataItem
- -
data used in obtaining a possible set of filter valuesgoverning
- -
object specifying the maximum number or records to be returned from the server. If the object is
set with a value of -1, this indicates all records should be returned from the server. If a null
value is passed in for this parameter, the query will be set to return at most 1,000 rows.honorFilters
- -
flag specifying how to create a query. If the lookup type is LookupByDataItem and this flag is
set, then the query that is created will include the effective set of filters for the DataItem's
DataSelection. If honorFilters is true and the specified dataItem is based on a BusinessQuery
containing prompted filters, this method expects that the prompt values have been assigned and
uses them during query execution.ignoreFormattingForced
- True if the data items formattingForced should be ignoreddataToReturn
- FORMATTED, UNFORMATTED, or FORMATTED_UNFORMATTED. If FORMATTED is used then only the formatted
data is returned, but it is returned in both the formatted and unformatted values of the
PossibleFilterValue. Similar for UNFORMATTED.
DataServicesException
public void setConnection(com.sas.iquery.intelligentquery.QueryConnectionInterface qc)
qc
- -
an QueryConnectionInterface objectpublic void setService(IntelligentQueryMetadataServiceInterface iqService)
iqService
- -
an IntelligentQueryMetadataServiceInterface objectpublic void verify(BusinessItem item) throws DataServicesException
The performance of this method will vary from item to item. The calling application should be written to handle potentially slow performance.
item
- -
the business item to be verified
DataServicesException
- if the item is not valid or an error occurred during verification.public void verify(BusinessModel businessModel, ExpressionInterface expression) throws DataServicesException
The performance of this method will vary from expression to expression. The calling application should be written to handle potentially slow performance.
businessModel
- -
the business model to query againstexpression
- -
the expression to be verified
DataServicesException
- if the item is not valid or an error occurred during verification.
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |