Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to programmatically instanciate a unique data source ?‏(In BIRT RCP Designer...)
How to programmatically instanciate a unique data source ?‏ [message #1289835] Wed, 09 April 2014 17:37 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

Following BIRT FAQ, I recently cloned the BIRT Git repository.
I then made some changes to 'org.eclipse.birt.designer.ui.rcp' to adapt the BIRT RCP Designer to my needs.

Now I would like to perform one more modification that, I guess, should take place in another plug-in but I don't know where to start.

I would like to programmatically instanciate a data source at the application startup.
Can anyone tell me how to achieve this ?

Moreover, I would like to make sure this data source will be the only one and can't be modified or deleted by the users.

How to disable the data source creation in the 'Data' menu, 'Data Explorer' and 'Outline' ?

How to disable the context menu for the instanciated data source ?

How to change or even remove the data source property sheet ?

Kind regards,

Laurent
Re: How to programmatically instanciate a unique data source ?‏ [message #1292396 is a reply to message #1289835] Fri, 11 April 2014 19:43 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi again,

I found some answers...
Automatically declare a data source in a new report (and not at application start...) can be done in NewReportWizard.doFinish the following way :

// Create a data source (this must be done in the display thread)
Display display = PlatformUI.getWorkbench().getDisplay();
display.syncExec(new Runnable() {public void run() {
  try {
    OdaDataSourceHandle ds =
      handle.getElementFactory().newOdaDataSource("myDSName", "myDSId");
   handle.addElement(ds, handle.getDataSources().getSlotID());
  } catch (ContentException e) {
    ExceptionUtil.handle(e);
  } catch (NameException e) {
    ExceptionUtil.handle(e);                
  }
}});


To get rid of the data source creation action and the data source context menu, one must modify DataActionsContributionItem, EditableDataSourcesNodeProvider and EditableDataSourceNodeProvider classes accordingly in the org.eclipse.birt.report.designer.data.ui plug-in.

Until now, I couldn't figure out where the data source property sheet page is implemented... Could somebody please give me a clue ?

Kind regards,

Laurent
Previous Topic:bar chart with 2 y-axes
Next Topic:Table cell tooltip
Goto Forum:
  


Current Time: Thu Apr 25 16:50:52 GMT 2024

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

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

Back to the top