OpenCms Architecture

OpenCms has a modular architecture centered on a VFS. The file system is considered virtual as it resides inside a database and not on a hard disk. The VFS is similar to a real file system that supports folders, file types, and permissions. Access permission masks on the files and folders, and controls access that users and groups have to the files. The OpenCms VFS also provides a feature very similar to symbolic links in a Unix file system. A link is a directory entry that contains...

The RSS Client Code

The ROME library makes it extremely simple to parse and read RSS feeds. Thorough documentation on the ROME library can be found at its website. So we will only cover its usage briefly. Rather than use ROME directly in our JSP, we wrap up access to the RSS feed through a Java bean. The Java bean code is very straightforward The URL of the RSS Feed protected String m_strFeed SyndFeedlnput instance protected SyndFeedlnput m_input SyndFeed instance protected SyndFeed m_feed This contains the list...

The RSS Feed Template and Java Classes

Now that RSS Channel Definitions can be created, the next step is to generate the RSS. A template is used for this, and the template-elements property of RSS content instances is used to specify it. As usual, the template goes into the templates folder of a module. Here is what the template code looks like instantiate the RSS bean and get the feed RssFeedBean rss new RssFeedBean pageContext, request, There is not much to it as all the work is done in the RssFeedBean Java class public class...

The Widget Code

By examining the existing OpenCms widget code base, we see that the widget can be based on the SELECT widget, which is implemented by the CmsSelectWidget class. Recall that the SELECT widget obtains its option values statically from the configuration parameter. We will subclass the widget to modify its behavior, so that it will get the data using the Java data source instead. This turns out to be quite straightforward, requiring only a few method overrides public class...