Hi Florian
I dynamically create the form definition and template by calling 2 seperate
flowscript functions:

function create_form_def(){

 cocoon.sendPage("form_model-pipeline.xsp" ,
    {questions: questionRegistry.getAllQuestions()});

 }
function create_form_template(){

 cocoon.sendPage("form_templateToXml-pipeline.xsp");
 }

both functions refer to the same pipeline entry:
<map:match pattern="*-pipeline.xsp">
     <map:generate type="jx" src="forms/{1}.xml"/>
      <map:serialize type="xml"/>
    </map:match>

the jx generator creates both the xml form definition and template
correctly. I now want to take the generated definition and template and feed
it back into the cocoon pipeline so that I may view the generated form.

I've been looking at two options:
1. saving the serialized xml output from my generator as a file and using
that file and the default generator to start the pipeline: I have been
looking at the source Writing Transformer (is that a good option? is there
another way to save  )

2. or rather than saving the serialized xml into physical space, to somehow
dynamically feed both serialized xml from the generator (the definition and
template) into a new pipeline entry to display the cocoon form...

those are the 2 thoughts i have atm, but i'm having problems implementing,
I'm not sure if i'm on the right track..

Hopefully i explained my problem well enough... Thanks alot for your help

Regards

On 4/18/07, Dev at weitling <[EMAIL PROTECTED]> wrote:

Hi Rashel,

> I'm trying to generate cocoon forms dynamically. atm I create the cForm
> model xml dynamically
Do you mean the form definition?

> using jx generator; this is what i have:
>
> in my flowscript:
>  cocoon.sendPage("form_model-pipeline.xsp" ,
>     {questions: questionRegistry.getAllQuestions()});
>
> and in my pipeline:
> <map:match pattern="*-pipeline.xsp">
>       <map:generate type="jx" src="forms/{1}.xml"/>
>       <map:serialize type="xml"/>
>     </map:match>

I propose calling it form_model-pipeline.jx rather than .xsp 'cause
that's different.

> the jx generator creates a cForm xml model in correct syntax and is
> outputted as XML to the browser...
You need two things: A definition and a template. The definition
declares the available fields and its types. The template is used for
the arrangement and display of these fields.

> what im trying to do now is feed this newly generated xml model to the
> pipeline so that a Form will be generated and viewed, however i'm not
> really
> sure how to do this, or which part of cocoon docos i sould be reading...
Please have a look at
http://cocoon.apache.org/2.1/userdocs/basics/index.html
I think (I hope ;-) this helps understanding the concepts. And then feel
free to ask again.

> How do I dynamically generate input content to be used as a source in
the
> sitemap??
In short: You may use every cocoon protocol (context:, cocoon:, file:,
http:, ...) as xml input and therefore any pipeline, even those creating
content dynamically.

> Any help would be appreciated...
I hope, this helped :-)
Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to