IBM Content Navigator, Version 2.0.3         

Creating plug-ins to IBM Content Navigator

You can create custom plug-ins to add features such as menus and services to IBM® Content Navigator.

Before you begin

You must understand the following programming languages to create a plug-in to IBM Content Navigator:
  • Java™
  • JavaScript

In addition, you must understand web programming to implement the JavaScript functions for the actions that are defined by the plug-in.

You should also be familiar with the Dojo Toolkit, which is the toolkit that IBM Content Navigator uses.

About this task

The plug-in that you create to use with IBM Content Navigator must provide:
  • The web browser logic that enables users to call the plug-in
  • The midtier server logic that enables the plug-in to load the plug-in components.

If administrators must provide additional information for the plug-in to function, you must also provide a configuration component. For example, the IBM Watson Content Analytics plug-in requires administrators to provide a URL to the IBM Watson Content Analytics server. Administrators use the IBM Content Navigator administration tool to configure the plug-in.

The plug-in consists of the following components that are contained in a single JAR file:
The web browser logic
The web browser logic is a required component of the plug-in that enables users to call the plug-in from the web client.

The web-browser logic component of your plug-in communicates with the IBM Content Navigator client. The web client is built by using the IBM Content Navigator visual widgets, which are based on the Dojo Toolkit. You should use the IBM Content NavigatorC visual widgets and the Dojo Toolkit to build your plug-in.

The web browser logic is implemented in JavaScript.

The midtier server logic
The midtier server logic is a required component of the plug-in. This logic calls the APIs for the content servers to retrieve the data that is used by the plug-in or that is displayed to users.

The midtier logic component of your plug-in communicates with the IBM Content Navigator services component on the web application server.

The midtier server logic is implemented in Java.

The configuration component
The configuration component is an optional component of the plug-in that enables an instance of the plug-in to be configured with the IBM Content Navigator administration tool. See step 2 in the following procedure for information about creating a configuration component for your plug-in.

The configuration component is implemented in Java.

Procedure

To create a plug-in to IBM Content Navigator:

  1. Extend the Plugin class to create the plug-in.
  2. If the plug-in requires configuration, define a configuration pane to display in the IBM Content Navigator administration tool:
    1. Extend the PluginConfigurationPane.js class to define parameters that need to be configured.
    2. Create an HTML file to define a form template to define the user interface for the configuration pane.
    3. In your Plugin class file, implement the getConfigurationDijitClass method to return the PluginConfigurationPane.js class.
  3. Extend the appropriate ecm.extension classes to create the components that define the functionality to be provided by the plug-in:
    Component type ecm.extension class
    Menu action PluginAction
    Menu PluginMenuType and PluginMenu
    Feature PluginFeature
    Layout PluginLayout
    Request filter PluginRequestFilter
    Response filter PluginResponseFilter
    Service PluginService
    Viewer PluginViewerDef
    Widget Not applicable. Instead, you extend the Dojo dijit._widget class or another Dojo dijit class.
  4. In your Plugin class file, implement the appropriate get methods to identify the custom components that are included in this plug-in:
    Component type Method
    Menu action getActions
    Menu getMenuTypes and getMenus
    Feature getFeatures
    Layout getLayouts
    Request filter getRequestFilters
    Response filter getResponseFilters
    Service getServices
    Viewer getViewers
    Widget getScript
  5. Package the plug-in files in a JAR file.
  6. Deploy the JAR file into your web application server.
    Important: The plug-in JAR file must be available on a URL addressable web application server or the plug-in will not work in the web client.
  7. Use the IBM Content Navigator administration desktop to add the new plug-in.

Sample plug-in definition and configuration files

The following files in the sample plug-in define the plug-in and the configuration:
Table 1. Sample files that define the plug-in and the configuration
File Description
SamplePlugin.java This file extends the Plugin class to list the custom components that are provided by the sample plug-in.
SamplePlugin.js This file extends the Plugin class to list the custom components that are provided by the sample plug-in.
ConfigurationPane.js This file defines the configuration pane that is used for the sample plug-in.
ConfigurationPane.html This file provides the HTML form template that is used for the sample plug-in configuration pane.