You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Joseph <pj...@gmail.com> on 2012/10/05 13:32:17 UTC

two scripts to handle flowscript in one sitemap

Hi there,

I have a flowscript that has a lot of functiofnality (functions).

It is possible for one sitemap to handle more than one flowscript? That 
way I can split this file out into smaller units associated with the 
submenus.

(Cocoon 2.1.11,  Apache Tomcat 7, Windows 2008)

brgds
Paul

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


Re: two scripts to handle flowscript in one sitemap

Posted by Paul Joseph <pj...@gmail.com>.
Great, good to know, thank you, will make things much "cleaner".

Paul

On 10/5/2012 7:40 AM, Javier Puerto wrote:
> Hi Paul,
>
> I can tell you for 2.2 version, but you can try...
>
> 2012/10/5 Paul Joseph <pjoseph@gmail.com <ma...@gmail.com>>
>
>     Hi there,
>
>     I have a flowscript that has a lot of functiofnality (functions).
>
>
>     It is possible for one sitemap to handle more than one flowscript?
>     That way I can split this file out into smaller units associated
>     with the submenus.
>
>
> We had the same issue. You can load more than one script, also if I 
> remember correctly, you can use functions defined in the same 
> sitemap.xmap. Like a web page, the declaration order is important.
>
>   <map:flow language="javascript">
>     <map:script src="flow/utils.js" />
>     <map:script src="flow/script1.js" />
>     <map:script src="flow/script2.js" />
> ...
>     <map:script src="flow/scriptN.js" />
>   </map:flow>
>
>
>
>     (Cocoon 2.1.11,  Apache Tomcat 7, Windows 2008)
>
>     brgds
>     Paul
>
>
> Salu2
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     For additional commands, e-mail: users-help@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>
>


Re: two scripts to handle flowscript in one sitemap

Posted by Javier Puerto <jp...@gmail.com>.
Hi Paul,

I can tell you for 2.2 version, but you can try...

2012/10/5 Paul Joseph <pj...@gmail.com>

> Hi there,
>
> I have a flowscript that has a lot of functiofnality (functions).
>

> It is possible for one sitemap to handle more than one flowscript? That
> way I can split this file out into smaller units associated with the
> submenus.
>

We had the same issue. You can load more than one script, also if I
remember correctly, you can use functions defined in the same sitemap.xmap.
Like a web page, the declaration order is important.

  <map:flow language="javascript">
    <map:script src="flow/utils.js" />
    <map:script src="flow/script1.js" />
    <map:script src="flow/script2.js" />
...
    <map:script src="flow/scriptN.js" />
  </map:flow>




>
> (Cocoon 2.1.11,  Apache Tomcat 7, Windows 2008)
>
> brgds
> Paul
>

Salu2

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

Re: two scripts to handle flowscript in one sitemap

Posted by Paul Joseph <pj...@gmail.com>.
Thanks Robby, good to know, will make use of this ability.

Paul
On 10/5/2012 7:37 AM, Robby Pelssers wrote:
> Not sure what you mean..
>
> For all I know you can just store all your flowscripts in the flow folder and cocoon will load all of them on startup.  So all functions should be available from your sitemap.. even when split into multiple files.
>
> So let's say you have
> File1:
> -----------
> Function func1() {}
>
> File2:
> ----------
> Function func2() {}
>
> File3:
> --------
> Function func3() {
>      //you should be able to call func1 and func2 because they will be available
>      Var res1 = func1()
>      Var res2 = func2()
>      Cocoon.sendPage("somePipeline", {x: res1, y: res2})
> }
>
>
> In your sitemap:
>
> <map:call function="func3"/>
>
> -----Original Message-----
> From: Paul Joseph [mailto:pjoseph@gmail.com]
> Sent: Friday, October 05, 2012 1:32 PM
> To: users@cocoon.apache.org
> Subject: two scripts to handle flowscript in one sitemap
>
> Hi there,
>
> I have a flowscript that has a lot of functiofnality (functions).
>
> It is possible for one sitemap to handle more than one flowscript? That way I can split this file out into smaller units associated with the submenus.
>
> (Cocoon 2.1.11,  Apache Tomcat 7, Windows 2008)
>
> brgds
> Paul
>
> ---------------------------------------------------------------------
> 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
>
>


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


RE: two scripts to handle flowscript in one sitemap

Posted by Robby Pelssers <Ro...@nxp.com>.
Not sure what you mean..

For all I know you can just store all your flowscripts in the flow folder and cocoon will load all of them on startup.  So all functions should be available from your sitemap.. even when split into multiple files.

So let's say you have 
File1:
-----------
Function func1() {}

File2:
----------
Function func2() {}

File3:
--------
Function func3() {
    //you should be able to call func1 and func2 because they will be available 
    Var res1 = func1()
    Var res2 = func2()
    Cocoon.sendPage("somePipeline", {x: res1, y: res2})
}


In your sitemap:

<map:call function="func3"/>

-----Original Message-----
From: Paul Joseph [mailto:pjoseph@gmail.com] 
Sent: Friday, October 05, 2012 1:32 PM
To: users@cocoon.apache.org
Subject: two scripts to handle flowscript in one sitemap

Hi there,

I have a flowscript that has a lot of functiofnality (functions).

It is possible for one sitemap to handle more than one flowscript? That way I can split this file out into smaller units associated with the submenus.

(Cocoon 2.1.11,  Apache Tomcat 7, Windows 2008)

brgds
Paul

---------------------------------------------------------------------
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