Home > Contents > Index >
TREEMANAGER.addchild
Adds a node to a tree table.
Syntax
<TREEMANAGER> <ARGUMENT NAME="ftcmd" VALUE="addchild"/> <ARGUMENT NAME="treename" VALUE="name"/> <ARGUMENT NAME="parentid" VALUE="node ID"/>] [<ARGUMENT NAME="otype" VALUE="object table"/>] [<ARGUMENT NAME="oversion" VALUE="object version"/>] [<ARGUMENT NAME="nrank" VALUE="node rank"/>] </TREEMANAGER>Parameters
ftcmd (required)- Value must be set to
addchild.
treename (required)- Name of the tree.
parentid (optional)- Node ID of the parent node. Omit or set to
NULLto make this node a top level node. Top level nodes are identified by a 0. Must be an integer.
otype (optional)- Name of an object table.
oid (optional)- Identifies the current object on this node. The
oidshould correspond to a value in the object table's id column.
oversion (optional)- Numeric value that specifies the version of the object. This parameter is not supported for this release of Sites, and is reserved for use in later versions.
ncode (optional)- 16-character string value that is available for use by the application.
nrank (optional)- Numeric value of the rank to assign this node.
Description
The
addchildcommand adds a node to a tree table.After executing the
addchildcommand, a list named after the tree table or found in a variable calledtreenameis created. A unique identifier for the node in the tree, thenidvalue, is generated when you successfully add a node. The value ofnidcan be retrieved in the tree result list.errno
The possible values of
errnoinclude:
Value Description -3 No access privileges to table. -103 No table. -105 Database error. -106 Missing or invalid parameter. -110 Invalid tree name.Example
The following example adds a single record in the tree table that contains all the necessary information to identify the object in the tree. Note that
oversionis passed a null value to ensure future product compatibility.<TREEMANAGER> <ARGUMENT NAME="ftcmd" VALUE="addchild" /> <ARGUMENT NAME="treename" VALUE="TreeMgrCatalog" /> <ARGUMENT NAME="nparentid" VALUE="Variables.parent" /> <ARGUMENT NAME="otype" VALUE="TreeObjectCatalog" /> <ARGUMENT NAME="oid" VALUE="Variables.id" /> <ARGUMENT NAME="oversion" VALUE="Variables.empty" /> <ARGUMENT NAME="nrank" VALUE="2" /> <ARGUMENT NAME="ncode" VALUE="testpage name" /> </TREEMANAGER> <IF COND="IsList.TreeMgrCatalog=true"> <THEN> <IF COND="Variables.errno!=-101"> <THEN> <LOOP LIST="TreeMgrCatalog"> <SETVAR NAME="mychild" VALUE="TreeMgrCatalog.nid"/> </LOOP> </THEN> </IF> </THEN> <ELSE> <!-- The list did not get created so add --> <!-- handling here --> Failed to add a child to the tree table. Error number - <CSVAR NAME="Variablse.errno"/> <BR/> </ELSE> </IF>See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.