AnsweredAssumed Answered

Get Category of a document

Question asked by stoefran on Feb 15, 2008
Latest reply on Feb 23, 2008 by jbarmash

I have the following problem. Whenever I move a document into a specific folder I need to find out whether or not the document is linked to a specific category.

I have written the following javascript code to do this, but it does not work and shows the error message "Unknown Exception".

var category =["cm:categories"];

var approveFolder = space.childByNamePath("tempApprove");

if (approveFolder == null && space.hasPermission("CreateChildren"))
   create the folder for the first time
   approveFolder = space.createFolder("Backup");

var logFile = approveFolder.childByNamePath("logfile.txt");

   if (logFile == null)
      logFile = approveFolder.createFile("logfile.txt");
   if (logFile != null)
      logFile.content += "Datei-Kategorie: " + category[0];

Unfortunately the alfresco debugger is not working either. When i try to start it i get an error aswell.

Can anybody tell me where the error is?