Class ContentTreeControllerBase
- Namespace
- Umbraco.Cms.Web.BackOffice.Trees
- Assembly
- Umbraco.Web.BackOffice.dll
public abstract class ContentTreeControllerBase : TreeController, ITree, ITreeNodeController
- Inheritance
-
ContentTreeControllerBase
- Implements
-
ITree
- Derived
- Inherited Members
Constructors
ContentTreeControllerBase(ILocalizedTextService, UmbracoApiControllerTypeCollection, IMenuItemCollectionFactory, IEntityService, IBackOfficeSecurityAccessor, ILogger<ContentTreeControllerBase>, ActionCollection, IUserService, IDataTypeService, IEventAggregator, AppCaches)
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
localizedTextServiceILocalizedTextServiceumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionmenuItemCollectionFactoryIMenuItemCollectionFactoryentityServiceIEntityServicebackofficeSecurityAccessorIBackOfficeSecurityAccessorloggerILogger<ContentTreeControllerBase>actionCollectionActionCollectionuserServiceIUserServicedataTypeServiceIDataTypeServiceeventAggregatorIEventAggregatorappCachesAppCaches
Properties
MenuItemCollectionFactory
public IMenuItemCollectionFactory MenuItemCollectionFactory { get; }
Property Value
- IMenuItemCollectionFactory
RecycleBinId
Returns the
protected abstract int RecycleBinId { get; }
Property Value
RecycleBinSmells
Returns true if the recycle bin has items in it
protected abstract bool RecycleBinSmells { get; }
Property Value
UmbracoObjectType
protected abstract UmbracoObjectTypes UmbracoObjectType { get; }
Property Value
- UmbracoObjectTypes
UserStartNodes
Returns the user's start node for this tree
protected abstract int[] UserStartNodes { get; }
Property Value
- int[]
Methods
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
protected override ActionResult<TreeNode?> CreateRootNode(FormCollection queryStrings)
Parameters
queryStringsFormCollection
Returns
- ActionResult<TreeNode>
FilterUserAllowedMenuItems(MenuItemCollection, IEnumerable<MenuItem>)
Based on the allowed actions, this will filter the ones that the current user is allowed
protected void FilterUserAllowedMenuItems(MenuItemCollection menuWithAllItems, IEnumerable<MenuItem> userAllowedMenuItems)
Parameters
menuWithAllItemsMenuItemCollectionuserAllowedMenuItemsIEnumerable<MenuItem>
GetChildEntities(string, FormCollection)
protected virtual ActionResult<IEnumerable<IEntitySlim>> GetChildEntities(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<IEnumerable<IEntitySlim>>
GetMenuForNode(string, FormCollection)
Checks if the menu requested is for the recycle bin and renders that, otherwise renders the result of PerformGetMenuForNode
protected override sealed ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<MenuItemCollection>
GetSingleTreeNode(IEntitySlim, string, FormCollection?)
protected abstract TreeNode? GetSingleTreeNode(IEntitySlim entity, string parentId, FormCollection? queryStrings)
Parameters
entityIEntitySlimparentIdstringqueryStringsFormCollection
Returns
- TreeNode
GetTreeNode(string, FormCollection?)
Gets an individual tree node
public ActionResult<TreeNode?> GetTreeNode(string id, FormCollection? queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<TreeNode>
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)
protected override sealed ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<TreeNodeCollection>
Remarks
This method is overwritten strictly to render the recycle bin, it should serve no other purpose
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
protected abstract bool HasPathAccess(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
HasPathAccess(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
protected bool HasPathAccess(IUmbracoEntity? entity, FormCollection queryStrings)
Parameters
entityIUmbracoEntityqueryStringsFormCollection
Returns
PerformGetMenuForNode(string, FormCollection)
protected abstract ActionResult<MenuItemCollection> PerformGetMenuForNode(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<MenuItemCollection>
PerformGetTreeNodes(string, FormCollection)
protected virtual ActionResult<TreeNodeCollection> PerformGetTreeNodes(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
Returns
- ActionResult<TreeNodeCollection>
ShouldRenderChildrenOfContainer(IEntitySlim)
Check to see if we should return children of a container node
protected bool ShouldRenderChildrenOfContainer(IEntitySlim e)
Parameters
eIEntitySlim
Returns
Remarks
This is required in case a user has custom start nodes that are children of a list view since in that case we'll need to render the tree node. In normal cases we don't render children of a list view.