Book Image

Building Websites with OpenCms

Book Image

Building Websites with OpenCms

Overview of this book

This book takes you through the process of creating content-rich websites and applications using OpenCms. Although powerful and flexible, OpenCms can be daunting on first approach, but its advanced features reward the investment in learning. This book exists to ease Java developers into getting the most from OpenCms. OpenCms OpenCms is a professional-level, open source Website Content Management System, with which you can create and manage complex websites. Based on Java and XML technology, it fits into almost any modern IT environment. With hard-won experience of the practical difficulties faced by developers working with OpenCms, this book is the embodiment of the author's expertise, and the perfect way to master the system.
Table of Contents (12 chapters)
Building Websites with OpenCms
Credits
About the Author
Introduction

Creating a Custom Launcher


In Chapter 5, we created a custom resource type, generic XML, which was designed specifically for storing arbitrary XML data. Since creating that resource type, we have developed a JSP to handle XSLT translations on the fly, a scheduled task to transform an entire directory of XML files to HTML using a given stylesheet, and an administration point that runs the same process on demand.

While each of these is useful, another solution to the problem would be to have OpenCms recognize when a file was a genxml document and, if there was an associated XSLT file, automatically transform the file on the fly. In this situation, there would be no additional maintenance aside from creating the XML files and one or more stylesheets.

In this section, we will create a class that implements the com.opencms.launcher.I_CmsLauncher interface for processing the contents of a particular resource type, and we will add this class to our XSLT module. This is an example of how a module...