#
BIRT Open Data Access Extension

###### Identifier:

org.eclipse.birt.data.oda.dataSource

###### Since:

2.0

###### Description:

[Deprecated] This extension point is used to support the extension of BIRT design time and runtime data source access. Each extension must implement the BIRT Open Data Access (ODA) Java runtime interfaces defined in the org.eclipse.birt.data.oda package.

As of BIRT 2.0, the BIRT ODA run-time framework has been migrated to the Eclipse Data Tools Platform (DTP) project. It is replaced by the org.eclipse.datatools.connectivity.oda.dataSource extension point.
BIRT 2.0 provides a DTP-to-BIRT ODA adapter plug-in to support existing ODA run-time extensions that implemented this extension point.

###### Configuration Markup:

<!ELEMENT extension (dataSource , dataSet+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

<!ELEMENT dataSource (traceLogging? , properties?)>

<!ATTLIST dataSource

id CDATA #REQUIRED

odaVersion CDATA "2.0"

defaultDisplayName CDATA #IMPLIED

displayNameID CDATA #IMPLIED

driverClass CDATA #REQUIRED

setThreadContextClassLoader (true | false) "false">

The definition of a type of ODA data source extension for use at design time and run-time.

- id - A fully qualified ID that uniquely identifies this ODA data source extension in the BIRT environment. If a data source designer extension (which extends the org.eclipse.birt.report.designer.ui.datasource extension point) for this ODA driver is available, the value of this attribute must match that of the designer extension's id attribute in its data-Source element.
- odaVersion - Version of the org.eclipse.birt.data.oda plug-in for which this driver is developed. This element is required and should take the format of Major.Minor or Major.Minor.Service (e.g. 2.0 or 2.0.1).
- defaultDisplayName - The display name of the ODA data source extension. Default to the extension id if no display name is specified. It can be used by the BIRT Designer in displaying a list of ODA data source extensions, when they do not have a corresponding data source editor (dataSourceUI extension point).
- displayNameID - Not supported in Release 1.
- driverClass - Concrete class that implements the org.eclipse.birt.data.oda.IDriver interface. This is the entry point of the ODA runtime driver. The same driver may support multiple data source extensions.
- setThreadContextClassLoader - If true, the consumer of the ODA runtime extension plug-in should set the thread context class loader to the one used to load this driver before calling any ODA interface method. In BIRT release 1, any data source extension with this flag set to true would take precedence, and is applied to all data source extensions implemented by this plug-in. In BIRT Data Engine, the thread context class loader being set is the OSGi class loader used to load this ODA runtime plugin. It is not designed to be used by a plugin to in turn load additional classes. If further class loading is needed, it is up to individual ODA runtime plugin implementation to provide its own URLClassLoader, and switch thread context class loader as appropriate.

<!ELEMENT dataSet (dataTypeMapping+ , properties?)>

<!ATTLIST dataSet

id CDATA #REQUIRED

defaultDisplayName CDATA #IMPLIED

displayNameID CDATA #IMPLIED>

The definition of a type of data set supported by this dataSource extension.

- id - A fully qualified ID that uniquely identifies this ODA data set definition in the BIRT environment.
- defaultDisplayName - The display name of the ODA data set definition. Default to its id if no display name is specified.
- displayNameID - Not supported in Release 1.

<!ELEMENT dataTypeMapping (alternativeOdaDataType*)>

<!ATTLIST dataTypeMapping

nativeDataType CDATA #IMPLIED

nativeDataTypeCode CDATA #REQUIRED

odaScalarDataType (Date|Double|Integer|String|Time|Timestamp|Decimal) "String">

A single mapping from a data provider's native data type to one or more ODA data types. Each native data type must be mapped to a primary ODA scalar data type. The driver can optionally provide a list of alternate ODA data types to which it is capable of converting a native data type. This data type mapping facilitates all ODA consumers to map from the same set of ODA data types to its own application-specific data types.

- nativeDataType - Native data type name (a string)
- nativeDataTypeCode - Native data type code (an integer). Its value must match one of the data type codes returned in the driver's ODA interface implementation.
- odaScalarDataType - The primary ODA scalar data type which the native type maps to. Supported ODA data types are: date, double, integer, string, time, timestamp and decimal.

<!ELEMENT alternativeOdaDataType EMPTY>

<!ATTLIST alternativeOdaDataType

odaScalarDataType (Date|Double|Integer|String|Time|Timestamp|Decimal) >

Provide an alternative mapping to an ODA scalar data type.

- odaScalarDataType - The ODA scalar data type to which the native type may be converted by the driver.

<!ELEMENT traceLogging EMPTY>

<!ATTLIST traceLogging

logLevel CDATA "WARNING"

logFileNamePrefix CDATA #IMPLIED

logDirectory CDATA #IMPLIED

logFormatterClass CDATA #IMPLIED>

Configures the ODA run-time driver's trace logging settings for the data source extension. The configured values are passed through to the driver's implementation of the `IDriver.setLogConfiguration` method.
It is up to individual ODA driver on how to honor any of these trace logging attributes as appropriate.
Note: The trace logging configuration specified in the plug-in PDE .options file would take precedence over those configured in this element, if the debug tracing flag is set to "true".
The ODA plug-in's PDE tracing options, listed below for cross reference, match the attributes of this element.
<plug-in Id>/debug = true/false
<plug-in Id>/traceLogging/logLevel
<plug-in Id>/traceLogging/logFileNamePrefix
<plug-in Id>/traceLogging/logDirectory
<plug-in Id>/traceLogging/logFormatterClass

- logLevel - The name or numeric value for the driver's log level.
  The log levels' names and corresponding numeric values are:
  "SEVERE" = 1000; "WARNING" = 900; "INFO" = 800; "CONFIG" = 700; "FINE" = 500; "FINER" = 400; "FINEST" = 300; "ALL" = 0; "OFF" = 1001 or higher .
- logFileNamePrefix - A string prefix for driver's log file name.
- logDirectory - Directory for log file.
- logFormatterClass - The class name of a concrete log formatter, suitable for use by the driver-specific logging utility.

<!ELEMENT property (choice*)>

<!ATTLIST property

name CDATA #REQUIRED

defaultDisplayName CDATA #IMPLIED

displayNameID CDATA #IMPLIED

type (string|choice) "string"

canInherit (true | false) "true"

defaultValue CDATA #IMPLIED

isEncryptable (true | false) "false">

A property whose value can be edited using the BIRT Designer at design-time. Its value is then passed to the ODA runtime driver during report generation.

- name - Unique name of the property
- defaultDisplayName - The default display name, which is used if no localized display name is found with I18N.
- displayNameID - Not supported in Release 1.
- type - Type of the property. The property type could be one of value from the enumerations.
- canInherit - Not supported in release 1.
- defaultValue - Default value of the property, if no property value is set.
- isEncryptable - A flag indicating whether this property value is encryptable. Setting it to "true" means that this property's value will be encyrpted in the report design file.

<!ELEMENT propertyGroup (property+)>

<!ATTLIST propertyGroup

name CDATA #REQUIRED

defaultDisplayName CDATA #IMPLIED

displayNameID CDATA #IMPLIED>

A grouping of one or more properties in the BIRT Designer. The group attributes are for display only. All properties listed under a propertyGroup are handled as scalar properties at run-time.

- name -
- defaultDisplayName - The default display name, which is used if no localized display name is found with I18N.
- displayNameID - Not supported in Release 1.

<!ELEMENT propertyVisibility EMPTY>

<!ATTLIST propertyVisibility

name CDATA #REQUIRED

visibility (change|lock|hide) >

Used to set the visibility level of the named property when it is shown in the BIRT Designer's property sheet.

- name - The name of a property that is defined either by this data source extension or is a system-defined property.
- visibility - The valid options are: change, hide, lock.

<!ELEMENT choice EMPTY>

<!ATTLIST choice

name CDATA #REQUIRED

value CDATA #IMPLIED

defaultDisplayName CDATA #IMPLIED

displayNameID CDATA #IMPLIED>

Choice of property values.

- name - Name of the choice
- value - Value to be used, if the given choice is selected.
- defaultDisplayName - The default display name, which is used if no localized display name is found with I18N.
- displayNameID - Not supported in Release 1.

<!ELEMENT properties (property* , propertyGroup* , propertyVisibility*)>

A collection of property definitions in a data source extension or its supported data set definitions.

###### Examples:

    <extension
             id="Id"
             name="Name"
             point="org.eclipse.birt.data.oda.dataSource">
          <dataSource
                odaVersion="2.0"
       driverClass="org.eclipse.birt.report.data.oda.jdbc.OdaJdbcDriver"
                id="org.eclipse.birt.report.data.oda.jdbc">

                <properties>
                 <propertyGroup
                     defaultDisplayName="Connection Properties"
                     name="connectionProperties">
                  <property
                        type="string"
                        defaultDisplayName="JDBC Driver Class"
                        canInherit="true"
                        name="odaDriverClass"/>
                  <property
                        type="string"
                        defaultDisplayName="JDBC Driver URL"
                        canInherit="true"
                        name="odaURL"/>
                  <property
                        type="string"
                        defaultDisplayName="Data Source"
                        canInherit="true"
                        name="odaDataSource"/>
                  <property
                        type="string"
                        defaultDisplayName="User Name"
                        canInherit="true"
                        name="odaUser"/>
                  <property
                        type="string"
                        defaultDisplayName="Password"
                        canInherit="true"
                        name="odaPassword"/>
               </propertyGroup>
                </properties>
          </dataSource>
          <dataSet
                defaultDisplayName="JdbcSelectDataSet&quot;"
             id="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet">
            <dataTypeMapping
                       nativeDataType="BIT"
                       nativeDataTypeCode="-7"
                       odaScalarDataType="Integer"/>
                 <dataTypeMapping
                       nativeDataType="TINYINT"
                       nativeDataTypeCode="-6"
                       odaScalarDataType="Integer"/>
                 <dataTypeMapping
                       nativeDataType="SMALLINT"
                       nativeDataTypeCode="5"
                       odaScalarDataType="Integer"/>
                 <dataTypeMapping
                       nativeDataType="INTEGER"
                       nativeDataTypeCode="4"
                       odaScalarDataType="Integer"/>
                 <dataTypeMapping
                       nativeDataType="BIGINT"
                       nativeDataTypeCode="-5"
                       odaScalarDataType="Decimal"/>
                 <dataTypeMapping
                       nativeDataType="FLOAT"
                       nativeDataTypeCode="6"
                       odaScalarDataType="Double"/>
                 <dataTypeMapping
                       nativeDataType="REAL"
                       nativeDataTypeCode="7"
                       odaScalarDataType="Double"/>
                 <dataTypeMapping
                       nativeDataType="DOUBLE"
                       nativeDataTypeCode="8"
                       odaScalarDataType="Double"/>
                 <dataTypeMapping
                       nativeDataType="NUMERIC"
                       nativeDataTypeCode="2"
                       odaScalarDataType="Decimal"/>
                 <dataTypeMapping
                       nativeDataType="DECIMAL"
                       nativeDataTypeCode="3"
                       odaScalarDataType="Decimal"/>
                 <dataTypeMapping
                       nativeDataType="CHAR"
                       nativeDataTypeCode="1"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="VARCHAR"
                       nativeDataTypeCode="12"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="LONGVARCHAR"
                       nativeDataTypeCode="-1"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="DATE"
                       nativeDataTypeCode="91"
                       odaScalarDataType="Date"/>
                 <dataTypeMapping
                       nativeDataType="TIME"
                       nativeDataTypeCode="92"
                       odaScalarDataType="Time"/>
                 <dataTypeMapping
                       nativeDataType="TIMESTAMP"
                       nativeDataTypeCode="93"
                       odaScalarDataType="Timestamp"/>
                 <dataTypeMapping
                       nativeDataType="BINARY"
                       nativeDataTypeCode="-2"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="VARBINARY"
                       nativeDataTypeCode="-3"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="LONGVARBINARY"
                       nativeDataTypeCode="-4"
                       odaScalarDataType="String"/>
                 <dataTypeMapping
                       nativeDataType="BOOLEAN"
                       nativeDataTypeCode="16"
                       odaScalarDataType="Integer"/>
          </dataSet>

     </extension>

###### API Information:

The data source extension's driver must implement the interfaces defined in the org.eclipse.birt.data.oda package. See the package's JavaDoc documentation and API interfaces for more information.

###### Supplied Implementation:

The plugin org.eclipse.birt.report.data.oda.jdbc, supplied with the BIRT installation, provides a good example for implementing an ODA runtime extension.
In addition, a set of default implementation of the main ODA runtime interfaces are provided in the org.eclipse.birt.data.oda.impl package. These classes assume the behavior of a simple ODA driver, and have labelled TODO tasks for a driver developer to implement data source dependent behavior. These concrete classes are provided for use as templates or base classes to aid in the development of an ODA custom driver. Their use is purely optional.

Copyright (c) 2004-2005 Actuate Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html