AnsweredAssumed Answered

Understanding Script inclusion

Question asked by leonardo.celati on May 7, 2014
Latest reply on May 8, 2014 by kaynezhang
Coming from s Javascript background I used to include files in html pages which have function in it to be invoked, often with parameters.

Things seems quite different with Alfresco Script (and Web Script). As it is stated in Alfresco Doc

Scripts can also include (or "import") other scripts. The developer can build libraries of scripts that are included at runtime to reduce copy/paste between script files.

I see many example on how to include Script file, and it works (I get no error), but I am missing how to use them from the main caller script.

A real case example: I have a working script 'RenderingScript' which retrieve a given node and creates a rendition and save its transformed file.

I wanted to create another script which retrieves a set of nodes and for each invoke the 'RenderScript'. This could be easily accomplished by encapsulating code into Javascript function, but I don't know how to do this in Alfresco, where this concept is missing (or I am missing).