01-24-2022 04:49 PM
Hi!
I've got a folder with tens of thousands of documents. Share doesn't show the content of this folder. Node browser can't show a list of children. It must be reorganised to make the folder useful. I'm looking for a way to get the children nodes of the folder on purpose to move them to the proper location. I tried javascript, CMIS, REST API. All ways have the same problem - timeout. Sometimes I can catch several children by javascript and move it. But it is not a stable solution.
Which function/method/request can get one or several children without reading the whole children map?
01-25-2022 06:48 AM
The search query give me any quontity of children I want.
If longFolder is a node of my folder, next query give quick answer:
var query = "PATH:'" + longFolder.qnamePath + "/*' AND PARENT:'" + longFolder.nodeRef + "' AND TYPE:'cm:content'"; var searchQuery = { query: query, language: "fts-alfresco", page: {maxItems: 100} }; var pack = search.query(searchQuery); for each (var doc in pack){ logger.log(doc.name + " \t" + doc.parent.id);
//move doc to new place
... }
Required quantity of nodes is given in maxItems.
Only one thing, after moving/organise documents, search need some time to find propper pack again. So I check parent relation every time before move.
01-25-2022 03:27 AM
I guess you can find some pattern (based in the filename, date of modification...) so you can create a filter and get only a subset of files on every step inside a loop.
01-25-2022 04:06 AM
So the answer is - there is no way to get the short part of a long children map.
Thanks, you saved my time!
Will be digging from the documents properties side.
01-25-2022 06:48 AM
The search query give me any quontity of children I want.
If longFolder is a node of my folder, next query give quick answer:
var query = "PATH:'" + longFolder.qnamePath + "/*' AND PARENT:'" + longFolder.nodeRef + "' AND TYPE:'cm:content'"; var searchQuery = { query: query, language: "fts-alfresco", page: {maxItems: 100} }; var pack = search.query(searchQuery); for each (var doc in pack){ logger.log(doc.name + " \t" + doc.parent.id);
//move doc to new place
... }
Required quantity of nodes is given in maxItems.
Only one thing, after moving/organise documents, search need some time to find propper pack again. So I check parent relation every time before move.
Explore our Alfresco products with the links below. Use labels to filter content by product module.