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:
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:
- Extend the Plugin class
to create the plug-in.
- If the plug-in requires configuration, define
a configuration pane to display in the IBM Content
Navigator administration tool:
- Extend the PluginConfigurationPane.js class
to define parameters that need to be configured.
- Create an HTML file to define a form template to define
the user interface for the configuration pane.
- In your Plugin class file, implement
the getConfigurationDijitClass method to return
the PluginConfigurationPane.js class.
- 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. |
- 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 |
- Package the plug-in files in a JAR file.
- 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.
- 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 configurationFile |
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. |