Summary
This tutorial covered the fundamental principles of developing Cocoon 2 applications.
After explaining how to install Cocoon, I introduced the pipeline model that defines the basic architecture of the Cocoon framework. I then examined the concept of a pipeline made up of individual processing steps. Processing at each stage in a pipeline is carried out by different kinds of components, which are classified by the roles they play in passing data through a pipeline. Generators are responsible for feeding data into a pipeline where it can be manipulated using transformers, and results are delivered in multiple formats using serializers.
Next, I covered the basics of the Cocoon sitemap. The sitemap is an XML configuration file that sits at the heart of the Cocoon framework and is responsible for declaring individual components, as well as defining how those components are used to construct pipelines. Declaring components within the sitemap provides Cocoon with a great deal of extensibility, allowing the plug-and-play addition of new implementations. I provided a number of examples that demonstrate how to:
- Use matchers and wildcards to flexibly associate content with pipeline processing
- Serve static files using readers
- Transform XML content with XSLT style sheets using transformer components
- Use different kinds of serializers, and specific XSLT transformations to deliver content in many different formats
This tutorial has only touched on the capabilities that Cocoon 2 offers. Later tutorials in this series will discuss in more detail the various Cocoon components, particularly selectors and actions. XML Server Pages, a Cocoon technology for adding custom processing to Cocoon pipelines using Java, will also be introduced.


