|
Re: avoid/clean up BIRT runtime images files [message #368287 is a reply to message #368270] |
Mon, 18 May 2009 16:15 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Alex,
The images should be getting removed automatically when the session expires.
Jason
Alex wrote:
> Hello,
>
> I am new to BIRT and just created a simple web app with BIRT report.
> It works fine.
> Because my report contains charts, it generates a png image file on the
> system every time I generate the report in html output.
> The pdf output doesn't seem to generate the image. It would generate
> thousands of images as time goes by.
> Just wonder if there is a way to avoid or clean up this kind of BIRT
> runtime images files.
> Thanks for your time and help.
>
> Regards,
>
> Alex
>
|
|
|
|
Re: avoid/clean up BIRT runtime images files [message #368350 is a reply to message #368337] |
Fri, 22 May 2009 15:09 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.windstream.net
Alex,
I should have clarified, the WebViewer does the temp image clean. If
you wrote your own servlet you will need to do this yourself.
You may want to add a session listener to your servlet
<listener>
<listener-class>org.mytest.com.MySessionListener</listener-class >
</listener>
public class MySessionListener implements HttpSessionListener
{
public void sessionCreated( HttpSessionEvent event )
{
}
public void sessionDestroyed( HttpSessionEvent event )
{
//Delete temp files
}
}
You could also just delete them on the servlet destroy method.
You could also checkout the source for the web viewer and copy its code.
Jason
Alex wrote:
> Hi Jason,
>
> Those images are still there even after I shut down my Tomcat server.
>
> The following code shows how I specified the BIRT image URL and directory:
>
> HTMLRenderOption options = new HTMLRenderOption();
> options.setImageHandler(new HTMLServerImageHandler());
> options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
> options.setBaseImageURL(req.getContextPath() + "/BIRTimages");
> options.setImageDirectory(sc.getRealPath("/BIRTimages"));
>
> Is there anything else I need to do in order for BIRT engine to remove
> those images after session expires?
> Thanks again for all your time and help.
>
> Best Regards,
>
> Alex
|
|
|
Re: avoid/clean up BIRT runtime images files [message #368351 is a reply to message #368350] |
Fri, 22 May 2009 15:12 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.windstream.net
BTW if you look at the viewer checkout
ViewingSessionManager.java
Jason Weathersby wrote:
> Alex,
>
> I should have clarified, the WebViewer does the temp image clean. If
> you wrote your own servlet you will need to do this yourself.
>
> You may want to add a session listener to your servlet
> <listener>
> <listener-class>org.mytest.com.MySessionListener</listener-class >
> </listener>
>
> public class MySessionListener implements HttpSessionListener
> {
>
> public void sessionCreated( HttpSessionEvent event )
> {
> }
>
> public void sessionDestroyed( HttpSessionEvent event )
> {
> //Delete temp files
> }
>
> }
>
> You could also just delete them on the servlet destroy method.
> You could also checkout the source for the web viewer and copy its code.
>
> Jason
>
>
> Alex wrote:
>> Hi Jason,
>>
>> Those images are still there even after I shut down my Tomcat server.
>>
>> The following code shows how I specified the BIRT image URL and
>> directory:
>>
>> HTMLRenderOption options = new HTMLRenderOption();
>> options.setImageHandler(new HTMLServerImageHandler());
>> options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
>> options.setBaseImageURL(req.getContextPath() + "/BIRTimages");
>> options.setImageDirectory(sc.getRealPath("/BIRTimages"));
>>
>> Is there anything else I need to do in order for BIRT engine to remove
>> those images after session expires?
>> Thanks again for all your time and help.
>>
>> Best Regards,
>>
>> Alex
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03238 seconds