Domanda

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?

È stato utile?

Soluzione

Your code should be as follow.First try with my code then just replace logic to add path.

if (!document.hasAspect("cm:taggable"))
document.addAspect("cm:taggable"); 
 document.addTag("test");

You can replace "test" with accessed path of your document.

Altri suggerimenti

As @gagravarr says you should save changes. But I think the correct statement is

document.save();

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top