OpenWGA 7.6 - OpenWGA Concepts and Features

Plugins » Creating plugins

What is a plugin?

OpenWGA design directories and OpenWGA plugins are closely related. You develop a plugin just by creating a new OpenWGA design directory and giving it a plugin configuration. The assistant to create a new "OpenWGA plugin project" actually does just that. Double-Click the "design.xml" inside a new plugin project to bring up the design configuration. Under tab "Plugin configuration" you will notice that such a configuration has been added to the design config.

The plugin configuration contains:

  • A unique name for the plugin, by which OpenWGA can distinguish individual plugins. It typically has the same format as a Java package. The OpenWGA content manager - which is also a plugin -  for example has the name "de.innovationgate.contentmanager".
  • A version number by which OpenWGA can distinguish versions of plugins with equal unique name
  • Descriptive information like a title, description and vendor information. Those will be presented to the administrator installing the plugin.
  • Various flags about the usage type of the plugin and its behaviour
  • Optionally dependencies  for plugin installation, like minimum Java and OpenWGA version, or dependencies to other plugins, so the plugjn may only be installed if other plugins are also available

Here see the plugin configuration of the basic website kit plugin as an example:

screenshot_44.png

You can find detail information about all the settings available here on chapter Tab "Plugin Configuration" or the Design configuration documentation.

A just created OpenWGA plugin project is already capable of being exported as a normal OpenWGA plugin file to be installed on any OpenWGA server. You can do so by clicking the link Export WGA Plugin to local file system. Another link Export WGA Plugin to remote server would directly install your plugin to any server you have administrative access to. However this new plugin would not have any behaviour defined and just be empty like the design directory it is created from.

For being able to judge how to add behaviour to your plugin, and what is actually possible, you need to know what actually happens when a plugin is installed to an OpenWGA server. As plugin projects are actually much like regular design directories it may not come as a huge surprise that an installed plugin is very much like a regular OpenWGA web application:

  • It consists of a design - your plugin design - and a content store, which is automatically created and maintained (unlike on web apps). It is created in a special HSQL database directory dedicated for plugin content stores.
  • It has a database key, which is automatically issued to it. It consists of the prefix "plugin-" plus some part of the plugin unique name which is able to uniquely identify the plugin on the current OpenWGA runtime.
    • That is why you see "plugin-contentmanager" in the URL everytime you work with it: Because you are accessing the OpenWGA plugin "contentmanager" via its database key.

So an OpenWGA plugin is like a more managed form of an OpenWGA web application, optimized to distribute additional OpenWGA functionalities for any server it gets installed on. Everything a web application can do a plugin can do too, like those things outlined in Extending OpenWGA, plus some special usages for plugins described in the following chapter.

Some additional notes about OpenWGA plugins and their behaviour:

  • OpenWGA plugins are always connected by OpenWGA server before everything else is setup, including database servers, domains, web applications and data sources. This enables them to provide functionalities needed for all of these entities.
  • OpenWGA maintains the versions of plugins and updates them accordingly. When a plugin is updated (i.e. a plugin version is to be installed, either via file or remotely, with higher version number than an already installed one ) then OpenWGA replaces the design of the "plugin application" with the design of the new plugin version, but keeps the plugin content store. The old design version is kept in the plugin management but in status "disabled". If you ever have trouble with your new version you can easily return to the previous one like described in Managing plugins.
  • OpenWGA plugins do not belong to any domain.  They may however choose to use resources from domain "default", like the authentication defined there.
  • OpenWGA plugins are not affected by any global server settings regarding application behaviour (except security related), so they work the same in any environment.