Script migration

Go to script to change the default value of "normal" links.

Download the script

var qm = session.getWorkspace().getQueryManager();   
var query = qm.createQuery("//element(*, ametys:directoryLink)[@ametys-internal:status = 'USUAL']", javax.jcr.query.Query.XPATH);   
var nodes = query.execute().getNodes();   
var count = 0;   
while (nodes.hasNext())   
{   
 var node = nodes.next();   
 var status = node.setProperty("ametys-internal:status", "NORMAL");   
 count++;   
}   
   
if (count > 0)   
{   
 session.save();   
}   
print(count + " updated links.");   

Then it's time to rebuild the live

Back to top