EditLive! allows a wealth of customisation options through the creation of plugins. In addition to customising the editor experience, plugins also make the work of extending EditLive! simpler because they provide
- Easier management and deployment of extensions, particularly across multiple sites.
- More flexibility in deployment, particularly in terms of reducing the start up time of the applet.
This article covers how you should include a plugin within EditLive! v7. It is assumed you already have the plugin as a compiled JAR. In addition, you need to have access to your server to upload the JAR and the ability to edit the EditLive! configuration file used by your instance of EditLive!.
Including a plugin
A plugin is included into EditLive! by two steps. The first is to deploy the plugin JAR file to your server. The second is to configure EditLive! to load and instantiate the plugin.
Deploying the plugin consists of placing the plugin JAR in a location that is "web accessible" to EditLive!. That is, a location on your web server/application server that is accessible by a browser.
While this location can be anywhere on your server we strongly recommend that you do not place your own plugins in the standard plugin folder that is part of EditLive!. We recommend against this as it is very easy to forget to backup and restore your customisations when upgrading EditLive!. Instead we recommend that you create a folder on your server outside of the EditLive! installation.
To illustrate, consider a Tomcat installation with a webapp, “editLiveDemo”, that contains both the EditLive! redistributables folder and pages that instantiate EditLive!. Creating a directory, “myplugins” within the webapp allows you to deploy all your EditLive! plugin JARs to the same location.
The remainder of this article assumes you have deployed your plugin JAR to a folder labelled "myplugins" located in the same directory are the page that included EditLive!
Configuring a plugin to be loaded by EditLive! is a simple case of including a separate <plugin> element in the <plugins> element of your configuration file.
The plugin element tells EditLive! the location and name of the plugin JAR and the Java Class to instantiate.
So, assuming you have a plugin JAR file named "footnotes.jar" with a class of "com.ephox.footnotes.Footnotes" the <plugin> element would look like the following.
<advancedapis jar="myplugins/footnotes.jar" class="com.ephox.footnotes.Footnotes" />
Remember, the plugin was deployed to the "myplugins" directory.
Two important things to note from the config element. Firstly, the "load" parameter tells EditLive! when to load the plugin. In the majority of cases this will be "background", however if your plugin needs to register a View, you will need to "immediate".
The second thing to note is the URL used in the "jar" attribute of the <advancedapis> element. In the example this is relative to the location of the page instantiating EditLive!. It can however be a fully qualified, or root relative URL.
For more details on the available options for the <plugin> element please refer to the reference documentation (http://docs.ephox.com/display/EditLive/plugin)