Contents |
The NightLabs BIRT-JDO integration provides a custom ODA datasource for the BIRT project that allows the connection to JDO datastores and execution of JDOQL.
As some tasks required by BIRT (like the generation of ResultSetMetaData) are not included in the JDO specification org.nightlabs.birt.jdo introduces a framework to register different types of JDO connections. They are used to handle the different vendors of JDO implementations.
The following graphics outlines the architecture of the birt-jdo framework along with its first extension.
Project overview
Currently NightLabs provides one implementation of the BIRT-JDO connection framework for the JDO reference implementation JPOX (see projects org.nightlabs.birt.jdo.jpox, org.nightlabs.birt.jdo.jpox.ui).
This implementation creates its own PersistenceManagerFactory based on the properties provided by the datasource and executes JDOQL queries on PersistenceManagers retrieved by this factory. In order for the JPOX implementation to be able to execute the queries it has to be able to access the JDO classes and corresponding meta-data. This can be done by providing an OSGI bundle containing or referencing the classes and make them buddies to org.nightlabs.birt.jdo.jpox. Have a look at org.nightlabs.birt.jdo.test
Here are the entries in a sample MANIFEST.MF
Eclipse-RegisterBuddy: org.nightlabs.birt.jdo.jpox
Like other datasource extensions to birt the JDO extension also provides UI to create and configure its datasources and datasets.
To create a new JDO datasource open the new datasoure wizard and select "JDOQL Driver" from the list of possible sources. Select next an a wizard page will appear that lets you select the JDO connection type and configure its properties. Typically JDO connections will be configured by an set of JDO properties (like the class to instantiate for the PersistenceManagerFactory) and specific and vendor-dependent other properties. A default UI lets you load these properties from a properties file like you would pass to JDOHelper to create a PersisteneceManagerFactory.
Now to create a JDOQL dataset open the new dataset wizard and select the previously created JDO datasource. You will be presented a dataset type of "JDOQL Data Set" only so there is not much to do wrong. After creation the dataset property wizard will appear (you can open this any time by choosing edit in the datasets context menu). The wizard contains one entry name "JDOQL Query". This page lets you enter a JDOQL text to be executed for this dataset. Use the JDOQL single-string notation of queries, here is an example:
You can define parameters in the JDOQL's PARAMETER clause or as implicit parameters direcly prefixed with a colon (e.g. :paramArticleID). However, you still have to register each parameter you want to pass to the query in the dataset wizards "Parameters" page. Please specify here all parameters in the correct order as parameters are passed to the JDO Driver and the query in this order.
As already mentioned some information BIRT needs is not part of the JDO specification thus org.nightlabs.birt.jdo introduces a framework to handle different types of so called JDOConnectionAdapters. These are used not only to handle different implementations of JDO but enable extendors to query very their very specific JDO repositories such as remote repositories accessed via EJBs.
org.nightlabs.birt.jdo introduces the extensionpoint org.nightlabs.birt.jdo.birtJDOConnectionAdapter where extendors register the entry points to their custom JDO connection. Each extension has to provide a classname for an implementation of IJDOConnectionAdapter along with a unique identifyer for it. Here is an example:
<extension
point="org.nightlabs.birt.jdo.birtJDOConnectionAdapter">
<birtJDOConnectionAdapter
class="org.nightlabs.birt.jdo.jpox.JDOConnectionAdapterJPOX"
connectionType="jpox.direct"/>
</extension>
For further information on the requirements of IJDOConnectionAdapter please consult the Javadoc.
Each JDOConnectionAdapter can provide its own UI for the configuration of its connection properties. The UI has to be registered as extension to the point org.nightlabs.birt.jdo.ui.birtJDOConnectionAdapterUI
<extension
point="org.nightlabs.birt.jdo.ui.birtJDOConnectionAdapterUI">
<birtJDOConnectionAdapterUI
class="org.nightlabs.birt.jdo.jpox.ui.JDOConnectionAdapterUIJPOX"
connectionType="jpox.direct"/>
</extension>
org.nightlabs.birt.jdo is published under the Eclipse Public License EPL Version 1.0.
Source
Sources are committed in NightLabs public SVN server. The birt integration has its own repository: https://svn.nightlabs.org/svn/birt
Binary
Update Site
Update Site URL is
http://www.nightlabs.de/updatesites/birt-jdo