MenuCreatorGetWebTree Method (ConnectionId, SessionId, DocumentId, DateTime, Boolean) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Returns a complete menu in a hierarchical structure with parent menu and all its children.

Namespace: ContentStudio.Document.Menu
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public string GetWebTree(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId documentId,
	DateTime dateCriteria,
	bool useRoot
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
documentId
Type: ContentStudio.DocumentDocumentId
The document that acts as a starting point of the tree
dateCriteria
Type: SystemDateTime
A DateTime that is compared with the publish date of the listed documents. Can be used when previewing documents in time. Pass MinValue to use the current date.
useRoot
Type: SystemBoolean
If this parameter is true this method returns a tree that starts with the ultimate tree root regardless of the position of the passed in DocumentID. If the parameter is false the returned tree starts with the passed in document.

Return Value

Type: String
This method returns the following xml document syntax
<cs_tree>
    <document level="1" children="1" leveltext="">
        <field name="elementid">1146</field>
        <field name="elementname">:root:</field>
        <field name="parentelementid">1146</field>
        <field name="categoryname">Webbsidor</field>
        <field name="categoryid">0</field>
        <field name="child">1</field>
        <document level="2" children="1" leveltext="1">
            <field name="elementid">1022</field>
            <field name="elementname">Startsida</field>
            <field name="parentelementid">1146</field>
            <field name="categoryname">Webbsidor</field>
            <field name="categoryid">0</field>
            <field name="child">1</field>
            <document level="2" children="0" leveltext="1.1">
                <field name="elementid">10522</field>
                <field name="elementname">Undersida</field>
                <field name="parentelementid">1022</field>
                <field name="categoryname">Webbsidor</field>
                <field name="categoryid">0</field>
                <field name="child">0</field>
            </document>
        </document>
    </document>
</cs_tree>
Exceptions

ExceptionCondition
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

All authenticated users and the anonymous use can call this method. However, only the document that the caller can BROWSE is returned.
Remarks

If DateCriteria is MinValue then only the currently valid menus are returned, otherwise the menus valid at the supplied date in time are returned. The "Web tree" component uses this method as input.
See Also

Reference