Java Viewer Samples Readme

This directory contains sample programs using the Java Viewer Toolkit. These samples are stand-alone and will work with local files without any need for a connection to a content server.

Setup Instructions

All samples can be executed using the DB2 Information Integrator for Content environment. To setup:

AIX, Linux

Execute the cmbenv81.sh command. (On AIX, this command may be located in the /usr/lpp/cmb/cmgmt directory.) This script sets up the PATH and CLASSPATH correctly for compiling and running the samples.
Gui samples require an X Server. A root user can enable the use of its X11 Graphics Session using the command:
xhost +
This gives permission to all users. Each user can then set the DISPLAY environment variable:
export DISPLAY=:0.0

Windows

Run the cmbenv81.bat file. This command file sets up the PATH and CLASSPATH correctly for compiling and running the samples.

Steps to run the samples ( common to all platforms ) :

  1. Set up the classpath:
    set CLASSPATH=<cmbroot>/samples/java/viewer;%CLASSPATH%
  2. Compile the sample: javac Sample.java
  3. Run the sample: java Sample

Overview of Samples

There are three types of samples in this directory:

  1. Document and Annotation Services samples.
  2. Stand-alone Viewer samples.
  3. Annotation Editor samples.

Note: These samples are not demo or turn-key programs that will run without any customization. The user is expected to do some customization to make them run in his/her environment. The main purpose of these sample programs is to provide sample code for the user to browse, so that he/she can have a clear example how to do a certain task using the Java Viewer.

Document and Annotation Services Samples

These command-line samples show how to use the non-visual layer of the viewer toolkit to convert documents, manipulate document pages and annotations.

Class Name Description
TStreamingDocServices Performs document conversions from streams using document conversion engines.
TDocumentEngine A sample document engine.
TPageManip Demonstrates page manipulation operations.
TAnnotationServices Demonstrates annotation manipulation capabilities.

Stand-alone Viewer Samples

These samples show how to use the Java viewer toolkit to build a viewer application.

Class Name Description
TGenericDocViewer An example of a stand-alone file viewer application. Annotations can also be created and saved, and pages of image document types can be manipulated.

Annotation Editor Sample

This sample demonstrates how an annotation editor can be built using the annotation services and also how a custom annotation type can be plugged in.

Class Name Description
TAnnotationEditor Demonstrates building annotation editing capabilities to a swing application using the annotation services support.
TImageAnnotation Implements a custom image annotation that can be plugged in to the annotation services.