You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2004/02/25 22:20:03 UTC

Flowscript and return to pipeline

Hello,

in some discussions I'd heard that actions and XSP should be more and 
more replaced by flowscript. I think, this is a good idea because 
flowscript is a good way to integrate logic parts into an application. 
But with one thing I cant agree. Why shouldn't it be possible to return 
to the sitemap without sendPage? I had read some discussions about the 
decision, throwing a Exception if no sendPage existst within a 
flowscript but I think this decision was wrong.

In our current project we have to create some Beans from a Database. 
After that, this beans should be integrated into the actual pipeline, 
but this is not possible because a return after the flowscript is not 
possible so we have to use Actions instead brrrr....

This is not possible but would be very very nice:

<map:match pattern="listProducts">
   <map:generate type="file" src="products.xml"/>
   <map:call function="readProductBeans"/>
   <map:transform type="jxt"/>
   <map:transform type="xslt"/>
   <map:serialize/>
</map:match>

Instead we have to do a work arround with an action which every time 
returns null and to put the Beans into the request scope. So we have to 
merge actions and flowscripts in one application but we do not want to 
use actions... So what to do?

An alternative way would be a kind of "linear"-flowscript which is not 
able to redirect into another pipeline. What do you think about this? 
This could be marked in the pipeline with an attribute linear="true" for 
example:

<map:call function="readProductBeans" linear="true"/>

So if you read this line, you can be shure that this flowscript comes 
back and does not redirect into another pipeline.

Thank you.

Regards





Re: Flowscript and return to pipeline

Posted by Stephan Coboos <cr...@gmx.net>.
Christopher Oliver wrote:

> Um, how much harder is this:
>
> <map:match pattern="listProducts">
>  <map:generate type="file" src="products.xml"/>
>  <map:call function="readProductBeans"/>
> </map:match>
>
> <map:match pattern="listProducts-result-pipeline">
>  <map:generate type="jxt"/>
>  <map:transform type="xslt"/>
>  <map:serialize/>
> </map:match>


Yes we had tried this solution, too. But we have much more flowscripts 
than only readProductBeans and for each one we have to split our 
pipeline. Therefore the sitemap will become a unreadable size. The other 
point is, if you (as designer or htmler) dont know, what function 
readProductBeans does you cant decide which pipeline will be called 
next. In you example, it is easy. In real projects it is possible to 
become a terrible find action. It would be more understanding for the 
html-designer if you can say: Here are your templates and with this call 
you can get all your data you need. Do it.

We want to creat a more generic way in which the html-designer is able 
to plug-in his on pipelines. No we are doing something like this and I 
think this is not the best solution:

<map:match pattern="listProducts">
 <map:generate type="file"/>
 <map:act type="listProductAction"/>
 <map:transform type="xslt"/>
 <map:serialize/>
</map:match>

Regards






Re: Flowscript and return to pipeline

Posted by Christopher Oliver <re...@verizon.net>.
Stephan Coboos wrote:

> Hello,
>
> in some discussions I'd heard that actions and XSP should be more and 
> more replaced by flowscript. I think, this is a good idea because 
> flowscript is a good way to integrate logic parts into an application. 
> But with one thing I cant agree. Why shouldn't it be possible to 
> return to the sitemap without sendPage? I had read some discussions 
> about the decision, throwing a Exception if no sendPage existst within 
> a flowscript but I think this decision was wrong.
>
> In our current project we have to create some Beans from a Database. 
> After that, this beans should be integrated into the actual pipeline, 
> but this is not possible because a return after the flowscript is not 
> possible so we have to use Actions instead brrrr....
>
Why do you have to use actions?

> This is not possible but would be very very nice:
>
> <map:match pattern="listProducts">
>   <map:generate type="file" src="products.xml"/>
>   <map:call function="readProductBeans"/>
>   <map:transform type="jxt"/>
>   <map:transform type="xslt"/>
>   <map:serialize/>
> </map:match>


Um, how much harder is this:

<map:match pattern="listProducts">
  <map:generate type="file" src="products.xml"/>
  <map:call function="readProductBeans"/>
</map:match>

<map:match pattern="listProducts-result-pipeline">
  <map:generate type="jxt"/>
  <map:transform type="xslt"/>
  <map:serialize/>
</map:match>