Edit online

Setting Up a Development Environment for Plugins

Prerequisite: You will need a recent version of Eclipse EE.

This procedure describes a development environment that can be used to increase your productivity in writing plugins for Oxygen XML Web Author.

Developing a plugin for Oxygen XML Web Author might require repetitive code-testing cycles. Since the process of building a WAR file requires a full Maven build, the whole process might prove to be time consuming. The following procedure provides a faster alternative for testing the plugin:

  1. Go to the following repository and follow the instructions: https://github.com/oxygenxml/web-author-plugin-archetype.
  2. Run Oxygen XML Web Author in a Tomcat server. You can either use one of the installation kits, the WAR distribution, or build it using the Web Author Component Integration sample project.
    Notes:
    • If you are using one of the installation kits, you should disable file security to work with plugins in development mode.
    • If you are using the WAR distribution or the Web Author Component, you can start Oxygen XML Web Author in Eclipse in debugging mode. This allows you to place breakpoints in your plugin code and make live code changes. The procedure is as follows:
      1. Import the .war application as a project in Eclipse:
        1. File > Import.
        2. Choose Web > WAR file.
        3. Choose your .war file.
        4. Click Finish.
      2. On the new project, choose Debug On Server in the contextual menu.
  3. Look in the Tomcat logs (or in the console) for a line like "Loading plugins from: ${path}" and note the path of the plugins folder.
  4. In the plugins folder, create a sub-folder with a name of your choice (for example, myplugin).
  5. In that folder (myplugin), create a plugin.redirect file that contains the path to your plugin project (created in steps 1 and 2) on a single line.
  6. Import your plugin project in Eclipse.
    1. Click File > Import.
    2. Choose Existing Maven Project.
    3. Browse for the location of your plugin.
  7. Modify the plugin.xml file to add a library reference to the directory where Eclipse places the compiled output.
    With the default setup of a Maven project, this step requires that you add the following element inside a <runtime> element:
    <library name="target/classes/"/>
  8. You can now open a document in the Oxygen XML Web Author and it will automatically load your plugin.
    Every time you make changes to the plugin sources, you will need to restart Oxygen XML Web Author.

If you are happy with the result, you can proceed with integrating the plugin into your SDK project and follow these instructions to perform a final testing of the project.