|Java menu knowledge base|
Perl script for making dynamic menus
About this script
This perl script generates a fresh index file for our java menus every
time someone visits your website. It reads and parses directory
contents and turns them into the XIXL format which can be read
by all our menu applets.
The script is suitable for use by anyone who has a CGI bin on
their website and is familiar with the use of perl scripts.
The script is distributed on an "open source" basis. Perl programmers
may modify the script provided they notify the changes and make
these available to others. The script is free to use
in conjunction only with our applets, and is not free otherwise.
As it is free, there are no guarantees and no free support.
WARNING: this script is intended only for advanced users.
There is NO free support for this
script. The instructions were written based on UNIX server experience;
NT server users may find additional changes are needed. If you are
still learning perl, there are a large number of sources of information
around the web which cover all the standard installation mistakes
made by beginners.
Download it here (4 KB).
- Reads directory contents and converts these to XIXL format
for reading by over 40 imint.com menu applets.
- Sophisticated include and exclude filters allow the script to be
set to read specific filename patterns and/or filetypes.
- Optional listing of subdirectories.
- Security features restrict outside access.
- Parses HTML files to extract titles and meta descriptions to
build the index information.
Advanced users may find that alternatives are possible to
the configuration described below. Please note that if you
diverge from what we recommend, support will not be available.
The files should be uploaded as follows:
Ensure that the list.pl file has the execute and read
permissions set (CHMOD 755), which is normally the default
for the cgi-bin.
- list.pl: upload to your cgi-bin directory
in ascii mode.
- list.cfg: upload to your cgi-bin directory
in ascii mode.
- *.class (the applet): upload to the ROOT directory of
your website in binary mode. The applet must be in a parent
directory of the perl script. The ROOT directory is recommended
(that's the normal main directory of your website).
If you upload the perl files in the wrong mode (a common
mistake), the applet will return error 4. It will also
return error 4 if it cannot find the perl script or if
you have corrupted the perl script to the point of
If you upload the applet in the wrong mode, your browser
will return a "class not found error" or "class format error".
To customise your server installation, you may want to
edit the CFG file. The CFG file contains instructions
for its editing. Here is a re-summary of things you can
Configuring an applet to use this script as an index source
- Set whether or not the script returns subdirectory names to the applet as part
of the index (set to "yes" or "no").
- Set which file types are parsed for title tags and meta description tags.
- Set whether or not files are parsed for meta description tags; these aren't
really necessary and may just possibly lead to format errors with some websites,
so we included an option to switch them off.
- Set the default file types listed by the script - this can be overridden
each time the script is called from an applet if you set the applet parameter
accordingly; this feature is just a time-saver.
- Set the names of the directories and the types of files
the script is allowed to read. This is essential protection against
unauthorised use of the script by external users. In theory someone
could tap into the perl script and use it to read private files
from your website UNLESS you prevent access, so we wrote the script
to DISALLOW EVERY directory on your website unless you specifically
grant access. The full names of all
allowed directories and filetypes must be entered here - wildcards
are not allowed as they might lead you to unwittingly open a security
loophole. The applet cannot override this setting.
The script cannot be accessed from our freebie applets. All other applets can use this.
1. Setting the codebase
If the HTML file with the applet is not in the root directory
of your website, you will need to use the codebase attribute
in the applet tag to set the path to the applet. Do not try
to set the path using the code attribute. Remember that to
access the perl script, the applet itself should be in the
root directory. You can find out what a codebase attribute
is by accessing the help system of your HTML editor or by
looking it up on the web.
2. Setting the menufile parameter
Most of our applets access the index file using a "menufile" parameter
(see individual applet documentation to verify this; iTree Pro is one
exception). To use the script as your index file source, you must point
the menufile parameter to the script.
The value of the menufile parameter contains a URL reference to the
perl script, using a query string to set various options for the
perl script. The query string begins with a ? and its elements are
separated by &.
CGI-BIN/LIST.PL: the path and name of the perl script
DIRECTORY: set this to the name of the directory to be read.
Do not preface or suffix it with slashes. If you use a complex path, insert
slashes between the directory names - e.g. directory=products/software. If
you find that the slashes lead to an error 4 in the applet, replace them
with %2F. Make sure this directory is permitted in the CFG file.
INCLUDES: you can use full patterns with wildcards.
g*.htm finds all files beginning with g and with an .htm extension.
A simple * finds all files. You can specify several types by separating them
with commas - e.g. includes=*.html,*.htm. If you set a default
include in the CFG file, this part is optional.
EXCLUDES: works the same way as includes.
ROOT: you MUST set the relative root if the resulting
index is to link correctly to your files. In most cases, the value of
ROOT should be the same as the value of the CODEBASE attribute in the
applet tag. For example, if the HTML file with the applet is one
directory deep from the root directory, use the value ..%2F (%2F is
hexadecimal for a slash). If the HTML file is two directories deep,
use the value ..%2F..%2F - which is like ../../ in the codebase attribute.
- The script cannot be accessed from our freebie applets.
- If you get errors from the applet like error 4 or error 10, etc,
check that you uploaded the files in the right mode and then refer
to our online advice centre.
- If you find that the index is read fine, but the links do not
link to the files, check the ROOT option in the applet menufile
parameter. This ensures that the paths are correctly maintained
by the perl script.
- If you find that your pages are loading correctly from the applet
but are being launched in a new browser window, look up in the individual
applet documentation how to set a default frame target (usually a
parameter called "menudeftarget").
- Slashes (/) in the menufile parameter can cause errors; replace
them with %2F.
- Strangely formatted meta descriptions in your HTML files may
possibly cause format errors; switch off meta description parsing
in the CFG file if you experience this.
- If you have really serious problems, test your perl script
using a simple form and no applet - this will enable you to
see if the problems are with your files or the script, or
whether they are related to the applet or its HTML file.
- This is a list of all the places where errors could theoretically
be caused - if a problem is difficult to trace, you will need to
systematically eliminate possible sources one by one:
- The server the files are located on
- The files the perl script indexes for you
- The perl script
- The HTML file holding the applet
- The applet
- The browser/OS combination used to view the results
- NT servers: if using NT servers, expect problems, as NT
and CGI aren't best friends. You may need to edit those bits of list.cgi which
use relative URL's (when looking for files) to look for absolute URL's instead
- e.g. the reference from list.cgi to list.cfg. If this doesn't help, switch
to Unix or employ someone who knows about NT/CGI.
- Remember that this script is provided free. Remember also that if you
are using this script together with an applet you purchased, you had the
option of testing the script with the trial version of the applet before
you bought and that the purchase agreement between you and us clearly states that
you successfully tested before purchasing. Ensure that you try before
If you require support
or modifications of this free script from us, please expect to pay for them.
Customisation / Modification
This free perl script is a joint production of Image
Intelligence Software Ltd. (a.k.a. imint.com)
and Red Dragon Enterprises.
The licence agreement enclosed with the script allows you to
modify the perl script yourself, provided you do not redistribute
the changes, and provided you notify either Image Intelligence or
If you wish to have modifications but would prefer to have these
done for you, you may contact Red Dragon Enterprises,
who will be happy to supply you with the necessary programming
skills and who will levy their own charges independently of any
applet licences you may have purchased from Image Intelligence.