General Architecture

The general architecture choice is founded on the J2EE specification which provides a framework for n-tiers enterprise applications.

General overview of the architecture

The choices of conception detailed are subdivided into four layers on the server side :

  • The presentation layer which ensures user interface management
  • The service layer which ensures the interfacing between business and presentation layer, and also un group of technical services : cache, transformation of XML/XSL to HTML or HTML towards XHTML
  • The business layer ensures the management of objects used to define business activity
  • The data access layer manage the persistence of the business objects

Content restitution schema

The following schema is a simple representation of the content restitution process :

Portal.jsp is the entry point of the restitution.

The presentation bean associated to a JSP, PortalJspBean, dispatches the calls from the content services with respect to the parameters of the request.

If the page is requested, the bean calls the PageService which will either provide the page if it is in the cache or build it.

The construction of the page calls the PageHome to obtain the page requested. Then, the content of each portlet of the page is collected in XML then processed ,with the help of an XSL style sheet, and finally composed to render the page. The newly built page is then put into cache. If an article is requested the schema is the same as above.

If the request corresponds to a search, the bean asks the SearchService to build the result page.

Content creation schema

The following schema is a simple representation of the content creation process for a HTML portlet example taken as example :

The validation of the creation form of a HTML portlet calls the JSP DoCreatePortletHtml.jsp. The processing is then undertaken by the bean.

The first operation is to convert the HTML content into XHTML in order to be able to upgrade to XML later on. Without this operation the HTML content tags can be disturb reading of the XML document which may be malformed.

The creation process continues by storing, at the portlet table and HTML portlet table levels ,into the database.

The creation of a new portlet causes the modification of the page whose modification date is updated in the database.

The indexing service, which is a background task, detects the page modified by looking at the last modification date and indexes it another time by requesting its content through PageService.

Software architecture using blocks : software layers description

1. Presentation layer

The components realizing the presentation and the user interface are gathered into the fr.paris.lutece.portal.web package

This layer consists of JSP, Java Beans and perhaps servlets. HTML code is produced by two ways :

  • In the case of the portal, The HTML produced through transformation of XML with the help of style sheets.The XML content will possibly contain HTML code for all non structured content especially local pages.
  • In the case of the administration module, which does not require many restitution formats,Templates are used.

1.1 The JSP

The role attributed to JSP is limited strictly to the page structure and navigation. The HTML part will be constructed by beans which will use template to construct the code which will be inserted into the JSP pages.

The JSP will mainly consist of :

  • The directive for redirection to the error page : errorPage
  • The directive for static objects inclusion : (ex : HTML code HTML to include a style sheet)
  • conditional branching(<jsp:forward> )

The Java code is forbidden in these pages.

The JSP must all contain a JSP header and a JSP footer. This enables integration of all pages from preprocessing and post processing without needing to modify all the pages (ex : timeout test of session, header and footer of HTML page , link towards a style sheet , addition of statistical processing, ...).

The application is composed with two JSP entities at the end of the page :

Jsp Files Characteristics
AdminHeader.jsp Standard header checking whether user is identified.
AdminHeaderSessionLess.jsp Header for anonymous access JSPs
PortletAdminHeader.jsp Standard portlets header checking whether user is identified.
PluginAdminHeaderSessionLess.jsp JSP header for plugins accessible without identification
AdminFooter.jsp End of standard page

1.2 JspBeans

These beans manages the presentation of the data produced by business objects. They generate HTML code which is inserted in the JSP. These components are found in fr.paris.lutece.portal.web. package and have a JspBean suffix to differ them from the business objects.

The JSP beans are used by numerous JSP handling same data, especially to share constants.

The of the JSP beans(attribute " scope " in bean declaration in the JSP ) must be either a session if it consists of user instance variables or a request if instance variable is absent.

The JSP Beans methods for processing JSPs must be prefixed by " Do " and return the URL of a page which depends on processing result.

1.3 Templates

The HTML templates are .html containing HTML code and perhaps Javascript. The files must obey to XHTML 1.0 transitional recommendation at W3C

The elements to insert in these blocks are generated by bookmarks represented as@variable@. The advantage of these templates is that it can be shared by many JSPs and be modified by web designers without any impact on processing. The templates are stored in the /WEB-INF/templates folder. The base classes of template management are part of the our framework . and corresponds to fr.paris.lutece.util.html.*.

Javascripts must be avoided. Therefore, in the case of the use of javascripts, the compatibilty with Internet Explorer 5.5 and over,Netscape version 6 et +, Mozilla Firefox, and Mac browsers (IE 4.5, Netscape 6, Safari, Mozilla Firefox) must be achieved.

2. Business Layer

The business layer is constituted with various classes of the business objects.

These classes will not contain any technical HTML or SQL code. Its components are packed into packages fr.paris.lutece.portal.business.*.

DAO (Data Access Object) manages persistence of these objects. Its interface contains the main methods to access data through SQL requests : load (SELECT), store (UPDATE), create ( INSERT), drop (DELETE).

In order to approach the design of EJBs, we use a "Home" class for each business object having a DAO. Similarly to EJBs,the purpose of these classes is to ensure proper management of the business object instances.

  • Creation of an instance (method create() )
  • Returns an instance for a specific primary key(method findByPrimaryKey())
  • Returns a instance collection for a specific criterion (method findByCriterion())

To these methods that are found in the interface of Home classes of EJB entity, we will add the methods which usually corresponds to the actions generated by the EJB container. The Home object being the only object having a DAO access, this ensures the modifications and deletions of entities in the database.

At the business level, the call to these methods are done through update() and remove() at the business.

Here is the recapitulation of the interfaces of the different objects, with method links, reach and similarity with EJB entity beans :

Business Objects     Home     DAO    
Method Reach Similarity EJB model Method Reach Similarity EJB model Method Reach Similarity EJB model
      create public X insert package X
      findByPrimaryKey public X load package X
      finbBy... public X selectBy package X
Update public   update package   store package X
Remove public   remove package   delete package X

An important recommendation when conceiving entity beans is to have coarse granularity, i.e. all the business objects must not be implemented as entity beans. All the business objects depending on the main business object, especially in the case it is a read-only resource. must be implemented as a simple class. This object will then be read by the DAO and the main business object.

3. Other Components

Technical services : package fr.paris.lutece.portal.util.

Various technical services are accessible by the application components.

Service Description
AppTemplateService Sends an HTML model called by its name.This service has an "activable" cache which enables to avoid retrieval from disk if model has been previously requested
AppConnectionService Provides connections from a pool The service can be parametrized to use its own pool or the application server's pool.
AppPropertiesService Returns the variable values defined in property files from the folders : /WEB-INF/conf/ and /WEB-INF/conf/plugins/

4. Lutece Database

The column types and the SQL syntax must be MySQL and PostgreSQL compatible.

Database Schema

Application files organization

The folder structure in the sources of Lutece core is defined as follows and integrates the J2EE specification Servlet 2.2.

Core folder structure

Localization File Type Description
src/ *.java Sources of the application
/src/sql *.sql The scripts use for creation and initialization of the database
<webapp>/css *.css CSS style sheets used by default by the application
<webapp>/images/** *.gif,*.jpg,*.png The set of pictograms used by the application
<webapp>/js/ *.js Javascript files used by the whole application
<webapp>/jsp/admin *.jsp Java Server Pages for administrative module
<webapp>/jsp/admin/plugins *.jsp Java Server Pages used for managing the plugins of the administration module.
<webapp>/jsp/site *.jsp Java Server Pages used for front office
<webapp>/WEB-INF web.xml Configuration file for webapp (specs Servlet 2.2). Contains the application servlets declaration
<webapp>/WEB-INF/conf *.properties
  • config.properties : The configuration file of the application.
  • db.properties : The configuration file used for connection pool configuration to database. It namely consists of the declarations :
    • JDBC Drivers
    • Data Source
    • Number of open connections at the creation of the pool
    • Maximum number of connections per pool
    This file is used for an autonomous operation (without an application server).
  • Other property files
<webapp>/WEB-INF/index _*.f* and others The index of the search engine Lucene for the application server
<webapp>/WEB-INF/indexall _*.f* and others The indexes of the search engines for a set of websites defined in the config.properties file
<webapp>/WEB-INF/lib *.jar Archive files containing the classes imported by the application and lutece core. (specs Servlet 2.2)
<webapp>/WEB-INF/logs *.logs The logs of the application.
<webapp>/WEB-INF/taglibs *.tld Taglib files used in the application.
<webapp>/WEB-INF/templates/admin and sub folders *.html The HTML models used for the dynamic construction of the pages. It concerns the blocks of HTML code used by the beans for presentation of the administration module
<webapp>/WEB-INF/templates/site and sub folder *.html The HTML models used for the dynamic construction of the pages. It concerns the blocks of HTML code used by the beans for presentation of the site
<webapp>/WEB-INF/tmp No files Folder used in the upload feature, must be empty after processing
<webapp>/WEB-INF/xsl/admin *.xsl The XSL style sheets used to shape the XML content of the administration module
<webapp>/WEB-INF/xsl/normal *.xsl The XSL style sheets used to shape the XML content on the site
<webapp>/WEB-INF/xsl/wml *.xsl The XSL style sheets used to shape the XML content in WAP mode

Plugin folder structure

A plugin can need a large set of different files Here are the folders designated to hold the files.

Localization Type of file Description
/src/java/fr/lutece/plugins/<plugin_name>/business/ *.java Java source files in the business layer
/src/java/fr/lutece/plugins/<plugin_name>/service/ *.java Java source files of the presentation service
/src/java/fr/lutece/plugins/<plugin_name>/web/ *.java Java source files of the presentation layer
/src/sql/plugins/<plugin_name>/ *.sql The SQL scripts for installation, initialization of the tables of the plugin
<webapp>/jsp/admin/plugins/<plugin_name>/ *.jsp JSP used for administrative purpose
<webapp>/images/local/skin/plugins/<plugin_name>/ *.gif,*.jpg,*.png Images used for administration purpose
<webapp>/images/local/skin/plugins/<plugin_name>/ *.gif,*.jpg,*.png Images used for presentation purpose
<webapp>/images/local/data/<plugin_name>/ *.gif,*.jpg,*.png Images treated as data by plugin
<webapp>/plugins/<plugin_name>/*.* subfolders, all type of files This folder is kept for plugins having specific folder and file needs
<webapp>/WEB-INF/conf/plugins/<plugin_name>.properties *.properties The property file of the plugin
<webapp>/WEB-INF/plugins/ *.xml, plugins.dat, plugin_2_2.dtd File definition of the plugin
/WEB-INF/templates/admin/plugins/ *.html Templates for administrative purpose
/WEB-INF/templates/skin/plugins/ *.html Templates accessible from portal
/WEB-INF/lib/plugin_<plugin_name>_<version>.jar *.jar Jar file containing plugin classes