Apache Cocoon is a Spring-based (since version 2.2 of Cocoon) framework built around the concepts of separation of concerns and component-based development.
Cocoon implements these concepts around the notion of component pipelines , each component on the pipeline specializing on a particular operation. This makes it possible to use a Lego(tm)-like approach in building web solutions, hooking together components into pipelines, often without any required programming.
Cocoon used as web framework is "web glue for your web application development needs". It is a glue that keeps concerns separate and allows parallel evolution of all aspects of a web application, improving development pace and reducing the chance of conflicts. In particular it makes it easy to support multiple output formats, offers continuation based web controller implementations and comes with a JSR-168 compatible Portal implementation.
A block is the unit of modularization in Cocoon (in comparison: Eclipse uses the term plugins, OSGi bundles). Everything that goes beyond what Cocoon provides in its core modules (Spring integration, sitemap and pipeline implementation) is provided as block. Custom Cocoon applications are also developed as blocks. A block can provide the following features:
- general servlet services ( any servlet can be managed by the Cocoon servlet-service framework),
- special services that provide pipelines as services,
- component services (Spring beans, Avalon services/components),
- a container for classes and resources.
- Apache Cocoon is a Spring-based (since version 2.2) framework built around the concepts of separation of concerns and component-based development, ensuring that people can interact and collaborate on a project without stepping on each other toes.
- Cocoon implements these concepts around the notion of component pipelines , each component on the pipeline specializing in a particular operation (usual pipeline uses a Generator, Transformers and a Serializer). This makes it possible to use a Lego(tm)-like approach in building web solutions, hooking together components into pipelines without requiring programming.
- Advanced Control Flow: continuation-based page flow hides the complexity of request/response processing and is cleanly separated from the view and data components.
- Cocoon is open source software (based on the Apache License 2.0 ).
- Cocoon does not duplicate efforts but tightly integrates many technologies.
- Cocoon is in use at many live sites and on many company networks.
- Cocoon has a strong community, with many active developers and more than plenty of active committers!
- There is free support from the thousands of people on our mailing lists and commercial support is available from various companies and consultants.
- There are many Cocoon sessions at different conferences:
- To get started see the Getting started tutorial
Usage scenariosAs you would expect, all of these scenarios can be combined.
- Dynamic multi-channel web publishing (see below for the possible datasources and output formats)
- Create static content (automatically) by separating data from view
- Offline generation modes with Cocoon's own offline facilities: command-line interface (CLI), ant task, bean. Also with Apache Forrest which utilises Cocoon.
- Dynamic document preparation with Apache Forrest, the ' forrest run ' mode. Use many different data input formats, see the transformed result immediately in the browser.
- Advanced web applications with J2EE integration (with separation of your data, the view and the flow logic --> this really means you can change one of the parts without touching another)
- Develop your company portal using the Cocoon Portal framework
- Support multiple clients, layouts and languages (i18n) without code duplication
- Integrate Cocoon with your existing web applications or use it to put a better face on them (page scraping)
- Add full-text search to any datasource that can be converted to XML (see below)
- Use Cocoon as the base for Enterprise Application Integration (EAI)
- Use Cocoon as the base for your Content Management System (CMS) (see Apache Lenya, Daisy CMS and Hippo CMS)
- Use Cocoon for producing mobile content (mobile phones, PDAs)
- Datawarehouse reporting across multiple formats (see xReporter)
Connect your datasourcesOut of the box, the following data can be converted to XML to be processed by Cocoon pipelines.
- XML Files
- XML based (Web) services
- RDBMS (via JDBC, including connection pooling)
- XML databases
- SAP (r) Systems by adding the SAP JavaConnector see http://service.sap.com/connectors/ (accessible for all SAP (r) customers)
- CVS (supported by the external project CVSSource)
- Text-based file formats, either using the integrated Chaperon parser for a yacc-like approach to parsing, or the "slop" component (Simple Line Oriented Parser).
- Velocity templates
- JXPath/Jexl templates
- eXtensible Server Pages (XSP) with wide range of logicsheets (database, mailing, ...)
- Python (Jython) and generic BSF support
- Filesystem (traversing directory hierarchies)
- Any information provided by environment (request, session)
- LDAP - Lightweight Directory Access Protocol
- Easily aggregate different datasources
Transform your XML based on standards
- XSLT (The default XSLT-Engine is Apache Xalan, XSLTC is included in the Cocoon distribution, other XSLT-Engines like Saxon can be easily integrated)
- STX (Streaming Transformations for XML)
- XInclude with XPointer framework support
Serialize your XML to various output formats
- MS Excel
- Charts (see external project Fins)
- Plain text
- Scalable Vector Graphics (SVG)
- ZIP archives
What else we can do for you
- tight integration with the Spring framework
- Modularize your applications using blocks
- Coexist and interoperate side-by-side with your existing J2EE solutions ( EJB, JMS, ...)
- Build your Portals based on Cocoon
- Scheduler - Run background tasks for maintenance, etc.
- Caching on many levels
- Integrated search engine (using Lucene)
- DELI (detect client configuration)
- Catalog Entity Resolver to map to local copies of DTDs and other resources
- Publish your own WebServices ( Apache Axis is integrated)
- Java Mail support
- Easy integration of object-relational frameworks ( Hibernate, OJB, ...)
- I18n support (translation support)
- Easily extensible by clear interfaces
- Many, many examples and samples
- Integration of Java data binding frameworks ( Castor, Betwixt)
Form handling frameworks
- Enhanced form handling with strong validation through Cocoon Forms
- Easy integration of (future) XForms clients