04-22-2020 08:06 AM
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.
04-22-2020 11:09 AM
Have tou tried a query like:
'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010" AND TYPE:"cm:folder"'
04-22-2020 11:09 AM
Have tou tried a query like:
'ANCESTOR:"workspace://SpacesStore/a0617f12-8eba-4dce-a5b5-59afec623010" AND TYPE:"cm:folder"'
04-23-2020 04:10 AM
Simple as that
Thanks!
04-23-2020 06:00 AM
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'.
04-23-2020 08:06 AM
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...
04-23-2020 08:25 AM
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.
04-23-2020 09:14 AM
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.
04-23-2020 09:24 AM
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.
04-23-2020 02:59 PM
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?
04-24-2020 02:44 AM
Nothing special I think. What I think is strange is that it looks like the script executed for each sub-folder.
Explore our Alfresco products with the links below. Use labels to filter content by product module.