Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » BIRT - ODA - EMF instance
BIRT - ODA - EMF instance [message #726710] Mon, 19 September 2011 06:27 Go to next message
Stein Erik is currently offline 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 #726795 is a reply to message #726710] Mon, 19 September 2011 11:01 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I assume you have seen this link:
http://eclipsecon.org/2011/sessions/?page=sessions&id=2028

I am not certain if this example uses in memory models. This may have
to be done with a scripted dataset. If you have some Java code that
locates the model in memory post it and I can show you how to call this
from BIRT. Also are you using the BIRT engine APIs or the BIRT Viewer?

Jason

On 9/19/2011 6:27 AM, Stein Erik wrote:
> 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 a 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.)
Re: BIRT - ODA - EMF instance [message #726821 is a reply to message #726795] Mon, 19 September 2011 11:59 Go to previous messageGo to next message
Stein Erik is currently offline Stein Erik
Messages: 9
Registered: September 2011
Junior Member
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...)
Re: BIRT - ODA - EMF instance [message #726833 is a reply to message #726821] Mon, 19 September 2011 12:13 Go to previous message
Jason Weathersby is currently offline 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...)
>
Previous Topic:Multible charts in one report using the same data set from scripted data source
Next Topic:dynamic image with Birt 3.7
Goto Forum:
  


Current Time: Fri Aug 29 10:23:48 EDT 2014

Powered by FUDForum. Page generated in 0.03051 seconds