CGIexecutor is mainly written to do all 'dirty' CGI handling for an external program
which it will execute. But, with its powerful and easy to use interface, CGIexecutor can
be used to manage number of different CGI forms, even without executing an external
program.
Following are some features of CGIexecutor:
Managing complex projects based on several forms
Support for creating response pages based on templates
Creating template based input files for programs which will be executed by CGIexecutor
Customizable template based error reports
Checking for required variables
And that is not all: With CGIexecutor You can build useful and powerful CGI handlers
for Your forms by using simple environments like MS-DOS batch scripts (.bat)
which CGIexecutor can preprocess and pass to command.com or cmd.exe,
or You can use any other interpreter along with CGIexecutor.
Moreover You can use CGIexecutor alone without executing any other programs to handle
useful things like:
Checking if all required entries are filled
Handle remembering information entered on several different pages
Or You can save files preprocessed by CGIexecutor to Your disk
with a single command passed to Your system.
Additionally CGIexecutor provides access to environment variables on Your system in any
of project files to help You build Your projects.
And You can also access several useful internal variables of CGIexecutor.
How to install CGIexecutor
When You unpack CGIex101.exe archive You will find following
directories:
bin
This directory contains binaries (i.e. programs) distributed with CGIexecutor
package.
html
Html directory contains documentation for CGIexecutor in HTML form.
demo
This directory contains sample projects for CGIexecutor to help You learn how to
use CGIexecutor.
You can install CGIexecutor in two ways:
I
First (and simpler) way to install CGIexecutor is to add directories with CGIexecutor
package to directories Your HTTP server will search. To do so see documentation for
Your HTTP server. You have to provide following names and access rights for directories:
bin
Name: /cgiexec/bin
Access: Execute
html
Name: /cgiexec/html
Access: Read
demo
This directory does not have to be in directory tree of Your HTTP server.
NOTE: Sample projects assume that CGIexecutor directories are stored in
/cgiexec directory in Your servers directory tree. If You specify other name
for this directory You have to edit files in demo directory to point to correct
location. Also edit sample front ends in html directory.
II
Second way to install CGIexecutor is to copy files as follows:
bin
Copy files from this directory
to directory which have permission for programs to be executed
from Your web server.
html
Copy files from html directory to directory which is
searched by Your HTTP server and has read access.
This directory also contain front ends for sample projects which are
stored in demo directory. To make them work
You have to edit them to point
to cgiexec.exe on Your system.
demo
This files does not have to be in directory which is accessible by web server
but they must be available for reading for other programs. To make these
samples to work correctly You have to edit all variables which contain
names of files to point to corresponding files on Your system.
PATHS MUST BE RELATIVE TO CGIEXEC.EXE, OR ABSOLUTE PATHS.
Also You have to edit templates when they contain references to cgiexec.exe
to point to URL where CGIexecutor is placed.
How CGIexecutor works
CGIexecutor works with so called 'projects' which can be put alone or
can be grouped in more complex projects.
Every project contains up to four 'project files' which will determine how CGIexecutor
will behave.
In shortly every project will contain some or all of following files:
Configuration file
Configuration file is required in every project and is 'backbone' of every project
for CGIexecutor. In this file are specified names of other project files along with
other values required to run project like name of temporary directory in which input and
output file for external program will be created, command line to be executed by
CGIexecutor etc.
Template for creating response
This file is used to be base for creating response to user and is only file, except configuration
file, which is required in every project.
Error template
CGIexecutor has set of error messages built in the program, but it can also be configured to
use error template file as template for error messages. This may be done by setting
ERRTEMPLATE variable in configuration file to point to file You want to use as template for
error messages in project.
Template for input file for executed program
If an external program needs input file You can use this file as template for that input file.
CGIexecutor will process this file in order to create input for program.
When started CGIexecutor will go through following steps:
First it will get input from server to provide other parts of program access to
variables entered by user.
Secondly CGIexecutor will process project configuration file and set internal variables
as requested in configuration file.
Additionally it will do checking for required variables
in configuration file.
Now CGIexecutor will check all other project files for required variables, and if it
finds required variable which is not set it will generate an
error 24.
Next if CMDINTEMPLATE variable is set in configuration file
CGIexecutor will process input file for external program. If CMDINTEMPLATE variable is not
set CGIexecutor will skip processing input file.
In this step CGIexecutor will execute program as specified in CMDLINE if this
variable is set in configuration file, otherwise CGIexecutor will skip this step.
Finally, CGIexecutor will create an response page and send it to user.
What's new in version 1.01
Corrected problem with cmd.exe on NT systems.
When cmd.exe was started in version 1.00 it returned an errorcode 255 and refused to
execute command.
Version 1.01 of CGIExecutor uses new input/output redirection aproach, wich corrects
this problem. See notes about IOREDIRECT, STDIN, STDOUT and STDERR variables in
configuration file for more information.
Removed "CONTENT_LENGTH variable is not passed" error message.
Some web servers will not pass CONTENT_LENGTH variable to an CGI program when
called from
tag. To allow users to call CGIExecutor this way CGIExecutor will now check
CONTENT_LENGTH variable and if set it will use it to determine length of input.
If CONTENT_LENGTH variable is not set CGIExecutor will assume that input is
zero-length and continue execution.
Improved configuration file processing.
Now INFEXT and OUTFEXT variables does not have to precede TMPDIR variable in
configuration file. CGIExecutor will now process configuration file in correct
order.
Package now contains GBMailer (a freeware command-line mailer) wich can be used with CGIExecutor.
For additional information about GBMailer see readme.txt in bin directory of this package.
For information on using GBMailer with CGIExecutor see complex sample.
Also I am planing to continue with including command-line tools wich can be used with CGIExecutor.
For additional information on CGIexecutor files and variables see following files: