Archive for the 'cocoon' Category

State of the art templating

Micah: “The Apache Cocoon project, where I was honored to work recently, is a central hub of state-of-the-art XML templating engines.”

Lepido, an IDE for Apache Cocoon

EclipseBannerPic.jpg
Today, Sylvain publicly announced the creation of the Lepido project:

The Lepido project is a proposed open source project under the Eclipse Technology Project.

[…] The purpose of this project is therefore to build a set of opensource tools to ease the development of web applications with Apache Cocoon. These tools will include wizards to quickly lay out a project structure, dedicated editors for the various XML files involved in application development, and runtime tools such as debuggers or profilers. Lepido will provide a usable feature set along with an extensible framework to build new editors and features.

I think a good toolset can do much to ease the acceptance of Cocoon among developers. So, welcome Lepido!

On related news, the sixth milestone release of Eclipse 3.1 has also been announced today. I hope it fixes the problems I've been having lately with M5, namely: losing preferences, not reloading changed files after a CVS commit, slow startup time.

Apache Cocoon 2.1.7 Released

cocoon.gif

The Apache Cocoon Community is proud to announce the new release
of Apache Cocoon. This release is licensed under the Apache License,
Version 2.0, and builds/run under JDK 5.0.

Apache Cocoon is a web development framework built around the concept
of separation of concerns (that is: allowing people to do their job
without having to step on each other toes) and component-oriented web
RAD.

Cocoon implements these concepts around the notion of 'component
pipelines' modelled after the 'process chain' concept where each
worker specializes on a particular operation. This makes it possible
to use a Lego(tm)-like approach in building web solutions where
these components can be hooked together into pipelines without
requiring further programming.

We like to think at Cocoon as “web glue” for your web application
development needs. But most important, a glue that can keep
concerns separate and allow parallel evolution of the two sides,
improving development pace and reducing the chance of conflicts.

The latest version is downloadable from
http://cocoon.apache.org/mirror.cgi
(Please use the mirrors to download the release - it might take
a little bit more time until the latest release is available on
all mirrors, so give the mirrors some time - approx. 24h to update.)

For more information about Apache Cocoon 2.1.7, please go to
http://cocoon.apache.org.

The Apache Cocoon Project

Cocoon and Spring

TheLambLiesDownOnBroadway.jpgCarsten: “I'm currently working on a better integration of Spring into Cocoon. Currently, of course you already can use Spring by using the spring servlet (filter) to initialize the application context.”

While the technique Carsten mentions, of using the filter, is something I have already documented here, what he's coming up with is much cooler and will hopefully foster a better integration between Cocoon and Spring. Can't wait to start testing it.

Update: I’ve updated the link to the slides.

RadTech announces Mini Cocoon

CocoonRadTech announces Mini Cocoon, RadPak | MacMinute News: “March 4, 2005 - 03:54 EST RadTech today announced the availability of the Mini Cocoon, a stylish and versatile, semi-rigid clamshell case for iPod mini. A tough, outer clamshell completely encases the iPod mini and a silicone skin allows access to all control elements and ports, providing added protection while nestled in the case, or when used separately apart from the case.”

Sheesh, it's been years that the Cocoon community has been trying to come up with a method to distribute Cocoon as a slim core and a set of optional blocks, instead of the monolithic entity it is now. And to think that these people have it for sale, already, makes you want to break down and cry ;).

(Via Bertrand.)

A gene network for navigating the literature

Robert Hoffmann - A gene network for navigating the literature: “A network of genes and proteins extends through the scientific literature, touching on phenotypes, pathologies and gene function. We report the development of an information system that provides this network as a natural way of accessing the more than ten million abstracts in PubMed. By using genes and proteins as hyperlinks between sentences and abstracts, we convert the information in PubMed into one navigable resource and bring all the advantages of the internet to scientific literature investigation.”

I'm quoting this for two reasons: first, I have a (marginal) professional interest in bioinformatics and second, the system is implemented using Apache Cocoon.

Integrate Cocoon with Lucene for Full Text Search of Unstructured Data

DodoJust found out today that there is a couple of Cocoon-related articles on DevX.com:

Integrate Cocoon with PostgreSQL for XML-driven Apps: “XML and relational databases are a natural fit. Learn how to access PostgreSQL data from Cocoon, so you can develop robust XML-driven applications with a relational backend.”

Integrate Cocoon with Lucene for Full Text Search of Unstructured Data: “By wrapping the Lucene search engine's return data in XML and then using Cocoon's XML-handling capabilities, you tap into the power of XML for multi-channel publishing of unstructured information.”

Unfortunately these articles are a bit outdated, as they present XSP and actions as the prototypical method of integrating data access in Cocoon, while the truth is that they are quickly going the way of the Dodo, to be supplanted by flowscript and the JXTemplate system. You've been warned!

There's only one Hani

It takes style to “pull a Hani”. Unfortunately, some copycats are starting to appear who lack the style and wit of the original and sometimes even the ability to use a spellchecker, like the following moron
(from Google's cache, since he was caught in the act and proceeded to delete the post soon after):

If anyone ever tries to tell you that cocoon is good tell them to fuck off and get a life. It could be the best thing on earth but you wouldn't know as everyone who seem to be or has been involved with the project have been too busy being engaged in mutual feltching to actually explain to anyone how the fucking thing works.

Its such a rancid amalgamation of congealed wank-stains that it even comes with its own ant classes bundled with it as it would have fuck all chance of building in any normal sense of the word. The actual idea of a XSLT framework is a nice one, but just how much deprecated no good to man or beast shite do you need to produce a framework of this sort?

At the core of cocoon is http://excalibur.apache.org/ avalon that excalibur was part of is now officially closed, and I suspect that exalibur will be heading the same way. Sorry cocoon folk but its a monumental fuck up, I have know idea why fuck wits who choose to use this stuff feel that they are in some way superior.

Sheesh…

Building Interactive Web Programs with Continuations

Phil Windley:

This leads to the question: what if I could write programs for the Web that were 'structured' in the programming sense of that word? The result would be Web programs that were more natural to write and easy to read. You'd no longer have to maintain the state of your program outside the language and the data could be kept in variables, where it belongs. The answer is: you can.

Of course you can. This has been possible in Cocoon since a few years ago!

Other continuation-capable web frameworks include Rife and Seaside.

Apache Cocoon Review

Apache Cocoon Logo

Apache Cocoon is a web development framework built around the concepts of separation of concerns (making sure people can interact and collaborate on a project, without stepping on each other toes) and component-based web 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 “building block” approach for web solutions, hooking together components into pipelines without any required programming.


Cocoon is “web glue for your web application development needs”. It is a glue that keeps concerns separate and allows parallel evolution of the two sides, improving development pace and reducing the chance of conflicts.

The website explains quite nicely what you can expect from Cocoon,doesn't it? The problem is that, on the other hand, it does a lousy job of explaining in clear and comprehensive terms how you are expected to work in order to reap all those benefits.

As we all know, great documentation is not a selling point of many Open Source projects, and Cocoon is not different in this respect. Add to it the fact that it is a complex, evolving framework that sometimes gives you too many options when you have to implement something, and you'll begin to understand why the docs, to put it bluntly, largely suck.

Alas, all is not lost. You have a users' mailing list for you beginner's questions and a developers' mailing list where you can discuss Cocoon internals and more esoteric issues. You can expect to find a quick and detailed response on either. Even beginner-level requests for support are not shunned on the dev list, as is the case with some other projects I know of.

Other valuable resources are books (a bit outdated though) and articles that you can find online.

Also, if your pockets are deep enough, you can hire very good consultants to hold your hand while you're dipping your toes in the water for the first time.

To sum it up, don't be put off if at first you're having some difficulties. With a good knowledge of Java and XML, and maybe some external help, you can surpass them quickly.

Well, enough about lack of docs and on to the good stuff.

I started using Cocoon back in the days of version 1.7 (1999 circa) and never stopped. I have developed maybe twenty projects with it and done my small share of contributions, in the spirit of Open Source, that gained me committer status back in 2003, of which I'm very proud.

There are lots of gems in Cocoon, but I would like to draw your attention to a couple of them, in particular: Forms and Flowscript.

The Cocoon Forms framework is one of the more elegant toolkits for doing web-based forms that you can find. It embodies perfectly the Separation of Concerns philosophy of Cocoon, allowing one to separately define form model, definition and appearance.

Continuations-based Flowscript is something that will really revolutionize the way you develop web applications. Without it, implementing complex control flows for the web is a daunting task, forcing you to implement finite state machines and tricks like hidden form fields in order to overcome the inherent statelessness of HTTP. I cannot explain the concept of continuations in this review, but I can assure you that once you get the hang of it, you will never ever want to come back. For an in-depth look, I can refer you to a recent article on developerWorks.

The other great thing about Cocoon is not in the code. It's the community. You won't easily find a community of developers that is like Cocoon's. The best way to appreciate it is to participate in the annual GetTogether event.

Now for some less enthusiastic notes. What I like less about Cocoon is the fact that it's based on the Apache Avalon framework. Avalon was one of the first examples of a framework based on Inversion of Control, and was great for its time, but nowadays it looks quite dated if you compare it to something more modern and less invasive, like Spring or Hivemind.

Should you be worried about this? Not at all. First, you're not supposed to be an Avalon expert to use Cocoon. You can develop a wide range of applications without ever implementing a custom Avalon component. Personally, I like to develop applications by implementing all my business logic with Spring and persistence with Hibernate, using Cocoon's Flowscript to take care of, roughly, the controller part of the MVC triad, and Cocoon's generators, transformers and serializers to implement the view part.

In conclusion, I cannot give Cocoon less than five stars, given how much it has helped me in the latest years. It has its shortcomings, but who hasn't, and you can see them as part of its overall philosophy. There's a Cocoon Way of doing things, and you can bend it, but to a point.

Highly recommended.