Developing the Hibernate ODA UI extension
To use the data retrieved by the Hibernate ODA driver in a BIRT report design, you must extend the DTP design user interface. To implement the Hibernate ODA user interface, you extend the following extension points:
*org.eclipse.datatools.connectivity.oda.design.ui.dataSource
The dataSource extension point defines and implements the user interface for new data source and data set wizards. These wizards use the Hibernate ODA driver plug-in to extend the functionality available in the Data Explorer of BIRT Report Designer.
*org.eclipse.ui.propertyPages
The propertyPages extension displays and manipulates the Hibernate configuration file and mapping files directory locations.
*org.eclipse.datatools.connectivity.connectionProfile
The connectionProfile extension shares a data source connection between applications.
To start developing the Hibernate ODA user interface plug-in, create the plug-in project, org.eclipse.birt.report.data.oda.hibernate.ui.
How to create the Hibernate ODA user interface plug-in project
1 From the Eclipse menu, choose FileNewProject.
2 On New Project—Select a wizard, open Business Intelligence and Reporting Tools and select ODA Designer Plug-in Project. Choose Next.
3 In Plug-in Project, apply the settings shown in Table 25‑16. Choose Next.
Table 25‑16 Settings for the Hibernate ODA UI plug-in project options
Section
Option
Value
Plug-in Project
Project name
org.eclipse.birt.report.data
.oda.hibernate.ui
 
Use default location
Selected
 
Location
Not available when you select Use default location
Project Setting
Create a Java project
Selected
 
Source folder name
src
 
Output folder name
bin
Target Platform
Eclipse version
3.5 or greater
 
OSGi framework
Deselected
Working Sets
Add project to working sets
Not selected
4 In Plug-in Content, apply the settings shown in Table 25‑17. Choose Finish.
Table 25‑17 Settings for the Hibernate ODA UI plug-in content options
Section
Option
Value
Properties
ID
org.eclipse.birt.report.data
.oda.hibernate.ui
 
Version
2.0.0
 
Name
BIRT Hibernate User Interface Plug-in
 
Vendor
yourCompany.com or leave blank
 
Execution Environment
JavaSE-1.6
Options
Generate an activator, a Java class that controls the plug‑in’s life cycle
Selected
 
Activator
org.eclipse.birt.report.data
.oda.hibernate.ui.Activator
 
This plug-in will make contributions to the UI
Selected
 
Enable API Analysis
Deselected
Rich Client Application
Would you like to create a 3.x rich client application?
No
5 In Templates, choose ODA Data Source Designer. Choose Next.
6 In ODA Data Source Designer, specify new values for the following options used to generate the Hibernate ODA user interface plug-in, as shown in Table 25‑18. Choose Finish.
Table 25‑18 Settings for the Hibernate ODA data source designer options
Option
Value
Java Package Name
org.eclipse.birt.report.data.oda.hibernate.ui
ODA Runtime Driver Plug‑in Id
org.eclipse.birt.report.data.oda.hibernate
ODA Runtime Data Source Element Id
org.eclipse.birt.report.data.oda.hibernate
ODA Runtime Driver Class
org.eclipse.birt.report.data.oda.hibernate
.Driver
ODA Runtime Data Set Element Id
org.eclipse.birt.report.data.oda.hibernate
.dataSet
Data Source Display Name
ODA Hibernate File Designer Data Source
Data Set Display Name
ODA Hibernate File Designer Data Set
The Hibernate ODA user interface plug-in project appears.
How to specify the Hibernate ODA user interface dependencies
On the Eclipse PDE Manifest Editor, in Dependencies, specify the required plug‑ins in the following order:
*org.eclipse.core.runtime
*org.eclipse.ui
*org.eclipse.datatools.connectivity.oda.design.ui
*org.eclipse.birt.report.data.oda.hibernate
How to specify the Hibernate ODA user interface run time
In Runtime, in Exported Packages, add org.eclipse.birt.report.oda.hibernate.ui to the list of packages that this plug-in exposes to clients.
How to specify the Hibernate ODA user interface extensions
1 Check to ensure that the following extensions have been defined:
*org.eclipse.datatools.connectivity.oda.design.ui.dataSource
*org.eclipse.ui.propertyPages
*org.eclipse.datatools.connectivity.connectionProfile
2 In Extensions, select the extension point, org.eclipse.datatools.connectivity
.oda.design.ui.dataSource, and add the following elements and element details:
*dataSourceUI extension element details for the newDataSourceWizard extension element, as shown in Table 25‑19.
Table 25‑19 Property settings for the Hibernate newDataSourceWizard extension element
Property
Value
pageClass
org.eclipse.birt.report.data.oda.hibernate
.ui.HibernateDataSourceWizard
windowTitle
Hibernate Data Source
includesProgressMonitor
false
pageTitle
Hibernate Data Source
*dataSetUI extension element details, as shown in Table 25‑20.
Table 25‑20 Property settings for the Hibernate dataSetUI extension element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
.dataSet
initialPageId
org.eclipse.birt.report.data.oda.hibernate
.ui.HibernatePage
supportsInParameters
true
supportsOutParameters
false
3 In Extensions, select dataSetUI, and add the following properties and element details:
*dataSetWizard, as shown in Table 25‑21
Table 25‑21 Property settings for the Hibernate dataSetWizard extension element
Property
Value
class
org.eclipse.datatools.connectivity.oda
.design.ui.wizards.DataSetWizard
windowTitle
Hibernate Data Set
*dataSetPage, as shown in Table 25‑22
Table 25‑22 Property settings for the Hibernate dataSetPage extension element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
.ui.HibernatePage
wizardPageClass
org.eclipse.birt.report.data.oda.hibernate
.ui.HibernateHqlSelectionPage
displayName
Enter HQL
path
/
4 In Extensions, select org.eclipse.ui.propertyPages, and add the ODA Hibernate Data Source Connection Properties (page) property and extension element details, as shown in Table 25‑23.
Table 25‑23 Property settings for the Hibernate page extension
element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
name
ODA Hibernate Data Source Connection Properties
class
org.eclipse.birt.report.data.oda.hibernate.ui
.HibernatePropertyPage
objectClass
org.eclipse.datatools.connectivity
.IConnectionProfile
5 In Extensions, select ODA Hibernate Data Source Connection Properties (page), and add the filter property and extension element details, as shown in Table 25‑24.
Table 25‑24 Property settings for the Hibernate filter extension element
Property
Value
name
org.eclipse.datatools.profile.property.id
value
org.eclipse.birt.report.data.oda.hibernate
6 In Extensions, select org.eclipse.datatools.connectivity.connectionProfile, and add the following properties and element details:
*category, as shown in Table 25‑25
Table 25‑25 Property settings for the Hibernate category extension element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
parentCategory
org.eclipse.datatools.connectivity.oda
.profileCategory
name
Hibernate Data Source
*connectionProfile, as shown in Table 25‑26
Table 25‑26 Property settings for the Hibernate connectionProfile extension element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
category
org.eclipse.birt.report.data.oda.hibernate
name
ODA Hibernate Data Source Connection Profile
pingFactory
org.eclipse.datatoools.connectivity.oda
.profile.OdaConnectionFactory
*connectionFactory, as shown in Table 25‑27
Table 25‑27 Property settings for the Hibernate connectionFactory extension element
Property
Value
id
org.eclipse.datatools.connectivity.oda
.IConnection
class
org.eclipse.datatools.connectivity.oda
.profile.OdaConnectionFactory
profile
org.eclipse.birt.report.data.oda.hibernate
name
ODA Connection Factory
*newWizard, as shown in Table 25‑28
Table 25‑28 Property settings for the Hibernate newWizard extension element
Property
Value
id
org.eclipse.birt.report.data.oda.hibernate
name
ODA Hibernate Data Source
class
org.eclipse.datatools.connectivity.oda
.design.ui.wizards.NewDataSourceWizard
profile
org.eclipse.birt.report.data.oda.hibernate
description
Create an ODA Hibernate connection profile
The completed extension definitions appear as shown in Figure 25‑22.
Figure 25‑22 Extensions for the Hibernate ODA UI