History | Edit

What is a Plugin

A plugin (also referred to as add-on or extension) is a component that adds specific features to an existing application. Oxygen XML Web Author supports plugins to enable numerous customizations.

General Configuration of a Plugin

The Oxygen XML SDK is a Java library that allows you to extend the functionality of Oxygen XML Web Author through API calls. It includes sample plugins (source and compiled Java code) and the Javadoc API necessary for developing custom plugins.

For information about what the general configuration requirements for a plugin, see General Configuration of an Oxygen Plugin.

Supported Extension Types

Oxygen XML Web Author provides support for the following extension types:

  • URLStreamHandler - This extensions can be used to integrate the Oxygen XML Web Author with XML databases or CMS. There is an example URLStreamHandler provided in Oxygen XML SDK project in the oxygen-sample-plugins/oxygen-sample-plugin-custom-protocol folder. The extension uses the cproto protocol to access the file system of the server and can be used as a starting point.
    Note: For more details about implementing an authentication mechanism, see Implementing a CMS Authentication Mechanism.
  • WorkspaceAccess - Most of the methods used to configure the Oxygen XML Editor/Author GUI are unavailable in theses extensions, but they can still be used, for example, to configure a javax.xml.transform.URIResolver.
    Note: The ro.sync.exml.workspace.api.PluginWorkspace instance passed to the extension also implements the ro.sync.ecss.extensions.api.webapp.access.WebappPluginWorkspace interface and provides access to some Oxygen XML Web Author-specific functionality.
  • WebappServlet - This extension allows you to provide an implementation of a servlet-like interface (ro.sync.ecss.extensions.api.webapp.plugin.WebappServletPluginExtension) that will be dynamically loaded by the Oxygen XML Web Author. Your implementation will also provide the path to the location where the servlet will be exposed.

    This extension can also be used to create a configuration page for a plugin.

  • AuthorStylesheet - Allows you to add a stylesheet (CSS or LESS) used for rendering all XML documents.
  • WebappStaticResourcesFolder - This extension allows you to access a static resource folder. It should provide a path attribute (the static resources folder path relative to the plugins directory) and an href attribute that declares the plugin. An example of a use-case is you can use it to have the Oxygen XML Web Author provide icons for plugin-specific actions.
    In the following example, the static resources will be available at http://example.com/oxygen-xml-web-author/plugin-resources/<relative-href>/path-to-file, with the path-to-file being relative to the static resources folder:
    <extension type="WebappStaticResourcesFolder" path="path-to-resorce-folder" 
               href="relative-href"/>

Loading plugin-related custom JavaScript code

If your plugin needs accompanying JavaScript code to be loaded and executed on the client-side you can bundle it together with your plugin code. The Oxygen XML Web Author loads all files with the .js extension located in the web folder of the plugin. The files are loaded in lexicographical order, meaning that their alphabetical order is based upon the total order rather than sequence (for example, abc10.js would be loaded before abc2.js).

Adding the Plugins in the Oxygen XML Web Author

If you have already developed Oxygen XML Editor/Author plugins, they can be added in the bundle-plugin/dropins folder in the Maven project.

If you are developing a new plugin, you are encouraged to use as a starting point any of the existing plugins. Then you should add the resulting Maven project as a dependency (or even a sub-module) in the oxygen-sample-plugins module.

Public Plugin Integration Projects

Some public projects are available on github.com that can be used to help you integrate Oxygen XML Web Author.
  • WebDAV Support for Oxygen XML Web Author (https://github.com/oxygenxml/webapp-webdav-integration) - This project is a very simple integration of Oxygen XML Web Author with a WebDAV-enabled server, which can be extended with more features or can be adapted to work with any CMS.
  • Other Open-Source Plugins - Here is a list with all open-source Oxygen XML Web Author plugins provided by Oxygen. For example, there are plugins for integrating with Google Drive, editing files in a GitHub repository, adding support for special UTF-8 characters, adding support for SVG graphics, adding support for MathML, implementing REST-endpoints for content handling, and more.