protected override void CreateRootNode(ref XmlTreeNode rootNode)
        {
            //if the _rootNode is not defined yet, just return an empty one
            if (_rootNode == null)
            {
                NullTree nullTree = new NullTree(this.app);
                _rootNode = XmlTreeNode.CreateRoot(nullTree);
            }

            rootNode.Menu     = _rootNode.Menu;
            rootNode.Text     = _rootNode.Text;
            rootNode.Action   = _rootNode.Action;
            rootNode.Source   = _rootNode.Source;
            rootNode.Icon     = _rootNode.Icon;
            rootNode.OpenIcon = _rootNode.OpenIcon;
            rootNode.NodeType = _rootNode.NodeType;
            rootNode.NodeID   = _rootNode.NodeID;
        }
Example #2
0
        protected override void CreateRootNode(ref XmlTreeNode rootNode)
        {
            //if the _rootNode is not defined yet, just return an empty one
            if (_rootNode == null)
            {
                NullTree nullTree = new NullTree(this.app);
                _rootNode = XmlTreeNode.CreateRoot(nullTree);
            }                

            rootNode.Menu = _rootNode.Menu;
            rootNode.Text = _rootNode.Text;
            rootNode.Action = _rootNode.Action;
            rootNode.Source = _rootNode.Source;
            rootNode.Icon = _rootNode.Icon;
            rootNode.OpenIcon = _rootNode.OpenIcon;
            rootNode.NodeType = _rootNode.NodeType;
            rootNode.NodeID = _rootNode.NodeID;
        }
        /// <summary>
        /// Converts an ITree into a BaseTree. This is used for Legacy trees that don't inherit from BaseTree already.
        /// </summary>
        /// <param name="tree"></param>
        /// <param name="alias"></param>
        /// <param name="appAlias"></param>
        /// <param name="iconClosed"></param>
        /// <param name="iconOpened"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static BaseTree FromITree(ITree tree, string alias, string appAlias, string iconClosed, string iconOpened, string action)
        {
            TreeService treeSvc = new TreeService(null, alias, null, null, TreeDialogModes.none, appAlias);
            //create the generic XmlTreeNode and fill it with the properties from the db
            NullTree    nullTree = new NullTree(appAlias);
            XmlTreeNode node     = XmlTreeNode.CreateRoot(nullTree);

            node.Text     = BaseTree.GetTreeHeader(alias);;
            node.Action   = action;
            node.Source   = treeSvc.GetServiceUrl();
            node.Icon     = iconClosed;
            node.OpenIcon = iconOpened;
            node.NodeType = "init" + alias;
            node.NodeType = alias;
            node.NodeID   = "init";
            node.Menu     = BaseTree.GetDefaultRootNodeActions();

            //convert the tree to a LegacyTree
            LegacyTree bTree = new LegacyTree(tree, appAlias, node);

            return(bTree);
        }
Example #4
0
        /// <summary>
        /// Creates the root node for the content tree. If the current User does
        /// not have access to the actual content tree root, then we'll display the 
        /// node that correlates to their StartNodeID
        /// </summary>
        /// <param name="rootNode"></param>
        protected override void CreateRootNode(ref XmlTreeNode rootNode)
        {
            if (StartNodeID != -1)
            {
                Document doc = StartNode;
                if (doc == null)
                {
                    rootNode = new NullTree(this.app).RootNode;
                    rootNode.Text = "You do not have permission for this content tree";
                    rootNode.HasChildren = false;
                    rootNode.Source = string.Empty;
                }
                else
                {
                    rootNode = CreateNode(doc, RootNodeActions);
                }
            }
            else
            {
                if (IsDialog)
                    rootNode.Action = "javascript:openContent(-1);";
            }

        }
 /// <summary>
 /// Load an empty tree structure to show the end user that there was a problem loading the tree.
 /// </summary>
 private void LoadNullTree(TreeRequestParams treeParams)
 {
     BaseTree nullTree = new NullTree(treeParams.Application);
     nullTree.SetTreeParameters(treeParams);
     nullTree.Render(ref xTree);
 }
Example #6
0
        /// <summary>
        /// Converts an ITree into a BaseTree. This is used for Legacy trees that don't inherit from BaseTree already.
        /// </summary>
        /// <param name="tree"></param>
        /// <param name="alias"></param>
        /// <param name="appAlias"></param>
        /// <param name="iconClosed"></param>
        /// <param name="iconOpened"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static BaseTree FromITree(ITree tree, string alias, string appAlias, string iconClosed, string iconOpened, string action)
        {
            TreeService treeSvc = new TreeService(null, alias, null, null, TreeDialogModes.none, appAlias);
            //create the generic XmlTreeNode and fill it with the properties from the db          
			NullTree nullTree = new NullTree(appAlias);
            XmlTreeNode node = XmlTreeNode.CreateRoot(nullTree);
            node.Text = BaseTree.GetTreeHeader(alias);;
            node.Action = action;
            node.Source = treeSvc.GetServiceUrl();
            node.Icon = iconClosed;
            node.OpenIcon = iconOpened;
            node.NodeType = "init" + alias;
			node.NodeType = alias;
            node.NodeID = "init";
            node.Menu = BaseTree.GetDefaultRootNodeActions();

            //convert the tree to a LegacyTree
            LegacyTree bTree = new LegacyTree(tree, appAlias, node);

            return bTree;
        }
Example #7
0
 /// <summary>
 /// Load an empty tree structure to show the end user that there was a problem loading the tree.
 /// </summary>
 private void LoadNullTree()
 {
     BaseTree nullTree = new NullTree(m_treeParams.Application);
     nullTree.SetTreeParameters(m_treeParams);
     nullTree.Render(ref m_xTree);
 }