Am Sep 13, 2007 um 15:51 schrieb Andreas Hartmann:
Jürgen Ragaller schrieb:
Hi
I have to implement a rather complex contact form in lenya.
It would be nice to benefit from the cocoon cform features
(validation,
i18n, flow, etc.).
The modules I looked at for inspiration were cforms (using cforms
for a
resource-type/usecase) and contactform (using jx/java without a
cform).
I'm a still a bit confused here
- The cforms module has a custom Flowscript featuring a
customLoopFlow
and a customSubmitFlow
Is it a customSubmitFlow I have to write in my case (and reqister the
form Definition / Binding / View there)?
No idea, I guess Thorsten knows more.
Thorsten, is there already some documentation available about this
feature?
In the usecase framework docu I read that «Some special complex
usecases
might require a custom flowscript, in this case you can't use this
framework». The customSubmitFlow mechanism seems to be an option to
write a custom flow for a 2.0 usecase - or do I walk in the wrong
direction?
The comment in the docs is older than the CForms module. Thorsten
enhanced the usecase framework to allow custom flowscripts.
Thanks a lot for hints about the best practise to write a contact
form
module using a cform (if possible)!
Plain CForms are certainly a good start, I have no idea if the CForms
module is designed for this kind of application. Maybe Thorsten can
tell
you more.
Thanks a lot, Andreas
I managed to setup a cform, writing a customLoopFlow - the validation
is working.
But the working cform has the design of the login screen (no tabs
menu etc.).
To get the cform displayed inside a lenya page envelope I created a
usecase document
using the uri:
usecase=mymodulename.event&lenya.usecase=usecasedocument.create
(as it is done in the contactform module).
This results in a correctly displayed life area lenya page with the
cform inside,
but when I now submit the form I get an error message that the
continuation ID is invalid.
In my custom flow script I basically copied the LoopFlow from
usecase.js and just
added a form definition.
The log after a form submit is somewhat interesting:
SocketListener0-9 WARN flow.manager - WK: Continuation
(3b8d0b332d766e4e6b3e64805668713879690665) lookup for wrong
interpreter. Bound to: file:///Users/jurgenragaller/lenya2src/modules/
usecasedocument/sitemap.xmap, looked up for: file:///Users/
jurgenragaller/lenya2/src/modules-core/usecase/usecase.xmap
SocketListener0-9 ERROR sitemap.handled-errors - The continuation ID
3b8d0b332d766e4e6b3e64805668713879690665 is invalid.
org.apache.cocoon.components.flow.InvalidContinuationException: The
continuation ID 3b8d0b332d766e4e6b3e64805668713879690665 is invalid.
Any help in interpreting the above behaviour is very appreciated -
I've been digging in the dark for a while now...
Jürgen