AnsweredAssumed Answered

How to Identify current space?

Question asked by snig on Mar 30, 2007
Latest reply on Apr 21, 2007 by snig

Me being a pretty new user in Alfresco, am struggling to create a feature.
The requirement is quite simple… I want to create a script which will create a new item (new node) in the current space from where the script is being invoked.
I call this script from a FTL which is actually in the custom view of a new space.

This is the code of the script:

var content = args["content"];
var newNode = space.createNode("test.txt", "cm:content");
newNode.content = content;
result = newNode.content;

Unfortunately, it generates error in space keyword - "space is not defined". My requirement is just to refer the current space and create a new item in that. I create a new space in the companyhome and invoked this script from there and got this error.

Please Help.