Skip to content

Technical documentation

ylegat edited this page Aug 28, 2012 · 11 revisions

NOT UP TO DATE


Package structure.

  • fr.ippon.wip.config: configuration portlet management;
  • fr.ippon.wip.filter: filter for logging performances;
  • fr.ippon.wip.http: resources for http request / responses;
  • fr.ippon.wip.http.hc: HttpClient management;
  • fr.ippon.wip.ltpa.*: LTPA authentification management;
  • fr.ippon.wip.portlet: configuration and display portlets;
  • fr.ippon.wip.servlet: redirection servlet for downloading content;
  • fr.ippon.wip.state: state of present and past requests;
  • fr.ippon.wip.transformers: data corrections and rewriters call;
  • fr.ippon.wip.util: cache DTD resources and other utilities.

The portlets.

The WIP application is built around two portlets named WIPConfigurationPortlet and WIPortlet. The purpose of the first one is to configure the display of the websites that will be proxied by the second one.

HTTP requests.

HTTP requests set by a WIPortlet instance toward websites are built with the HttpClient library of the Apache project. However, the application doesn't use the DefaultHttpClient implementation directly, but it decorates it in order to encapsulate cache functionalities, along with transformation capabilities.

diagram1

This decoration is performed by the HttpClientResourceManager, which also manage cookies, connection manager etc. Moreover, the HttpClientResourceManager will automatically set a configuration cache as private if it requires so.

Here is a sequence diagram showing the treatment of a standard request through the different concerned entities:

sequence1

It should be noted that if the configuration used set the cache as private, then the HttpClientDecorator would itself be encapsulated inside another CachingHttpClient instance.

Configurations storage.

The configurations storage has been designed in such a way that one can easily integrate a new persistence system in the application. Right now only one persistence system has been implemented: each configuration is split and stored in three different files: one file containing XSLT clipping directives, one file containing XSLT transformation directives, and one XML file for general configuration. Those files are saved in /webapps/wip-portlet/WEB-INF/classes/configurations of the TOMCAT_HOME. The name of this DAO is XMLWipConfigurationDAO.

A DAO can be accessed through the factory named WIPConfigurationDAOFactory. It is possible to decorate any DAO with an instance of WIPConfigurationDAOCache, which provide cache functionalities.

diagram2

Transformations process.

The transformation process takes place in HttpClientDecorator and it is split in two phase: before and after the execution of the request. The transformation which occurs before manage LTPA authentication when needed. The transformation which occurs after manage clipping, HTML, CSS, JSON and javascript transformation according to the response content type.

Here is a sequence diagram of this process for an HTML content :

sequence2

This transformation process can be customized in the configuration view by modifying the XSLT code. This process is quite similar for non-HTML content like CSS or Javascript document, except that CSSTransformer and JSTransformer are used instead of HTMLTransformer.

Clone this wiki locally