Cocoon Forms

Here is a small writeup on CForms usage. Again, nothing that can't be found in the documentation, just for personal reference:

First create a flowscript that loads the Form resource:
cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");

Next create a function that creates an instance of the Form class with a form descriptor as a constructor argument.
var form = new Form("registration.form.xml");

Now you will call showForm on your form instance and pass a display pipeline as a parameter. CForms will loop within the showForm function until the form validates (as per the form descriptor above):
form.showForm("registration-display-pipeline");

The display pipeline needs to have cform template code within it, typically namespace ft (http://apache.org/cocoon/forms/1.0#template); the form-template element with a continuation-id element within. It will also have cform instance code within it, typically having a namespace fi (http://apache.org/cocoon/forms/1.0#instance).
<ft:form-template action="continue" method="POST">
<ft:continuation-id/>
<fi:group>

The form action continue is caught by the pipeline, simply:
<map:match pattern="continue">
<map:call continuation="{request-param:continuation-id}"/>
</map:match>

The display pipeline needs to have the forms transformer applied to it. It should come before any of your GUI or i18n transformations (correct me if I'm wrong here) and obviously after the generate output described above.
<map:transform type="forms"/>

Finally you can do as you wish with the form model within Flowscript and send the user to a result page with the form model as a parameter:
var model = form.getModel();
var bizdata = { "username" : model.name }
cocoon.sendPage("registration-success-pipeline.jx", bizdata);

The success pipeline simply generates a jx file that takes "username" as a parameter.