Apache » Cocoon »

  Cocoon Core

Cocoon Core 2.2


Cocoon core provides implementations of the sitemap engine and pipelines. In brief, a sitemap connects a request with a pipeline. This is a simple sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
      <map:match pattern="demo.html">
        <map:generate src="demo/welcome.xml"/>
        <map:transform src="demo/welcome.xslt"/>
        <map:serialize type="html"/>

If a request with the path demo.html hits this sitemap, the defined matcher activates enclosed sitemap instructions, which assemble a Cocoon pipeline. This pipeline consists of a generator (parses input stream and creates XML in the form of SAX events), a transformer that consumes XML in form of SAX events, transforms it, and omits transformed XML again in the form of SAX events (in this case transformation is based on an XSLT stylesheet) and a serializer that consumes SAX events and creates an output stream.

This documentation contains a more detailed explanations what the sitemap language provides and how you can plugin your own components.

Cocoon core also defines the contract for the integration of controller technologies. There are several implementations (Flowscript, Apples, Javaflow) in the form of blocks for it.

Cocoon's unit of modularization are so-called blocks. Everything that goes beyond providing core contracts and the most important implementations of them, has been moved into its own block.