Google Summer of Code Proposal - Cocoon Forms Library


by MaxPfingsthorn (email).


Cocoon Forms is a, if not the most, prominent part of Apache's Cocoon framework. With CForms (short of Cocoon Forms), it is possible to define a form independent from the display and handling of the POST/GET data returned from the client browser. It is also possible to bind the input/output of the form to Java Beans or XML streams. This way it is easy to generate complex and mutable forms with server-side validation which produce XML: The core technology used in Cocoon. This project focuses on making the form definitions more readable, portable, extensible, maintainable and sharable. A rough sketch of the desired functionality is available at After the completion of this project, form definition blocks (or widgets) will be able to be defined in separate "widget library" files which can be tied in to a specific definition easily. Also, widgets are inheritable so to override properties or add behaviour as needed in the more specific form definitions. This functionality should also work for form bindings and templates. This would effectively cover all three tiers of CForms.

Benefits to the Community

While CForms is a very widely used feature within the Cocoon Community, it is still heavily under development. Currently, form definitions have to be rewritten many times for very similar cases. Building the briefly described extension will allow CForms to grow even faster and stand out as a formidable feature of Cocoon even more, ultimately advancing Cocoon itself. With already implemented extensions, such as AJAX-based update of rendered forms, CForms is in need of a more handy development interface to reach even more developers.


  1. Complete library implementation as described above, including
    1. import of library files
    2. extending definitions from libraries (e.g. changing id's or adding more validators)
    3. nested inclusing/extension in libraries (libraries include and extend others)
    4. above features also applicable for bindings and templates instead of definitions
    5. improve the current forms cache to exploit the library structure
  2. Documentation for developer usage of the new feature on the wiki as well as the new Cocoon Zone (Daisy)

Project Details

The project will mostly be contained within the Cocoon Forms formmodel class heirachy. After some inspection of the current code and code which already very basically implements parts of this feature (available at SVN Whiteboard, implements only the library loading part within an outdated CForms framework), I come to the conclusion that there should be a separate component to store library definitions which are kept in memory (maybe in a LRUMap commonly used for Last-Recently-Used caches) and provide definition objects of the widgets that are referenced in form definitions. As some kind of inheritance of widgets is required, which is still to be designed and implemented, the general WidgetDefinitionBuilder heirarchy has to be extended to allow for overriding parameters in a given definition of the same kind.

The project will start with an evaluation of the currently available very basic and partial implementation. It will then progress to the design and coding of the missing and to-be-updated parts. Finally, I will throughly test and evaluate my contributions as well as CForms itself and include user documentation.

Project Schedule

The schedule governing the execution of this project would look as follows:

June 24th - July 30th

Evaluation of current state

June 30th - July 24th

Design and coding (and code documentation) of requirements

July 24th - August 10th

Testing and final evaluation

August 10th - August 17th

User documenation on the Cocoon Zone

August 17th - September 1st

Buffer Time


My name is Max Pfingsthorn and I am currently enrolled in the University of Amsterdam, The Netherlands. I pursue a Master of Science in Grid Computing (soon to be Artificial Intelligence, see website) with a specialisation in Multimodal and Intelligent Systems. I started programming around 8th grade in high school, which was about 9 years ago. Since then, my knowledge of programming languages was continually broadened, starting at Pascal to C/C++, Java, Python, PHP, and Assembler. Since about 7 months, I have been working at Hippo where I gained a significant insight into Cocoon and learned to appreciate it a lot. Through my constant exposure to the ASF and its various projects (I am currently working on Slide as well as Lucene, and Excalibur/Avalon of course), I have grown quite fond of the ASF and its great user community. Apart from the experience gained from contributing to such a prestigious ASF project, I would like to get to know the Open Source community better as an active member instead of a passive one. Personally, I have been using Linux and Open Source Software for about 4-5 years, and I cannot wait to be an active part of it.

I am very excited to start contributing!

For more information about me please have a look at my CV.

Best regards, Max Pfingsthorn

CocoonFormsLibraryProject (last edited 2009-09-20 23:41:47 by localhost)