View Source
Class TreeControllerBase
A base controller reference for non-attributed trees (un-registered).
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[AngularJsonOnlyConfiguration]
public abstract class TreeControllerBase : UmbracoAuthorizedApiController
Constructors
View Source
TreeControllerBase(UmbracoApiControllerTypeCollection, IEventAggregator)
Declaration
protected TreeControllerBase(UmbracoApiControllerTypeCollection apiControllers, IEventAggregator eventAggregator)
Parameters
Type |
Name |
Description |
UmbracoApiControllerTypeCollection |
apiControllers |
|
IEventAggregator |
eventAggregator |
|
Properties
View Source
IsSingleNodeTree
Declaration
public abstract bool IsSingleNodeTree { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
RootNodeDisplayName
The name to display on the root node
Declaration
public abstract string RootNodeDisplayName { get; }
Property Value
Type |
Description |
System.String |
|
View Source
SectionAlias
Declaration
public abstract string SectionAlias { get; }
Property Value
Type |
Description |
System.String |
|
View Source
SortOrder
Declaration
public abstract int SortOrder { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
TreeAlias
Declaration
public abstract string TreeAlias { get; }
Property Value
Type |
Description |
System.String |
|
View Source
TreeGroup
Declaration
public abstract string TreeGroup { get; }
Property Value
Type |
Description |
System.String |
|
View Source
TreeTitle
Declaration
public abstract string TreeTitle { get; }
Property Value
Type |
Description |
System.String |
|
View Source
TreeUse
Declaration
public abstract TreeUse TreeUse { get; }
Property Value
Methods
View Source
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.
Declaration
protected void AddQueryStringsToAdditionalData(TreeNode node, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
TreeNode |
node |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
View Source
Helper method to create a root model for a tree
Declaration
protected virtual ActionResult<TreeNode?> CreateRootNode(FormCollection queryStrings)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TreeNode>> |
|
View Source
Helper method to create tree nodes and automatically generate the json URL + UDI
Declaration
public TreeNode CreateTreeNode(IEntitySlim entity, Guid entityObjectType, string parentId, FormCollection queryStrings, bool hasChildren)
Parameters
Type |
Name |
Description |
IEntitySlim |
entity |
|
Guid |
entityObjectType |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.Boolean |
hasChildren |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes and automatically generate the json URL + UDI
Declaration
public TreeNode CreateTreeNode(IUmbracoEntity entity, Guid entityObjectType, string parentId, FormCollection queryStrings, string icon, bool hasChildren)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
entity |
|
Guid |
entityObjectType |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
icon |
|
System.Boolean |
hasChildren |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
System.String |
icon |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes and automatically generate the json URL
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
System.String |
icon |
|
System.Boolean |
hasChildren |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes and automatically generate the json URL
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren, string routePath)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
System.String |
icon |
|
System.Boolean |
hasChildren |
|
System.String |
routePath |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes and automatically generate the json URL + UDI
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren, string routePath, Udi udi)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
System.String |
icon |
|
System.Boolean |
hasChildren |
|
System.String |
routePath |
|
Udi |
udi |
|
Returns
Type |
Description |
TreeNode |
|
View Source
Helper method to create tree nodes
Declaration
public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, string routePath)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
System.String |
title |
|
System.String |
icon |
|
System.String |
routePath |
|
Returns
Type |
Description |
TreeNode |
|
View Source
The action called to render the menu for a tree node
Declaration
public async Task<ActionResult<MenuItemCollection?>> GetMenu(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<MenuItemCollection>>> |
|
View Source
Returns the menu structure for the node
Declaration
protected abstract ActionResult<MenuItemCollection> GetMenuForNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<MenuItemCollection> |
|
View Source
Returns the menu structure for the node
Declaration
protected virtual async Task<ActionResult<MenuItemCollection>> GetMenuForNodeAsync(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<MenuItemCollection>> |
|
View Source
The action called to render the contents of the tree structure
Declaration
public async Task<ActionResult<TreeNodeCollection?>> GetNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
All of the query string parameters passed from jsTree
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TreeNodeCollection>>> |
JSON markup for jsTree
|
View Source
Returns the root node for the tree
Declaration
public async Task<ActionResult<TreeNode?>> GetRootNode([ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TreeNode>>> |
|
View Source
The method called to render the contents of the tree structure
Declaration
protected abstract ActionResult<TreeNodeCollection> GetTreeNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
All of the query string parameters passed from jsTree
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<TreeNodeCollection> |
|
View Source
The method called to render the contents of the tree structure
Declaration
protected virtual async Task<ActionResult<TreeNodeCollection>> GetTreeNodesAsync(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))] FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
All of the query string parameters passed from jsTree
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<TreeNodeCollection>> |
|
View Source
If the request is for a dialog mode tree
Declaration
protected bool IsDialog(FormCollection queryStrings)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
System.Boolean |
|