cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco: Add a tag based on the location of the document

robinho
Champ in-the-making
Champ in-the-making


I've been struggling with a little script that should be easy to implement: I've added a rule on a folder that runs a script. The script should get the folderlocation of the uploaded or incoming document and add the location as a tag:

var url = document.properties.locale.nodeRef;
document.addTag(url);

It should be something like this, but this doesn't work. how should I do it?
Is it possible to get the folder-structure of the file as a tag?

thanks
1 REPLY 1

kaynezhang
World-Class Innovator
World-Class Innovator
You can get a node's path by

document.getQnamePath()
or
document.getDisplayPath()

Although you can ,but I dont'think it is a good idea to set folder-structure as a tag.