[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application

Stefano,

I believe I understand and I do not think the viewer plugin can work this way. One way may be to use the BIRT runtime and copy the viewer plugin and its required plugins to birt runtime plugins directory and then do a platform startup. I have not tried this though.

Jason

Stefano Zaccaria wrote:
Oh, Jason, how much patience!

Thanks again for you answers,
I'm sorry for my bad English...
Ok, I try again to explain my project. I want to use the birt viewer plugin in my swt application. My swt application is not a rcp application neither a plugin project, it only a simple swt application as you can see in my last snippet. I put in the class path of my application the plugin that contain org.eclipse.birt.report.viewer.utilities.WebViewer
and com.ibm.icu


I hope that this could help you... then me :-)

Thanks!

Stefano,

Can you email me the project or explain how you setup the project?
When you call the startup for the WebViewer this should start the required plugins for BIRT.


Jason

Stefano Zaccaria wrote:
Thanks Jason for you replay.

First off, I want to be sure that you understand that my application don't have the rcp style, I want run this plugin inside my swt application where I use some jface class. So my application don't use the rcp framework and as you can see from my snippet i want to test the use of webviewer plugin with the swt browser class.

Now, I put some plugin in the class path of this application ( I saw that the vm trows some null pointer exception and so I try to meet its request ;-) ), but I suppose that the problem is inside the osgi framework, because it not be instantiate by my snippet.

Thanks thousand!



Stefano,

Do you have all the plugins that the viewer requires in your plugins directory and did you add the viewer plugin to your project dependecies?

Jason

Stefano Zaccaria wrote:
First off, good year to all!!!

Second, I need some help for you!

In my swt application i want run a "org.eclipse.birt.report.viewer.utilities.WebViewer" BIRT plugin

This is my snippet:


public class TestWebBrowser {

   public static void main(String[] args) {

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("BIRT Example");
final Browser browser;
try {
browser = new Browser(shell, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browser: " + e.getMessage());
return;
}


       WebViewer.startup(browser);

       try {

WebViewer.display("C:\\birt\\prova.rptdesign", WebViewer.HTML, browser, "frameset");
} catch (Exception e) {
// logger.error(e);
e.printStackTrace();
}


       shell.open();             while (!shell.isDisposed()) {
           if (!display.readAndDispatch())
               display.sleep();
       }
       display.dispose();
   }
}

When I run this snippet i received this error:

Exception in thread "main" java.lang.NullPointerException
at org.eclipse.birt.report.viewer.ViewerPlugin.getResourceString(ViewerPlugin.java:159)


at org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedResourceString(ViewerPlugin.java:181)

at org.eclipse.birt.report.viewer.utilities.WebappAccessor.getWebappPath(WebappAccessor.java:152)

at org.eclipse.birt.report.viewer.utilities.WebappAccessor.start(WebappAccessor.java:68)

at org.eclipse.birt.report.viewer.utilities.WebViewer.startWebApp(WebViewer.java:369)

at org.eclipse.birt.report.viewer.utilities.WebViewer.startup(WebViewer.java:410)

   at it.cedacosrl.test.TestWebBrowser.main(TestWebBrowser.java:28)

Now, the problem ( I suppose ) is in the "WebappAccessor" class where the row: "Bundle bundle = Platform.getBundle( pluginId );"
try to load the resource bundle of "org.eclipse.birt.report.viewer.utilities.WebViewer".
Obviously the problem is in the osgi, where there is not load the necessary bundle.
Somebody can have a idea to give me?
Thanks in advance.


Stefano