Nov 4, 2021 3:47:20 PM Thomas Dumont avatar

Lutece plugins


Plugins are components that can be added to Lutece to extend its functionality. They are intended to integrate different types of features by respecting the same mode of installation. The common step of installing a plugin is as follows :

  • Stop the Webapp
  • Unzip the plugin binary distribution in the webapp directory
  • optional Execute the scripts for creating and / or initializing the tables associated with the plugin (see below to locate these scripts in different distributions)
  • optional Configure plugin properties file
  • optional Configure the Lutece file to add a new specific connection pool to the plugin
  • Restart the Webapp
  • Log in ad Admin and go to the Manage plugins function
  • The new plugin should appear not installed in the list of plugins. Click on Install.
  • optional Select the connection pool that may be used by the plugin.

Extensions brought by the plugins

Several types of extensions are planned :

A plugin can contain one or more of these types of extensions. By example, it can introduce a new type of portlet and two administration functions to handle this type of portlet.

Plugins and databases

A plugin can access two databases. he can access the Lutece database through the class AppConnectionService, but it is also possible to assign a specific connection pool to it, declared in the configuration file.

Loading plugins

The plugins are loaded at the start of the webapp by the service PluginService that searches all XML files in the /WEB-INF/plugins directory. To not load a plugin, just remove the XML file from this directory.

Information about the local status of plugins (status installed/uninstalled, specific connection pool, ...) are saved in the plugins.dat file located in the same directory.

If a plugin has a properties file, it must be found in the directory /WEB-INF/conf/plugins. The properties of this plugin will be automatically loaded and added to the properties of the application. They will then be accessible through the class AppPropertiesService.
All properties of a plugin must be prefixed by the name of the plugin to avoid especially any conflict.

The plugin files

A plugin may require a fairly large set and various files. Here are the directories designated for hold these files :

File Type Directory
JSP administrative functions /jsp/admin/plugins/<plugin_name>/*.jsp
Accessible JSPs from the portal /jsp/site/plugins/<plugin_name>/*.jsp
Administration function images /images/admin/skin/plugins/<plugin_name>
Presentation images of the application /images/local/skin/<plugin_name>/*.*
Images managed as plugin data /images/local/data/<plugin_name>/*.*
Plugin properties file /WEB-INF/conf/plugins/<plugin_name>.properties
The plugin definition file /WEB-INF/plugins/<plugin_name>.xml
Administrative function templates /WEB-INF/templates/admin/plugins/<plugin_name> .properties
Application templates accessible from the portal /WEB-INF/templates/skin/plugins/<plugin_name>.properties
The jar file containing the plugin classes /WEB-INF/lib/plugin_<plugin_name>_<version>.jar
SQL scripts for installing and initializing plugin tables (binary distribution) /WEB-INF/sql/plugins/<plugin_name>/*.sql

The organization of the source files is also the following

File Type Directory
Java source files for the business layer /src/java/en/lutece/plugins/<plugin_name>/business/*.java
Java source files from the service layer /src/java/en/lutece/plugins/<plugin_name>/service/*.java
Java source files of the presentation layer /src/java/en/lutece/plugins/<plugin_name>/web/*.java
Message type resources in different languages ​​/src/java/en/lutece/plugins/<plugin_name>/resources/*.properties
SQL scripts for installing and initializing plugin tables (source distribution) /src/sql/plugins/<plugin_name>/*.sql
Documentation in XML format for Maven /src/site/xdoc/[en/]/xdoc/plugins/<plugin_name>/*.xml

The plugin configuration file

The configuration file of a plugin is an XML file like :

<?xml version=1.0 encoding=ISO-8859-1?>
    <description>Description of the plugin</description>
    <provider>Mairie de Paris</provider>
    <copyright>Copyright (c) 2001-2008 Mairie de Paris</copyright>


    <!-- CSS Stylesheets -->

    <!-- JavaScript Files -->

    <!-- Administration Features-->
            <feature-title>My Feature</feature-title>
            <feature-description>Description of my feature</feature-description>

    <!-- Portlets-->
            <portlet-type-name>MyNew Portlet</portlet-type-name>

    <!-- Applications -->

    <!-- Content Services -->

    <!-- Insert Services -->

    <!-- Servlets-->

    <!-- Filters -->
                <param-value>value of param1</param-value>


A plugin DTD is available in the directory /WEB-INF/plugins of the Lutece Webapp.


Some plugins may have their own plugins. These are called modules. Plugins such as mylutece, formengine, codewizard have modules.

The rules for the modules are as follows :

File Type Directory
Java source file packages /src/java/en/lutece/plugins/<plugin_name>/modules/<module_name>/**/*.java
HTML template file localization /plugins/<plugin_name>/modules/<module_name>/**/*.html
Name and location of plugin XML file /WEB-INF/plugins/<plugin_name>-<module_name>.xml
Name and location of the configuration file /WEB-INF/conf/plugins/<plugin_name>-<module_name>.properties