|Re: deploying birt with a jar file [message #660264 is a reply to message #660036]
||Thu, 17 March 2011 15:11
| Jason Weathersby
Registered: July 2009
Right now (BIRT 2.6.2) requires the OSGi runtime which can be packaged |
but needs to be expanded before it runs. This is explained here:
IPlatformContext - Web Based Plugin Loading
By default BIRT loads plug-ins located in the BIRT_HOME/plugins
directory. The plug-ins loaded provide functionality for connecting to
data sources, emitters (eg, PDF, WORD, XLS, HTML ...), and chart
rendering. BIRT_HOME in the examples on this page is set using the
setEngineHome method of the EngineConfig class. BIRT loads these
plug-ins using the Java File API.
This method is usually sufficient. If deployed to a web application, the
developer can usually call ServletContext.getRealPath to retrieve the
real path and set the BIRT_HOME accordingly. This can present a problem
when deploying to a war file. Certain application servers will return
null when getRealPath is called. This will result in the plug-ins not
The IPlatformContext interface describes the methods needed to load the
resources required by the BIRT runtime. Within BIRT there are two
implementations of this interface, PlatformFileContext() and
PlatformServletContext(). The Platform Context is set using the
setEngineContext method of the EngineConfig class. If this method is not
called it defaults to PlaformFileContext() and uses the Java File API to
load the resources. The PlatformServletContext class uses Resource based
operations. So if you are deploying an application to the Web that uses
the BIRT API and it is not contained in a war you can use the default
and set your engine home to something similar to:
The BIRT Viewer application will load the plug-ins from /WEB-INF/Plugins
directory. If you deploy your application in a war, setup your code like:
//this causes the plug-in loader to look in the current directory.
//Using the PlatformServletContext will cause the OSGi loader to look
//plug-ins in the WEB-INF/Platform directory. If this directory
//does not exist create it.
//Next copy the plug-ins directory from the ReportEngine directory to
//the WEB-INF/Platform/ directory.
IPlatformContext context = new PlatformServletContext( sc );
config.setPlatformContext( context );
In BIRT 3.7 we have a project to deploy birt in a much simpler fashion.
Here is the project plan
http://www.eclipse.org/projects/project-plan.php?planurl=htt p://www.eclipse.org/birt/project/plan/birt_project_plan_3_7. xml
and the bug tracking this feature is
On 3/16/2011 11:39 AM, SabanU wrote:
> hi friends,
> i want to write a report api.
> this api will have some methods that accepts a cvs file and a report
> design and generates pdf or html output.
> if i cannot pass birt report design file as a parameter i'm thingking to
> pass only report type and design the report using design engine api on
> the fly (thats ok, there is no problem i think)
> after all, i want to archive my application as jar file and give this
> jar file and birt's report engine jar files to the users who want to
> generate reports.
> i'm wondering that is it possible to deploy such an application without
> installing anything on the computer (in other words, is it enough to
> give only my api's jar file, birt design engine api's jar file and birt
> report engine api's jar file)?
> thanks in advance.
Powered by FUDForum
. Page generated in 0.01677 seconds