TREEGEN COMPONENT 4.01
Tree Object
Last modified: April 9,1999 
© 1999 Advantys. All rights reserved.

Name

The Name property contains the name of the tree.

Syntax
.Name

Return Values
Returns a String value.

Example
<%
Response.Write("TreeName=" & MyTree.Name & "<br>")
%>


Description

The Description property contains a global description of the tree.

Syntax
.Description

Return Values
Returns a String value.

Example
<%
Response.Write("Description=" & MyTree.Description & "<br>")
%>


TreeType

The TreeType property contains the type of the tree (TREE, NEWS...).

Syntax
.TreeType

Return Values
Returns a String value which is the type of the tree.

Example
<%
Response.Write("TreeType=" & MyTree.TreeType & "<br>")
%>


DataSource

The DataSource property contains the current DataSource of the tree. The default DataSource is the "TEXT" value.

Syntax
.DataSource

Return Values
Returns a String value which can be "TEXT" or "ODBC".

Example
<%
Dim MyTree
Set MyTree = Server.CreateObject("TreeGen.Tree")
MyTree.DataSource = "ODBC"
%>


Version

The Version property returns the current TreeGen version.

Syntax
.Version

Return Values
Returns a String value.

Example
<%
Response.Write("Version=" & MyTree.Version & "<br>")
%>


Domain

The Domain property specifies the Domain for the object.

Syntax
.Domain

Return Values
Returns a String value.

Example
<%
for intI=1 to MyTree.ACL.Count
set MyTree = MyTree.ACL.ACE(inI)
Response.Write ("AccessMask=" & MyTree.AccessMask & "<br>")
Response.Write ("AceType=" & MyTree.AceType & "<br>")
Response.Write ("Domain=" & MyTree.Domain & "<br>")
Response.Write ("Trustee=" & MyTree.Trustee & "<br>")
next
%>


RootItem

The RootItem property contains the root of the tree.

Syntax
.RootItem

Return Values
Returns a TreeGen Item object which is the root of the current tree.

Example
<%
Response.Write("RootItem=" & MyTree.RootItem.link.Text & "<br>")
%>

Note : the loaditems function is automatically called if there is no loaded item when the root property is called.


PhysicalPath

The PhysicalPath property contains the physical path of the description file of the tree.

Syntax
.PhysicalPath

Return Values
Returns a String value.

Example
<%
MyTree.PhysicalPath = "c:\inetpub\intranet\scripts\treegen\trees\mytree.txt"
%>


TextSeparator

The TextSeparator property contains the text separator for the current tree. This property is only available for a tree with a "TEXT" data source.

Syntax
.TextSeparator

Return Values
Returns a String value.

Example
<%
MyTree.TextSeparator = "<SEP>"
%>

Note : the default value for the textSeparator property is ";".


DateLastModified

The DateLastModified property contains the date of the last modification of the tree.

Syntax
.DateLastModified

Return Values
Returns a Date value which is the date of last modification of the current tree.

Example
<%
Response.Write("Last modification=" & MyTree.DateLastModified & "<br>")
%>


ConnectString

The ConnectString property contains the connect string of the tree when its data source is "ODBC".

Syntax
.ConnectString

Return Values
Returns a String value.

Example
<%
MyTree.ConnectString = "DSN=TREEGEN;UID=TREEGEN_USER;PWD=TREEGEN_PASSWD;DATABASE=TREES"
%>


SQLSelectString

The SQLSelectString property contains the SQL request used to display the items of a tree.
Available when DataSource = "ODBC"

Syntax
.SQLSelectString

Return Values
Returns a String value.

Example
<%
MyTree.SQLSelectString = "SELECT * From Trees"
%>


SQLCleanString

The SQLCleanString property contains the SQL request which deletes the data of the current tree.
Available when DataSource = "ODBC"

Syntax
.SQLCleanString

Return Values
Returns a String value.

Example
<%
MyTree.SQLCleanString = "DELETE * From Trees"
%>


SQLAddString

The SQLAddString property contains the SQL request used to add the items of a tree.
Available when DataSource = "ODBC"

Syntax
.SQLAddString

Return Values
Returns a String value.

Example
<%
MyTree.SQLAddString = "SELECT * From Trees"
%>


LoadItems

The LoadItems method only loads selected items of the tree. The root is the item with the specified id. The deep of the loaded tree depends of the deep parameter.

Syntax
.LoadItems([IdStart], [deep])

Parameters
IdStart    (optional) Item ID which becomes the root of the tree.

deep       (optional) Deep of the loading.

NOTE : LoadItems with no parameter, loads all items of the tree.

Example
This example loads a tree, only on one level. The start item depends on the Request("STARTID") value.

<%
if Request("STARTID")<> "" then
MyTree.LoadItems Cint(Request("STARTID")),1
else
MyTree.LoadItems 1,1
end if
%>


LoadItemsFromShortCut

The LoadItemsFromShortCut method only loads the selected items. The root is the item which has the specified shortcut.

Syntax
.LoadItemsFromShortCut(shortCut, [deep])

Parameters
ShortCut     Item shortcut.

deep          (optional) Deep of the loading.

Example
<%
if Request("STARTID")<> "" then
MyTree.LoadItems Cint(Request("STARTID")), 1
else
MyTree.LoadItemsFromShortCut "MyShortCut", 1
end if
%>


SaveItems

The SaveItems method saves the items of a tree according to its datasource (TEXT or ODBC).

Syntax
.SaveItems

Examples
<%
MyTree.DataSource = "TEXT"
Mytree.PhysicalPath = "c:\inetpub\intranet\scripts\treegen\trees\mytree.txt"
MyTree.RootItem.Link.Text = "New Text"
MyTree.SaveItems
%>


ShowDebugInfo

The ShowDebugInfo method displays all tree and items properties.

Syntax
.ShowDebugInfo()

Examples
<%
Response.Write("Here is a full display of the tree :<br>")
MyTree.ShowDebugInfo
%>


ShowDebugTreeInfo

The ShowDebugTreeInfo method displays the tree properties.

Syntax
.ShowDebugTreeInfo()

Examples
<%
Response.Write("Here are the tree properties :<br>")
MyTree.ShowDebugTreeInfo
%>


ShowDebugItemInfo

The ShowDebugItemInfo method displays the items properties.

Syntax
.ShowDebugItemInfo(oItem)

Parameters
oItem    : Item object

Examples
<%
Set myItem = MyTree(3)
Response.Write("Here are the item properties :<br>")
MyTree.ShowDebugItemInfo(myItem)
%>


© 1999 Advantys. All rights reserved.