1. The tables

Introduction

using applet parameters

<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

passing database tables

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

using default values

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.

 

loading tables from external files

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.

examples:

a site wide consistent look and feel

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.