cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Heussen" <heus...@rheinland-online.com>
Subject AW: AW: [Woody/CForms] Multipage forms with woody and one XML source to bind
Date Fri, 16 Jan 2004 09:04:03 GMT


> -----Ursprungliche Nachricht-----
> Von: Tony Collen
> Gesendet: Freitag, 16. Januar 2004 04:43
> An: users@cocoon.apache.org
> Betreff: Re: AW: [Woody/CForms] Multipage forms with woody and one XML
> source to bind
>
>
> Markus Heussen wrote:
>
> > Meanwhile I have found a solution but I don't know if it is the
> elegant way
> > ;-) Maybe you can have a look at it and do a comment? I have
> one source but
> > two or more form defintion files and two or more binding files.
> Also two or
> > more templates.
> >
> >
> > First of all the following call initializes the form part1:
> >
> >
> >
> cocoon.sendPage("form.init?function=contractConclusionForm1&form-d
> efinition=
> > test1&documentURI=test&bindingURI=test1);
> >
> >
> > That calls the following sitemap matcher:
> >
> >
> > <map:match pattern="form.init">
> > 	<map:call function="woody">
> > 		<map:parameter name="function"
> value="{request-param:function}"/>
> > 		<map:parameter name="form-definition"
> >
> value="cocoon:/forms/descriptors/{request-param:form-definition}.d
> escriptor.
> > xml"/>
> > 		<map:parameter name="documentURI"
> > value="cocoon:/forms/sources/{request-param:documentURI}.source.xml"/>
> > 		<map:parameter name="bindingURI"
> > value="cocoon:/forms/bindings/{request-param:bindingURI}.binding.xml"/>
> > 	</map:call>
> > </map:match>
> >
> >
> > Then the function "contractConclusionForm1" is called:
> >
> >
> > function contractConclusionForm1(form) {
> > ...
> > 	doc = flowHelper.loadDocument(documentURI); // globale
> > 	form.load(doc); // bind the document data (first part data
> to first form)
> > 	form.showForm("portal.base?template=test1", // show with
> first template
> > 		{
> > ...
> > 		}
> > 	);
> > 	form.save(doc); // bind the form's data back to the document
> >
> >
> cocoon.sendPage("form.init?function=contractConclusionForm2&form-d
> efinition=
> > test2&documentURI=test&bindingURI=test2);
> > }
> >
> >
> > Then the function "contractConclusionForm2" is called:
> >
> >
> > function contractConclusionForm2(form) {
> > 	form.load(doc); // bind the document data (second part data
> to second form)
> > 	form.showForm("portal.base?template=test2", // show with
> second template
> > 		{
> > ...
> > 		}
> > 	);
> > 	form.save(doc); // bind the form's data back to the document
> > 	flowHelper.saveDocument(doc,"test2.xml");
> >
> > 	cocoon.sendPage("portal.base",
> > 			{
> > ...
> > 			}
> > 	);
> > }
> >
> >
> > Is this stupid?
> >
> > Markus
>
> Well, I don't think putting the function name in the request parameter
> is all that great of an idea (just think if the wrong function gets
> called that happens to do something you really don't want), but I'm not
> all that sure how else it could be done...
>
> Regards,
> Tony
>

Hi Tony,

my sample above is just a code snippet. From my flowscript I call an XSP
page and give it a javascript object. Using jx transformer I create an
<cinclude:src/> using the cocoon protocol that includes the form sources
from an internal pipeline using request parameters to control the form. So I
have everything under control. The request parameters never appear at the
gui.

Greetings, Markus :-)

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


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


Mime
View raw message