cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a library of common functions

attack7
Champ in-the-making
Champ in-the-making
Hi Everyone -

We have 7 or 8 webscripts, and I'm looking for the right way to use only one file to contain things like

*  Constants
*  Commonly used functions (String formatting, sorting, etc)

and include those in the other webscripts.  Is there a suggested mechanism to do this?

Thanks,
Matt
2 REPLIES 2

sbuckle
Champ in-the-making
Champ in-the-making
You can include other webscripts from either the classpath or the repository. Try either one of the following:


<import resource="classpath:/alfresco/extension/lib.js">
<import resource="/Company Home/Data Dictionary/Scripts/lib.js" >

The import statement(s) should be at the top of the script you want to include them in.

attack7
Champ in-the-making
Champ in-the-making
Thanks very much!