Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Build DataSource from code - without external resources?
Build DataSource from code - without external resources? [message #759066] Fri, 25 November 2011 21:53 Go to next message
Anton is currently offline AntonFriend
Messages: 23
Registered: July 2009
Junior Member
I would like to build a datasource from code that does not have any
reference to any external resources on the filesystem, eg. flatfile,
xmlfile, database etc.

As an example a xml datasource can be build like this:



OdaDataSourceHandle dataSourceHandle =
elementFactory.newOdaDataSource(dataSourceName,
org.eclipse.birt.report.data.oda.xml");
dataSourceHandle.setProperty("FILELIST", dataSourceFile);

But how do I build a datasource as a pojo without any reference to external
resources? I have tried:

ElementFactory elementFactory = report.getElementFactory();
OdaDataSourceHandle dataSourceHandle =
elementFactory.newOdaDataSource(dataSourceName);

but how do I populate it with some content that I can next connect a dataset
to? Maybe there are some examples showing how this can be done?
Re: Build DataSource from code - without external resources? [message #759507 is a reply to message #759066] Mon, 28 November 2011 20:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you wanting to create a scripted datasource?
Take a look at the attached example.

Jason

On 11/25/2011 4:53 PM, Anton wrote:
> I would like to build a datasource from code that does not have any
> reference to any external resources on the filesystem, eg. flatfile,
> xmlfile, database etc.
>
> As an example a xml datasource can be build like this:
>
>
>
> OdaDataSourceHandle dataSourceHandle =
> elementFactory.newOdaDataSource(dataSourceName,
> org.eclipse.birt.report.data.oda.xml");
> dataSourceHandle.setProperty("FILELIST", dataSourceFile);
>
> But how do I build a datasource as a pojo without any reference to
> external resources? I have tried:
>
> ElementFactory elementFactory = report.getElementFactory();
> OdaDataSourceHandle dataSourceHandle =
> elementFactory.newOdaDataSource(dataSourceName);
>
> but how do I populate it with some content that I can next connect a
> dataset to? Maybe there are some examples showing how this can be done?
Re: Build DataSource from code - without external resources? [message #878958 is a reply to message #759507] Wed, 30 May 2012 09:14 Go to previous messageGo to next message
Seton GNANHA is currently offline Seton GNANHAFriend
Messages: 1
Registered: May 2012
Junior Member
Hello!
I'm a biginner with Birt and I have a same problem.
Actually i need to buid an EMF ECORE Data source from code and i cannot find any solutions.
Help me please! Jason?

Thanks
Anicet
Re: Build DataSource from code - without external resources? [message #879292 is a reply to message #878958] Wed, 30 May 2012 23:24 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You may want to look over these threads


http://www.eclipse.org/forums/index.php/t/216203/
http://wiki.eclipse.org/Ecore_ODA_Driver#Using_the_Driver_to_Create_BIRT_Reports
http://eclipsecon.org/2011/sessions/?page=sessions&id=2028
Older post on Ecore ODA
http://timezra.blogspot.com/2008/04/oda-ecore-getting-started-guide.html

Jason


n 5/30/2012 5:14 AM, Anicet HOUNKPE wrote:
> Hello!
> I'm a biginner with Birt and I have a same problem.
> Actually i need to buid an EMF ECORE Data source from code and i cannot
> find any solutions.
> Help me please! Jason?
>
> Thanks Anicet
Previous Topic:BIRT Webservice ODA integration with JIRA
Next Topic:java.lang.Integer cannot be cast to java.lang.Long - When trying to connect to MySQL
Goto Forum:
  


Current Time: Fri Nov 28 17:14:02 GMT 2014

Powered by FUDForum. Page generated in 0.01576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software