prev next Up Title Contents

2.1 Configuring Viewers

Java Virtual Folders can be configured to open certain document types with certain viewers. Viewers are searched in the following order: Each viewer component can be configured. You can set entries in the configuration files in: This will overwrite entries in the global configuration files in following subdirectory of the installation directory:

Note: When no files (e.g. hwjvf.properties), are found in the directory $HOME/.hwjava (UNIX) or $HOME/hwjava (Windows NT),the data is read from the original global configuration file.

CONFIGURING THE BROWSER

Note: This section applies to UNIX only.

To configure the browser you wish to use to view documents from Java Virtual Folders:

  1. Open the file:
    1. .hwjava/hwjvf.properties for UNIX
    2. hwjava/hwjvf.properties for Windows NT
    Create (or modify) the value for the key application.to_start_for_url
The default value for this key is:

application.to_start_for_url= netscape -remote "openurl(%u)"

CONFIGURING NATIVE VIEWERS

To configure the native (non-Java) viewers you wish to use to view documents from Java Virtual Folders:

  1. Open the file:
    1. .hwjava/hwjvf.properties for UNIX
    2. hwjava/hwjvf.properties for Windows NT
  2. Add a viewer for a particular mimetype by entering the key
    application.to_start.[mimetype]

    Where [mimetype] is the document type for which the new viewer should be registered.

  3. Enter the viewer command as the value for this entry, for example:

    application.to_start.text/java=emacs

    or

    application.to_start.image/*=xv

    CONFIGURING JAVA VIEWERS

    Note: This section on Configuring Java Viewers is for programmers' use only.

    A Java viewer is the most efficient way to add viewers. It can also be used to add additional features such as edit, send mail, print, etc. The Java class which is to act as a viewer (or editor, or printer) must implement the CommandObject Interface as defined in the Java Activation Framework.

    To configure the Java viewers you wish to use to view documents from the Java Virtual Folders:

    1. Open the file:
      1. .hwjava/commandmap.txt for UNIX
      2. hwjava/commandmap.txt for Windows NT
      This file uses the same syntax as a mailcap file (RFC 1524).
    2. Add the line
    text/rtf;;x-java-view=com.foo.RTFViewer

    where com.foo.RTFViewer is a Java viewer class you have written for viewing RTF documents.

    Note: Make sure your viewer class and its helper classes are in your CLASSPATH environment variable.

    CONFIGURING EDIT, PRINT COMMANDS

    Note: This section on Configuring Edit print Commands is for programmers' use only.

    To add any other command to a mimetype, like edit, print, mail etc., you must enter x-java-[command] where [command] is to be replaced by the specified command.

    The name of this command will also be used as a menu item name for the context-sensitive menu where you can select a viewer. Registered commands will only be selectable if you have write access to the object. If your command is really only a viewer and does not change the content of the object, you can register it as read-only. Add the command name to the application.command_readonly key in the file:


    prev next Up Title Contents