Class TreeControllerBase
- Namespace
- Umbraco.Cms.Web.BackOffice.Trees
- Assembly
- Umbraco.Web.BackOffice.dll
A base controller reference for non-attributed trees (un-registered).
public abstract class TreeControllerBase : UmbracoAuthorizedApiController, ITree
- Inheritance
-
TreeControllerBase
- Implements
-
ITree
- Derived
- Inherited Members
Remarks
Developers should generally inherit from TreeController.
Constructors
TreeControllerBase(UmbracoApiControllerTypeCollection, IEventAggregator)
protected TreeControllerBase(UmbracoApiControllerTypeCollection apiControllers, IEventAggregator eventAggregator)
Parameters
apiControllersUmbracoApiControllerTypeCollectioneventAggregatorIEventAggregator
Properties
IsSingleNodeTree
public abstract bool IsSingleNodeTree { get; }
Property Value
RootNodeDisplayName
The name to display on the root node
public abstract string? RootNodeDisplayName { get; }
Property Value
SectionAlias
public abstract string SectionAlias { get; }
Property Value
SortOrder
public abstract int SortOrder { get; }
Property Value
TreeAlias
public abstract string TreeAlias { get; }
Property Value
TreeGroup
public abstract string? TreeGroup { get; }
Property Value
TreeTitle
public abstract string? TreeTitle { get; }
Property Value
TreeUse
public abstract TreeUse TreeUse { get; }
Property Value
- TreeUse
Methods
AddQueryStringsToAdditionalData(TreeNode, FormCollection)
The AdditionalData of a node is always populated with the query string data, this method performs this operation and ensures that special values are not inserted or that duplicate keys are not added.
protected void AddQueryStringsToAdditionalData(TreeNode node, FormCollection queryStrings)
Parameters
nodeTreeNodequeryStringsFormCollection
CreateRootNode(FormCollection)
Helper method to create a root model for a tree
protected virtual ActionResult<TreeNode?> CreateRootNode(FormCollection queryStrings)
Parameters
queryStringsFormCollection
Returns
- ActionResult<TreeNode>
CreateTreeNode(string, string, FormCollection, string)
Helper method to create tree nodes
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title)
Parameters
idstringparentIdstringqueryStringsFormCollectiontitlestring
Returns
- TreeNode
CreateTreeNode(string, string, FormCollection?, string?, string?)
Helper method to create tree nodes
public TreeNode CreateTreeNode(string id, string parentId, FormCollection? queryStrings, string? title, string? icon)
Parameters
idstringparentIdstringqueryStringsFormCollectiontitlestringiconstring
Returns
- TreeNode
CreateTreeNode(string, string, FormCollection, string?, string?, bool)
Helper method to create tree nodes and automatically generate the json URL
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string? title, string? icon, bool hasChildren)
Parameters
Returns
- TreeNode
CreateTreeNode(string, string, FormCollection, string?, string?, bool, string)
Helper method to create tree nodes and automatically generate the json URL
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string? title, string? icon, bool hasChildren, string routePath)
Parameters
idstringparentIdstringqueryStringsFormCollectiontitlestringiconstringhasChildrenboolroutePathstring
Returns
- TreeNode
CreateTreeNode(string, string, FormCollection?, string?, string, bool, string?, Udi)
Helper method to create tree nodes and automatically generate the json URL + UDI
public TreeNode CreateTreeNode(string id, string parentId, FormCollection? queryStrings, string? title, string icon, bool hasChildren, string? routePath, Udi udi)
Parameters
idstringparentIdstringqueryStringsFormCollectiontitlestringiconstringhasChildrenboolroutePathstringudiUdi
Returns
- TreeNode
CreateTreeNode(string, string, FormCollection, string, string, string)
Helper method to create tree nodes
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, string routePath)
Parameters
Returns
- TreeNode
CreateTreeNode(IEntitySlim, Guid, string, FormCollection?, bool)
Helper method to create tree nodes and automatically generate the json URL + UDI
public TreeNode CreateTreeNode(IEntitySlim entity, Guid entityObjectType, string parentId, FormCollection? queryStrings, bool hasChildren)
Parameters
entityIEntitySlimentityObjectTypeGuidparentIdstringqueryStringsFormCollectionhasChildrenbool
Returns
- TreeNode
CreateTreeNode(IUmbracoEntity, Guid, string, FormCollection, string, bool)
Helper method to create tree nodes and automatically generate the json URL + UDI
public TreeNode CreateTreeNode(IUmbracoEntity entity, Guid entityObjectType, string parentId, FormCollection queryStrings, string icon, bool hasChildren)
Parameters
entityIUmbracoEntityentityObjectTypeGuidparentIdstringqueryStringsFormCollectioniconstringhasChildrenbool
Returns
- TreeNode
GetMenu(string, FormCollection)
The action called to render the menu for a tree node
public Task<ActionResult<MenuItemCollection?>> GetMenu(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- Task<ActionResult<MenuItemCollection>>
GetMenuForNode(string, FormCollection)
Returns the menu structure for the node
protected abstract ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<MenuItemCollection>
GetMenuForNodeAsync(string, FormCollection)
Returns the menu structure for the node
protected virtual Task<ActionResult<MenuItemCollection>> GetMenuForNodeAsync(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- Task<ActionResult<MenuItemCollection>>
Remarks
If overriden, GetMenuForNode will not be called
GetNodes(string, FormCollection?)
The action called to render the contents of the tree structure
public Task<ActionResult<TreeNodeCollection?>> GetNodes(string id, FormCollection? queryStrings)
Parameters
idstringqueryStringsFormCollectionAll of the query string parameters passed from jsTree
Returns
- Task<ActionResult<TreeNodeCollection>>
JSON markup for jsTree
Remarks
We are allowing an arbitrary number of query strings to be passed in so that developers are able to persist custom data from the front-end to the back end to be used in the query for model data.
GetRootNode(FormCollection?)
Returns the root node for the tree
public Task<ActionResult<TreeNode?>> GetRootNode(FormCollection? queryStrings)
Parameters
queryStringsFormCollection
Returns
- Task<ActionResult<TreeNode>>
GetTreeNodes(string, FormCollection)
The method called to render the contents of the tree structure
protected abstract ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollectionAll of the query string parameters passed from jsTree
Returns
- ActionResult<TreeNodeCollection>
Remarks
We are allowing an arbitrary number of query strings to be passed in so that developers are able to persist custom data from the front-end to the back end to be used in the query for model data.
GetTreeNodesAsync(string, FormCollection)
The method called to render the contents of the tree structure
protected virtual Task<ActionResult<TreeNodeCollection>> GetTreeNodesAsync(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollectionAll of the query string parameters passed from jsTree
Returns
- Task<ActionResult<TreeNodeCollection>>
Remarks
If overriden, GetTreeNodes will not be called We are allowing an arbitrary number of query strings to be passed in so that developers are able to persist custom data from the front-end to the back end to be used in the query for model data.
IsDialog(FormCollection)
If the request is for a dialog mode tree
protected bool IsDialog(FormCollection queryStrings)
Parameters
queryStringsFormCollection