childFileFolders()
Returns
Returns a JavaScript array of child file and folder nodes for the node. It automatically retrieves all sub-types of cm:content and cm:folder, and removes system type folders from the results.
Example
childFileFolders(files, folders)
Parameters
- files
- A boolean value which if set to true specifies that files extending from cm:content should be returned.
- folders
- A boolean value which if set to true specifies that folders extending from cm:folder should be returned, ignoring sub-types of cm:systemfolder.
Returns
Returns a JavaScript array of child file and folder nodes for the node. It automatically retrieves all sub-types of cm:content and cm:folder, and removes system type folders from the results.
Example
childFileFolders(files, folders, ignoreTypes)
Parameters
- files
- A boolean value which if set to true specifies that files extending from cm:content should be returned.
- folders
- A boolean value which if set to true specifies that folders extending from cm:folder should be returned, ignoring sub-types of cm:systemfolder.
- ignoreTypes
- Can be set to filter nodes of the specified type or types from the results returned. The type is specified in either long or short QName string form, as a single string or as an array of strings to filter multiple types.
Returns
Returns a JavaScript array of child file and folder nodes for the node. It automatically retrieves all sub-types of cm:content and cm:folder, and removes system type folders from the results.
Example
childFileFolders(files, folders, ignoreTypes, maxItems)
Parameters
- files
- A boolean value which if set to true specifies that files extending from cm:content should be returned.
- folders
- A boolean value which if set to true specifies that folders extending from cm:folder should be returned, ignoring sub-types of cm:systemfolder.
- ignoreTypes
- Can be set to filter nodes of the specified type or types from the results returned. The type is specified in either long or short QName string form, as a single string or as an array of strings to filter multiple types.
- maxItems
- An integer value which sets the maximum number of results to return.
Returns
Returns a ScriptPagingNode object. The results are limited to the number specified by maxItems.
Example
var nodeNames = new Array(); var nodes = null; var maxItems = 10; var results = companyhome.childFileFolders(true, false, "st:sites", maxItems); nodes = results.getPage(); for (var n in nodes){ nodeNames.push(nodes[n]['name']); }
childFileFolders(files, folders, ignoreTypes, skipOffset, maxItems, requestTotalCountMax, sortProp, sortAsc, queryExecutionId)
Parameters
- files
- A boolean value which if set to true specifies that files extending from cm:content should be returned.
- folders
- A boolean value which if set to true specifies that folders extending from cm:folder should be returned, ignoring sub-types of cm:systemfolder.
- ignoreTypes
- Can be set to filter nodes of the specified type or types from the results returned. The type is specified in either long or short QName string form, as a single string or as an array of strings to filter multiple types.
- skipOffset
- Number of items to skip. For example 0, or number of pages to skip * size of page.
- maxItems
- An integer value which sets the maximum number of items, the size of the page.
- requestTotalCountMax
- Request total count (up to a given max total count) Note, if set to 0 then total count is not requested and the query might be able to optimise/cutoff for max items.
- sortProp
- Optional sort property as a prefix QName string, for example cm:name. Also supports special content cases such as cm:content.size and cm:content.mimetype.
- sortAsc
- A boolean value. If true nodes will be sorted in ascending order, if false nodes will be sorted in descending order.
- queryExecutionId
- If paging then can pass back the previous query execution (as a hint for possible query optimization). Note this parameter is not used, it is reserved for future use.
Returns
Returns a ScriptPagingNode containing child file and folder nodes for the node. It automatically retrieves all sub-types of cm:content and cm:folder, and removes system type folders from the results.
Example
var queryExecutionId = null; // reserved for future use var results; var nodeNames = new Array(); // just store file names in a list var resultsTrimmed = false; var nodes = null; // get files ordered by name (exclude folders and st:sites) results = companyhome.childFileFolders(true, false, "st:sites", 0, 100, 0, "cm:name", true, queryExecutionId); nodes = results.getPage(); for (var n in nodes){ nodeNames.push(nodes[n]['name']); } resultsTrimmed = results.hasMoreItems(); // did we get all possible child files/folders?