Anatomy of an i2 Notebook plug-in
An i2 Notebook plug-in is deployed to the i2 Analyze server as a directory that contains:
- The plug-in manifest, which is a JSON file that contains configuration details
- The plug-in entry point, which is a JavaScript file that is loaded directly into i2 Notebook
- Optional tool views, which are HTML pages (and associated JavaScript/CSS/image files) that provide a user interface
Operation
At startup, the Liberty server scans the plug-in directories and reads the plug-in manifest files. It then provides information about all the available plug-in entry points to i2 Notebook.
After i2 Notebook loads its user interface, it goes on to load the entry point JavaScript file for each available plug-in. The main()
method of each entry point performs some actions against i2 Notebook. For example:
- Register new commands for i2 Notebook users to run
- Modify the ribbon to show the new commands
- Register to receive events from open charts (to control the state of commands based on selection, for example)
- Register command handlers (to launch a separate application when a command is invoked, for example)
- Register HTML files for tools that i2 Notebook might display in frames or separate browser windows
When the registration work is done, the entry point signals completion to i2 Notebook. After all plug-ins signal completion, i2 Notebook acts upon the registrations and updates its configuration accordingly.