cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashel Shehata" <rashe...@gmail.com>
Subject Re: dynamic cForm generation
Date Wed, 18 Apr 2007 09:28:07 GMT
Hi Bart
Thanks for your help, but i have tried that path in the morning and
unfortunally was unsuccessful...
when i call

  var form = new Form("form_model-pipeline.xsp" ,
     {questions: questionRegistry.getAllQuestions()});

from my flowscipt, cocoon actually looks for the file "form_model-
pipeline.xsp" ,
so i get the fllowing file not found exception:

java.io.FileNotFoundException:
C:\cocoon\build\webapp\test\forms\test\form_model-pipeline.xsp (The system
cannot find the file specified)

so i think that the aregument of the form constructor is not matched with
the sitemap...

any other help???

thanks again
On 4/18/07, Dev at weitling <dev1@weitling.net> wrote:
>
> Seems we are visited by an old friend - the "Think pull, not push"
> discussion :-)
>
> You can't call the pipelines for definition and display to save them for
> later use. Or differently explained: You can't feed them to a pipeline.
> But you can make a pipeline calling another pipeline which provides its
> results. Completely baffled?
>
> Well, in flowscript it looks like this (incomplete, though):
>
> function myFormFlow () {
> var form = new Form("my-definition-pipeline");
> form.showForm("my-template-pipeline");
> }
>
> In your case this rewrites to:
>
> function myFormFlow () {
> var form = new Form("form_model-pipeline.xsp");
> form.showForm("form_templateToXxml-pipeline.xsp");
> }
>
> Important:
> - in these pipeline calls you may use any of the supported protocols
> - cocoon.sendPage() sends a page to the browser
>
> Hope I put you on the right track :-) Otherwise keep on asking (maybe
> there's someone around here better in pedagogics ;-)
>
> 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..
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message