Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Custom ODA driver in BIRT rptdesign
Custom ODA driver in BIRT rptdesign [message #219997] Tue, 20 February 2007 12:28 Go to next message
Ivan Biddles is currently offline Ivan Biddles
Messages: 22
Registered: July 2009
Junior Member
Hi,
I have written a custom ODA driver following the example of the Flatfile
ODA driver.
It works on its own within a JUnit test suite but when I try to reference
it in a BIRT ".rptdesign" file, the driver never gets called.
I have searched for an example of a ".rptdesign" file that shows the
Flatfile ODA in action but have been unable to find one anywhere on the
Net.
Does anyone have such an example ".rptdesign" file, particularly showing
the appropriate data source and data set tags?
Thanks in advance, Ivan.
Re: Custom ODA driver in BIRT rptdesign [message #220041 is a reply to message #219997] Tue, 20 February 2007 15:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Does you ODA driver show up in the designer when you do a new data
set/source?

Jason

"Ivan Biddles" <ivanb@scientology.net> wrote in message
news:d71e8a14db99dcb1714dc6542c7cea94$1@www.eclipse.org...
> Hi,
> I have written a custom ODA driver following the example of the Flatfile
> ODA driver.
> It works on its own within a JUnit test suite but when I try to reference
> it in a BIRT ".rptdesign" file, the driver never gets called.
> I have searched for an example of a ".rptdesign" file that shows the
> Flatfile ODA in action but have been unable to find one anywhere on the
> Net.
> Does anyone have such an example ".rptdesign" file, particularly showing
> the appropriate data source and data set tags?
> Thanks in advance, Ivan.
>
Re: Custom ODA driver in BIRT rptdesign [message #220053 is a reply to message #220041] Tue, 20 February 2007 17:41 Go to previous messageGo to next message
Ivan Biddles is currently offline Ivan Biddles
Messages: 22
Registered: July 2009
Junior Member
Dear Jason,

Thank you for your very fast reply.

I was a little slower getting back to you because, to be honest, I
haven't been using the report designer so I had to set it up and work out
how to use it. (Since my focus is on the underlying ODA driver I have just
a simple rptdesign file that I copied from an ordinary sample and edited
the XML.)

Anyway, I did set up the BIRT 2.2M4 all-in-one and opened the rptdesign
in the designer and the data source and data set did show up.

Best wishes, Ivan
Re: Custom ODA driver in BIRT rptdesign [message #220061 is a reply to message #220053] Tue, 20 February 2007 19:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You should be able to create a design with your data source then.
I have attached an example that uses the flat file driver as well.

Jason

<?xml version="1.0" encoding="UTF-8"?>

<!-- Written by Eclipse BIRT 2.0 -->

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6"
id="1">

<property name="createdBy">Eclipse BIRT Designer Version
2.1.1.v20060922-1058 Build &lt;20060926-0959></property>

<property name="units">in</property>

<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
here>></property>

<data-sources>

<oda-data-source
extensionID="org.eclipse.datatools.connectivity.oda.flatfile " name="Data
Source" id="4">

<text-property name="displayName"></text-property>

<property name="HOME">C:\dwn</property>

<property name="CHARSET">UTF-8</property>

<property name="INCLTYPELINE">NO</property>

</oda-data-source>

</data-sources>

<data-sets>

<oda-data-set
extensionID="org.eclipse.datatools.connectivity.oda.flatfile.dataSet "
name="Data Set" id="5">

<structure name="cachedMetaData">

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">Date</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">2</property>

<property name="name">Open</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">3</property>

<property name="name">High</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">4</property>

<property name="name">Low</property>

<property name="dataType">string</property>

</structure>

</list-property>

</structure>

<property name="dataSource">Data Source</property>

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">Date</property>

<property name="nativeName">Date</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">2</property>

<property name="name">Open</property>

<property name="nativeName">Open</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">3</property>

<property name="name">High</property>

<property name="nativeName">High</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">4</property>

<property name="name">Low</property>

<property name="nativeName">Low</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

</list-property>

<property name="queryText">select Date, Open, High, Low from
table.csv</property>

<xml-property name="designerValues"><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>

<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">

<Version>1.0</Version>

<design:ResultSets derivedMetaData="true">

<design:resultSetDefinitions>

<design:resultSetColumns>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>Date</design:name>

<design:position>1</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>-1</design:precision>

<design:scale>-1</design:scale>

<design:nullability>Unknown</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>Date</design:label>

<design:formattingHints/>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>Open</design:name>

<design:position>2</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>-1</design:precision>

<design:scale>-1</design:scale>

<design:nullability>Unknown</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>Open</design:label>

<design:formattingHints/>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>High</design:name>

<design:position>3</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>-1</design:precision>

<design:scale>-1</design:scale>

<design:nullability>Unknown</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>High</design:label>

<design:formattingHints/>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>Low</design:name>

<design:position>4</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>-1</design:precision>

<design:scale>-1</design:scale>

<design:nullability>Unknown</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>Low</design:label>

<design:formattingHints/>

</design:usageHints>

</design:resultColumnDefinitions>

</design:resultSetColumns>

</design:resultSetDefinitions>

</design:ResultSets>

</model:DesignValues>

]]></xml-property>

</oda-data-set>

</data-sets>

<page-setup>

<simple-master-page name="Simple MasterPage" id="2">

<page-footer>

<text id="3">

<property name="contentType">html</property>

<text-property name="content"><![CDATA[<value-of>new
Date()</value-of>]]></text-property>

</text>

</page-footer>

</simple-master-page>

</page-setup>

<body>

<table id="6">

<property name="width">100%</property>

<property name="dataSet">Data Set</property>

<list-property name="boundDataColumns">

<structure>

<property name="name">Date</property>

<expression name="expression">dataSetRow["Date"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">Open</property>

<expression name="expression">dataSetRow["Open"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">High</property>

<expression name="expression">dataSetRow["High"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">Low</property>

<expression name="expression">dataSetRow["Low"]</expression>

<property name="dataType">string</property>

</structure>

</list-property>

<column id="30"/>

<column id="31"/>

<column id="32"/>

<column id="33"/>

<header>

<row id="7">

<cell id="8">

<label id="9">

<text-property name="text">Date</text-property>

</label>

</cell>

<cell id="10">

<label id="11">

<text-property name="text">Open</text-property>

</label>

</cell>

<cell id="12">

<label id="13">

<text-property name="text">High</text-property>

</label>

</cell>

<cell id="14">

<label id="15">

<text-property name="text">Low</text-property>

</label>

</cell>

</row>

</header>

<detail>

<row id="16">

<cell id="17">

<data id="18">

<property name="resultSetColumn">Date</property>

</data>

</cell>

<cell id="19">

<data id="20">

<property name="resultSetColumn">Open</property>

</data>

</cell>

<cell id="21">

<data id="22">

<property name="resultSetColumn">High</property>

</data>

</cell>

<cell id="23">

<data id="24">

<property name="resultSetColumn">Low</property>

</data>

</cell>

</row>

</detail>

<footer>

<row id="25">

<cell id="26"/>

<cell id="27"/>

<cell id="28"/>

<cell id="29"/>

</row>

</footer>

</table>

</body>

</report>

"Ivan Biddles" <ivanb@scientology.net> wrote in message
news:f372a1938ee39bb5b71a630899806709$1@www.eclipse.org...
> Dear Jason,
>
> Thank you for your very fast reply.
>
> I was a little slower getting back to you because, to be honest, I
> haven't been using the report designer so I had to set it up and work out
> how to use it. (Since my focus is on the underlying ODA driver I have just
> a simple rptdesign file that I copied from an ordinary sample and edited
> the XML.)
>
> Anyway, I did set up the BIRT 2.2M4 all-in-one and opened the rptdesign
> in the designer and the data source and data set did show up.
>
> Best wishes, Ivan
>
Re: Custom ODA driver in BIRT rptdesign [message #220344 is a reply to message #219997] Wed, 21 February 2007 16:09 Go to previous messageGo to next message
Scott Rosenbaum is currently offline Scott Rosenbaum
Messages: 425
Registered: July 2009
Senior Member
Hello Ivan,

Do you see your ODA DataSource show up in your list of available data sources
in the DataSource browser?

Scott

> Hi,
> I have written a custom ODA driver following the example of the
> Flatfile
> ODA driver.
> It works on its own within a JUnit test suite but when I try to
> reference
> it in a BIRT ".rptdesign" file, the driver never gets called.
> I have searched for an example of a ".rptdesign" file that shows the
> Flatfile ODA in action but have been unable to find one anywhere on
> the
> Net.
> Does anyone have such an example ".rptdesign" file, particularly
> showing
> the appropriate data source and data set tags?
> Thanks in advance, Ivan.
Re: Custom ODA driver in BIRT rptdesign [message #220383 is a reply to message #219997] Wed, 21 February 2007 23:55 Go to previous messageGo to next message
Eclipse User
Originally posted by: rchamarthy.gmail.com

Hope you have a valid plugin.xml file for your custom ODA driver.

Also after launching the designer with your driver, look under
Help->About Eclipse SDK->Plug-in Details->Plug-in ID, and check if your driver
bundle ID is mentioned in that list.

Ravi Chamarthy.

Ivan Biddles wrote:

> Hi,
> I have written a custom ODA driver following the example of the Flatfile
> ODA driver.
> It works on its own within a JUnit test suite but when I try to reference
> it in a BIRT ".rptdesign" file, the driver never gets called.
> I have searched for an example of a ".rptdesign" file that shows the
> Flatfile ODA in action but have been unable to find one anywhere on the
> Net.
> Does anyone have such an example ".rptdesign" file, particularly showing
> the appropriate data source and data set tags?
> Thanks in advance, Ivan.
Re: Custom ODA driver in BIRT rptdesign [message #220635 is a reply to message #220061] Thu, 22 February 2007 23:49 Go to previous messageGo to next message
Ivan Biddles is currently offline Ivan Biddles
Messages: 22
Registered: July 2009
Junior Member
Dear Jason and Scott and Ravi,

Thank you all very much for your replies and your help on this.

I took your sample rptdesign file, Jason, and basically just replaced your
driver details with mine.

My data source does appear in the Data Explorer.

In the report designer preview panel, it said:

Cannot process the org.xxxx.data.dataSource driver's configuration.

So I tend to agree with Ravi that there must be a problem in my plugin.xml
file.

Let me explain my setup a little more.

I have one plugin that provides the ODA driver (org.xxxx.data) and a
second that uses the report engine API (org.xxxx.report). The ODA driver
works fine on its own; the report plug-in works fine with reports that do
not use my driver.

I debugged into the report engine and found that when it tries to find my
driver extension down in ManifestExplorer.findExtension, there are 4
extensions that it does find -- 3 BIRT extensions and the flatfile driver
-- but mine is not there in the list.

The error I get from my report engine test case is:

java.lang.IllegalArgumentException: org.xxxx.data.dataSource
at ....Driver.doGetDriverManifest (Driver.java:237)

So that explains why my driver is never getting called.

I checked the plugins in Help->About as you suggested, Ravi, and mine is
not there.

Originally I had the plugin.xml file in the "data" plugin but I also tried
putting it in the "report" plug-in with the same result.

My plugin snippets are quite straightforward but I'll include them in case
you see a glaring error in there:

<extension point="org.eclipse.datatools.connectivity.oda.dataSource">
<dataSource id="org.xxxx.data.dataSource"
odaVersion=3.0"
driverClass="org.xxxx.data.MyOdaDriver"
defaultDisplayName="ODA Data Source"
setThreadContextClassLoader="false">

and

<dataSet id="org.xxxx.data.dataSet"
defaultDisplayName="Data Set">

It seems that this must be pretty close and just some simple setup error
at this point.

Again thank you all for your help.

Best wishes, Ivan.
Re: Custom ODA driver in BIRT rptdesign [message #220744 is a reply to message #220635] Fri, 23 February 2007 12:21 Go to previous messageGo to next message
Ivan Biddles is currently offline Ivan Biddles
Messages: 22
Registered: July 2009
Junior Member
Dear Jason, Scott and Ravi,

I have progressed a little more.

My ODA driver plugin now appears in both the "Plug-in Details" and
"Configuration Details" (marked as resolved), but I still get the same
errors in the report designer and when running the report engine API.

i.e. SEVERE: Cannot process data source extension configuration.

I am continuing to experiment but if you have any further ideas or need
more data, please let me know.

Best wishes, Ivan
Re: Custom ODA driver in BIRT rptdesign [message #220790 is a reply to message #220383] Fri, 23 February 2007 23:00 Go to previous message
Ivan Biddles is currently offline Ivan Biddles
Messages: 22
Registered: July 2009
Junior Member
Hi,

This is what I have found so far.

1. I do have a plugin.xml file and it "appears" to be correct.

2. When I run from the BIRT previewer it works. In that case I am running
in the IDE and my plugin appears in the "Help->About" as active.

3. When I run from the report engine API, my extension is not registered.
I have my same plugins in the BIRT run-time plugins directory as I have in
the main IDE plugins directory

I tried adding my plug-in to the config.ini file.

I then debugged into the OSGILauncher.setup method and traced the
installBundles and startBundles methods. My plugin was installed but not
started. I noticed that none of the 4 plugins whose extensions are
registered (3 BIRT and the flatfile extensions) were in that list anyway.

I was trying to see if the launcher considered that there was some sort of
a problem with my plug-in and therefore didn't load it, but there was no
error.

when I start up the BIRT Platform, I print out all the extension points
and their corresponding extensions and my plugin simply does not appear at
all.

Is there something I'm supposed to do to get my extension point registered
other than in plugi.xml?

Best wishes, Ivan.
Previous Topic:why did birt switch from FOP to itext? and can FOP still be used?
Next Topic:ERROR IN PDF REPORT
Goto Forum:
  


Current Time: Wed Jul 30 05:17:55 EDT 2014

Powered by FUDForum. Page generated in 0.07707 seconds