Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » deploying birt with a jar file
deploying birt with a jar file [message #660036] Wed, 16 March 2011 15:39 Go to next message
Saban Ulutas is currently offline Saban Ulutas
Messages: 2
Registered: March 2011
Location: Antalya/Turkiye
Junior Member
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.
Re: deploying birt with a jar file [message #660264 is a reply to message #660036] Thu, 17 March 2011 15:11 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.p hp

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
getting loaded.

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:

config.setEngineHome( servletContext.getRealPath("/WEB-INF"));
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.
config.setEngineHome("");
//Using the PlatformServletContext will cause the OSGi loader to look
for the
//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
https://bugs.eclipse.org/bugs/show_bug.cgi?id=230149

Jason


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.
Previous Topic:Birt, Arial Unicode MS, Hindi, PDF Export
Next Topic:Supressing PageHeader & Footer (Masterpage) in XLS Output
Goto Forum:
  


Current Time: Wed Sep 03 04:46:32 GMT 2014

Powered by FUDForum. Page generated in 0.13886 seconds