| Java menu knowledge base XIXL - external source format
What is an external source?
An external source is, for example:
- A simple text file - such as "menu.txt";
- A server script or programme - such as "menu.pl", "menu.cfm", "menu.jsp", "menu.php" - which returns a simple text stream in the same format specified below.
An external source is NOT a set of applet parameters.
Where do I put an external source?
On the server, preferably in the same directory as the applet. The external
source MUST be either: (i) in the same directory as the applet; or: (ii) in a
sub-directory of the applet's directory. You tell the applet where to look for the external source by using a parameter which is usually called menufile but which may have other names (check applet documentation).
What is the required format of the external source?
Ensure you have read this first. Then read on.
Each line entry in the text file is considered to be one single
entry for the navigation applet.
So every time you press the return key, it's a new menu entry.
Order of items: you write the items in the order in which they
are to be display on the menu.
The 5 entry strings: Every line MUST contain 5 entry strings. Each of the
5 strings MUST be enclosed by double inverted commas (") and separated by white space
(e.g. space, tab) but NOT by line breaks. Thus an empty but valid line would
look like:
"" "1" "" "" "" .
An incorrect number of " in any line will lead to an error - this is a frequent
mistake.
The five strings, in order, are interpreted as:
- Appearance entry: contains one or more distinct commands
which affect text and graphics appearing in the menu at this point.
The commands available vary from applet to applet - always look in the applet documentation
under "XIXL commands". Typical commands include TEXT (for defining the text which displays
on a menu item) and ICON (for defining the icon next to the text).
- Hierarchy marker: an integer marking the level at
which the menu item is displayed (1=top level; 2=second level (submenu); etc);
even if the menu applet is not a hierarchical menu, the hierarchy
marker must still be present for cross-applet compatibility.
- Stylesheet marker: an integer indexing the entry
to a set of formatting commands in a stylesheet - it decides how
the entry will appear. Even if the applet you are using does not
have stylesheets, the stylesheet
marker must still be present for cross-applet compatibility.
- Command entry: contains one or more commands to be issued
when the site visitor clicks on the menu entry. These may include
a number of normal hyperlinked URL's. The commands available vary from applet to applet - always look in the applet documentation
under "XIXL commands". Typical commands include LINK (for setting a hyperlink URL)
and SCRIPT (for firing a user-defined javascript function).
- Message: the text which will be displayed in the browser
status bar when the mouse moves over the menu entry; iTree applets
and Sensomap applets
will also display this information in an optional multi-line preview panel immediately below the menu.
An example:
"TEXT:my entry" "1" "4" "LINK:myPage.html,myFrame" "description of my page"
This line defines a menu entry with the text "my entry" at the top hierarchical level;
it is formatted according to the 4th entry in the stylesheet
(which you may define by parameter) and when
clicked it loads the page "myPage.html" into the frame "myFrame". When the mouse moves
over the entry, the message "description of my page" appears in the browser status bar.
Can I insert comments and white space to organise my thoughts?
Yes.
An empty line and other whitespace will just
be ignored by the applet.
To help organise complex menus, you can also add
comments to the menu source file that are invisible to the applet - place your
comments after // signs (two of them).
How can I debug my external source for errors?
Our applets have an internal error reporting system, which is active if the
escapepage parameter is NOT set. Errors
which are related to index format will usually be accompanied by a line
number, which will tell you approximately where to look for your error.
If you are using a dynamic server-programme source, try to display the results
of your script in a browser window (without using the applet). For example,
if you server source is "menu.asp", then write "http://www.mydomain.com/applets/menu.asp" into your browser address bar. If your script is
correct, then a simple text file in the appropriate format will display in
the browser window.
Are there reserved characters?
Yes. Double inverted commas and semi-colons. To display inverted commas,
use a single inverted comma or \" (escape character just before the double inverted comma.
To display semi-colons, ask us for a customisation.
What are the advantages of external files against parameters?
See this.
|
|