REST API ODA PLUGIN FOR BIRT

arjung
edited February 11, 2022 in Analytics #1
contest_winner_ribbon_small.pngThis DevShare submission qualifies for the Autumn 2012 Plug In 2 BIRT Contest!<br />
<br />
We have ODA plug-ins for many data sources, and they are very much helpful in creating custom reports. But we don’t have a generic plug-in which can be used to get data from common data sources. It will be amazing if we have a single Plug-in which can go fetch data like ESPN sports details, BBC news Details, Social media details including facebook and twitter , Yahoo Query language, Google Search and even databases like JIRA and ORACLE. And many more. <br />
<br />
How this is possible ? Almost every data source has a support for REST API and if we have a plugin which can communicate in the language of REST, the above is possible. And now here it is. A REST API plug-in which supports JSON responses and prepares data for you from the response. It also helps you to configure your response and play with the data type and all. <br />
<br />
There are some limitations with the plug-in for now. Say it can support only JSON response. Even though all REST API’s supports JSON, the plug-in can be amazing if it can support XML also. But these limitations can be fixed for sure in the later releases.<br />
<br />
There is a sample report attached with the submission. Don’t go with the design in as I am bad in designing pages. But for sure you can understand the data source and data set configurations.Also you can see some sample queries. You can get hundreds of them online..but most of them requires API key for the use. <br />
<br />
Any doubts feel free to ask..I need your help to find the bugs and fix them all.<br />
<br />
Also there are some sample queries.You can get queries from net for all data sources. But you should be having API key if the data source is not open to public. Then you have to prepare the http Request and this can be used in the the plug-in

Comments

  • Hi Arjung,

    I have been struggling for last couple of weeks to get through doing a report having the datasource from a rest API. Finally came upon your post today and was very hopeful as it looked exactly like what i wanted.

    But when creating the datasource and testing the connection on the httprequest, I get a ping failed message. The endpoint is valid. Would be very helpful if you can help me out with this. The following is the detailed message:

    org.eclipse.datatools.connectivity.oda.OdaException ;
    java.lang.NullPointerException

    at org.eclipse.datatools.connectivity.oda.profile.OdaConnectionWrapper.open(OdaConnectionWrapper.java:215)
    
    at org.eclipse.datatools.connectivity.oda.profile.OdaConnectionWrapper.<init>(OdaConnectionWrapper.java:59)
    
    at org.eclipse.datatools.connectivity.oda.profile.OdaConnectionFactory.createConnection(OdaConnectionFactory.java:26)
    
    at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
    
    at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)
    
    at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
    
    at org.eclipse.datatools.connectivity.oda.design.internal.ui.DataSourceWizardPageCore$1.run(DataSourceWizardPageCore.java:244)
    
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    
    at org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage.testConnection(ConnectionProfileDetailsPage.java:194)
    
    at org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage$2.widgetSelected(ConnectionProfileDetailsPage.java:131)
    
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
    
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
    
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
    
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
    
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
    
    at org.eclipse.jface.window.Window.open(Window.java:794)
    
    at org.eclipse.birt.report.designer.data.ui.actions.NewDataSourceAction.run(NewDataSourceAction.java:127)
    
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
    
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
    
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
    
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
    
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
    
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
    
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
    
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
    
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
    
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    
    at java.lang.reflect.Method.invoke(Unknown Source)
    
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    
    at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
    

    Caused by: java.lang.NullPointerException

    at org.eclipse.birt.report.data.oda.restapi.impl.Connection.open(Connection.java:50)
    
    at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:250)
    
    at org.eclipse.datatools.connectivity.oda.profile.OdaConnectionWrapper.open(OdaConnectionWrapper.java:209)
    
    ... 47 more
    
  • I too am having the same issue... Can anyone help with this?

    Thanks,
    Scott