AnsweredAssumed Answered

Add ascpect dependent on subfolder level

Question asked by d_franz on Apr 9, 2013
Latest reply on Apr 9, 2013 by d_franz
Hello,

I want to add a script to the root folder of a Site in Alfresco. This script should add a specific aspect to every new folder, dependent on its subfolder level.
This Aspects I want to use later to identify the subfolder level out of a other scripts when a file is added.
In the end I will show a Indicator if a specific file/aspect on a subfolder is missing.


My first try was the following code. But it doesn’t shows an effect.

if (document.isContainer)
{
   var level = document.partens.length;
   if(level == 0)
   {
      document.addAspect("marker:folderLevel_0");   
   }
   if(level == 1)
   {
      document.addAspect("marker:folderLevel_0");
   }
   if(level == 2)
   {
      document.addAspect("marker:folderLevel_0");
   }
}


Can anybody help me with a better code or even with a better strategy?

Thanks in advance

Outcomes