|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.businessobjects.dsws.Consumer
com.businessobjects.dsws.queryservice.QueryService
public class QueryService
The QueryService class provides the entry point for writing applications that use query web services. Before
obtaining an instance of the QueryService class, you must first create Connection and Session objects. Once
you have obtained Connection and Session objects, you then obtain a QueryService instance by passing the
Session object and service URL for the QueryService to the QueryService.getInstance method.
The QueryService class provides services to list data sources and data providers of a document.
It also provides the ability to create a new document, or modify or delete a document query.
Once you have obtained a QueryService instance, your next step depends on your particular work flow.
Creating a new query:
If you want to create a new query, and don't have a data source UID, you would use the
getDataSourceList
method to obtain a list of data sources. Then you would choose a data source, obtain its UID and use
the getDataSource
method to obtain a DataSourceSpecification
instance. The DataSourceSpecification class
contains information about the objects available in the chosen universe (data source). The next step is
to create a QuerySpecification instance and use the
information in the DataSourceSpecification instance to
construct a QuerySpecification instance. Once you have created a QuerySpecification instance, the final step is to
use the createDataProvider
method to run the query. The DataProviderInformation
instance returned by
the createDataProvider method contains a document reference. You can use this document reference to
work with the document using the Report Engine service.
Modifying an existing query:
To modify an existing query (or document), you use the getDataProviderInformation
method to obtain the
DataProviderInformation instance for a given document. You should also pass in true to
return the QuerySpecification. You can then modify the QuerySpecification instance.
Once you have modified a QuerySpecification instance, the final step is to
use the modifyDataProvider
method to run the query. The DataProviderInformation
instance returned by
the modifyDataProvider method contains a document reference. You can use this document reference to
work with the document using the Report Engine service.
Example: Initializing a QueryService instance.
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/Session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);
EnterpriseCredential objEnterpriseCredential = EnterpriseCredential.Factory.newInstance();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");
SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);
String[] astrURLs = objSession.getAssociatedServicesURL("QueryService");
// If no URL is returned, the service is not available
if (astrURLs.length > 0)
{
QueryService objQueryService = QueryService.getInstance(objSession, astrURLs[0]);
}
See the Business Objects web services Developer's Guide for further information on how to use the QueryService web service.
Connection,
AuthenticationCredential,
Session,
QuerySpecification,
Serialized Form| Constructor Summary | |
|---|---|
QueryService()
Instantiates a new QueryService object |
|
QueryService(Connection objConnection,
ConnectionState objConnectionState)
Instantiates a new QueryService object using existing Connection and ConnectionState objects. |
|
QueryService(java.lang.String strImplementation,
ConnectionState objConnectionState)
Internal Use Only. |
|
| Method Summary | |
|---|---|
DataProviderInformation |
createDataProvider(java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties)
The createDataProvider method is used to create a query (specified by the QuerySpecification parameter). |
DataProviderInformation |
createDataProvider(java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties,
InputProperties inParams)
The createDataProvider method is used to create a query (specified by the QuerySpecification parameter). |
java.lang.String |
deleteDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID)
The deleteDataProvider method deletes an existing data provider in a given document. |
DataProviderInformation |
getDataProviderInformation(java.lang.String documentReference,
java.lang.String dataProviderUID,
boolean includeQuerySpecification)
The getDataProviderInformation method provides the DataProviderInformation for the document identified by documentReference
and the data provider specified by dataProviderUID. |
DataProviderInformation[] |
getDataProviderList(java.lang.String documentReference,
boolean includeQuerySpecification)
The getDataProviderList method provides the list of DataProviderInformation objects for the document identified by documentReference. |
DataSourceSpecification |
getDataSource(java.lang.String dataSourceUID)
The getDataSource method returns a DataSourceSpecification object that
represents the universe. |
DataSource[] |
getDataSourceList()
The getDataSourceList method provides the list of data sources on which you can perform a query. |
static QueryService |
getInstance(Consumer objConsumer,
java.lang.String strURL)
|
DataProviderInformation |
modifyDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID,
java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties)
The modifyDataProvider method modifies an existing data provider in a given document. |
DataProviderInformation |
modifyDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID,
java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties,
InputProperties inParams)
The modifyDataProvider method modifies an existing data provider in a given document. |
void |
readExternal(java.io.ObjectInput in)
Internal Use Only. |
void |
writeExternal(java.io.ObjectOutput out)
Internal Use Only. |
| Methods inherited from class com.businessobjects.dsws.Consumer |
|---|
CreateAxisFault, displayException, GetAxisFaultDetails, getConnection, getConnection, getConnectionState, getConsumer, getConsumer |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryService(java.lang.String strImplementation,
ConnectionState objConnectionState)
throws AxisFault
Internal Use Only.
AxisFault
public QueryService(Connection objConnection,
ConnectionState objConnectionState)
throws AxisFault
Instantiates a new QueryService object using existing Connection and ConnectionState objects. Before
using this method, you must have valid Connection,
ConnectionState, and Session
objects.
Example: Initializing a QueryService instance.
Connection objConnection = new Connection(objURLSession);
SessionInfo objSessionInfo = objSession.Login(objEnterpriseCredential);
String[] astrURLs = objSession.getAssociatedServicesURL("QueryService");
if (astrURLs.length > 0)
{
objConnection.setURL(new URL(astrURLs[0]));
QueryService objQueryService = new QueryService(objConnection, objSession.getConnectionState());
}
objConnection - a valid Connection object with the URL set to the QueryService service.objConnectionState - the ConnectionState of the current user session.
AxisFaultConnection,
ConnectionStatepublic QueryService()
| Method Detail |
|---|
public static QueryService getInstance(Consumer objConsumer,
java.lang.String strURL)
throws AxisFault
objConsumer - one of the current user's consumer objects.strURL - URL to connect to the QueryService web service.
DSWSException - Exception raised either as a Web Service SOAP Fault or as a Consumer side trapped exception.
Example: Initializing a QueryService instance.
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/Session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);
EnterpriseCredential objEnterpriseCredential = EnterpriseCredential.Factory.newInstance();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");
SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);
String[] astrURLs = objSession.getAssociatedServicesURL("QueryService");
if (astrURLs.length > 0)
{
QueryService objQueryService = QueryService.getInstance(objSession, astrURLs[0]);
}
AxisFaultConnection,
AuthenticationCredential,
Session
public DataSource[] getDataSourceList()
throws AxisFault
The getDataSourceList method provides the list of data sources on which you can perform a query.
A data source represents a universe that you can use to build your query. Once you have obtained an array of DataSource objects, you
use the getUID method to obtain the UID
for the universe (data source) that you want to use to construct a query. You then pass the UID for the data source
to the getDataSource method, which
returns a DataSourceSpecification object that
represents the universe. The DataSourceSpecification class contains all of the Detail, Dimension, Measure and PreConditionObject
objects that you can use in a query.
Example: Using the getDataSourceList method to obtain a list of data sources:
DataSource[] boUniverseList = objQueryService.getDataSourceList();
String boUniverseUID = boUniverseList[4].getUID();
DataSourceSpecification boUniverseSpec = objQueryService.getDataSource(boUniverseUID);
DataSource objects.
AxisFaultDataSource
public DataSourceSpecification getDataSource(java.lang.String dataSourceUID)
throws AxisFault
The getDataSource method returns a DataSourceSpecification object that
represents the universe. The DataSourceSpecification class contains all of the Detail, Dimension, Measure and PreConditionObject
objects that you can use in a query.
Example: Using the getDataSource method to obtain a DataSourceSpecification:
DataSource[] boUniverseList = objQueryService.getDataSourceList();
String boUniverseUID = boUniverseList[4].getUID();
DataSourceSpecification boUniverseSpec = objQueryService.getDataSource(boUniverseUID);
dataSourceUID - the UID of the DataSource (or Universe)
DataSourceSpecification for the Universe (data source) represented by the dataSourceUID
AxisFaultDataSourceSpecification,
DataSource
public DataProviderInformation[] getDataProviderList(java.lang.String documentReference,
boolean includeQuerySpecification)
throws AxisFault
The getDataProviderList method provides the list of DataProviderInformation objects for the document identified by documentReference.
The DataProviderInformation class provides access to the QuerySpecification for a given document. As such,
the getDataProviderList method is useful when you want to obtain an existing QuerySpecification for a document
and then modify the QuerySpecification (or use it as a basis for a new document or query).
documentReference - The unique ID or document reference for the instance of a document. The documentReference can be retrieved using the
BICatalog service or from a DocumentInformation object. The document reference
can be either a UID or a document reference String.includeQuerySpecification - A boolean that specifies whether the QuerySpecification attribute of the returned DataProviderInformation
object should be filled.
DataProviderInformation objects.
AxisFaultDataProviderInformation,
QuerySpecification
public DataProviderInformation getDataProviderInformation(java.lang.String documentReference,
java.lang.String dataProviderUID,
boolean includeQuerySpecification)
throws AxisFault
The getDataProviderInformation method provides the DataProviderInformation for the document identified by documentReference
and the data provider specified by dataProviderUID.
The DataProviderInformation class provides access to the QuerySpecification for a given document. As such,
the getDataProviderInformation method is useful when you want to obtain an existing QuerySpecification for a document
and then modify the QuerySpecification (or use it as a basis for a new document or query).
documentReference - The unique ID or document reference for the instance of a document. The documentReference can be retrieved using the
BICatalog service or from a DocumentInformation object. The document reference
can be either a UID or a document reference String.dataProviderUID - The UID of the DataProviderInfo for which to retrieve the DataProviderInformation.includeQuerySpecification - A boolean that specifies whether the QuerySpecification attribute of the returned DataProviderInformation
object should be filled.
DataProviderInformation.
AxisFaultDataProviderInformation,
QuerySpecification
public DataProviderInformation createDataProvider(java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties,
InputProperties inParams)
throws AxisFault
createDataProvider method is used to create a query (specified by the QuerySpecification parameter). When
the query is processed, a new document instance and data provider are created. The DataProviderInformation object that represents the created data provider
is returned. The document reference for the created document instance can be obtained from the returned DataProviderInformation object.
This method is used to create a new document instance and new data provider using a QuerySpecification. If you are creating a new query, this is the method that
should be called once you have constructed a QuerySpecification object.
dataSourceUID - The UID of the DataSource (or universe) on which the query is to be performed.querySpecification - The QuerySpecification instance that defines the query.returnProperties - The ReturnProperties instance describing what is returned by this method call.inParams - The InputProperties instance describing the input parameter to this method call.
DataProviderInformation object that represents the new data provider
AxisFaultDataProviderInformation,
QuerySpecification
public DataProviderInformation createDataProvider(java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties)
throws AxisFault
createDataProvider method is used to create a query (specified by the QuerySpecification parameter). When
the query is processed, a new document instance and data provider are created. The DataProviderInformation object that represents the created data provider
is returned. The document reference for the created document instance can be obtained from the returned DataProviderInformation object.
This method is used to create a new document instance and new data provider using a QuerySpecification. If you are creating a new query, this is the method that
should be called once you have constructed a QuerySpecification object.
dataSourceUID - The UID of the DataSource (or universe) on which the query is to be performed.querySpecification - The QuerySpecification instance that defines the query.returnProperties - The ReturnProperties instance describing what is returned by this method call.
DataProviderInformation object that represents the new data provider
AxisFaultDataProviderInformation,
QuerySpecification
public DataProviderInformation modifyDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID,
java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties,
InputProperties inParams)
throws AxisFault
The modifyDataProvider method modifies an existing data provider in a given document. The QuerySpecification
passed into this method as a parameter is used as the query specification for the modified data provider. Once
the data provider is modified using the new query specification, the returned DataProviderInformation instance
contains the information about the updated data provider and especially, the document reference for the modified document.
documentReference - The unique ID or document reference for the instance of a document. The documentReference can be retrieved using the
BICatalog service or from a DocumentInformation object. The document reference
can be either a UID or a document reference String.dataProviderUID - The UID of the DataProviderInfo to be updateddataSourceUID - The UID of the DataSource on which the query has to be performedquerySpecification - The specification of the updated queryreturnProperties - The ReturnProperties instance describing what will actually be returned by this method callinParams - The InputProperties instance describing the input parameter to this method call.
DataProviderInformation.
AxisFaultDataProviderInformation,
QuerySpecification
public DataProviderInformation modifyDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID,
java.lang.String dataSourceUID,
QuerySpecification querySpecification,
ReturnProperties returnProperties)
throws AxisFault
The modifyDataProvider method modifies an existing data provider in a given document. The QuerySpecification
passed into this method as a parameter is used as the query specification for the modified data provider. Once
the data provider is modified using the new query specification, the returned DataProviderInformation instance
contains the information about the updated data provider and especially, the document reference for the modified document.
documentReference - The unique ID or document reference for the instance of a document. The documentReference can be retrieved using the
BICatalog service or from a DocumentInformation object. The document reference
can be either a UID or a document reference String.dataProviderUID - The UID of the DataProviderInfo to be updateddataSourceUID - The UID of the DataSource on which the query has to be performedquerySpecification - The specification of the updated queryreturnProperties - The ReturnProperties instance describing what will actually be returned by this method call
DataProviderInformation.
AxisFaultDataProviderInformation,
QuerySpecification
public java.lang.String deleteDataProvider(java.lang.String documentReference,
java.lang.String dataProviderUID)
throws AxisFault
The deleteDataProvider method deletes an existing data provider in a given document.
documentReference - The unique ID or document reference for the instance of a document. The documentReference can be retrieved using the
BICatalog service or from a DocumentInformation object. The document reference
can be either a UID or a document reference String.dataProviderUID - The UID of the DataProviderInfo to be deleted
AxisFault
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
Internal Use Only.
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
Internal Use Only.
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||