IBM Content Navigator, Version 2.0.3         

Creating a viewer

You can create a plug-in to provide a custom viewer. Administrators can then map the custom viewer to document types by using the IBM® Content Navigator administration tool.

Before you begin

Read and understand the steps to creating plug-ins to IBM Content Navigator.

About this task

IBM Content Navigator comes with a default viewer map to open and manipulate documents. You can also configure the AFP Viewer plug-in or configure the IBM Content Collector plug-in to view certain types of documents.

To provide a custom viewer of your own, create a plug-in to specify the custom viewer.

Procedure

To create a custom viewer:

  1. Extend the PluginService class to create a service that provides the viewer.
  2. Extend the PluginViewerDef class to provide a URL template that will open the viewer.
  3. Extend the DocViewer class to provide a custom document viewer.
  4. Optional: Start of change Customize the title that is displayed in the toolbar in this widget so that it blends in with your business scenario. Extend the ContentViewer class and use the getContentViewerTitle method and contentViewerTitle to assign your custom label. End of change

Sample plug-in files for a custom viewer

The following files in the sample plug-in define a viewer:
Table 1. Sample files that define a plug-in viewer
File Description
SamplePluginViewerDef.java A definition of a new custom viewer.

This class defines the sample viewer service as a viewer. The launch URL pattern describes how to invoke the viewer and provides the parameters that the viewer service uses to retrieve and format the document for viewing.

SamplePluginViewerService.java This class extends the PluginService.java class to implement a service. The service provides a custom viewer that performs simple formatting of an archived RSS feed.
SampleImageViewer.java This class extends the DocViewer.js class to implement a custom image viewer.

What to do next

After you write the plug-in, you must register and configure the plug-in in the IBM Content Navigator administration tool. To use the custom viewer, you must add the registered plug-in to a viewer map.