Chapter 23. Extensions

Table of Contents

23.1. Installing extensions
23.2. Installing the X-JSP compiler
23.3. Configuring the extensions system
23.3.1. Settings
23.3.2. Disable/enable extensions

The BASE web client has an extension system that can be used to add functionality to BASE. The extension system should not be confused with plug-ins (Chapter 22, Plug-ins). Extensions are additions to the user interface, for example, additional menus, toolbar buttons, etc. Extensions are for the web interface only, they can not be used on job agents, or by plug-ins. Plug-ins, on the other hand, are used to perform some kind of work, for example, importing, exporing or analysing data, and are not restricted to be used from the web client.

More reading

23.1. Installing extensions

The first step is to install the actual extension code on the web server. Extensions are always packaged as XML or JAR files. To install an extension put the XML or JAR file in the <base-dir>/www/WEB-INF/extensions folder. This is the only place were extensions can be installed.

[Note] Make sure the extensions folder is writable by Tomcat

The extension you are installing may include resources such as HTML files, JSP scripts, images, etc. that needs to be extracted to the web application path before they can be used. This extraction is automatically done by the extensions system, but you have to make sure that the user account Tomcat is running as has permission to create (and delete) new files in the <base-dir>/www/extensions directory.

If you have enabled automatic installation you just have to wait and the extensions will be installed and registered automatically. Otherwise, you have to do a manual scan, using the following instructions.

Go to ExtensionsManual scan...

Figure 23.1. Manual scan

Manual scan

Performs a manual scan for new, updated or deleted extensions. If Force update is checked, extensions that have not been modified will also be re-registered. Leave this option unchecked unless there is any problem with the extension system.

Click on Start to start the scan.

If everything goes well you should get a report of what happend. The new XML or JAR file is hopefully listed as Installed. Click on the + icons to show more details.

Figure 23.2. Scan results

Scan results

23.2. Installing the X-JSP compiler

Some extensions may want to use custom JSP files that also uses classes that are stored in the extension's JAR file. The problem with this is that Tomcat usually doesn't know to look for classes in the WEB-INF/extensions directory. To solve this problem BASE ships with a X-JSP compiler that can do this. This compiler has been mapped to files with a .xjsp extension, which are just regular JSP files with a different extension.

The X-JSP compiler must be installed into Tomcat's internal library folder ($CATALINA_HOME/lib) since this is the only place where Tomcat look for compilers. The installation is easy. Simply copy <base-dir>/bin/jar/base2-xjsp-compiler.jar to $CATALINA_HOME/lib and restart Tomcat.

[Note] X-JSP is experimental

This is an experimental feature that depends on functionality in Tomcat. It may or may not work with future versions of Tomcat. The compiler will most likely not work with other servlet containers.

23.3. Configuring the extensions system

Go to ExtensionsInstalled extensions to display an overview of all installed extensions.

Figure 23.3. Installed extensions

Installed extensions

The left-hand side of the screen shows you a tree with all installed extensions, sorted by extension point and by file. Use the + and - icons to expand and collapse parts of the tree. Click on an item in the tree to display detailed information about it on the right-hand side of the screen.

23.3.1. Settings

Click on the Settings... button to display a popup dialog that allows you to changes some global settings.

Figure 23.4. Extension settings

Extension settings

Auto-installation interval

The number of seconds between each check by the automatic installer. Enter 0 to disable automatic installation. The automatic installation performs the same steps as a manual scan with the Force update option unchecked. The default setting is to have the automatic installation disabled and we don't recommend enabling it in a production environment.

Click on Save to save the settings.

23.3.2. Disable/enable extensions

It is possible to disable specific extensions and/or entire extension points without uninstalling the XML or JAR file. When you click on an extension or extension point in the tree on the left-hand side of the screen a lot of detailed information about it will show up on the right-hand side.

The right-hand side will also have a Disable button. Click on that button to disable the extension or all extensions for an extension point. The button will change to Enable which lets you enable the extension (point) again.