Community
Participate
Working Groups
Accessign classes used also by an ODA runtime plugin is possible when embedding BIRT in your app, i.e. at the deployment phase. This is made possible by registering the correct classloader like described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272 However, javascript still fails to find classes inside an ODA driver in * BIRT RCP designer's preview, thus making designing reports more difficult (now working preview) * BIRT runtime's genReport.bat (/.sh also I suppose), thus making that tool unusable if you need javascript access to your own classes Being able to access classes exported from an ODA runtime driver plugin from javascript makes it easier to implement an ODA plugin as, at least in my case, there is some data that is not natural to provide as a result set and I'd like to let the report maker access that with javascript. I am wrapping a native library, so having more than one classloader load my classes will result in problems. Also in general I think it is cleaner to have the classes loaded only once. I'm saying this as it means the classloader javascript uses should then either ask for the classes it needs from the ODA plugins' classloaders OR there should be a way to access the classloaders used by a named ODA plugin from javascript. The latter is propably simpler and cleaner. Or maybe some other solution?
This appears to be the same issue as in bug 190500. I tried to use buddy classloading by appending this to my plugin's manifest.mf: Eclipse-RegisterBuddy: org.eclipse.birt.report.data.adapter,org.eclipse.tomcat It didn't help, so maybe I didn't choose the right buddies? *** This bug has been marked as a duplicate of bug 190500 ***
Sorry, actually this is not a duplicate to bug 190500, but it's related. With some help I got in birt newsgroup I was able to resolve the issue for the RCP designer. The solution is to enable buddying in org.eclipse.birt.report.viewer plugin's manifest.mf like this: Eclipse-BuddyPolicy: registered and then registering my ODA runtime plugin as its buddy in its manifest.mf: Eclipse-RegisterBuddy: org.eclipse.birt.report.viewer Now the javascript snippets in the report are able to access classes exported by my ODA runtime plugin when using RCP designer's preview. So I suggest adding buddypolicy registered to org.eclipse.birt.report.viewer's manifest.mf as then one would not need to modify rcp designer installation's plugins to get things working. I suppose the same idea would work for genReport.bat, i.e. modify the suitable plugin's manifest to enable buddying and then be buddies with it. I don't know which plugin it should be, though. It would be useful to get genReport.bat working, but I do not have the time to look into it right now.
This bug is actually not only about the accessing of Classes that defined in ODA runtime, but also the accessing to the Classes that in a loaded plugin in java scripting. Our current policy in finding a java Class in javascript is: 1.Using the user defined classloader. 2.Search particular location, say "scriptlib" directory. We need to consider whether to allow alternative approaches.
Add Eclipse-BuddyPolicy: registered in MANIFEST.MF