Book Image

OpenCms 7 Development

By : Dan Liliedahl
Book Image

OpenCms 7 Development

By: Dan Liliedahl

Overview of this book

<p>OpenCms is a professional-level open-source Website Content Management System, based on Java and XML. Many companies or organizations have requirements that go beyond what is available in the standard OpenCms application. Thankfully, OpenCms can be used by Java developers to create sophisticated add-ons and customizations that extend the power of OpenCms in virtually unlimited directions.<br /><br />Targeting version 7 of OpenCms, this book is for Java developers interested in extending and further customizing OpenCms through its Java API.<br /><br />Starting by showing how to set up a development environment for OpenCms work, the book moves you through various tasks of increasing complexity. Some of the common tasks covered are building OpenCms, XML asset type development, templating, module development, user and role setup, and search integration. In addition to these common tasks some more advanced topics are covered such as self-registering users, RSS support, developing custom widgets and extending the administrative interface. All the topics include examples and are presented while building a sample blog site. <br /><br />The skills you develop will make you an OpenCms developer to be reckoned with!</p>
Table of Contents (16 chapters)
OpenCms 7 Development
Credits
About the Author
About the Reviewer
Preface
Index

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:


<%@ page import="com.deepthoughts.rss.*" %>
<%
    // instantiate the RSS bean and get the feed
    RssFeedBean rss = new RssFeedBean(pageContext, request, response); 
    rss.getFeed();
%>

There is not much to it as all the work is done in the RssFeedBean Java class:

public class RssFeedBean extends CmsJspActionElement {
    /** URL parameter to specify the RSS feed format */
    public static final String PARAM_FEED_FORMAT = "fmt";
    /** the VFS path to the RssChannelDef instance */
    protected String m_strChannel;
    /** POJO to represent the channel definition */
    protected RssChannelDef m_rssChannelDef;
    /** Current...