Edit online

Developing a Simple JavaScript Plugin

You can extend Oxygen XML Web Author by writing JavaScript code as part of a plugin.

Creating the Plugin Project

You should create a the following files in a folder:
  • plugin.xml - The content structure should look like the following snippet, where you change the ellipsis with the details of your plugin:
    <!DOCTYPE plugin SYSTEM "../plugin.dtd">
  • web/plugin.js - This file contains your JS code that uses the Oxygen XML Web Author JavaScript API.

Loading the Plugin in Development Mode

To load the plugin in development mode, perform these steps:
  1. Start Oxygen XML Web Author.
  2. Look in the server logs for a line similar to "Loading plugins from: ${path}" and note the path of the plugins folder.
  3. In the plugins folder, create a sub-folder with a name of your choice (for example, myplugin).
  4. In that folder (myplugin), create a plugin.redirect file that contains the path to your plugin project on a single line.
  5. Restart Oxygen XML Web Author.

After this initial setup, every time you make a change in the JavaScript file, you only need to refresh the browser page.