Grammatical Picture Generation
A Tree-Based Approach
Frank Drewes

Creating a Java policy
To be able to run the examples on the CD using a browser with Java plug-in, it may be necessary to inform your system about the fact that the TREEBAG applet is allowed to, e.g., read local files – namely the examples on the CD. To establish a policy, you simply create a file named .java.policy in your home directory, granting the required permissions. Depending on whether you trust TREEBAG or not, and which freedom you want to have in saving files and the like, there are several choices.

1. Simply grant TREEBAG all permissions (i.e., as it would run as a stand-alone application). For this, your policy file should contain the following lines:

   `grant codeBase "file:`<root directory of CD>`/examples/treebag.jar" { permission java.security.AllPermission; };`

   Here, <root directory of CD> should be replaced with the path that corresponds to the root directory of the CD drive into which you insert the CD. If you already have a file named .java.policy you simply add the new permission to that file. You can also use Sun's `policytool`, which belongs to the standard Java tools, in order to create a policy file.

2. A more restrictive possibility is to use the following rights instead:

   `grant codeBase "file:`<root directory of CD>`/examples/treebag.jar" { permission java.io.FilePermission "<<ALL FILES>>", "read"; permission java.awt.AWTPermission "accessEventQueue"; permission java.awt.AWTPermission "listenToAllAWTEvents"; permission java.awt.AWTPermission "showWindowWithoutWarningBanner"; };`

   In fact, you may replace `<<ALL FILES>>` with <root directory of CD>`/-` (where the hyphen implies that the rights are extended recursively to all subdirectories) since only files on the CD may be accessed.

   If you also want to be able to save modified components or worksheets on your hard disk from within TREEBAG but do not want to grant AllPermission, you should turn the specification of the FilePermission into `"read, write"` (but, of course, without restricting it to the CD).

Back to main page