Let me guess: you would like to learn cocoon in 2 minutes, right?

Great, this wiki is for you.

Cocoon in a Nutshell

Cocoon is based on the key concept of pipelines. As the name suggests, the pipeline connotes a series of events, which consists of taking a request as input, processing and transforming it, and then giving the desired response.

A pipeline consists of:

  • A Generator, which generates XML data for further processing.
  • Zero or more Transformers, which process, transform or complete the XML data.
  • A Serializer, which transforms the XML data into the appropriate text or binary format for the client.

Here a very basic example:

   <map:match pattern="hello.html">
    <map:generate src="docs/hello.xml"/>
    <map:transform src="stylesheets/page2html.xsl"/>
    <map:serialize type="html"/>

This pipeline matches any request made to hello.html. It then generates XML from hello.xml, applies an xslt transformation on it, and finally serializes it as an html.


The sitemap is often referred to as the heart of Cocoon. It primarily consists of declarations for pipelines (like the one above), components, and resources. Whenever a request comes in, this is where it all begins.

The best way to understand what the sitemap does is to open the sitemap.xmap file in your favorite XML editor and study and fiddle with the existing XML structure, or create your own bits of XML.

Now, you have two choices:

a) close this wiki and try to hack Lenya by yourself

b) keep reading

Go ahead and choose option a), but don't complain if you can't figure out how to modify Lenya for your needs.

Still here? good. You won't regret it.

If you intend to use Lenya without modifying it much (that is: stick to the default publication and just edit some xslt's), then you should be fine with little Cocoon knowledge. However, if you want to harness the power of Lenya, then you should strongly consider spending some time learning some of the basics of Cocoon.

Here some selected ressources:


INSTALL.txt from Cocoon

_ originally contributed by RenaudRichardet_

  • No labels