The general architecture choice is founded on the J2EE specification which provides a framework for n-tiers enterprise applications.
The choices of conception detailed are subdivided into four layers on the server side :
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.
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.
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 :
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 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 :
|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|
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.
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.*.
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.
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 :
|Method||Reach||Similarity EJB model||Method||Reach||Similarity EJB model||Method||Reach||Similarity EJB model|
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.
Technical services : package fr.paris.lutece.portal.util.
Various technical services are accessible by the application components.
|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/|
The column types and the SQL syntax must be MySQL and PostgreSQL compatible.
The folder structure in the sources of Lutece core is defined as follows and integrates the J2EE specification Servlet 2.2.
|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>/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/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|
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|