ODA data source extension points
In this step you review the extension points added by the wizard. Click the Extensions tab in PDE Manifest Editor to open the Extensions pane in the
editor. The PDE Manifest Editor automatically adds the following two
extension points:
*org.eclipse.datatools.connectivity.oda.dataSource
*org.eclipse.datatools.connectivity.oda.connectionProfile
dataSource extension point properties
The ODA data source extension point supports extending design-time and run‑time data source access for an application. The extension must implement
the ODA Java run-time interfaces defined in the org.eclipse.datatools
.connectivity.oda plug‑in. Figure 25‑4 shows the ODA data source extension points used in the CSV ODA plug-in example.
Figure 25‑4 PDE Manifest Editor—CSV ODA Extensions
The extension point, org.eclipse.datatools.connectivity.oda.dataSource, specifies the following properties that identify the extension in the run-time environment:
*ID
Optional identifier of the extension instance.
The wizard added a reference, %oda.data.source.id, to the extension point ID that you specified in the wizard. The plugin.properties file provides definitions of all the localized variables. The value for the ID, shown in Listing 25‑1, is as follows:
org.eclipse.birt.report.data.oda.csv
Listing 25‑1 plugin.properties
############################################################
# Copyright (c) 2013 <<Your Company Name here>>
#
############################################################
# Plug-in Configuration
#
oda.data.source.id=org.eclipse.birt.report.data.oda.csv
#
############################################################
# NLS String
############################################################
#
plugin.name=CSV Data Source ODA Runtime Driver
data.source.name=CSV Data Source
data.set.name=CSV Data Set
connection.profile.name=CSV Data Source Connection Profile
*Name
Optional name of the extension instance. Fully qualified identifier of the extension.
The extension point defines the extension elements and extension element details for the CSV ODA driver.
The dataSource extension element defines the ODA data source extension type to use at design time and run time. It contains the following properties:
*id
Fully qualified identifier of an ODA data source extension. The wizard references the externalized id with the notation %oda.data.source.id.
*driverClass
Java class that implements the org.eclipse.datatools.connectivity.oda.IDriver interface. This interface provides the entry point for the ODA run‑time driver extension.
*odaVersion
Version of the ODA interfaces. Specify version 3.2 for an ODA driver developed for BIRT Release 4.3.1.
*defaultDisplayName
Display name of the ODA data source extension. To externalize the value, use the plugin.properties mechanism.
*setThreadContextClassLoader
Indicates whether the consumer of the ODA run-time extension plug-in must set the thread context class loader before calling an ODA interface method.
The OSGi class loader that loads the ODA run-time plug-in is not designed to load additional classes. To load additional classes, an ODA run-time plug-in must provide its own java.net.URLClassLoader object and switch the thread context class loader as required.
The dataSource element also specifies a property, containing the following extension element details:
*name
Unique name of a property group. Type HOME for a property name.
*defaultDisplayName
Default display name of a property group. To localize the value, use the plugin.properties mechanism.
For the default display name, type "CSV File Full Path".
*type
Data type of the property. The default is string.
*canInherit
Flag indicating whether the property extension element can inherit properties. Select true.
*defaultValue
Default value of the property extension element.
*isEncryptable
Flag indicating whether the property is encrypted. Select false.
*allowsEmptyValueAsNull
Flag indicating whether an empty value of this property can be treated as a null value. The default value is true.
The dataSet extension element describes the following properties:
*id
Required identifier of the ODA data set extension.
*defaultDisplayName
Display name of the ODA data set extension.
To localize the value, use the plugin.properties file. The default display name is CSV Data Set, as you can see from Listing 25‑1.
The dataSet element also specifies a complex data type, dataTypeMapping,
which defines a sequence of data type mappings containing the following properties:
*nativeDataTypeCode
Integer value that must match one of the data type codes returned in the implementation for the ODA driver interface.
*nativeDataType
String value specifying the data source native data type.
*odaScalarDataType
ODA scalar data type that maps to the native type. Supported ODA data types include Date, Double, Integer, String, Time, Timestamp, Decimal, and Boolean. The default supported types set by the wizard are shown in Table 25‑4.
Table 25‑4 Settings for CSV ODA dataTypeMapping elements
nativeDataTypeCode
nativeDataType
odaScalarDataType
1
String
String
4
Integer
Integer
8
Double
Double
3
BigDecimal
Decimal
91
Date
Date
92
Time
Time
93
TimeStamp
Timestamp
16
Boolean
Boolean
ConnectionProfile properties
This extension point supports creating database connections using connections profiles. The CSV ODA plug-in uses the following settings created by the plug‑in wizard:
*CSV ODA Data Source (category)
*CSV ODA Data Source Connection Profile (connectionProfile)
*ODA Connection Factory (connectionFactory)