Sep 10, 2018 2:48:15 PM seb leridon avatar   2851

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 (Cf. 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:

  • new type of porlet [Portlets]
  • new integrated application [Application]
  • new administration feature [Administrative functions]
  • new content service [ContentServices]
  • new insert link service [InsertServices]
  • new page inclusion service [PageIncludeServices]
  • new servlet or servlet filter [PageIncludeServices]

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

In summary, a plugin can contain:

  • 0 to n applications
  • 0 to n specific CSS style sheets
  • 0 to n specific Javascript scripts
  • 0 to n administration functions
  • 0 to n portlets
  • 0 to 1 content service
  • 0 to 1 LinkService insertion services
  • 0 to 1 insertion services of type HtmlService
  • 0 to n servlets or servlet filters
  • 0 to n dashboard

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 / non-installed, 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>

      <!-- Le plugin requiert-il un pool de connexions : 1 - oui, 0 - non -->

      <!-- Feuilles de style CSS spécifiques éventuelles -->

      <!-- Scripts eventuels -->

      <!-- Listes des fonctionnalités d'administration éventuellement introduites par le plugin-->
                    <feature-title>My Feature</feature-title>
                    <feature-description>Description of my feature</feature-description>

      <!-- Listes des portlets éventuellement introduits par le plugin-->
                    <portlet-type-name>MyNew Portlet</portlet-type-name>

      <!-- Application à base de pages spéciales introduite éventuellement par le plugin -->

      <!-- Content Service -->

      <!-- Links Service -->
                    <link-service-label>Link to my URIs</link-service-label>

      <!-- 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