You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Apache Wiki <wi...@apache.org> on 2005/04/21 16:03:01 UTC

[Lenya Wiki] Update of "BasicCocoonKnowledge" by RenaudRichardet

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.

The following page has been changed by RenaudRichardet:
http://wiki.apache.org/lenya/BasicCocoonKnowledge

The comment on the change is:
What you need to know about Cocoon

New page:
= BasicCocoonKnowledge =

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:

 * the '''supersonic tour of cocoon''': deep hidden in the cocoon samples, but VERY GOOD to start with cocoon
 Find it in $COCOON-HOME/samples/blocks/tour/intro/docs/index.html

 * http://redarrow.textdrive.com/archives , especially the '''Part 3: Anatomy of the pipeline'''

 * 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]

 * the book "Cocoon: Building XML Applications" (New Riders). [http://cocoon.apache.org/link/books.html more books]


=== Credits ===

INSTALL.txt from Cocoon

'' originally contributed by RenaudRichardet''

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org