Edit online

Customizing Web Author with Plugins

What is a Plugin

A plugin (also referred to as an 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

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 extension can be used to integrate the Oxygen XML Web Author with an XML database or CMS. Some examples include the WebDAV connector and the REST API connector.
    Note: For details about implementing an authentication mechanism, see Implementing a CMS Authentication Mechanism.
  • WorkspaceAccess - This extension can be used to execute code when the application is started. For example, you can:
    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.
    Note: Most of the methods used to configure the Oxygen XML Editor/Author GUI are unavailable in these extensions.
  • WebappServlet - This extension allows you to provide an implementation of a servlet-like interface (ro.sync.ecss.extensions.api.webapp.plugin.ServletPluginExtension) 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.

  • WebappServletFilter - This extension allows you to provide an implementation of a servlet filter (javax.servlet.Filter) that will be dynamically loaded by Oxygen XML Web Author.
  • AuthorStylesheet - Allows you to add a stylesheet (CSS or LESS) used for rendering all XML documents. For more details, see Author Stylesheet Plugin Extension.
  • 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"/>
    Note: You can find a sample plugin that uses this extension here.
  • WebappCSSResource - This extension allows you to specify a CSS stylesheet in the plugin descriptor file to be loaded for styling the Web Author interface. All the CSS resources declared by all plugins will be loaded in one single request.

    For example:
    <extension type="WebappCSSResource" href="web/static/style.css"/>
    Note: The path is relative to the base directory of the plugin.
    Warning: The encoding used to load a CSS resource in Web Author is UTF-8. CSS files that use other encoding might fail to load.

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 any of the existing plugins as a starting point. 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.