|
Re: Platform.startup() [message #541184 is a reply to message #541140] |
Fri, 18 June 2010 14:55 |
|
If OSGi is already running with the BIRT plugins the static Platform
class will be available. In your code just drop the Platform.startup line.
Jason
On 6/18/2010 9:03 AM, bob wrote:
> I am developing a birt application that should be used as eclipse plugin
> (PDE). In the book:
>
> "Integrating and Extending BIRT"
>
> page 283 it says that its not necessary to start or stop the OSGI
> Platform when using the application in an OSGI context (eg. eclipse PDE
> projects).
>
> In the below code I am creating a ReportDesignHandle:
>
> public void startEngine() {
> SessionHandle session;
> IDesignEngine designEngine;
> DesignConfig designConfig;
> ReportDesignHandle designHandle;
>
> designConfig = new DesignConfig();
> try {
> // Setting to "" since it is a PDE project
> designConfig.setProperty("BIRT_HOME", "");
>
>
> Platform.startup(designConfig);
> IDesignEngineFactory designFactory = (IDesignEngineFactory) Platform
> .createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_E NGINE_FACTORY);
> designEngine = designFactory.createDesignEngine(designConfig);
> session = designEngine.newSessionHandle(ULocale.ENGLISH);
> designHandle = session.createDesign();
>
> } catch (Exception e) {
> logger.error("BIRT engine could not be started!", e);
> }
> }
>
>
> But I don't see how I can avoid starting the Plaform since I need to
> call (which depends on the Platform):
>
> IDesignEngineFactory designFactory = (IDesignEngineFactory) Platform
> .createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_E NGINE_FACTORY);
>
> to create the ReportDesignHandle.
>
> Is there an exception to the rule of not using the Platform in an OSGI
> context when it comes to creating a ReportDesignHandle?
|
|
|
Powered by
FUDForum. Page generated in 0.03267 seconds