ALP RAW scripts (ScriptGen)
GateCGI settings dialog:

CGI applications are logically separated in two types - applications and scripts. This is is mostly for convenience of course and actually means the following:

  • Applications are CGI programs executed by the OS and only their output must be compatible with the CGI requirements. How they are executed is not important for the host - it just asks the OS to start certain file. So these are the executables and the batch files. For such programs just set the CGI processor to none and if the associated file extension is one of the extensions recognized by the OS as executable files this is enough.
  • Scripts are more dependent on the host. The associated file extension is something you choose (or typical file extension for the script/config files for the processor). Then you need to specify the command line which includes the application that will process that file. In other words the host (ALP in this case) is configured to pass the associated files to the configured processor.
    In this case you choose one of the other settings for the CGI processor (depending on where the file processor's main executable is) and you specify the command line to be used when passing the associated file to it.

CGI processor command line

The command line (must be entered in the edit box below the options list) looks like this:
[path]\processor.exe options
You have 3 possible options for the path part of the command line:
- Full/system path to the CGI processor
- Relative to the virtual site
- Relative to the CGStandard.DLL (the GateCGI's DLL)
They define where the specified exe will be searched. If some of the relative options is specified you can specify path relative to the specified directory - for example if you have a virtual site with a subdirectory bin that contains your processor.exe you can set bin\processor.exe options and select the second option from the list.

Options depend on the command line syntax of the processor but you have several predefined variables that GateCGI module will replace with:

  • %m - is replaced with the full physical path containing the GateCGI module (CGStandard.dll)
  • %r - is replaced with the full physical path of the virtual site root.
  • %p - is replaced with the full physical path from the URL - i.e. physical path corresponding to the current URL
  • %s - is replaced with the full physical path of the script file - i.e. physical equivalent of the URL
  • %q - is replaced with the query string

Do not forget that this is command line and you may need quotes around some of the variables to prevent problems if they contain path with spaces in it.

In most cases the programs especially designed to execute CGI scripts will need only the %s variable to pass the script file to them. However ALP supports more variables to allow you adapt some applications not designed to run as CGI programs.

Another specific options:

Show error output. Usually if the CGI failed to return at least Content-Type header an error is generated (as required by the CGI standard). However when testing programs you may want to see what is in the output even if no header has been sent by the CGI. Setting this option will show the output from the CGI no matter if it is correct or not. It is recommended to uncheck this option when the application is deployed to the customers.

Check that file exists. Sometimes you may want to write a specific CGI application that treats the input file as parameter and no file is actually read. In such case you will want to uncheck this option to allow non-existent files to be executed by the CGI processor. However note that none of the popular CGI processors (such as Pearl interpreter for example) expects non-existent files, so checking the option for them will help ALP generate error skipping the processor's execution.

 

newObjects Copyright 2001-2006 newObjects [ ]