protected virtual Node GetBindingRoot() { if (BindTarget != null) { var value = (SenseNet.Portal.UI.PortletFramework.BindTarget)Enum.Parse(typeof(SenseNet.Portal.UI.PortletFramework.BindTarget), BindTarget); switch (value) { case SenseNet.Portal.UI.PortletFramework.BindTarget.Unselected: return(Content.CreateNew("Folder", Repository.Root, "DummyNode").ContentHandler); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentSite: //return PortalContext.Current.Site; return(SenseNet.Portal.Site.GetSiteByNode(PortalContext.Current.ContextNode)); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentPage: return(PortalContext.Current.Page); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentUser: return(HttpContext.Current.User.Identity as User); case SenseNet.Portal.UI.PortletFramework.BindTarget.CustomRoot: return(Node.LoadNode(this.CustomRootPath)); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentStartPage: return(PortalContext.Current.Site.StartPage as Node ?? PortalContext.Current.Site as Node); case SenseNet.Portal.UI.PortletFramework.BindTarget.Breadcrumb: case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentContent: return(PortalContext.Current.ContextNode ?? Repository.Root); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentWorkspace: return((Node)PortalContext.Current.ContextWorkspace ?? PortalContext.Current.Site); case SenseNet.Portal.UI.PortletFramework.BindTarget.CurrentList: return(ContentList.GetContentListByParentWalk(PortalContext.Current.ContextNode)); default: throw new NotImplementedException(BindTarget.ToString()); } } else { return(PortalContext.Current.ContextNode ?? Repository.Root); } }
private Node GetBindingRootPrivate() { switch (BindTarget) { case BindTarget.Unselected: return(Content.CreateNew("Folder", Repository.Root, "DummyNode").ContentHandler); case BindTarget.CurrentSite: //return PortalContext.Current.Site; return(Portal.Site.GetSiteByNode(PortalContext.Current.ContextNode)); case BindTarget.CurrentPage: return(PortalContext.Current.Page); case BindTarget.CurrentUser: return(HttpContext.Current.User.Identity as User); case BindTarget.CustomRoot: return(Node.LoadNode(this.CustomRootPath)); case BindTarget.CurrentStartPage: return(PortalContext.Current.Site.StartPage as Node ?? PortalContext.Current.Site as Node); case BindTarget.Breadcrumb: case BindTarget.CurrentContent: return(PortalContext.Current.ContextNode ?? Repository.Root); case BindTarget.CurrentWorkspace: return((Node)PortalContext.Current.ContextWorkspace ?? PortalContext.Current.Site); case BindTarget.CurrentList: return(PortalContext.Current.ContentList); default: throw new NotImplementedException(BindTarget.ToString()); } }