Beispiel #1
0
        private void CreateIndividualTreeNode(TreeNode currentTreeNode, List <ChildPagesOutput_Result> pages)
        {
            foreach (var item in pages)
            {
                string childUrl = AppSettingsHelper.GetValue(Strings.BASEURL_KEY) + string.Format("/rest/api/content/{0}/child/page", item.id);

                ChildPagesOutput childPages = HttpClientHelper.ExecuteGet <ChildPagesOutput>(childUrl, this.logger);

                TreeNode newNode = new TreeNode();
                newNode.Text = item.title;
                newNode.Name = item.title;
                newNode.Tag  = item;

                currentTreeNode.Nodes.Add(newNode);

                if (childPages.results.Count > 0)
                {
                    CreateIndividualTreeNode(currentTreeNode.LastNode, childPages.results);
                }
                else
                {
                    CreateIndividualTreeNode(currentTreeNode, childPages.results);
                }
            }
        }
        public void ExecuteDelete()
        {
            ConfluencePageTreeTaskExecutor pageTask = new ConfluencePageTreeTaskExecutor();
            PageByTitleAndKeyOutput        page     = pageTask.GetPageByKeyAndTitle(PARENT_SPACE, PARENT_TITLE);


            ConfluenceChildPagesTaskExecutor childPagesTask = new ConfluenceChildPagesTaskExecutor();
            ChildPagesOutput children = childPagesTask.Execute(page.results.FirstOrDefault().id);

            foreach (var c in children.results)
            {
                ChildPagesOutput children2 = childPagesTask.Execute(c.id);
                foreach (var c2 in children2.results)
                {
                    HttpClientHelper.ExecuteDelete <string>(string.Format(DELETE_URL, c2.id), this.logger);
                }
            }
            logger.Log("Done Deleting.");
        }
Beispiel #3
0
        private void CreateIndividualTreeNodeWeb(System.Web.UI.WebControls.TreeNode currentTreeNode, List <ChildPagesOutput_Result> pages)
        {
            foreach (var item in pages)
            {
                string childUrl = AppSettingsHelper.GetValue(Strings.BASEURL_KEY) + string.Format("/rest/api/content/{0}/child/page", item.id);

                ChildPagesOutput childPages = HttpClientHelper.ExecuteGet <ChildPagesOutput>(childUrl, string.Empty, "vd2:Welcome2", this.logger);

                System.Web.UI.WebControls.TreeNode newNode = new System.Web.UI.WebControls.TreeNode();
                newNode.Text  = item.title;
                newNode.Value = JsonConvert.SerializeObject(item);

                currentTreeNode.ChildNodes.Add(newNode);

                if (childPages.results.Count > 0)
                {
                    CreateIndividualTreeNodeWeb(currentTreeNode.ChildNodes[currentTreeNode.ChildNodes.Count - 1], childPages.results);
                }
                else
                {
                    CreateIndividualTreeNodeWeb(currentTreeNode, childPages.results);
                }
            }
        }