XML at Jetspeed
May 15, 2000
Jetspeed, part of the Java Apache Project, is a project to create an XML-based enterprise information portal. Naturally, being part of the Apache Project, it's open source.
Though very much still in development, Jetspeed utilizes XML not only in its integration and aggregation facilities, but also at a deeper level inside the application. One feature of Jetspeed's XML support is that it is cutting-edge in its employment of W3C technology. XSLT and XML Schemas drive the heart of the configuration and data-integration code.
In this article I examine the Jetspeed system, its anatomy, capabilities and potential. I've approached Jetspeed from a developer's perspective, rolling up my sleeves and spending some time in the source code. I conclude by examining how Jetspeed could be useful to your organization now, and what's in store in the near future.
What Jetspeed Does
Jetspeed is designed to be a gateway to many information sources. These can include resources from the Internet as well as custom-coded access to services within an organization. XML is used within Jetspeed as the mediating format for incoming data.
The new user of Jetspeed will be struck most immediately by its use of RSS, the XML format for headline syndication (for more on RSS, see the O'Reilly Network RSS DevCenter). Jetspeed's default page presents a view that will be familiar to users of My Netscape and sites of that ilk -- a page made up of boxes showing content from various news sources.
The screenshot below shows the view on my browser after installation.
Figure 1: Default Jetspeed Home Page
However, there's more to Jetspeed than merely being a headline viewer. The boxes of headlines on the front page are, in fact, the representations of so-called portlets--information chunks imported into Jetspeed. By using caching techniques, Jetspeed automatically builds a database of networked resources into portlets, and presents them according to the user's configuration.
Although RSS import is one of the most obvious features, Jetspeed in fact defines a Portlet API, so that components can be written to slot into the framework. Jetspeed ships with a Cocoon and file-system portlet, and work is currently underway for calendaring and groupware components.
I'll go on to unpack these features a little further, but first let's look at where Jetspeed fits into the open source world.
Jetspeed's Family Tree
Jetspeed builds on an extensive amount of other open source work, both from the Apache Project and from other open source authors. Understanding the platform is helpful in order to work with Jetspeed, and there are some useful things to find out on the way.Servlet Engine
Jetspeed is based around Java servlets, so a servlet engine is required to run in the web server. As Jetspeed utilizes the Java servlet 2.0 API, either Apache JServ or the more recent Tomcat engine work fine. Both of these engines are part of the Apache Project.Xerces and Xalan
The Apache XML Project XML and XSLT processors provide the backbone XML parsing and styling functionality in Jetspeed.Castor
Exolab's Castor provides marshalling of XML data into Java objects. Jetspeed uses Castor to import XML data. The code generation component of Castor uses XML Schema definitions in order to create Java classes. At the moment, support is only partial, but this is an exciting use of the new specification in released code.Turbine
Turbine provides an application framework that Jetspeed takes advantage of. Turbine offers features such as database connection pooling, user and session management facilities and security management. Any advanced level of development with Jetspeed will likely require an understanding of the Turbine framework.Cocoon
Once Jetspeed is up and running, it can be managed via through-the-web interfaces. Because Jetspeed sits on top of Turbine, it can be connected to a JBDC source for database connectivity: this is required in order to create user accounts within your portal. Turbine will handle user logins, sessions, etc. The administrator can configure things like the available RSS channels, the Java runtime parameters, and general configuration of Jetspeed's look and feel.
Getting Jetspeed running in the first place requires editing some configuration files, but after that it can be maintained through its online control panel. Let's explore some of Jetspeed's configuration files, as it will give an insight into the internal operation of the system.
All Jetspeed's configuration files are expressed in XML. This makes it easy to get around the source and find out what's going on. The central concept of Jetspeed, the portlet, is represented in XML like this (I've split the Java class names over two lines for clarity, they should be all one line):
<portlets> <entry application="true"> <classname>org.apache.jetspeed.portal. portlets.PortletBrowserPortlet</classname> <metainfo> <title>Channels</title> <description>Browse channels available within Jetspeed</description> </metainfo> </entry> <entry> <url>/content/xml/rss/Jetspeed.rss</url> <classname>org.apache.jetspeed.portal. portlets.RSSPortlet</classname> </entry> </portlets>
The first of these two portlets represents an application, the second syndicated content. The Java classes specified support multiple actions on the portlet, including generating a representation for the portal view, and other views for the display of meta-information and managing the portlet.
A user is the able to arrange the available portlets on their home page. This arrangement is stored within Jetspeed as a Portal Site Markup Language (PSML) document. PSML was invented within the Jetspeed project. Here's an extract:
<portlets> <controller name="org.apache.jetspeed.portal.controllers. CardPortletController"> <parameter name="defaultcard" value="0"/> <parameter name="parameter" value="channel"/> </controller> <control name="org.apache.jetspeed.portal.controls. PanedPortletControl"/> <skin> <property name="selected-color" value="#FFCC00"/> <property name="title-color" value="#FFFFFF"/> </skin> <layout> <property name="row" value="0"/> <property name="column" value="0"/> </layout> <entry ref="Slashdot"> <control name="org.apache.jetspeed.portal. controls.ClearPortletControl"/> <layout position="0"/> </entry> <entry ref="Mozilla"> <control name="org.apache.jetspeed.portal. controls.ClearPortletControl"/> <layout position="1"/> </entry> </portlets>
A PSML document captures the information sources and their layout in the portal, in a structure reminiscent of common GUI layout methods. For a full example, see this complete PSML document from the Jetspeed code repository.
As mentioned above, the most immediately impressive feature of Jetspeed is its support for syndication via RSS. Jetspeed also supports the Open Content Syndication (OCS) XML format in use at xmlTree. This means that users can take advantage of over a thousand channels of content from the Internet into their portal right out of the box.
Jetspeed handles external XML such as OCS by coercing it into a particular XML schema with XSLT, and then utilizing Castor marshalling to bring the data in to memory. So, in the source, you will find an XSLT stylesheet to transform OCS into a list of portlets. (The openness of this approach allowed me to fix a small bug with OCS import in the version of Jetspeed I was testing, simply by tweaking the stylesheet!)
One clever feature of the RSS integration is the support for AvantGo. With a couple of clicks you can send information from your portal page to your Palm Pilot or Windows CE machine. From the way this is implemented, it looks as though plugging in other content destinations would be feasible--for example, instant messaging or paging.
Although RCS and OCS syndication currently is an input-only feature of Jetspeed, the intention of the project team is that outbound syndication of XML be implemented as well. Effectively this will enable Jetspeed to function as an XML routing server, with possible applications in a B2B or e-commerce scenario.
Using Jetspeed Now
Jetspeed is full of promise, but the bad news is that you have to be brave right now to start using it. Recalling the "release early and often" mantra of open source, it's still quite early if you haven't got the time to get involved in the project.
It took me the best part of a day to get my Jetspeed installation up and running, and this was often quite frustrating. Fortunately, there is a mailing list with online archives, which helped a lot.
That said, it's already possible to use Jetspeed to advantage within your organization, if you're willing to cope with its rapidly developing nature. There are two levels at which you might want to plug in to the portal. The first of these is RSS. RSS is an incredibly simple format, with plenty of support libraries and programs available. It represents a quick way of tying in services that already have web representations.
If you want to go further than providing a headline feed of your information into the portal, then you need to write your own code for a portlet. This is where you gain the ability to integrate legacy systems and those without pre-existing web implementations. Through Java code implementing the portlet interfaces Jetspeed can acquire the kind of functionality that commercial EIPs are offering.
Jetspeed's application development page offers some insight as to the possibilities for portlets within the Jetspeed architecture. One example offered up is an LDAP-based phone directory portlet. There are many possibilities for XML applications too, as Jetspeed supports Cocoon-based pages as portlets--this includes support for eXtensible Server Pages (XSP). Cocoon's XSP may be a good way of integrating web applications into Jetspeed without hacking raw Java, and having your applications available for reuse in other scenarios.
What the Future Holds
|• Jetspeed home page|
• Jetspeed mailing
|• Jetspeed CVS repository|
with Kevin Burton
Although functional on a basic level now, Jetspeed is in rapid development, and acquiring some exciting new functionality. The current release is 1.1, but Kevin Burton, the project leader, says that release 1.2 will be available very shortly.
The new release will bring improved administration interfaces, and support for iCalendar. Additionally, Jetspeed will get content management abilities enabling it to create Slashdot-style rolling news publications, whose content can again be syndicated out via RSS.
Burton says that the functionality for the release after that hasn't been finalized yet, but it is likely that Jetspeed will acquire web mail and discussion facilities. Further ideas for the future include device-dependent content negotiation, so that portlets will know what device is browsing them and be able to produce content accordingly.
Despite Jetspeed's early stage of development, the project team has a lot of energy, and there is a realistic prospect of a solid, easy-to-administer, open source portal product in the not-too-distant future. The use of XML technology in particular is very intriguing and has some great possibilities. If you have the resource, then I recommend you spend some time with Jetspeed, and maybe even get involved.