On 03/14/2012 08:24 PM, Mika M Lehtonen wrote:
14.3.2012 20:00, Andre Juffer kirjoitti:
On 03/14/2012 07:31 PM, Mika M Lehtonen wrote:
Hi list,
I started to experiment with the Cocoon 2.11 after a long while. I did
some adjustment on the registration example.

I added this to the samples/blocks/forms/ sitemap:

Did you to say here that this particular sitemap is a subdirectory
called "forms"...
that is ...cocoon/samples/blocks/forms/sitemap.xmap

<map:match pattern="registration.mika">
<map:generate src="forms/registration2.xml"/>

if yes, then this probably would try to load a file in
forms/registration2.xml, that is subdirectory of forms, thus
forms/forms/registration2.xml in the block context.
This one works
http://host:8080/cocoon/samples/blocks/forms/registration.mika
The actual file is here:
/home/tomcat/webapps/cocoon/samples/blocks/forms/forms/registration2.xml

Thus, your sitemap is at the top directory (block context) and not in forms/forms directory. You registration2.xml should then be in forms/registration2.xml and not in forms/forms/registration2.xml.


You did read this all, right?

http://cocoon.apache.org/2.1/userdocs/binding.html

Forms can be pre-filled using something like

?xml version="1.0" encoding="UTF-8"?>
<fb:context
    xmlns:fb="http://apache.org/cocoon/forms/1.0#binding";
    path="/" >

  <fb:value id="surname" path="surname" />
  <fb:value id="initials" path="initials" />
  <fb:value id="firstname" path="firstname" />
  <fb:value id="email" path="email" />

</fb:context>

Still, I would argue not to use this, and move this all to the client and use a toolkit like dojo instead. This is much more efficient.



<map:serialize/>
</map:match>
and this modification to the registration.js
var form = new Form("registration.mika");

This is not working. Obviously this is trying to fetch a file with that
name.
java.io.FileNotFoundException:
/home/tomcat/webapps/cocoon/samples/blocks/forms/registration.mika (No
such file or directory)

How can I make this work with the pipelines?

I am trying to create forms based on data in database, anyway that is
the ultimate goal. I found some examples how to use pipelines in flow
script, but I haven't been able to get them work.

An alternative is to send the form data back to the client, and let
the client create the form, instead of creating the form plus form
data by the server. See for instance the dojotoolkit (do not use the
one included in cocoon, nor required at all).
Original question still remains; how can I use data from pipelines in
flowscript instead of static files, or can I?

- mika -




cheers,
- mika -


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



--
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juf...@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
Triacle Biocomputing         | WWW: www.triacle-bc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to