AnsweredAssumed Answered

javascript problem

Question asked by thk on Jun 2, 2015
Latest reply on Jun 25, 2015 by thk
Hi,

I have many folders for meetings and in many of this meeting-folders are sub-folders with the name "English" which contains documents with presentations in English. I want to categorize all documents in all sub-folders with the Name "English". So for this first I have to search for all sub-folders with the name "English" and then categorize all docs in it (asigning an already existing category "English").
This seems not to be possible just with a simple rule. I seems the rule has to execute a script to do the task. I tried to write a Javascript-Script but I`m no Javascript programmer. I alos don`t know how to find the correct path name (in the DocumentLibrary of my site I have a folder Meetings, in it sub-folders for every meeting and in these meeting-folders sub-folders with the name "English")

Something like this doesn`t work:

var nodes = search.luceneSearch("<Sitename>/Meetings/", "English");
var categories = new Array(10);
categories.push("English");
for (var node in nodes){
   for each (doc in node.children)
      doc.properties["cm:categories"] = categories;
      doc.save();
   }
}


Thanks for any help

Outcomes