Available for: Content Management Server, Template Engine
Task: Returns the file hierarchy located below the given folder.
Syntax:
obj (withId objId) | (withPath path) | root getHierarchy {parameter value}
Additional information: The hierarchy contains only the IDs of the files to which the user has read access (TE users have root access and therefore can read all files). The hierarchy returned is a Tcl list with two elements. The first element of this list can be 0 or 1 and specifies whether the hierarchy had to be cut off (1) or not (0). The second element is a list that contains the actual hierarchy. In this list, every CMS file except folders is represented by its ID. Folders are represented by a list with two elements of which the first is the ID of the folder, and the second is a list containing the contents of the folder.
Function parameters:
parameter
specifies the name of a
parameter whose value is expected in the corresponding
value
. The following parameter names exist:
maxDepth
: Specifies the maximum depth the
computed hierarchy may have. The default value is 4 unless it is
overridden by the value of the maxHierarchyDepth
key (either in the user's
personal
preferences or in the general
userManagement.preferences
section).
The value -1
specifies that no depth limit is to be applied
(from Version 6.7.2).
maxLines
: Specifies the maximum number of
files to be added to the hierarchy returned. The default value is
200 unless it is overridden by the value of the
maxHierarchyLines
key (either in the user's
personal
preferences or in the general
userManagement.preferences
section).
The value -1
specifies that no limit
regarding the number of files is to be applied (from Version 6.7.2).
objTypes
: Specifies the list of file
types to which the hierarchy is to be restricted. As a default, only
publication
files are contained in the hierarchy. If
this parameter is specified and the publication
type
is missing from the list, no hierarchy will be returned.
value
contains the value for the
respective parameter.
Return value if successful: the hierarchy as an encoded Tcl list (stringlist)
Necessary permissions (CM only): The user must have the permissionRead
permission for the specified file.
Example:
CM>obj root getHierarchy 0 {2001 {2012 {2086 2099}}}
Use the following command to modify your personal maxHierarchyLines
preference.
CM>userConfig setTexts maxHierarchyLines 250