cancel
Showing results for 
Search instead for 
Did you mean: 

Add ascpect dependent on subfolder level

d_franz
Champ on-the-rise
Champ on-the-rise
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
11 REPLIES 11

zladuric
Champ on-the-rise
Champ on-the-rise
Well, if it's good enough, then cool. But I'm still curious of why it won't just take nodeRef property and compare by that. Ah well, if you get stuck again, you know where to reach for an extra hand Smiley Happy

d_franz
Champ on-the-rise
Champ on-the-rise
Thanks a lot!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.