Customizing Oxygen XML Web Author Component Plugins

The Oxygen XML Web Author Component server side can be customized with a variety of plugin types. We currently provide support for the following extension types:

  • URLStreamHandler - This extensions can be used to integrate the Oxygen XML Web Author Component 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 plugin 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 Component-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 Component. Your implementation will also provide the path to the location where the servlet will be exposed.
  • 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 plugin 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 Component provide icons for plugin-specific actions.

    In the following example, the static resources will be available at [OXYGEN_WEBAUTHOR_INSTALL_DIR]/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 Component loads all files with the .js extension located in the web folder of the plugin.

Adding the Plugins in the Oxygen XML Web Author Component

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

If you are developing a new Oxygen XML Editor plugin 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 Component. The following plugin projects are available:

  • Oxygen XML Web Author Component GitHub Connector (https://github.com/oxygenxml/webapp-github-plugin) - This plugin enables Oxygen XML Web Author Component to open and commit files on GitHub.
  • WebDAV Server Plugin for Oxygen XML Web Author Component (https://github.com/oxygenxml/webapp-webdav-server) - This project is a simple Oxygen XML Web Author Component plugin that provides a WebDAV-enabled workspace by registering the Tomcat built-in WebDAV servlet to manage a folder.
  • 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 Component with a WebDAV-enabled server, which can be extended with more features or can be adapted to work with any CMS.

Was this helpful?