AnsweredAssumed Answered

Help with creating web-scripts

Question asked by mperez on Aug 3, 2017
Latest reply on Aug 4, 2017 by calvo

Hi, I'm new to Alfresco and according to some needs, I need to work on some web-scripts to automate a few things. I got into it followig some examples from JavaScript API Cookbook | Alfresco Community but I can't seem to get them to work.


I made a simple script with Javascript to create a folder, making use of this function: createFolder | Alfresco Documentation.


I copied the .js (with that function call) and .desc files into /Data Directory/Web Scripts/org/alfresco/sample, but when I go to alfresco:8080/alfresco/services/createFolder I see a message saying:


ReferenceError: "userhome" is not defined.

Looks like I can't access any Root Object and I honestly don't know what's going wrong here.


As I said the Javascript file only contains a call to the createFolder() function (actually copied the line of code from the docs) and the desc.xml file contains:


  <shortname>Ejemplo para crear directorio</shortname>
  <description>se crea directorio</description>

Am I missing something? Any help would be much appreciated.