Fork me on GitHub

Create a new PageIncludeService


The PageIncludeServices allows inclusion of HTML codde in the pages of the site by means of bookmarks placed in the pricipal page frameset of the portal (page_frameset.html). These services can inject content but are rather used to place technical code to places inaccessible by portlets or XPages. For example, dynamic insertion of links to CSS style sheets or RSS files,in the <head> of HTML pages.


Lutèce integrates par default many PageIncludeServices :

Name Description
Links Insertion of style sheets and Javascripts specificto the installed plugins
Metas Insertion of tag values taken from file
Themes Dynamic management of the path of CSS style sheets depending on scheme associated to the page
Statistics Insertion of HTML code to measure audience.

Default services are declared in file.

The plugins can add new PageIncludeServices by adding in their XML file as shown below :

     <page-include-service-name>My Include Service</page-include-service-name>        


A PageIncludeService must implement the PageInclude interface.

Here is a simple implementation :

public class MyInclude implements PageInclude
    private static final String BOOKMARK_MY_INCLUDE = "@my_include@";
     * Substitue specific bookmarks in the page template.
     * @param template The page template containing bookmarks to substitute
     * @param data A PageData object containing applications data
     * @param nMode The current mode
     * @param request The HTTP request
    public void fillTemplate( HtmlTemplate template, PageData data, int nMode, HttpServletRequest request )
        template.substitute( BOOKMARK_MY_INCLUDE , "My include content" );