The Jakarta-Jetspeed project permits the construction of enterprise portals by means of portlets.
Portlets are web components that can be used as plug-in and managed by a container (Jetspeed).
The pages are created assembling portlets, which are pieces of pages and their role is giving information from sources.
The use of this technology allows users to construct their own portal, simply choosing where
, how and in which page put the portlets with the different contents.
Portlets can be java applications of several kinds, for example based on ¬?actions¬? ( of Turbine, Velocity or Struts), contents from other sites through RSS , xslt, or publications made with Cocoon .
Another application allowed by portlets is the connection with content management systems , thanks to the fact that portlets are components.
Jetspeed shows the content adapting the language to the user¬?s browser ; which can be an http client or a wap phone.
In order to consent the portability between commercial portlet containers, the java community process has been asked to create a standard for portlets (jsr 168*) .
The comitee is composed by ASF, Oracle, IBM, Sun, SAP, Borland, Novell, and many others.
Framework and components used in Jetspeed
Let¬?s start to see in a logical-functional way how pages are assembled.
The assembling of portlets in a page is made by Turbine.
Turbine is a Jakarta framework for the creation of web application according to the paradigm MVC.
Turbine gives services and functionalities, particularly by means of the actions , services in background and template.
For template Turbine uses Velocity or the Jsp.
Velocity is a Jakarta template engine, with his template (.vm Velocity macro) it is possibile to have access to java objects in his context.
Velocity represents the view of Turbine.
Creation of the pages
The calls to Jetspeed are like this:
The url contains the name of the user who is asking the page and refers to a psml file , even followed by possible params .
The psml file (Portal structure markup language) is an xml file which contains the site structure with the portlet entries for the different pages (but it is also possible to have separated files, for each page, that refer to each other to compose a psml file).
In the psml file it is shown what layout controller must be used to dispose the components that form the page (es.tab-controller, card- controller) .
At this point Jetspeed has all the information to compose the page.
Turbine, starting from the file default.vm of Velocity, that contains the general layoutof pages, creates the portlets according to the scheme imposed by the controller written in the psml.
Fig 1. Jetspeed¬?s architecture
Velocity macro files (vm) are Velocity¬?s templates, they are html files with variables that are substituted by Velocity
An example of the vm file is this default.vm :
In this file Velocity is asked to compose the layout of the page with a top,
a left and a bottom and a piece that is called $screen placeholder and that
we will see later.
The result will be a page like fig 2
Let¬?s see what is $screen placeholder.
As we have said, the psml file contains the portlets that must be visualized for the corresponding pages , and they are inserted for that page in the part called $screen placeholder, according to the modalities given by the controller.
So we will have the page like in fig3 and 4, that is the structure of the pages constructed by Turbine using Velocity¬?s templates.
Fig 3 Turbine Layout
Fig 4 Layout Screen
After the explanation of the most common use, with http calls, let¬?s see other functionalities of Jetspeed.
In the folder WEB-INF\templates we have two subdirectories, Jsp and Velocity, as Turbine can use both templates.
In the subdirectories we have the folder html and wml: in the first are contained the template for browser http, in the second that for wap device.
Fig 5 Jetspeed on http :http://www.anglonaweb.it
Fig 6 Jetspeed on wap
With these template is managed the supplying of the contents on several canals.
The localization is managed by a service from turbine that is used by Velocity (l10n).
Jetspeed exposes even some web-services.
Configurating properly Velocity templates, it is possibile to have even different layouts for the portal pages, the only limit is the fantasy of the graphic who will choose the layout of the site, that will be translated in the Velocity¬?s template.
Structure and content of psml file (Portal structure markup language)
It contains the structure of the user¬?s portal, the portlets that will composed the pages and the controllers for the pages and even the portlets¬? skins.
<?xml version="1.0" encoding="iso-8859-1"?> <portlets xmlns="http://xml.apache.org/jetspeed/2000/psml"> <metainfo> <title>Default Jetspeed Page</title> </metainfo> <control name="TabControl"/> <controller name="CardPortletController"> <parameter name="parameter" value="pane"/> </controller> <skin name="orange-grey"/> ¬? <portlets> <entry parent="HelloVelocity"/> <br> <layout> <br> <property name="row" value="0"/> <br> <property name="column" value="1"/> <br> </layout> <br> </portlets> <portlets> <entry parent="HelloJSP"/> <layout> <property name="row" value="1"/> <property name="column" value="0"/> </layout> </portlets> </portlets>Conclusions