07-17-2019 08:25 AM
07-17-2019 09:40 AM
I think you want to know the numbers if i understand correctly.
You can implement javabacked webscript which can execute a search query to find the folders in a given site at any depth. You can implement same thing using javascript as well.
Sample search query : PATH:"/app:company_home/st:sites/cm:test-site/cm:documentLibrary//*" AND TYPE:"cm:folder"
You can execute the above query in node browser as well and see the total results.
See the sample code below which can be used to get the number of nodes in a site
main();
function main(){
//Defualt to cm:folder if no inputs provided
var objectType = (args["objectType"]==null || args["objectType"]==undefined) ? "cm:folder" : args["objectType"];
//Defualt to test-site if no inputs provided
var siteShortName = (args["siteShortName"]==null || args["siteShortName"]==undefined) ? "test-site" : args["siteShortName"];
//Defualt to 0 if no inputs provided
var skipCount = (args["skipCount"]==null || args["skipCount"]==undefined)?0:args["skipCount"];
//Defualt to 1000 if no inputs provided
var maxCount = (args["maxCount"]==null || args["maxCount"]==undefined)?1000:args["maxCount"];
var query = 'PATH:"/app:company_home/st:sites/cm:' +siteShortName+'/cm:documentLibrary//*" AND TYPE:"'+objectType+'"';
var page = {
skipCount : parseInt(skipCount),
maxItems : parseInt(maxCount)
};
var searchQuery = {
query : query,
language : "lucene",
page : page
};
logger.log("Executing SearchQuery: "+query)
var nodes = search.query(searchQuery);
var totalNodes = nodes.length;
logger.log("Total Nodes: "+totalNodes)
model.totalCount = totalNodes;
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.