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:
-
Open a command-line interface (Terminal on macOS/Linux, Command Prompt on
Windows).
-
Navigate to the directory where you want to create your project and type this
command:
mvn "org.apache.maven.plugins:maven-archetype-plugin:2.4:generate"
"-DarchetypeGroupId=com.oxygenxml"
"-DarchetypeArtifactId=web-author-plugin-archetype" "-DarchetypeVersion=26.1"
"-DarchetypeRepository=https://raw.githubusercontent.com/oxygenxml/web-author-plugin-archetype/mvn-repo/"
-
To create the plugin archive, run the following command in the plugin's folder:
mvn package
The archive will be found in the target/ folder with a name
ending in -plugin.jar.
-
To deploy your plugin, you need to upload it in the Web Author's Administration
Page.
-
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's Java code and make live code
changes. The procedure is as follows:
- Import the .war application as a
project in Eclipse:
- .
- Choose .
- Choose your .war file.
- Click Finish.
- On the new project, choose Debug On
Server in the contextual menu. Then create a new server by
choosing a server container supported by your version of Web Author (see the
Software Requirements topic). Before starting the server, check that
the Java version is also supported by doing the following:
- Open the Server view.
- Double-click on the newly created server.
- See the Runtime Environment configuration in the
Overview tab.
Note: If you choose to start
Oxygen XML Web Author using the
WAR (using Eclipse or directly putting the WAR in a Tomcat), make sure that you check
that the
Software Requirements are met.
-
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.
-
In the plugins folder, create a sub-folder with a name of your
choice (for example, myplugin).
-
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.
-
Import your plugin project in Eclipse.
-
Click .
-
Choose Existing Maven Project.
-
Browse for the location of your plugin.
-
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/"/>
-
Connect Web Author to an Oxygen License Server by either connecting to an
already existing one in your company or start one locally by following the steps from
this topic.
-
You can now open a document in the Oxygen XML Web Author and it will
automatically load your plugin.
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.