|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataProvider
The DataProvider
interface represents the data
provider(query).
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 |
---|
java.lang.String getName()
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.
java.lang.String getID()
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.
name
- the new name
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.java.util.Date getDate()
DataProvider
was last
refreshed.int getDuration()
DataProvider
.
int getRowCount()
DataProvider
's data table.
DataProvider
java.lang.String getSource()
void cancelQuery()
DataProvider
.
Note: This is a asynchronous method.
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.DataSource getDataSource() throws REException
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.Query getQuery() throws REException
Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
Returns theQuery
associated to this
DataProvider
. Gets the Query
if it is a
simple query, that is to say DataProvider.hasCombinedQueries()
returns
false
.
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.Query
void runQuery() throws REException
ReportDictionary
.
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.CharacterView getResultAsXML(int flowIndex)
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.
<!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. |
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.
DataProvider
resultsCharacterView getResultAsXML()
DataProvider
results as XML output.
DataProvider
resultsfor full description of
the Data Provider DTD
@Deprecated void executeQuery() throws REException
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.
REException
- something went wrong, for example a filter may not have
correct valuesvoid 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 ofDataProvider.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.
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.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.
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.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)
;
purgePromptValues
- if true
, prompt values used during the last refresh will be reset, too.
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.Recordset getResult(int flowIndex) throws REException
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.
flowIndex
- -
Indicates which part (flow) of the query is used to build the
results Recordset
.
REException
CSVView getResultAsCSV(int flowIndex)
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
.
flowIndex
- Indicates which part (flow) of the query is used to build CSV
stream.
CSVView
instance.DataProvider.getFlowCount()
,
BinaryView
int getFlowCount()
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.
boolean isPartialResult()
DataProvider
has been totally or
partially refreshed.
DataProvider
has been totally or
partially refreshedboolean hasCombinedQueries()
Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
Returnstrue
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.
true
if the DataProvider
contains
combined queries.CombinedQueryOperator
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.
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
.
qc
- the QueryContainer
to be copied.
UnsupportedFeatureException
- if DataProviderFeature.EDIT_QUERY
isn't granted.
void removeCombinedQueries()
Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
Removes all combined queries associated to thisDataProvider
.
UnsupportedFeatureException
- if DataProviderFeature.EDIT_QUERY
isn't granted.QueryNode getQueryNode(java.lang.String ID)
Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
Returns theQueryNode
identified by an ID string.
ID
- the QueryNode
identifier
QueryNode
.PromptOrder getPromptOrder(boolean removeDuplicateQuestions)
Warning: This method is no longer functional from the SAP BusinessObjects 4.0 release onwards.
Returns thePromptOrder
.
removeDuplicateQuestions
- If true
, the collection will not contain any
duplicated ConditionPrompt
s. If
false
, it returns a collection of all
ConditionPrompt
s.
PromptOrder
ConditionPrompt.setQuestion(String)
boolean isSupported(Feature feature)
Feature
is supported by this DataProvider.
feature
- a Feature instance to be checked
True
if the Feature
otherwise,
False
.DataProviderFeature
,
QueryFeature
,
ConditionOperatorFeature
boolean isSampledData()
true
or false
.SQLDataProvider.setSamplingMode(SamplingMode)
,
SamplingMode
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 subsequentDocumentInstance.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.
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());
Contexts
,
DocumentInstance.getMustFillContexts()
,
DocumentInstance.getContextPrompts()
DataSourceParameterValues getDataSourceParameterValues()
DataSourceParameterValues
collection allowing to read
or modify data source parameter values for this DataProvider
.
DataSourceParameterValues
instance.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.
DPExpression
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.
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.
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.
true
if the data provider has been run or saved, otherwise returns false
.boolean isIgnoredForRefresh()
Warning:This interface is no longer functional from the SAP BusinessObjects XI 4.0 release onwards.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |