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
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:
- Extend the PluginService class to create a service that provides the viewer.
- Extend the PluginViewerDef class to provide a URL template that will open the viewer.
- Extend the DocViewer class to provide a custom document viewer.
- Optional: 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.
Sample plug-in files for a custom viewer
The following files in the sample plug-in define a 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. |