AnsweredAssumed Answered

Hint of the day : Apply a template to ALL users on a space

Question asked by zomurn on May 7, 2009
Latest reply on Apr 5, 2013 by rafaelscg
Hi,

Just a simple javascript to apply a template for all user :

function applyTemplates()
{
   var usersHome = companyhome.childByNamePath(USERS_ROOT_FOLDER);
   usersHome.addAspect("cm:templatable");
   query = "PATH:\"app:company_home/app:dictionary/app:content_templates/cm:" + TEMPLATE_BANNETTES + "\"";
   var templateRef = search.luceneSearch(query);
   usersHome.properties["cm:template"]=templateRef[0];
   templateRef[0].setPermission("Consumer");
   templateRef[0].save();
   usersHome.save();
}

We just need to allow READ access to the template.

PS : from the problem quoted here : http://forums.alfresco.com/en/viewtopic.php?f=36&t=11255

Outcomes