Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentTreeControllerBase

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    TreeControllerBase
    TreeController
    Namespace: Umbraco.Cms.Web.BackOffice.Trees
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    public abstract class ContentTreeControllerBase : TreeController, IUmbracoFeature, IDiscoverable, ITree, ITreeNodeController

    Constructors

    View Source

    ContentTreeControllerBase(ILocalizedTextService, UmbracoApiControllerTypeCollection, IMenuItemCollectionFactory, IEntityService, IBackOfficeSecurityAccessor, ILogger<ContentTreeControllerBase>, ActionCollection, IUserService, IDataTypeService, IEventAggregator, AppCaches)

    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

    MenuItemCollectionFactory

    Declaration
    public IMenuItemCollectionFactory MenuItemCollectionFactory { get; }
    Property Value
    Type Description
    IMenuItemCollectionFactory
    View Source

    RecycleBinId

    Returns the

    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<TreeNode>
    View Source

    FilterUserAllowedMenuItems(MenuItemCollection, IEnumerable<MenuItem>)

    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

    GetMenuForNode(String, FormCollection)

    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
    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<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>
    Remarks

    This method is overwritten strictly to render the recycle bin, it should serve no other purpose

    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

    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

    Declaration
    protected bool HasPathAccess(IUmbracoEntity entity, FormCollection queryStrings)
    Parameters
    Type Name Description
    IUmbracoEntity entity
    Microsoft.AspNetCore.Http.FormCollection queryStrings
    Returns
    Type Description
    System.Boolean
    View Source

    PerformGetMenuForNode(String, FormCollection)

    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
    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.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ContentTreeControllerBase(ILocalizedTextService, UmbracoApiControllerTypeCollection, IMenuItemCollectionFactory, IEntityService, IBackOfficeSecurityAccessor, ILogger<ContentTreeControllerBase>, ActionCollection, IUserService, IDataTypeService, IEventAggregator, AppCaches)
    • Properties
      • MenuItemCollectionFactory
      • RecycleBinId
      • RecycleBinSmells
      • UmbracoObjectType
      • UserStartNodes
    • Methods
      • CreateRootNode(FormCollection)
      • FilterUserAllowedMenuItems(MenuItemCollection, IEnumerable<MenuItem>)
      • GetChildEntities(String, FormCollection)
      • GetMenuForNode(String, FormCollection)
      • GetSingleTreeNode(IEntitySlim, String, FormCollection)
      • GetTreeNode(String, FormCollection)
      • GetTreeNodes(String, FormCollection)
      • HasPathAccess(String, FormCollection)
      • HasPathAccess(IUmbracoEntity, FormCollection)
      • PerformGetMenuForNode(String, FormCollection)
      • PerformGetTreeNodes(String, FormCollection)
      • ShouldRenderChildrenOfContainer(IEntitySlim)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX