fbpx
Wikipedia

Apache Cocoon

Apache Cocoon, usually abbreviated as 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. Cocoon's use of XML is intended to improve compatibility of publishing formats, such as HTML and PDF. The content management systems Apache Lenya and Daisy 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.

Apache Cocoon
Developer(s)Apache Software Foundation
Stable release
2.2.0 / May 15, 2008; 14 years ago (2008-05-15)
Repository
  • svn.apache.org/repos/asf/cocoon/trunk/
Written inJava, XML
Operating systemCross-platform
TypeWeb application framework
LicenseApache License 2.0
Websitecocoon.apache.org

Sitemap

Apache Cocoon uses sitemaps to allow users to control a variety of components in the Cocoon software, as well as define the client-server interactions in what Cocoon refers to as the Pipelines.

Components

The components within Cocoon are grouped by function.

Matchers

Matchers are used to match user requests such as URLs or cookies against wildcard or regular expression patterns. Each user request is tested against matchers in the sitemap until a match is made. It is within a matcher that the response to a particular request is specified.

Generators

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.

XSP

One type of generator is an XML Server Page (XSP), an 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). XSPs 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 built-in ("XSP") or user-defined processing tags, both of which are defined in logic sheets. Tags are defined using XSLT templates that describe how the tags (represented as XML nodes) are transformed into other XML nodes or into procedural code such as Java. The tags are used to embed procedural logic, substitute expressions, retrieve information from the webserver environment, and other operations.

Note that XSP is deprecated in recent releases of Cocoon.[citation needed]

Transformers

Transformers take a stream of data and change it 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 commands for example).

Serializers

A serializer turns an XML event stream into a sequence of bytes (such as HTML) that can be returned to the client. Some serializers allow you to send the data in many different formats including HTML, XHTML, PDF, RTF, SVG, WML and plain text, for example.

Selectors

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

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.

Readers

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

Actions

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

The Pipeline

A pipeline is used to specify how the different Cocoon components interact with a given request to produce a response.[1] A typical pipeline consists of a generator, followed by zero or more transformers, and finally a serializer.

See also

  • Reactor pattern - the design pattern that Cocoon is based on.
  • XProc - a W3C Standard for modelising of XML pipeline.

References

  1. ^ "An Introduction to Apache Cocoon 2.1". Developer.com. 2003-10-24. Retrieved 2022-05-26.

External links

  • The Apache Cocoon Project

apache, cocoon, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced, material, challenged, removed, find, sources, news, newspapers, books, scholar, jstor, 2022, learn. This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Apache Cocoon news newspapers books scholar JSTOR May 2022 Learn how and when to remove this template message Apache Cocoon usually abbreviated as 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 Cocoon s use of XML is intended to improve compatibility of publishing formats such as HTML and PDF The content management systems Apache Lenya and Daisy 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 Apache CocoonDeveloper s Apache Software FoundationStable release2 2 0 May 15 2008 14 years ago 2008 05 15 Repositorysvn wbr apache wbr org wbr repos wbr asf wbr cocoon wbr trunk wbr Written inJava XMLOperating systemCross platformTypeWeb application frameworkLicenseApache License 2 0Websitecocoon wbr apache wbr org Contents 1 Sitemap 2 Components 2 1 Matchers 2 2 Generators 2 2 1 XSP 2 3 Transformers 2 4 Serializers 2 5 Selectors 2 6 Views 2 7 Readers 2 8 Actions 3 The Pipeline 4 See also 5 References 6 External linksSitemap EditApache Cocoon uses sitemaps to allow users to control a variety of components in the Cocoon software as well as define the client server interactions in what Cocoon refers to as the Pipelines Components EditThe components within Cocoon are grouped by function Matchers Edit Matchers are used to match user requests such as URLs or cookies against wildcard or regular expression patterns Each user request is tested against matchers in the sitemap until a match is made It is within a matcher that the response to a particular request is specified Generators Edit 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 XSP Edit One type of generator is an XML Server Page XSP an 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 XSPs 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 built in XSP or user defined processing tags both of which are defined in logic sheets Tags are defined using XSLT templates that describe how the tags represented as XML nodes are transformed into other XML nodes or into procedural code such as Java The tags are used to embed procedural logic substitute expressions retrieve information from the webserver environment and other operations Note that XSP is deprecated in recent releases of Cocoon citation needed Transformers Edit Transformers take a stream of data and change it 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 commands for example Serializers Edit A serializer turns an XML event stream into a sequence of bytes such as HTML that can be returned to the client Some serializers allow you to send the data in many different formats including HTML XHTML PDF RTF SVG WML and plain text for example Selectors Edit 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 Edit 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 Readers Edit Publish content without parsing it no XML processing Used for images and such Actions Edit Actions are Java classes that execute some business logic or manage new content production The Pipeline EditA pipeline is used to specify how the different Cocoon components interact with a given request to produce a response 1 A typical pipeline consists of a generator followed by zero or more transformers and finally a serializer See also EditReactor pattern the design pattern that Cocoon is based on XProc a W3C Standard for modelising of XML pipeline References Edit An Introduction to Apache Cocoon 2 1 Developer com 2003 10 24 Retrieved 2022 05 26 External links EditThe Apache Cocoon Project Retrieved from https en wikipedia org w index php title Apache Cocoon amp oldid 1090116744, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.