Apache Cocoon

From Wikipedia, the free encyclopedia

In software, Apache Cocoon, usually just called Cocoon, is a web application framework built around the concepts of pipeline, separation of concerns and component-based web development. The framework focuses on XML and XSLT publishing and is built using the Java programming language. The flexibility afforded by relying heavily on XML allows rapid content publishing in a variety of formats including HTML, PDF, and WML. The content management systems Apache Lenya and Daisy (CMS) have been created on top of the framework. Cocoon is also commonly used as a data warehousing ETL tool or as middleware for transporting data between systems.

Contents

The sitemap is at the core of Cocoon. It's here that the web site developer configures the different Cocoon components, and defines the Client/Server interactions in what Cocoon refers to as the Pipeline.

The components within Cocoon are grouped by function.

Matchers are used to match user requests such as URLs or cookies against wildcard or regular expression patterns. Each user request is sent through the pipeline until a match is made. It is from here that a particular request is processed.

Generators create a stream of data for further processing. This stream can be generated from an existing XML document or there are generators that can create XML from scratch to represent something on the server, such as a directory structure or image data.

Transformers take a stream of data and change them in some way. The most common transformations are performed with XSLT to change one xml format into another. But there are also transformers that take other forms of data (SQL for example).

A serializer takes a data stream, makes any required changes, and sends it to the client. There are serializers that allow you to send the data in many different formats including HTML, XHTML, PDF, RTF, SVG, WML and plain text, for example.

Selectors offer the same capabilities as a switch statement. They are able to select particular elements of a request and choose the correct pipeline part to use.

Views are mainly used for testing. A view is an exit point in a pipeline. You can put out the XML-Stream which is produced till this point. So you can see if the application is working right.

Publish content without parsing it (no XML processing). Used for images and such.

Actions are Java classes that execute some business logic or manage new content production.

An XSP page [1] is a Cocoon XML document containing tag-based directives that specify how to generate dynamic content at request time.

Upon Cocoon processing, these directives are replaced by generated content so that the resulting, augmented XML document can be subject to further processing (typically an XSLT transformation).

XSP pages are transformed into Cocoon producers, typically as Java classes, though any scripting language for which a Java-based processor exists could also be used.

Directives can be either XSP built-in processing tags or user-defined library tags. XSP built-in tags are used to embed procedural logic, substitute expressions and dynamically build XML nodes. User-defined library tags act as templates that dictate how program code is generated from information encoded in each dynamic tag.

The Pipeline is used to define how the different Cocoon components interact with different requests to produce a response.

See also XProc models and standardization.

  • Reactor Pattern - The design pattern that Cocoon is built on.
  • XML pipeline - Wikipedia article on XML pipelines, operations, standards and history
  • XSLT - The XML language that Cocoon uses to store its transformations.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.