Skip to content

Technical documentation

ylegat edited this page Jun 4, 2012 · 11 revisions

Package structure.

  • fr.ippon.wip.cache: cache management;
  • fr.ippon.wip.config: configuration portlet management;
  • fr.ippon.wip.cookie: cookies management;
  • fr.ippon.wip.http: http request process, resource downloader, request and response data structure;
  • fr.ippon.wip.ltpa.*: LTPA authentification management;
  • fr.ippon.wip.portlet: main portlet;
  • fr.ippon.wip.rewriters: rewriters for transformation process, called by XSLT;
  • fr.ippon.wip.servlet: redirection servlet in order to download content;
  • fr.ippon.wip.transformers: data corrections and rewriters call;
  • fr.ippon.wip.util: cache DTD resources and other utilities.

The WIPortlet portlet.

The WIP application is build around a portlet named WIPortlet. It implements the two following modes of display : the view display : displays the website for which the portlet is used as a proxy ; the edition display : for configuring the portlet behavior (transform the data received by the proxy, clipping...)

Configuration.

Configuration profiles can be saved in as xml (file {TOMCAT_HOME}/conf/saved-config.xml). The association between a WIPortlet instance and its configuration is saved in {TOMCAT_HOME}/conf/wip-config.xml file. Thanks to JSR-168, a portlet can be easily identified by calling the getNamespace method from a PortletResponse.

diagram1

The WIPConfigurationManager class contains the method allowing to load and save a configuration. Every configuration profile is represented by a WIPConfigurationImpl instance.

HTTP request.

HTTP requests set by a WIPortlet instance toward the targeted website are built with the HttpClient library of the Apache project. An HttpClient instance is encapsulated in the HttpManagerImpl singleton ; it adds cookies and cache manager functionalities (see CookiesManager and CacheManager).

diagram2

Resource download.

Resource download is available with the WIPDownload class : when a non-HTML content is detected by the portlet, an instance of WIPDownloader (which is in fact a thread) is created and the download is started. In the same time, the request process is redirected toward the ResourceHandler servlet. This servlet wait for the end of the download to send the result back to the client.

sequence1

Transformation.

Most of the time, contents must be transformed by the portlet in order to be integrated in the portal environment. 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, except that CSSTransformer and JSTransformer are used instead of HTMLTransformer.

Clone this wiki locally