View Source
Class ContentTreeControllerBase
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public abstract class ContentTreeControllerBase : TreeController, ITreeNodeController
Constructors
View Source
Declaration
protected ContentTreeControllerBase(ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IMenuItemCollectionFactory menuItemCollectionFactory, IEntityService entityService, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILogger<ContentTreeControllerBase> logger, ActionCollection actionCollection, IUserService userService, IDataTypeService dataTypeService, IEventAggregator eventAggregator, AppCaches appCaches)
Parameters
Type |
Name |
Description |
ILocalizedTextService |
localizedTextService |
|
UmbracoApiControllerTypeCollection |
umbracoApiControllerTypeCollection |
|
IMenuItemCollectionFactory |
menuItemCollectionFactory |
|
IEntityService |
entityService |
|
IBackOfficeSecurityAccessor |
backofficeSecurityAccessor |
|
Microsoft.Extensions.Logging.ILogger<ContentTreeControllerBase> |
logger |
|
ActionCollection |
actionCollection |
|
IUserService |
userService |
|
IDataTypeService |
dataTypeService |
|
IEventAggregator |
eventAggregator |
|
AppCaches |
appCaches |
|
Properties
View Source
Declaration
public IMenuItemCollectionFactory MenuItemCollectionFactory { get; }
Property Value
Type |
Description |
IMenuItemCollectionFactory |
|
View Source
RecycleBinId
Declaration
protected abstract int RecycleBinId { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
RecycleBinSmells
Returns true if the recycle bin has items in it
Declaration
protected abstract bool RecycleBinSmells { get; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
UmbracoObjectType
Declaration
protected abstract UmbracoObjectTypes UmbracoObjectType { get; }
Property Value
Type |
Description |
UmbracoObjectTypes |
|
View Source
UserStartNodes
Returns the user's start node for this tree
Declaration
protected abstract int[] UserStartNodes { get; }
Property Value
Type |
Description |
System.Int32[] |
|
Methods
View Source
CreateRootNode(FormCollection)
Ensure the noAccess metadata is applied for the root node if in dialog mode and the user doesn't have path access
to it
Declaration
protected override 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
Based on the allowed actions, this will filter the ones that the current user is allowed
Declaration
protected void FilterUserAllowedMenuItems(MenuItemCollection menuWithAllItems, IEnumerable<MenuItem> userAllowedMenuItems)
Parameters
Type |
Name |
Description |
MenuItemCollection |
menuWithAllItems |
|
IEnumerable<MenuItem> |
userAllowedMenuItems |
|
View Source
GetChildEntities(String, FormCollection)
Declaration
protected virtual ActionResult<IEnumerable<IEntitySlim>> GetChildEntities(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<IEntitySlim>> |
|
View Source
Checks if the menu requested is for the recycle bin and renders that, otherwise renders the result of
PerformGetMenuForNode
Declaration
protected sealed override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<MenuItemCollection> |
|
View Source
GetSingleTreeNode(IEntitySlim, String, FormCollection)
Declaration
protected abstract TreeNode? GetSingleTreeNode(IEntitySlim entity, string parentId, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
IEntitySlim |
entity |
|
System.String |
parentId |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
System.Nullable<TreeNode> |
|
View Source
GetTreeNode(String, FormCollection)
Gets an individual tree node
Declaration
public ActionResult<TreeNode?> GetTreeNode([FromRoute] 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<System.Nullable<TreeNode>> |
|
View Source
GetTreeNodes(String, FormCollection)
Ensures the recycle bin is appended when required (i.e. user has access to the root and it's not in dialog mode)
Declaration
protected sealed override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<TreeNodeCollection> |
|
View Source
HasPathAccess(Nullable<IUmbracoEntity>, FormCollection)
Returns true or false if the current user has access to the node based on the user's allowed start node (path)
access
Declaration
protected bool HasPathAccess(IUmbracoEntity? entity, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.Nullable<IUmbracoEntity> |
entity |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
HasPathAccess(String, FormCollection)
Returns true or false if the current user has access to the node based on the user's allowed start node (path)
access
Declaration
protected abstract bool HasPathAccess(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
Declaration
protected abstract ActionResult<MenuItemCollection> PerformGetMenuForNode(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<MenuItemCollection> |
|
View Source
PerformGetTreeNodes(String, FormCollection)
Declaration
protected virtual ActionResult<TreeNodeCollection> PerformGetTreeNodes(string id, FormCollection queryStrings)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Microsoft.AspNetCore.Http.FormCollection |
queryStrings |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<TreeNodeCollection> |
|
View Source
ShouldRenderChildrenOfContainer(IEntitySlim)
Check to see if we should return children of a container node
Declaration
protected bool ShouldRenderChildrenOfContainer(IEntitySlim e)
Parameters
Type |
Name |
Description |
IEntitySlim |
e |
|
Returns
Type |
Description |
System.Boolean |
|