Hi,
I have following code
nodes = search.query({ language: 'fts-alfresco', query: 'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010"+nodeType:"cm:folder"', maxItems: 2000 });
But this gives me also all documents in all sub-folders. I only want objects of type folder.
All help appreciated.
Solved! Go to Solution.
Have tou tried a query like:
'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010" AND TYPE:"cm:folder"'
Have tou tried a query like:
'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010" AND TYPE:"cm:folder"'
Simple as that
Thanks!
Hi,
One more question. Why does following code
function main() { log = "*** Start script ***\n"; logFile.content += log; nodes = search.query({ language: 'fts-alfresco', query: 'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010" AND TYPE:"cm:folder"', maxItems: 2000 }); log = " -> Gevonden mappen: " + nodes.length + "\n"; logFile.content += log; log = "*** Einde script ***\n"; logFile.content += log; } var logFile = space.childByNamePath("log.txt"); var nodes = null; if (logFile == null) { logFile = space.createFile("log.txt"); } var log = ""; main();
give me an output that repeats the logging a hundred times? I get in the log output file hundred times the 'Start script', 'Gevonden mappen' and 'Einde script'.
Mmmm maybe you are appending the logs to the file at every script execution, instead of creating new content for the file? If that is not the cause, I don't know what could it be...
I delete the log file before executing the script, so...
The script is executed via a rule on a folder, and it looks like it is executed for each sub-folder in that folder.
Then check that subfolders have the "inherit rules" option deactivated.
Also, depending on how you want to trigger this rule, take a look at the "apply rule to subfolders" option in rule configuration, to see whether it is well configured.
I deactvated the inherit rules on some of the sub-folders, but the number stays the same.
The option to apply the rule to subfolders is not activated.
Then I don't know what could it be. It seems the rule is triggering for a lot of nodes. What is your rule configuration, triggers, etc?
Nothing special I think. What I think is strange is that it looks like the script executed for each sub-folder.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
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.