1. The tables
Introduction
- <APPLET CODE="diputree.class" ARCHIVE="diputree.jar" WIDTH=150
HEIGHT=250>
- <PARAM name=recordseparator value="^">
- <PARAM name=fieldseparator value="|">
- <PARAM name=options value="
^containershiftx|20
^containershifty|20
- .
.
.
^tipwait|1000
^tipfontprofile|tipdefaultfont ">
</APPLET>
The parameter tag contains the following parts
- <PARAM
this part of the tag indicates that a new parameter definition starts here
- name="the_name_of_your_parameter"
this part of the tag declares the name of the parameter
- value="the value of the parameter"
this part of the tag contains the actual value of the parameter
- >
this part of the tag indicates that the parameter definition ends here
The applet uses the parameter tag for passing complete database tables from the applet
definition in your web page to the applet.
Such a parameter can contain multiple records and every record can contain multiple
fields.
So first you have to define which character will serve as a record separator and which
character will serve as a field separator. This is done through the parameters
recordseparator and fieldseparator. These are the only 2 single
value parameters, they are meta-parameters (parameters who describe other parameters)
So if we want to define 4 persons whose names are Sven, Danny, Jessica and Serge, with
their home address Oostende, Baal, Mechelen and Mechelen and with the ages of 25,28,25 and
29, then we have to define the following parameter (assuming recordseparator is ^ and
fieldseparator is | )
- ^Sven|Oostende|25
^Danny|Baal|28
^Jessica|Mechelen|25
^Serge|Mechelen|29
Rule:
- You always need to enter the fieldseparator, even if you are using a default value for a
field.
Exception:
- You can omit the fieldseparators when a default field or the end of the record follows
every default field.
examples
First the general rule
Let us assume that the default city is set to Mechelen.
Now our parameter looks like this:
- ^Sven|Oostende|25
^Danny|Baal|28
^Jessica||25
^Serge||29
For Serge and Jessica we used the default city. But notice that although we used the
default value for the city field, we still had to use the field (we left it blank!)
The exception
Now assume that the default age is 25.
This would make the parameter look like this:
- ^Sven|Oostende
^Danny|Baal|28
^Jessica
^Serge||29
Notice that Jessica does not require any fieldseparator, because a default field or the
end of the record follows every default field (jessica has 2 default values). Now the
parser (the code that reads in the fields) can not be mistaken, he knows that all the
non defined fields are default fields.
You can instruct the applet to fetch the table from an external file, instead of
hardwiring the fields of your table in a parameter tag in your web page.
- Use a prefixed URL in the value part of the parameter tag.
A prefixed URL is an URL with the characters "url:" prefixed to it.
So just add "url:" in front of the URL where your values file is located.
You can use fully qualified or relative URLs.
- Put your table in a text file.
The text file should look exactly like the value part of the parameter tag when no
external files are used.
So you can just cut and paste what was in the value part of the parameter and paste it in
an empty file.
examples:
- The web page
<APPLET CODE="diputree.class" ARCHIVE="diputree.jar" WIDTH=150
HEIGHT=250>
<PARAM name="entries"
value="url:http://www.mysite.com/mydirectory/entries.txt">
</APPLET>
- The external file (entries.txt)
^parent||Hi, I'm the parent
^child-1|Hi, I'm child 1|parent
^child-2|Hi, I'm child 2|parent
If you use the same files for the options, fonts and images parameters your site will
look and feel the same everywhere! Updates in a file will be reflected site wide.