cancel
Showing results for 
Search instead for 
Did you mean: 

How to add sys:temporary to a folder in Community Edition?

sbenedetti
Champ in-the-making
Champ in-the-making
I need to add the sys:temporary aspect to a folder to avoid archiving during delete.
I need to apply it to the folder and to all files and folder inside it.

But I don't know how to achieve it. I'm using Community version 4.2.d

Thank you.
1 REPLY 1

hgindl
Champ in-the-making
Champ in-the-making
install the javascript console from here https://github.com/share-extras/js-console or https://code.google.com/p/share-extras/downloads/detail?name=javascript-console-0.5.1.zip&can=2&q=la...

find out the noderef of your folder and use a script like

/* use the noderef of the folder you want to be deleted */
var folder = search.findNode("workspace://SpacesStore/ee9ade57-9681-415c-aa1f-cd395d87c613")

if(folder) {
   addTemporaryAspect(folder);
   logger.log("success");
}
else {
  logger.log("no such file or folder");   
}
   
function addTemporaryAspect(node) {
    node.addAspect("sys:temporary");
    for each (child in node.children) {
       addTemporaryAspect(child);
    }
}


Kind regards,
Hannes