Understanding the ODA data source user interface extensions
In this next step, you review the extensions added by the wizard to implement the CSV ODA user interface extension and add the extension element details. Figure 20‑9 shows the list of CSV ODA user interface extensions.
Figure 20‑9 CSV ODA user interface extensions
The CSV ODA user interface plug-in extends the functionality defined by the following extension points:
*org.eclipse.datatools.connectivity.connectionProfile
Provides support for adding a connection profile.
*org.eclipse.datatools.connectivity.connectionProfileImage
The connection profile image extension point supports adopters using multiple icons from their main connection profile extension into a separate plug-in for user interface code and resources.
*org.eclipse.ui.propertyPages
Adds a property page that displays the properties of an object in a dialog box.
*org.eclipse.datatools.connectivity.oda.design.ui.dataSource
Extends the ODA Designer user interface framework to support creating a dialog page so a user can specify an ODA data source and a related data set.
The extension points specify the following properties that identify the extensions in the run-time environment:
*ID
Optional identifier of the extension instance
*Name
Optional name of the extension instance
Understanding the connectionProfile extension point
The connectionProfile extension point specifies the newWizard, which creates the connection profile.
Understanding the propertyPages extension point
The propertyPages extension point specifies the following extension elements:
*page
Defines a property page. Specifies properties such as id, display name, category, icon, object class, filter, and category. The id and the display name are localized in the plugin.properties file, as shown in Listing 20‑17.
Listing 20‑17 plugin.properties
########################################################
# Copyright (c) 2013 <<Your Company Name here>>
#######################################################
# Plug-in Configuration
#
oda.data.source.id=org.eclipse.birt.report.data.oda.csv
#
#######################################################
# NLS strings
#
plugin.name=CSV File ODA Data Source ODA Designer
newwizard.name=CSV File ODA Data Source
newwizard.description=Create a CSV File ODA Data Source connection profile
wizard.window.title=New CSV File ODA Data Source Profile
wizard.data.source.page.title=CSV File ODA Data Source
profile.propertypage.name=CSV File ODA Data Source Connection Properties
wizard.data.set.window.title=New CSV File ODA Data Set
wizard.data.set.page.title=Query
The ODA user interface framework provides a default implementation that creates a text control for each property value, which is why there is no need to provide a custom implementation. By default, the wizard sets the page.class in the following org.eclipse.ui.propertyPages extension point:
page.class=org.eclipse.datatools.connectivity.oda.design.ui
.pages.impl.DefaultDataSourcePropertyPage
*filter
Specifies an action filter that evaluates the attributes of each object in a current selection. If an object has the specified attribute state, a match occurs. Each object must implement the org.eclipse.ui.IActionFilter interface.
Understanding the dataSource extension point
The dataSource extension point specifies the following extension elements:
*dataSourceUI
Adds user interface support for specifying an extended data source.
*dataSetUI
The dataSetUI extension element defines the following extension elements and details:
*id
Fully qualified name of the data set, such as org.eclipse.birt.report.data
.oda.csv.dataSet. This name must be the same as the name for the ODA extension driver data set.
*dataSetWizard
Wizard class used to specify a data set in the BIRT Report Designer user interface. This class must use or extend org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizard. Localize the window title, %wizard.data.set.window.title, in the plug-in properties file.
*dataSetPage
Specifies an editor page to add to the editor dialog for a data set. The data set user interface adds editor pages to a dialog in the order in which the pages are defined. This class must use or extend org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage. The implementation code is in org.eclipse.birt.report.data.oda.csv.ui.impl.CustomDataSetWizardPage. The wizard provides a default implementation code.
The page display name, %wizard.data.set.page.title, is externalized in the plugin.properties file.