Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Embedding the Reporting Engine Into a Java Application

  1. #1
    Join Date
    Mar 2014
    Posts
    4

    Default Embedding the Reporting Engine Into a Java Application

    Hi,

    Pentaho Reporting works great inside Java Web App. But I run into issues below:

    Report generated with a set of parameters. The problem is that creates a lot of files/folders inside Web Server because users can view the same report with his input at the same time. That why I cannot override the generated report by newer one. So When/How I should remove/delete it?

    Any one can help?

    Best,

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    The most simple solution I recommend is to bind a session listener to your HTTP session and to clean up the report's data when the session ends. To make that easy, generate a session-id (not the one used in the cookie, but just a UUID object stored on the session) and use that as part of the directory name that holds the report data.

    So lets assume you store your temp-files in the temp-directory:

    ${TEMP}/

    then each user's report data would go into a subdirectory under it

    ${TEMP}/${UUID}/

    and when the session finishes, you can safely delete that directory and all its files. That delete operation can be a one-liners with the help of Commons-IO's FileUtils#deleteDirectory method.

    Why use a extra UUID and not the user's name or login info? The same user may be logged in via two different browsers or devices and then would generate conflicts. Killing/timing out the session on his first browser will also kill his content of the still-alive second session.

    Why not use the session ID the servlet framework maintains? Exposing the session id anywhere is a security risk. If its not on disk, it cannot be seen by any attacker and thus they wont be able to steal sessions from legitimate users.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.