The WebApp 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 WebApp 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.
- WorkspaceAccess - Most of the methods used to configure the Oxygen XML Editor
GUI are unavailable in theses extensions, but they can still be used, for example, to
configure a javax.xml.transform.URIResolver.
- 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 WebApp 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 WebApp Component
provide icons for plugin-specific actions.
In the following example, the static resources
will be available at
[OXYGEN-WEBAPP]/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 WebApp Component loads all files with the .js extension
located in the web folder of the plugin.
Adding the plugins in the WebApp Component
If you have already developed such Oxygen XML Editor 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 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.