// execute onCreate of a Site
var childAssoc = behaviour.args[0];
var site = childAssoc.getChild();
//var site = args[0];
logger.log("### avant template");
//if (site.properties["st:sitePreset"]=="prj-dashboard"){
logger.log("### Prepping to get Templates folder");
var templateFolder = search.luceneSearch('PATH:"/app:company_home/app:dictionary/app:space_templates"');
var docLib = site.childByNamePath("documentlibrary");
if (!docLib){
docLib = site.createFolder("documentlibrary");
}
if (docLib) {
for (var i in templateFolder.children){
var child = templateFolder.children[i];
child.copy(docLib, true);
}
}
//}
Encore merci de votre aide
Array luceneSearch(string query)Dans votre code templateNode est donc un tableau. L'appel templateFolder.children ne correspond donc à rien.
Returns an array of ScriptNode objects that were found by the Alfresco repository full-text search, for example: var nodes = search.luceneSearch("TEXT:alfresco");
var childAssoc = behaviour.args[0];
var site = childAssoc.getChild();
var templateFolder = search.luceneSearch('PATH:"/app:company_home/app:dictionary/app:models"');
var docLib = site.childByNamePath("documentlibrary");
if (!docLib){
docLib = site.createFolder("documentlibrary");
}
if (docLib) {
for(var i=0;i< templateFolder.length;i++)
{
for(j=0;j< templateFolder[i].children.length;j++)
{
templateFolder[i].children[j].copy(docLib,true);
}
}
}
Merci infiniment Charles.
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.