Jarnal - Startup

by David K. Levine


The command line format is java -jar jarnal.jar [options] [file_to_open].
Several command line options are supported
If filename begins with http:// the file will be downloaded from the url rather than loaded from the local filesystem.

MetadataFiles: A metadata file is a text file containing command line options plus other options. Here is a sample


email=one@a.com, John <john@b.com>
[Net Options]

The format is the usual .ini file format. There are two sections in the metadata file [Globals] and [Net Options]. The [Net Options] section will be used as the default Network Save Options, to send information back to a server. The [Globals] section supports the following keys:
The intended usage is that a web server can generate a metadata file on the fly instructing jarnal what file to download and open, and where the server is so that the file can be saved back to the server.

Applet Parameters: The applet uses parameters to set the metadata. The parameters pn where n is an integer, and the parameters are numbered sequentially starting with 0 become [Net Options]. For example the jarnal-demo.htm file uses the following (you can view the source by clicking on the files and viewing the code in your browser).

<applet code="jarnal/Jarnal" archive="jarnal.jar" width="20" height="20">
<param  name=netServer  value="http://www.dklevine.com/workshops/jarnal.php3">
<param  name=p0  value="just=a test">
<param  name=p1  value="infile=$$snapshot">

This will cause the network save function to send a jpg snapshot under the name infile to the php script
http://www.dklevine.com/workshops/jarnal.php3. Note that due to java security restrictions, this script will work only if loaded from www.dklevine.com.

All keys that can appear in metafiles can appear as applet parameters. In addition three additional keys are supported

Priorities: When opened as an application, parameters can be read from several locations.

1. Either a template or a file can be opened, but not both, and no more than one of each should be specified. If both a template and a file to open are specified, whichever appears last on the command line is used; if a template was specified, the whichever file is used is treated as a template. If a metadatafile is used, the background, template and file replace those specified on the command line. The template in a metadatafile always has priority over opening a file. The first encountered file is used. Files specified in a metadata file have priority over files specified by applet parameters.

2. Only one background file should be specified as an option at loading; it is added to whatever backgrounds already exist in the file. The background in the file or template that is opened takes priority over that specified in the metadatafile or the command line. On the command line, the last encountered background file is used; in a metadata file the first encountered background file is used.

3. It is not regarded as an error to have duplicate network save parameters in different locations; since network save parameters are stored in the .jaj file, when a metadata file is loaded from the network, it will generally duplicate parameters stored in the loaded file. The parameters in the metadata file take precedence. applet parameters get second priority, and parameters in the file get least priority. Metadata variables ([Network Options]) are combined with those from the applet, and the two together replace any variables in the file.