You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2005/10/14 11:57:19 UTC

Linking/including mutiple flowscript files

Is it possible to have one "master" flowscript file
which links or includes other "child" flowscript files,
in much the same way as XSL uses the "include" 
statement?

If so, how?; if not, what is the best design approach 
for ensuring a clean design around location of logic
in appropriate places?
 
Thanks
Derek


-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
HelpDesk@csir.co.za.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: Linking/including mutiple flowscript files

Posted by Sylvain Wallez <sy...@apache.org>.
Derek Hohls wrote:

>Is it possible to have one "master" flowscript file
>which links or includes other "child" flowscript files,
>in much the same way as XSL uses the "include" 
>statement?
>
>If so, how?; if not, what is the best design approach 
>for ensuring a clean design around location of logic
>in appropriate places?
>  
>

use "cocoon.load()" in your scripts to load the current script's 
dependencies.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


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


Re: Linking/including mutiple flowscript files

Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
* Leszek Gawron:

> Derek Hohls wrote:
>
> >Is it possible to have one "master" flowscript file which links
> >or includes other "child" flowscript files,
>
> you can use  cocoon.load( scriptUri ) in your  main script e.g.:
> cocoon.load("...Form.js");
>
> I  have  a feeling  there  are  some  caching issues  with  this
> approach.

Not really  *caching* issues, but rather  *reloading* issues.  The
« child »  script will  only get  reloaded if  you touch  the main
script.  A bit boring when doing intense development.
-- 
Jean-Baptiste Quenot
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/

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


Re: Linking/including mutiple flowscript files

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Derek Hohls wrote:
> Is it possible to have one "master" flowscript file
> which links or includes other "child" flowscript files,
> in much the same way as XSL uses the "include" 
> statement?
> 
> If so, how?; if not, what is the best design approach 
> for ensuring a clean design around location of logic
> in appropriate places?
you can use cocoon.load( scriptUri ) in your main script e.g.:
cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");

I have a feeling there are some caching issues with this approach.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


Re: Linking/including mutiple flowscript files

Posted by Upayavira <uv...@odoko.co.uk>.
Derek Hohls wrote:
> Is it possible to have one "master" flowscript file
> which links or includes other "child" flowscript files,
> in much the same way as XSL uses the "include" 
> statement?
> 
> If so, how?; if not, what is the best design approach 
> for ensuring a clean design around location of logic
> in appropriate places?

load("path/to/flowscript.js");

Same as you use at the top for loading form.js.

Upayavira

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


Re: Linking/including mutiple flowscript files

Posted by Andre Juffer <An...@oulu.fi>.
Derek Hohls wrote:
> Is it possible to have one "master" flowscript file
> which links or includes other "child" flowscript files,
> in much the same way as XSL uses the "include" 
> statement?

You could use something like

cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
cocoon.load("context:/app/flow/hibernate.js");


which you would place at the top of your master flowscript file. All the 
function listed in hibernate.js (for example) are visible in your master 
  file. There would be no need to define the hibernate.js in your 
sitemap, just for instance

   <map:flow language="javascript">
     <map:script src="flow/your-master-flowscript-file.js"/>
   </map:flow>



> 
> If so, how?; if not, what is the best design approach 
> for ensuring a clean design around location of logic
> in appropriate places?
>  
> Thanks
> Derek
> 
> 


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/

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