Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Platform.startup()
Platform.startup() [message #541140] Fri, 18 June 2010 13:03 Go to next message
bob is currently offline bobFriend
Messages: 60
Registered: July 2009
Member
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?
Re: Platform.startup() [message #541184 is a reply to message #541140] Fri, 18 June 2010 14:55 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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?
Previous Topic:Add column based on grand total
Next Topic:Create data set to MS Access db
Goto Forum:
  


Current Time: Thu Apr 25 09:11:37 GMT 2024

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

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

Back to the top