Java API - Extending Author Functionality through Java

Oxygen XML Editor plugin Author mode has a built-in set of operations covering the insertion of text and XML fragments (see the Author Default Operations) and the execution of XPath expressions on the current document edited in Author mode. However, there are situations in which you need to extend this set. The following examples are just a few of the possible situations:

  • You need to enter an element whose attributes will be edited by the user through a graphical user interface.
  • The user must send selected element content (or the whole document) to a server for some kind of processing.
  • Content authors need to extract pieces of information from a server and insert it directly into the edited XML document.
  • You need to apply an XPath expression on the current document and process the nodes of the resulting node set.

To extend the Oxygen XML Editor plugin Author mode functionality through Java, you will need the Oxygen SDK available on the Oxygen XML Editor plugin website. It includes the source code of the Author mode operations in the predefined document types and the full documentation (in Javadoc format) of the public API available for Author mode custom actions.

The subsequent Java examples make use of AWT classes. If you are developing extensions for the Oxygen XML Editor plugin XML Editor plugin for Eclipse, you will have to use their SWT counterparts.

Attention

Make sure the Java classes of your custom Author mode operations are compiled with the same Java version used by Oxygen XML Editor plugin. Otherwise, the classes may not be loaded by the Java virtual machine. For example, if you run Oxygen XML Editor plugin with a Java 1.6 virtual machine but the Java classes of your custom Author mode operations are compiled with a Java 1.7 virtual machine then the custom operations cannot be loaded and used by the Java 1.6 virtual machine.

Was this helpful?