com.businessobjects.rebean.wi
Interface DataProvider

All Known Subinterfaces:
PersonalDataProvider, SQLDataProvider

public interface DataProvider

The DataProvider interface represents the data provider(query).

See Also:
DataProviders

Method Summary
 void cancelQuery()
          Cancel the query currently being run.
 void clearContexts()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 QueryContainer copyCombinedQueries(QueryContainer qc)
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 void executeQuery()
          Deprecated. Use DataProvider.generateQuery() instead of this executeQuery. This method does not require contexts to be resolved, thus the resulting report dictionary can sometimes be incorrect.
 void generateQuery()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 QueryContainer getCombinedQueries()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 DataSource getDataSource()
          Returns the data source (universe).
 DataSourceParameterValues getDataSourceParameterValues()
          Returns a DataSourceParameterValues collection allowing to read or modify data source parameter values for this DataProvider.
 java.util.Date getDate()
          Returns the last refresh date.
 java.util.Set getDependents()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 int getDuration()
          Returns the time estimated to retrieve data for this DataProvider.
 int getFlowCount()
          Returns the number of flux (Recordsets) contained in the Query.
 java.lang.String getID()
          Gets the data provider ID.
 java.lang.String getName()
          Returns the DataProvider's name.
 PromptOrder getPromptOrder(boolean removeDuplicateQuestions)
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 Query getQuery()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 QueryNode getQueryNode(java.lang.String ID)
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 Recordset getResult(int flowIndex)
          Gets the DataProvider results of a specific flow as a Recordset.
 CSVView getResultAsCSV(int flowIndex)
          Retrieves the DataProvider results for a certain flow as a comma separated value (CSV) BinaryView.
 CharacterView getResultAsXML()
          Gets the DataProvider results as XML output.
 CharacterView getResultAsXML(int flowIndex)
          Returns the DataProvider results of a specific flow as XML output.
 DPExpression[] getResultExpressions()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 int getRowCount()
          Gets the number of rows in the DataProvider's data table.
 java.lang.String getSource()
          Returns the name of the data source.
 java.lang.String getSourceName()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 java.util.Set getSources()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 boolean hasCombinedQueries()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 boolean isIgnoredForRefresh()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 boolean isPartialResult()
          Returns true if the DataProvider has been totally or partially refreshed.
 boolean isQuerySubmitted()
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 boolean isSampledData()
          Checks if result data is a set of random sample depending database.
 boolean isSupported(Feature feature)
          Checks if Feature is supported by this DataProvider.
 void purge()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 void purge(boolean purgePromptValues)
          Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
 void removeCombinedQueries()
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 void runQuery()
          Runs the Query.
 void setName(java.lang.String name)
          Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
 

Method Detail

getName

java.lang.String getName()
Returns the DataProvider's name.

Returns:
the DataProvider's name

getSourceName

java.lang.String getSourceName()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Returns the name of the dataprovider in the locale it was created.

Returns:
The name of the dataprovider in the locale it was created.
Since:
12.2

getID

java.lang.String getID()
Gets the data provider ID.

Returns:
the data provider ID
Since:
11.5

setName

void setName(java.lang.String name)

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Changes this DataProvider's name.

Parameters:
name - the new name
Throws:
QueryException - when a data provider with the specified name already exists
java.lang.NullPointerException - when name is null
java.lang.IllegalArgumentException - when name.length() == 0
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.
Since:
6.5.0

getDate

java.util.Date getDate()
Returns the last refresh date.

Returns:
the time data in this DataProvider was last refreshed.

getDuration

int getDuration()
Returns the time estimated to retrieve data for this DataProvider.

Returns:
the estimated time to refresh the data provider

getRowCount

int getRowCount()
Gets the number of rows in the DataProvider's data table.

Returns:
the number of rows retrieved for this DataProvider

getSource

java.lang.String getSource()
Returns the name of the data source.

Returns:
the name of the source

cancelQuery

void cancelQuery()
Cancel the query currently being run. This method must called while a refresh action is in progress. This cancels the running query, The document is returned to it's state prior to the attempted refresh of the DataProvider.

Note: This is a asynchronous method.

Throws:
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.

getDataSource

DataSource getDataSource()
                         throws REException
Returns the data source (universe).

Returns:
the data source
Throws:
REException - something went wrong while retrieving the data source information
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.

getQuery

Query getQuery()
               throws REException

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Returns the Query associated to this DataProvider. Gets the Query if it is a simple query, that is to say DataProvider.hasCombinedQueries() returns false.

Returns:
the Query.
Throws:
REException - something went wrong while retrieving the Query information or when there are combined queries.
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.
See Also:
Query

runQuery

void runQuery()
              throws REException
Runs the Query. This fetches the data from the data base and populates the ReportDictionary.

Throws:
REException - something went wrong while running the Query.
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.

getResultAsXML

CharacterView getResultAsXML(int flowIndex)
Returns the DataProvider results of a specific flow as XML output. The table below contains the Document Type definition (DTD) which defines the document structure for Full Client data provider results returned as XML.

PCDATA is character text that will be parsed by the XML parser.

CDATA is character text that will not be parsed by the XML parser.

DTD
Meaning
<!ELEMENT DATA_PROVIDERS (DATA_PROVIDER*)
>
List of Data providers.
<!ATTLIST DATA_PROVIDERS
UID CDATA #REQUIRED
FORCE_REFRESH (%boolean;) "FALSE"
DATA_PROVIDER CDATA #IMPLIED
FORMATTED (%boolean;) "FALSE"
REFRESH (%boolean;) #IMPLIED
>
UID: the concatenation of the repository Type, document Id, document name and document extension separated by a |.
FORCE_REFRESH: indicates whether the document has already been refreshed.
DATA_PROVIDER: data provider name or an empty string in the case when all data providers are repatriated.
FORMATTED: indicates whether the data is formatted.
REFRESH: indicates whether the data provider result has been refreshed.
<!ELEMENT DATA_PROVIDER (COLUMN*, ROW*)> Description of the individual data provider.
<!ATTLIST DATA_PROVIDER
NAME CDATA #IMPLIED
SOURCE CDATA #REQUIRED
DATE CDATA # IMPLIED
DURATION CDATA # IMPLIED
CUBE CDATA # IMPLIED
>
NAME: data provider name.
SOURCE: data source name.
DATE: last execution date.
DURATION: time taken to retrieve data from the data source.
CUBE: attribute contains the cube number, this parameter is added if a query contains incompatible objects.
<!ELEMENT COLUMN (#PCDATA)> Description of the individual column.
<!ATTLIST COLUMN
INDEX CDATA #REQUIRED
ID CDATA #IMPLIED
TYPE CDATA #IMPLIED
FORMAT CDATA # IMPLIED
>
INDEX: index in the column list.
ID: contains the universe object ID. Not exposed if the Data Provider is an OLAP or Excel data source.
TYPE: contains the Data Provider column type (String, Date, Double, Long).
FORMAT: contains the column format. See table below.
<!ELEMENT ROW (CELL*)> Description of the individual row.
<!ELEMENT CELL (#PCDATA)> Description of the individual cell in the row.
<!ATTLIST CELL
INDEX CDATA #REQUIRED
>
INDEX: cell index in the row, corresponds to COLUMN.INDEX.

Column Numeric and Date Formats

Characters
Meaning
Example
d day of the month (numeric) 1
dd day of the month (numeric) 01
ddd day of the week (string. Thu
dddd day of the week (string). Thursday
M month (numeric) 1
MM month (numeric) 01
mmm month (string) Apr
mmmm month (string) April
yy year (numeric) 3
yyyy year (numeric) 2003
h hour in 12-hour format 3
hh hour in 12-hour format 03
H hour in 24-hour format 15
HH hour in 24-hour format 15
a AM or PM AM
m minute 3
mm minute 03
s second 3
ss second 03

Note: At this time, BusinessObjects documents use the regional settings of the machine for the Numeric and Date formats.

Returns:
characterView of the DataProvider results

getResultAsXML

CharacterView getResultAsXML()
Gets the DataProvider results as XML output.

Returns:
characterView of the DataProvider results
See Also:
for full description of the Data Provider DTD

executeQuery

@Deprecated
void executeQuery()
                  throws REException
Deprecated. Use DataProvider.generateQuery() instead of this executeQuery. This method does not require contexts to be resolved, thus the resulting report dictionary can sometimes be incorrect.

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Define the Query structure. After calling this method, DocumentInstance.getDictionary() will return all selected objects, but DocumentInstance.applyFormat() will create a document with no data. In other words, this method populates the ReportDictionary, but does not fetch any data as opposed to DataProvider.runQuery()).

Note: This method never requires contexts or Prompts to be filled.

Throws:
REException - something went wrong, for example a filter may not have correct values

generateQuery

void generateQuery()
                   throws REException

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Defines the report dictionary from the current query. The result of this method is exactly the same as that of DataProvider.runQuery(), except that it does not fetch any data and does not require any prompts to be answered.

Note: As no data is retrieved using this method, data in Reports will not be refreshed. If the Report did not contain any data previously, none will be present after this method has been called.

Note: No prompts have to be filled. However, if the Report contains Contexts, these will have to be filled before the ReportDictionary can be populated with correct values.

Throws:
REException - something went wrong, for example a filter may not have correct values
NotImplementedException - if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines.getService(com.businessobjects.rebean.wi.ReportEngines.ReportEngineType) for more information.
Since:
6.1

purge

void purge()

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Purges this data provider. Once a data provider has been purged, it no longer contains any data.

Throws:
NotImplementedException - Thrown when ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines.getService(com.businessobjects.rebean.wi.ReportEngines.ReportEngineType) for more information.
Since:
11.7

purge

void purge(boolean purgePromptValues)

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Purges this data provider. Once a data provider has been purged, it no longer contains any data.

Calling this method has the same effect as calling purgeAll(false);

Parameters:
purgePromptValues - if true, prompt values used during the last refresh will be reset, too.
Throws:
NotImplementedException - Thrown when ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines.getService(com.businessobjects.rebean.wi.ReportEngines.ReportEngineType) for more information.
Since:
11.7

getResult

Recordset getResult(int flowIndex)
                    throws REException
Gets the DataProvider results of a specific flow as a Recordset.

Normally a Query contains only one part (flow index = 0). For incompatible queries, the query is split into separate parts. To resolve incompatibilities, choose the part of the query to be retrieved.

For more information on incompatible queries, see the Designer's Guide.

Parameters:
flowIndex - - Indicates which part (flow) of the query is used to build the results Recordset.
Throws:
REException

getResultAsCSV

CSVView getResultAsCSV(int flowIndex)
Retrieves the DataProvider results for a certain flow as a comma separated value (CSV) BinaryView.

Normally a Query contains only one flow (Recordset), that is to say the flow index equals zero.

Note: Specify -1 to retrieve all flows contained in the DataProvider.

Parameters:
flowIndex - Indicates which part (flow) of the query is used to build CSV stream.
Returns:
A CSVView instance.
Since:
11.5
See Also:
DataProvider.getFlowCount(), BinaryView

getFlowCount

int getFlowCount()
Returns the number of flux (Recordsets) contained in the Query.

This method always returns 1, if ReportEngine.getCanEditDocument() returns false. That is to say, the ReportEngine instance used to open this DataProvider was opened to run Desktop Intelligence documents. See ReportEngines#getService(int type) for more information.

Returns:
the number of flux contained in the Query

isPartialResult

boolean isPartialResult()
Returns true if the DataProvider has been totally or partially refreshed.

Returns:
true if the DataProvider has been totally or partially refreshed

hasCombinedQueries

boolean hasCombinedQueries()

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Returns true if the DataProvider contains combined queries. A combined query is the Union, Intersection or Minus combination of two Query objects. For Query objects to be combined, both objects must contain an identical number of Result Objects (columns). The types of the corresponding columns in each Query must be identical.

Returns:
true if the DataProvider contains combined queries.
Since:
11.5
See Also:
CombinedQueryOperator

getCombinedQueries

QueryContainer getCombinedQueries()

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Returns the root container of combined query.

Note: If this method is called on an empty document (new document), an empty container with UNION operator will be returned. Under root query container an empty Query will be created. That is to say, getCombinedQueries().getChildCount() returns 1. You could fill this empty query and run it.

Returns:
the root container of combined query.
Since:
11.5

copyCombinedQueries

QueryContainer copyCombinedQueries(QueryContainer qc)

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Copy a given combined query.

Note: If the DataProvider already has a QueryContainer, it is replaces by a copy of the parameter qc.

Parameters:
qc - the QueryContainer to be copied.
Returns:
a copy of the QueryContainer qc passed as a parameter to this method.
Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.
Since:
11.5

removeCombinedQueries

void removeCombinedQueries()

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Removes all combined queries associated to this DataProvider.

Throws:
UnsupportedFeatureException - if DataProviderFeature.EDIT_QUERY isn't granted.
Since:
11.5

getQueryNode

QueryNode getQueryNode(java.lang.String ID)

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Returns the QueryNode identified by an ID string.

Parameters:
ID - the QueryNode identifier
Returns:
the QueryNode.
Since:
11.5

getPromptOrder

PromptOrder getPromptOrder(boolean removeDuplicateQuestions)

Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.

Returns the PromptOrder.

Parameters:
removeDuplicateQuestions - If true, the collection will not contain any duplicated ConditionPrompts. If false, it returns a collection of all ConditionPrompts.
Returns:
the PromptOrder
Since:
11.7
See Also:
ConditionPrompt.setQuestion(String)

isSupported

boolean isSupported(Feature feature)
Checks if Feature is supported by this DataProvider.

Parameters:
feature - a Feature instance to be checked
Returns:
Trueif the Feature otherwise, False.
Since:
12.0
See Also:
DataProviderFeature, QueryFeature, ConditionOperatorFeature

isSampledData

boolean isSampledData()
Checks if result data is a set of random sample depending database.

Returns:
true or false.
Since:
12.0
See Also:
SQLDataProvider.setSamplingMode(SamplingMode), SamplingMode

clearContexts

void clearContexts()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Clears any contexts set for this data provider. It means that a subsequent DocumentInstance.getContextPrompts() call will give Context with empty current values set for this DataProvider until Context.enterValues(String[]) call or DocumentInstance.getMustFillContexts() call returns true value.

When used in combination with Query.resetContexts(), calling this method will ensure that any contexts for this data provider will be prompted upon the next refresh. A subsequent call of documentInstance.getMustFillContexts() returns true value.

Example:Clearing the contexts
 String universeId = ((IUniverse) ceInfoobject).buildUniverseIdString();
 DocumentInstance doc = repEng.newDocument(universeId);
 ReportContainer report = doc.createReport("Report1");
 DataProviders dps = doc.getDataProviders();
 DataProvider dp = dps.getItem(0);
 DataSource ds = dp.getDataSource();
 DataSourceObject country = ds.getClasses().getChildByName("Country");
 DataSourceObject country_of_origin = ds.getClasses().getChildByName(
         "Country of origin");
 Query q = dp.getQuery();
 // Add result objects to the query
 q.addResultObject(country);
 q.addResultObject(country_of_origin);
 q.resetContexts(false);
 // Run the execute the query and fetch the data
 dp.runQuery();
 doc.applyFormat();
 Contexts contexts = doc.getContextPrompts();
 Context context = contexts.getItem(0);
 String CXT_VALUES = context.getAllValues()[0];
 context.enterValues(new String[] { CXT_VALUES });
 doc.setContexts();
 doc.refresh();
 out
         .println("No contexts is required because the query propery resetContexts is false: "
                 + doc.getMustFillContexts());
 dp.clearContexts();
 contexts = doc.getContextPrompts();
 context = contexts.getItem(0);
 out.println("The current values set contains 0 values:"
         + context.getCurrentValues().length);
 doc.refresh();
 out.println("After clearing the contexts:" + doc.getMustFillContexts());
 

Since:
12.0
See Also:
Contexts, DocumentInstance.getMustFillContexts(), DocumentInstance.getContextPrompts()

getDataSourceParameterValues

DataSourceParameterValues getDataSourceParameterValues()
Returns a DataSourceParameterValues collection allowing to read or modify data source parameter values for this DataProvider.

Returns:
a DataSourceParameterValues instance.
Since:
12.0

getResultExpressions

DPExpression[] getResultExpressions()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Returns all the result objects of a particular data provider.

Returns:
a array of result objects of a particular data provider.
Since:
12.2.0
See Also:
DPExpression

getDependents

java.util.Set getDependents()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Returns the set of data providers that are dependent on this data provider.

Returns:
the set of data providers that are dependent on this data provider.
Since:
12.2.0

getSources

java.util.Set getSources()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Returns the set of data providers on which this data provider is dependent.

Returns:
the set of data providers on which this data provider is dependent.
Since:
12.2.0

isQuerySubmitted

boolean isQuerySubmitted()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Checks if a particular data provider has been run or saved.

Returns:
true if the data provider has been run or saved, otherwise returns false.
Since:
12.2.0

isIgnoredForRefresh

boolean isIgnoredForRefresh()

Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.

Returns:
Since:
12.2