cancel
Showing results for 
Search instead for 
Did you mean: 

Creating folders and moving files in javascript

beginer
Champ in-the-making
Champ in-the-making
http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook
space.createFolder("Backup") 
does not work in Share.
how to create folders and move files using javascript?
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

when you write "does not work in Share", do you mean a javaScript web script controller you wrote in Share or the JavaScript console available as an addon for Share?
Please note that "space" is a special root object that is only available to scripts executed in the Repository tier and within a content structure context, e.g. a script triggered by a rule, or an action. This object is not available in any web script controller and - although I am only close to a 100 % certain - on-demand scripts executed via the console.

To create folders and move files using JavaScript, you need a script triggered by a rule or action within a specific content context… Please have a look at the wiki section about root objects in JavaScript.

Regards
Axel

beginer
Champ in-the-making
Champ in-the-making
Hello
try to write a script with these features http://wiki.alfresco.com/wiki/4.0_JavaScript_API#Root_Scope_Objects
and make sure it does not work in Alfresco Share

afaust
Legendary Innovator
Legendary Innovator
Hello,

of course - these elements are mostly Repository specific. I think it even says that in the wiki somewhere.

Regards
Axel

beginer
Champ in-the-making
Champ in-the-making
1. Write web script that works in Alfresco.
2. Call this script from Share using /share/proxy/[path to script]
3. PROFIT.