Difference between revisions of "RReportGenerator on the Web"

From Wikili
Jump to: navigation, search
Line 29: Line 29:
 
==To run RReportGenerator on the Web you need==
 
==To run RReportGenerator on the Web you need==
 
# A http web server (we use Apache)
 
# A http web server (we use Apache)
# An already installed RReportGenerator
+
# The RReportGenerator with
## with the files rrg.tcl and rrg_web.tcl or their binary version
+
## the files rrg.tcl and rrg_web.tcl or their binary version
 
## the logos RRG_logoTransparent.gif, RRG_generateReport.gif, LogoIGBMC.gif and your LocalLogo.png
 
## the logos RRG_logoTransparent.gif, RRG_generateReport.gif, LogoIGBMC.gif and your LocalLogo.png
## access to R, latex and pdflatex  
+
# Access to R, latex and pdflatex (they have to be in the binary path so we can find them with ''which R'' , ''which latex'' and ''which pdflatex'') 
 
# If you are running 'not compiled scripts' you need Tcl8.5 or higher
 
# If you are running 'not compiled scripts' you need Tcl8.5 or higher
  

Revision as of 10:00, 10 November 2010

While the original RReportGenerator is/was designed as stand-alone, now we've developed a version that is available through a web interface. This should allow users to benefit of servers that are much more powerful, in particular if the applications are memory consuming.

 http://lbgi.igbmc.fr/rreportgenerator

How it works

The main tcl program rrg.tcl (mostly code by Luc Moulinier) remains nearly unchanged. We replaced the call to 'main' with following lines :

global env
if {! [info exists env(QUERY_STRING)] && $argv=={}} {
    package require Tk
    main
} else {
    source "[file dirname [info script]]/rrg_web.tcl"
    MainWeb
}
  • (We should find a better way to test if it concerns http ...)
  • If launched as local program, rrg.tcl requires the package Tk and runs normally
  • If launched by the web server, rrg.tcl sources the additional file rrg_web.tcl (code written by Raymond Ripp) and sends a html page to the web browser.
  • Any action from the user through his web browser will rerun rrg.tcl, the arguments are always transfered within the web page and users queries, avoiding use of session variables.
  • The user can switch between existing projects (if he knows the password) or create a new project.
  • Within a project he can select, delete or create scenarios and input files.
  • After selection of a scenario and input file the user can run RReportGenarator. This lauches the normal rrg.tcl from Luc and stores the result in the OutputDir of the project.
  • These output files can be shown, downloaded and deleted by any user knowing the password of the project.

Installation

To run RReportGenerator on the Web you need

  1. A http web server (we use Apache)
  2. The RReportGenerator with
    1. the files rrg.tcl and rrg_web.tcl or their binary version
    2. the logos RRG_logoTransparent.gif, RRG_generateReport.gif, LogoIGBMC.gif and your LocalLogo.png
  3. Access to R, latex and pdflatex (they have to be in the binary path so we can find them with which R , which latex and which pdflatex)
  4. If you are running 'not compiled scripts' you need Tcl8.5 or higher

Where have the files to be located

  • we need a directory accessible by the web server. We call it rreportgenerator
  • rrg.tcl, rrg_web.tcl and the logos (with your LocalLogo.png) have to be in that directory (if not in the same directory you can use unix links to simulate it)
  • in the same directory must exist a sub directory called Web which will contain the scenarios, input and ouput files for all projects. (use links if they are elsewhere)

We can now use the url http://http_server/rreportgenerator/rrg.tcl

  • To allow the execution of the .tcl as cgi-bin you need following line in the apache configuration file
  ScriptAliasMatch ^/rreportgenerator/rrg.tcl /real/path/to/the/directory/rreportgenerator/rrg.tcl
  • if you want to allow the url http://http_server/rreportgenerator
    • create a file index.html in rreportgenerator with a redirection to rrg.tcl
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 <head>
 <meta http-equiv="REFRESH" content="0;url=./rrg.tcl?commande=WebForm">
 </head>
 </html>
    • or do it in the apache configuration