Customizing and integrating BIRT Studio : Providing data : Creating a custom data source : Extended sample ODA example
 
Extended sample ODA example
To implement an extended custom data source, you perform the following programming and configuration tasks:
*Develop an open data access (ODA) data driver to connect to and retrieve data from a data source.
*Develop a query builder that prompts the user to select data, processes the user’s selection, and creates the query to get the data.
*Configure the custom data source for use with BIRT Studio.
An example of an extended ODA data source installs with BIRT Studio. The data source accesses data from an integrated sample database named ClassicModels. To test this custom data source with BIRT Studio, you must first enable the data source, named OdaSampleExt, by setting the data source’s <enabledInEnterpriseMode> attribute in erni_config.xml to true. The erni_config.xml file is stored in the following locations:
In iHub:
<ACTUATE_HOME>\iHub2\servletcontainer\iportal\WEB-INF
In Information Console:
<ACTUATE_HOME>\iPortal\iportal\WEB-INF
Listing 14‑5 shows in bold the <enabledInEnterpriseMode> attribute whose value you change from false to true. Look for the ODA data source named OdaSampleExt.
Listing 14‑5 Configuring the extended sample data source in erni_config.xml
<odaconfig>
<name>OdaSampleExt</name>
<displayName>Extended sample ODA data source</displayName>
<description>An extended sample ODA data source</description>
<datasourceExtensionId>org.eclipse.birt.report.data.oda.jdbc</datasourceExtensionId>
<datasetExtensionId>org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet</datasetExtensionId>
<enabledInWorkgroupMode>true</enabledInWorkgroupMode>
<enabledInEnterpriseMode>true</enabledInEnterpriseMode>
<entryPoint>/OdaSample</entryPoint>
</odaconfig>
After you enable the extended sample data source, restart the appropriate Windows service, and open BIRT Studio. When prompted, select one of the standard report templates. The Data Source dialog box, as shown in Figure 14‑14, prompts you to select a data source. Select Extended sample ODA data source.
Figure 14‑14 Selecting a data source
A query builder page, as shown in Figure 14‑15, prompts you to select the data to use in the report.
Figure 14‑15 Building a query
After you select the data and choose OK, the query builder closes, and the data you selected appears under Available Data, as shown in Figure 14‑16.
Figure 14‑16 Selected data appears under Available Data