| BIRT - ODA - EMF instance [message #726710] |
Mon, 19 September 2011 06:27  |
Stein Erik Messages: 9 Registered: September 2011 |
Junior Member |
|
|
Is it possible to setup a BIRT Data Source (using ODA) to access an Ecore model which is already instanciated in memory?
The tutorials I have discovered so far are only able to create a Data Source from an Ecore xmi file. I am apparently not smart enough to, by myself, figure out howto create a connection to an Ecore model/resource already floating in memory.
Code snippet that illustrate how to setup the Data Source in such a manner would be very appreciated! (and possibly how to create/access a Data Set afterwards...maybe to much to ask for in one go...)
(Ps. The background is that I am trying to develop an EMF centric application where several Views are accessing/manipulating the EMF model. BIRT would be helpful to visualize some of that data. Ds.)
[Updated on: Mon, 19 September 2011 06:28] Report message to a moderator
|
|
|
|
|
| Re: BIRT - ODA - EMF instance [message #726833 is a reply to message #726821] |
Mon, 19 September 2011 12:13  |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
First thing look at how a scripted data source works:
http://www.eclipse.org/birt/phoenix/examples/scripting/
another example:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/255-birt-scripted-datasource-example-design/
To call your classes from a beforeOpen event just import the package like:
importPackage(Packages.my.model.package);
to get the model you can then call:
//assuming a static method
var mymodel = ModelResource.getInstance().eModel();
You will also need to use the importPackage call on emf packages that
are required to navigate your model.
Jason
On 9/19/2011 11:59 AM, Stein Erik wrote:
> Excellent, thanks so much.
>
> The rigup is to be a BIRT Engine API. Attached is some code extract. At least I hope it is relevant! The InformationFormView is accessing the ModelResource. ModelResource acts as the central point for the common EMF model and is accessed by several other Views Hope this makes sense.
>
> (I believe the supplied EditingDomain will be irrelvant for the BRIT access though since it will just need to strip out data? Well, maybe not. It needs to be notified if EMF data changes. Just a sidestep discussion by myself...)
>
Jason Weathersby
BIRT Exchange
|
|
|
Powered by
FUDForum. Page generated in 0.01815 seconds