문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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

document.save();

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top