Differences between revisions 4 and 5
Revision 4 as of 2005-05-15 16:05:06
Size: 3177
Comment:
Revision 5 as of 2009-09-20 23:27:16
Size: 3191
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 58: Line 58:
 * the tutorial [http://lenya.apache.org/1_2_x/tutorial/anatomy_of_the_pipeline.html Anatomy of the pipeline]  * the tutorial [[http://lenya.apache.org/1_2_x/tutorial/anatomy_of_the_pipeline.html|Anatomy of the pipeline]]
Line 60: Line 60:
 * the [http://www.codeconsult.ch/lots/lots05-bdelacretaz-presentation.pdf presentation] of [http://www.codeconsult.ch/ Bertrand Delacretaz] about Cocoon. There's also a good one-page [http://www.codeconsult.ch/lots/lots05-bdelacretaz-drawing.pdf overview of Cocoon].  * the [[http://www.codeconsult.ch/lots/lots05-bdelacretaz-presentation.pdf|presentation]] of [[http://www.codeconsult.ch/|Bertrand Delacretaz]] about Cocoon. There's also a good one-page [[http://www.codeconsult.ch/lots/lots05-bdelacretaz-drawing.pdf|overview of Cocoon]].
Line 62: Line 62:
 * a good [http://www.xml.com/pub/a/2002/02/13/cocoon2.html article] by Stefano Mazzocchi on xml.com [http://cocoon.apache.org/link/in-the-press.html more articles]  * a good [[http://www.xml.com/pub/a/2002/02/13/cocoon2.html|article]] by Stefano Mazzocchi on xml.com [[http://cocoon.apache.org/link/in-the-press.html|more articles]]
Line 64: Line 64:
 * the book "Cocoon: Building XML Applications" (New Riders). [http://cocoon.apache.org/link/books.html more books]  * the book "Cocoon: Building XML Applications" (New Riders). [[http://cocoon.apache.org/link/books.html|more books]]

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:pipeline>
   <map:match pattern="hello.html">
    <map:generate src="docs/hello.xml"/>
    <map:transform src="stylesheets/page2html.xsl"/>
    <map:serialize type="html"/>
   </map:match>
 </map:pipeline>

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.

Sitemap

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:

Credits

INSTALL.txt from Cocoon

originally contributed by RenaudRichardet

OverviewCocoonKnowledge (last edited 2009-09-20 23:27:16 by localhost)