Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Ecore ODA Driver"

(Interim Driver)
 
(37 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
The Ecore ODA Driver was created to allow an [[EMF ECore]] model to serve as an [[Connectivity#Open Data Access (ODA) Framework|ODA]] data source. The primary consumer of ODA data sources is [[BIRT Project|BIRT]]. Any ODA drivers registered with the platform show up within BIRT as data source types, each with a wizard to allow for the entry of connection information. In the case of the Ecore ODA Driver, the only information required is the path to a serialized Ecore model of a registered model type. (If you aren't familiar with registering EMF models, see this question in the [[EMF-FAQ#I get a PackageNotFoundException: e.g., "Package with uri 'http://com.example.company.ecore' not found." What do I need to do?|EMF FAQ]].)
+
The Ecore ODA Driver was created to allow an [[EMF ECore]] model to serve as an [[Connectivity#Open Data Access (ODA) Framework|ODA]] data source. This makes it simple for [[BIRT Project|BIRT]] reports to draw data from Ecore models.
  
== Installation ==
+
The Ecore ODA Driver has been implemented in two projects:
 +
# An interim driver was created as a [[DTP Incubator]] project. Its latest status can be found in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=132958 Bugzilla 132958].
 +
# A second  ''official'' and more functional ODA driver has been added to [[EMF ECore]] for [[Indigo]] M4. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=330988 bug 330988] for details. This official [[EMF]] implementation effectively obsoletes the interim [[DTP Incubator]] implementation.
  
The Ecore ODA Driver is only available from [[#CVS|CVS]]. The driver has a number of dependencies that may be un-met in your workspace: [[Connectivity|Datatools Connectivity]], [http://www.eclipse.org/modeling/emft/?project=search#search EMF Search], [http://www.eclipse.org/modeling/emf/?project=transaction#transaction EMF Transaction], and [http://www.eclipse.org/modeling/emf/?project=query#query EMF Query].  You will also need to install the EMF Model Query OCL Integration feature (or the "Next" button on the New Data Source Wizard for the Ecore ODA Data Source will be disabled) and the Data Tools Platform Enablement for JDBC (or you will see assertion failures in the ConnectionProfileManager for a missing generic db JDBC profile).
+
== Data Tools Platform Incubating Ecore ODA Driver ==
  
== Using the Driver ==
+
=== Tutorial ===
Toolwise, the primary beneficiary of the Ecore ODA driver is [http://www.eclipse.org/birt/phoenix/ BIRT], which you've presumably installed. To use the Ecore ODA Driver, un the BIRT Report Designer and create a new report.  You might want to install the EMF Examples from [http://www.eclipse.org/modeling/emf/updates] and create an instance of an .extlibrary file if you don't already have a serialized EMF model to use as your report data source.  When adding a Data Source, a new type will display <tt>Ecore ODA Data Source</tt> and the wizard will allow you to choose a file.  Selecting and naming this Data Source and giving the name of a file will allow you to enter a new Data Set.
+
  
== CVS ==
+
Tim Myer has written a tutorial for the Ecore ODA Driver at [http://timezra.blogspot.com/2008/04/oda-ecore-getting-started-guide.html Overcoming Fear].
  
The Ecore ODA Driver and UI can be checked out of CVS from the <tt>Datatools_Project</tt> Repository of <tt>dev.eclipse.org</tt> with a path of <tt>org.eclipse.datatools.incubator/plugins</tt>.
+
=== Installation ===
  
Browse: [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.datatools.incubator/plugins/?root=Datatools_Project ViewCVS]
+
The DTP Incubating ECore ODA Driver build package (for the Indigo release) is available on the [http://www.eclipse.org/datatools/downloads.php DTP downloads] page.
 +
<br>Due to no new development activities, the incubating project will no longer be built for the Juno release.
 +
 
 +
=== DTP Git Source Repository ===
 +
 
 +
The Ecore ODA Driver and UI source codes are maintained in the Eclipse DTP Git repository: <tt>org.eclipse.datatools.incubator.git</tt>.
 +
<br>For anonymous read access, use the <tt>git</tt> or <tt>http</tt> protocol.  E.g.
 +
  git://git.eclipse.org/gitroot/datatools/org.eclipse.datatools.incubator.git
 +
 
 +
Browse:  
 +
<br>Or use a web browser to browse the content of the [http://git.eclipse.org/c/datatools/org.eclipse.datatools.incubator.git/ DTP Incubator Git]
 +
 
 +
=== Backport to Eclipse 3.2, EMF 2.2 and JDK 1.4 ===
 +
 
 +
For the original driver, a backport of these plug-ins was checked-in to [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.datatools.incubator/plugins/?root=Datatools_Project CVS] for use with Eclipse 3.2, EMF 2.2 and JDK 1.4.  The backport has no guarantee of future support.  If you would like instructions for using these versions of the plug-ins, please look [http://timezra.blogspot.com/2008/05/oda-ecore-driver-backport.html here].
 +
 
 +
=== Connection Properties and Profiles ===
 +
 
 +
In order to support requests for [https://bugs.eclipse.org/bugs/show_bug.cgi?id=243099 Connection Profiles] and [https://bugs.eclipse.org/bugs/show_bug.cgi?id=243499 Connection Properties], we made some changes as of August 22, 2008 that will affect existing reports, i.e., the Model file location is now stored directly as a URI, the property for this URI has been renamed, Column Selections are contained in a single property (instead of in properties with increasing numbers), and the name of the Column Selection property has been changed.  Hopefully these fixes will not be too disruptive to existing reports and the benefit of dynamic property binding will outweigh the inconvenience of either manually editing existing reports or re-creating those reports.
 +
 
 +
== EMF Driver ==
 +
 
 +
=== Tutorial ===
 +
 
 +
* Download and install the BIRT All-In-One from http://download.eclipse.org/birt/downloads/
 +
* Start up Eclipse and and install EMF and the EMF ODA Driver
 +
** Help | Install New Software | Site: Indigo
 +
** In the Modeling folder select
 +
*** EMF - Eclipse Modeling Framework SDK
 +
*** EMF Model Query SDK
 +
*** EMF ODA SDK
 +
*** OCL End User SDK
 +
* After the install of the EMF Framework and ODA SDKs, reboot Eclipse and create sample EMF model, edit and the editor projects in your workspace:
 +
** New | Examples | Eclipse Modeling Framework | Extended Library Model Example.
 +
* In order to write reports on instances of the Extended Library Model, the library model has to be registered.  The easiest way to do this is to launch an Eclipse Application using the 3 library projects.
 +
** Right click on the org.eclipse.emf.examples.library.editor project and launch an Eclipse Application
 +
*** Run as | Eclipse Application
 +
* After the launched workspace comes up create a BIRT Report project.
 +
* Create an instance of the library model in order to report on it.
 +
** New | Example EMF Model Creation Wizards | EXTLibrary Model
 +
** A New Dialog window will be displayed
 +
*** Use your new BIRT Report Project as the parent of the library model document
 +
*** For the Model Object select Library, keep UTF-8 as the encoding
 +
** The library model document will be created and will open in a EXTLibrary Editor.
 +
* Edit the  Library document to set something for the name and an address properties.
 +
** In the editor unfold the root entity to expose the Library element of the model
 +
** Select the Library element and right click to open a popup menu.
 +
** Select ''Show Properties View''
 +
** In the properties view edit the properties for Name and Address and save your file.
 +
* Create a blank BIRT report and add a datasource pointing to the model instance document you just created.
 +
** ''You can browse the Workspace to your BIRT Report Project and select the library model document you just saved''
 +
* Create a dataset referencing the just created datasource with the values:
 +
    Query Delegate: http://www.eclipse.org/emf/2002/ECore/OCL
 +
    Context Type:  extlibrary.Library
 +
    Query Text:    self
 +
    Result Type:    extlibrary.Library
 +
* You should now be able to create your BIRT Report using this dataset
 +
 
 +
=== Classloader Issue ===
 +
Depending on your model you may or may not encounter the need to configure Report Designer Classpath user preferences.  [https://bugs.eclipse.org/bugs/show_bug.cgi?id=359306 See Bugzilla 359306]
 +
 
 +
=== EclipseCon Talk ===
 +
2011 [[EclipseCon]] Session: [http://eclipsecon.org/2011/sessions/?page=sessions&id=2028 Reports and Charts right from your EMF models]
 +
 
 +
 
 +
=== Installation ===
 +
 
 +
EMF ODA Driver SDK can be obtained through the [[p2]] Eclipse Modeling Project Update Site - http://www.eclipse.org/modeling/updates/
 +
 
 +
* ''The EMF ODA Driver builds are not yet available for download as a zips.''
 +
 
 +
=== CVS ===
 +
 
 +
The EMF Ecore ODA Driver and UI can be checked out of CVS from the <tt>Modeling</tt> Repository of <tt>dev.eclipse.org</tt> with a path of <tt>/cvsroot/modeling</tt>.
 +
 
 +
You will find the EMF Driver implemented as features under org.eclipse.emf/features:
 +
* org.eclipse.emf.oda-feature
 +
* org.eclipse.emf.oda.ecore-feature
 +
* org.eclipse.emf.oda.ecore.ui-feature
 +
 
 +
 
 +
== Dependencies ==
 +
 
 +
After obtaining the code, you may notice the drivers have a number of dependencies that might be un-met in your workspace:
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Dependency
 +
! Download Site
 +
|-
 +
| [http://www.eclipse.org/birt/phoenix/ BIRT Report Designer]
 +
| [http://download.eclipse.org/birt/downloads/ http://download.eclipse.org/birt/downloads/]
 +
|-
 +
| [[Connectivity|Datatools Connectivity]]
 +
| [http://www.eclipse.org/datatools/downloads.php http://www.eclipse.org/datatools/downloads.php]
 +
|-
 +
| [http://www.eclipse.org/modeling/emf/?project=query#query EMF Query]
 +
| [http://www.eclipse.org/modeling/emf/downloads/?project=query http://www.eclipse.org/modeling/emf/downloads/?project=query]
 +
|-
 +
| [http://www.eclipse.org/modeling/mdt/?project=ocl Object Constraint Language (OCL) Integration]
 +
| [http://www.eclipse.org/modeling/mdt/downloads/?project=ocl http://www.eclipse.org/modeling/mdt/downloads/?project=ocl]
 +
|}
 +
 
 +
== Using the Driver to Create BIRT Reports ==
 +
 
 +
Those less familiar with EMF or without a handy EMF model should install the EMF Examples from [http://www.eclipse.org/modeling/emf/updates http://www.eclipse.org/modeling/emf/updates] and create an instance of an .extlibrary file with some data. It's outside the scope of this document to describe this process, but typical readers will already have familiarity with EMF editors.
 +
 
 +
Of course, any serialized EMF model will do, as long as the package has been registered so that the Java classes representing the model are available at runtime.
 +
 
 +
=== Create a Report ===
 +
 
 +
The primary consumer of ODA data sources is [[BIRT Project|BIRT]]. Typically, creating a [[BIRT Project|BIRT]] report is the first step to using the Ecore ODA Driver.
 +
 
 +
=== Create an Ecore ODA Data Source ===
 +
 
 +
Any ODA driver registered with the platform show up within BIRT as data source types, each with a wizard to allow for the entry of connection information. In the case of the Ecore ODA Driver, the only information required by the connection is the path to a serialized Ecore model of a registered model type. (If you aren't familiar with registering EMF models, see [[EMF/FAQ#I get a PackageNotFoundException: e.g., "Package with uri 'http://com.example.company.ecore' not found." What do I need to do?|this question]] in the [[EMF/FAQ]].) Attempting to load a serialized model for an unregistered package will result in an error.
 +
 
 +
=== Create an Ecore ODA Data Set ===
 +
 
 +
Once a data source has been created for your Ecore model, use the New Data Set wizard to launch the Ecore ODA Data Set Wizard.
 +
 
 +
''...to be continued... Feature changes in process--screen shots forthcoming...''

Latest revision as of 18:26, 18 January 2012

Introduction

The Ecore ODA Driver was created to allow an EMF ECore model to serve as an ODA data source. This makes it simple for BIRT reports to draw data from Ecore models.

The Ecore ODA Driver has been implemented in two projects:

  1. An interim driver was created as a DTP Incubator project. Its latest status can be found in Bugzilla 132958.
  2. A second official and more functional ODA driver has been added to EMF ECore for Indigo M4. See bug 330988 for details. This official EMF implementation effectively obsoletes the interim DTP Incubator implementation.

Data Tools Platform Incubating Ecore ODA Driver

Tutorial

Tim Myer has written a tutorial for the Ecore ODA Driver at Overcoming Fear.

Installation

The DTP Incubating ECore ODA Driver build package (for the Indigo release) is available on the DTP downloads page.
Due to no new development activities, the incubating project will no longer be built for the Juno release.

DTP Git Source Repository

The Ecore ODA Driver and UI source codes are maintained in the Eclipse DTP Git repository: org.eclipse.datatools.incubator.git.
For anonymous read access, use the git or http protocol. E.g.

 git://git.eclipse.org/gitroot/datatools/org.eclipse.datatools.incubator.git

Browse:
Or use a web browser to browse the content of the DTP Incubator Git

Backport to Eclipse 3.2, EMF 2.2 and JDK 1.4

For the original driver, a backport of these plug-ins was checked-in to CVS for use with Eclipse 3.2, EMF 2.2 and JDK 1.4. The backport has no guarantee of future support. If you would like instructions for using these versions of the plug-ins, please look here.

Connection Properties and Profiles

In order to support requests for Connection Profiles and Connection Properties, we made some changes as of August 22, 2008 that will affect existing reports, i.e., the Model file location is now stored directly as a URI, the property for this URI has been renamed, Column Selections are contained in a single property (instead of in properties with increasing numbers), and the name of the Column Selection property has been changed. Hopefully these fixes will not be too disruptive to existing reports and the benefit of dynamic property binding will outweigh the inconvenience of either manually editing existing reports or re-creating those reports.

EMF Driver

Tutorial

  • Download and install the BIRT All-In-One from http://download.eclipse.org/birt/downloads/
  • Start up Eclipse and and install EMF and the EMF ODA Driver
    • Help | Install New Software | Site: Indigo
    • In the Modeling folder select
      • EMF - Eclipse Modeling Framework SDK
      • EMF Model Query SDK
      • EMF ODA SDK
      • OCL End User SDK
  • After the install of the EMF Framework and ODA SDKs, reboot Eclipse and create sample EMF model, edit and the editor projects in your workspace:
    • New | Examples | Eclipse Modeling Framework | Extended Library Model Example.
  • In order to write reports on instances of the Extended Library Model, the library model has to be registered. The easiest way to do this is to launch an Eclipse Application using the 3 library projects.
    • Right click on the org.eclipse.emf.examples.library.editor project and launch an Eclipse Application
      • Run as | Eclipse Application
  • After the launched workspace comes up create a BIRT Report project.
  • Create an instance of the library model in order to report on it.
    • New | Example EMF Model Creation Wizards | EXTLibrary Model
    • A New Dialog window will be displayed
      • Use your new BIRT Report Project as the parent of the library model document
      • For the Model Object select Library, keep UTF-8 as the encoding
    • The library model document will be created and will open in a EXTLibrary Editor.
  • Edit the Library document to set something for the name and an address properties.
    • In the editor unfold the root entity to expose the Library element of the model
    • Select the Library element and right click to open a popup menu.
    • Select Show Properties View
    • In the properties view edit the properties for Name and Address and save your file.
  • Create a blank BIRT report and add a datasource pointing to the model instance document you just created.
    • You can browse the Workspace to your BIRT Report Project and select the library model document you just saved
  • Create a dataset referencing the just created datasource with the values:
   Query Delegate: http://www.eclipse.org/emf/2002/ECore/OCL
   Context Type:  extlibrary.Library
   Query Text:    self
   Result Type:    extlibrary.Library
  • You should now be able to create your BIRT Report using this dataset

Classloader Issue

Depending on your model you may or may not encounter the need to configure Report Designer Classpath user preferences. See Bugzilla 359306

EclipseCon Talk

2011 EclipseCon Session: Reports and Charts right from your EMF models


Installation

EMF ODA Driver SDK can be obtained through the p2 Eclipse Modeling Project Update Site - http://www.eclipse.org/modeling/updates/

  • The EMF ODA Driver builds are not yet available for download as a zips.

CVS

The EMF Ecore ODA Driver and UI can be checked out of CVS from the Modeling Repository of dev.eclipse.org with a path of /cvsroot/modeling.

You will find the EMF Driver implemented as features under org.eclipse.emf/features:

  • org.eclipse.emf.oda-feature
  • org.eclipse.emf.oda.ecore-feature
  • org.eclipse.emf.oda.ecore.ui-feature


Dependencies

After obtaining the code, you may notice the drivers have a number of dependencies that might be un-met in your workspace:

Dependency Download Site
BIRT Report Designer http://download.eclipse.org/birt/downloads/
Datatools Connectivity http://www.eclipse.org/datatools/downloads.php
EMF Query http://www.eclipse.org/modeling/emf/downloads/?project=query
Object Constraint Language (OCL) Integration http://www.eclipse.org/modeling/mdt/downloads/?project=ocl

Using the Driver to Create BIRT Reports

Those less familiar with EMF or without a handy EMF model should install the EMF Examples from http://www.eclipse.org/modeling/emf/updates and create an instance of an .extlibrary file with some data. It's outside the scope of this document to describe this process, but typical readers will already have familiarity with EMF editors.

Of course, any serialized EMF model will do, as long as the package has been registered so that the Java classes representing the model are available at runtime.

Create a Report

The primary consumer of ODA data sources is BIRT. Typically, creating a BIRT report is the first step to using the Ecore ODA Driver.

Create an Ecore ODA Data Source

Any ODA driver registered with the platform show up within BIRT as data source types, each with a wizard to allow for the entry of connection information. In the case of the Ecore ODA Driver, the only information required by the connection is the path to a serialized Ecore model of a registered model type. (If you aren't familiar with registering EMF models, see this question in the EMF/FAQ.) Attempting to load a serialized model for an unregistered package will result in an error.

Create an Ecore ODA Data Set

Once a data source has been created for your Ecore model, use the New Data Set wizard to launch the Ecore ODA Data Set Wizard.

...to be continued... Feature changes in process--screen shots forthcoming...

Back to the top