Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Custom ODA driver IDataSetMetaData usage(IConnection.getMetaData() never called so no query parameters possible)
Custom ODA driver IDataSetMetaData usage [message #1006051] Tue, 29 January 2013 16:04 Go to next message
Ian Gardner is currently offline Ian GardnerFriend
Messages: 2
Registered: January 2013
Junior Member
Defining query parameters for a custom ODA driver does not work because
IConnection.getMetaData() is never called by BIRT framework.

I created a custom ODA data source using the standard template
project that comes with eclipse. This template code provides a
IParameterMetaData instance with one parameter, so I would expect
that when I add such a data source in report designer and edit the
"Data Set" then I would get the parameters binding screen in the
"Edit Data Set" dialog.

I added some logging to trace the main calls of the ODA driver
and note that the IConnection method
IDataSetMetaData getMetaData(String dataSetType)
is never called. Thus it is not surprising that report designer does
not know that query parameters are required.

The template implementation of IDataSetMetaData has method
supportsInParameters() return true so it expects input parameters
to be used.

Why is this not called?
Is there some special plugin.xml setting required?

Obviously this works for the ODA JDBC drivers, but they additionally provide
special UI configuration screens so may be using the API in a different way.
I feel this feature should work in some basic manner for a simple ODA driver
without a special UI plugin.

The same problem applies when just using the runtime reporting engine,
but since the report design will not specify any query parameters this
is not surprising.

My platform:
linux x86_64
java 1.7 (openjdk "icedtea" 7)
eclipse juno SR1
DTP 1.10.1
BIRT 4.2.1


Here is the basic sequence of calls when I first insert a new data source
and data set into a report design using the sample code ODA driver:

Driver.setAppContext
Driver.getConnection() odatemplatedriver
Connection.setAppContext()
Connection.open()
Connection.newQuery()
Query.setSpecification()
Query.setAppContext()
Query.prepare() queryText=
Query.setProperty() name=property1 value=null
Query.getMetaData()
ResultSetMetaData.getColumnCount()
ResultSetMetaData.getColumnName()
ResultSetMetaData.getColumnName()
Driver.getManifest
ResultSetMetaData.getColumnName()
ResultSetMetaData.getColumnName()
Driver.getManifest
Query.close()
Connection.close()

Re: Custom ODA driver IDataSetMetaData usage [message #1006264 is a reply to message #1006051] Wed, 30 January 2013 15:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I just looked at this and the parameters entry shows up for me.
The getParameterMetaData method is actually called from the dataset wizard page:
(CustomDataSetWizardPage.java)

try
{
IParameterMetaData paramMd = query.getParameterMetaData();
updateParameterDesign( paramMd, dataSetDesign );
}

Am I misunderstanding the issue?

Jason
  • Attachment: odaparams.png
    (Size: 28.18KB, Downloaded 183 times)
Re: Custom ODA driver IDataSetMetaData usage [message #1006289 is a reply to message #1006264] Wed, 30 January 2013 17:16 Go to previous messageGo to next message
Ian Gardner is currently offline Ian GardnerFriend
Messages: 2
Registered: January 2013
Junior Member
Hello Jason,

You have understood correctly.
In my case the Query "IParameterMetaData getParameterMetaData()" method is
never called either. I assumed the problem was upstream since the
IConnection.getMetaData() method is also not called.

Am I doing something wrong in the report designer?
Here is my sequence of steps:

1. Install my custom ODA driver into the eclipse dropins folder and restart
eclipse with the -clean to purge any plugin cache
2. Create a new report design based on blank page template
3. Add a new data source
4. Add a new data set

After I click the Finish button of the add new dataset wizard the
edit dialog for the dataset pops up (Same as right mouse menu on
dataset and select Edit).

This dialog contains the sub-pages "Data Source", "Output Columns", "Computed Columns",
"Filters", "Property Binding", "Settings" and "Preview Results".
However no input parameter sub-page which is what I am expecting.

Without proceeding any further the main calls logged by my driver are:

Driver.setAppContext
Driver.getConnection() odatemplatedriver
Connection.setAppContext()
Connection.open()
Connection.newQuery()
Query.setSpecification()
Query.setAppContext()
Query.prepare() queryText=
Query.setProperty() name=property1 value=null
Query.getMetaData()
ResultSetMetaData.getColumnCount()
ResultSetMetaData.getColumnName()
ResultSetMetaData.getColumnName()
Driver.getManifest
ResultSetMetaData.getColumnName()
ResultSetMetaData.getColumnName()
Driver.getManifest
Query.close()
Connection.close()

No calls to IConnection.getMetaData() or Query.getParameterMetaData().

Thankyou,
Ian
Re: Custom ODA driver IDataSetMetaData usage [message #1006293 is a reply to message #1006289] Wed, 30 January 2013 17:24 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

getMetaData and getParameterMetaData are called by your design time ui plugin. Look at the default ui plugin wizard and it generates:
CustomDataSetWizardPage
Both of those calls are in this class.

Jason
Previous Topic:How to add a metadata to a field ?
Next Topic:Ecore Data Source with ExtendedMetaData
Goto Forum:
  


Current Time: Thu Apr 25 07:34:41 GMT 2024

Powered by FUDForum. Page generated in 0.03588 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top