cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Rosenberger" <>
Subject Re: Prefill form with Woody and XML without binding?
Date Wed, 12 May 2004 19:03:46 GMT

> Joerg Heinicke wrote:
> Ah, if you have already XML and need it in the backend too, then the
> conversion is not of sense of course. I thought you convert it in the
> generator/transformer from/to XML, e.g. via castor or another java/xml
> convertor.

No, it is already XML. No conversion done.

> Ok, than let's go on with it:
> <map:match pattern="form">
>   <!-- pass the control to flowscript -->
>   <map:call function="form"/>
> </map:match>

Here is the binding framework missing, I think. Is your solution without 
using the binding framework? How is the binding form vars <=> input xml doc 

The binding example uses parameters.

   <map:call function="woody">
       <map:parameter name="function" value="form2xml"/>
       <map:parameter name="form-definition" value="forms/wd_movie.xml"/>
       <map:parameter name="documentURI" 
       <map:parameter name="bindingURI" value="forms/wb_movie.xml"/>

> <map:match pattern="shwoForm">
>   <!-- show the form to the user -->
>   <map:generate src="formTemplate.xml"/>
>   <map:transform type="woody"/>
>   <map:transform type="woody-samples-styling.xsl"/>
>   <map:trasnform type="i18n"/>
>   <map:serialize type="html"/>
> </map:match>

That is nearly the same.

> <map:match pattern="getData">
>   <!-- flowscript calls this pipeline to get the data -->
>   <map:generate type="yourGenerator"/>
>   <map:serialize type="xml"/>
> </map:match>

Done this, too.

> <map:match pattern="showResult">
>   <!-- after finishing you maybe want to present a result, below is
> just an example -->
>   <map:generate type="xsp" src="result.xsp"/>
>   <map:transform src="result2html.xsl"/>
>   <map:serialize type="html"/>
> </map:match>

Don't wanna use xsp. Is there a alternative in this case? I use usually 
JXTemplate Generator.

> function form() {
>     initializeForm(); //pseudo code

What do you mean with this?

>     //call pipeline to get the data
>     var doc = cocoon.processPipelineToDOM("getData");

Ok, that sounds good.

>     //bind the data to the form
>     form.load(doc);

See above. How is binding done??

>     //show the user the form
>     form.showForm("showForm");
>     //save the data back to the XML
>     //get the object that will pass the data back to db or what ever

>     var component =
>     cocoon.createObject("your.component.FormerlyKnownAsTransformer");
>; //pseudo code

This is not as easy. Because my transformer has configuration files and so 
Pass some of this configuration to my backend processes. (it's not just one 

>     cocoon.release(component);
>     //at the end show a result
>     cocoon.sendPage("showResult");
> }
> I hope this code is understandable.

Yes, it is!

>I kicked your transformer and made a pure component out of it. A 
>transformer > should in theory only transform documents and not interact 
>with a backend.

What about a SQLTransformer? ;-)

> Also calling a pipeline that controls the storage sounds not that
> preferable. In the above the
> flowscript controller has the control. I would maybe also abstain from
> the generator and call the same component. If you need the generator and
> the transformer in other cases, you could also call that component.
> That's better reuse I think.

Thanks for your proposal. See my questions above!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message