Esempio n. 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);
                }
            }
        }
Esempio n. 2
0
        public System.Web.UI.WebControls.TreeNode CreateSpaceTreeNodeWeb(Result space)
        {
            System.Web.UI.WebControls.TreeNode result = new System.Web.UI.WebControls.TreeNode(space.name);
            if (space == null)
            {
                return(result);
            }

            string childUrl  = AppSettingsHelper.GetValue(Strings.BASEURL_KEY) + space._expandable.homepage + Strings.CHILDPAGE_PATH;
            var    rootPages = HttpClientHelper.ExecuteGet <ChildPagesOutput>(childUrl, string.Empty,
                                                                              string.Format("{0}:{1}", AppSettingsHelper.GetValue("username"), AppSettingsHelper.GetValue("password")), this.logger);

            CreateIndividualTreeNodeWeb(result, rootPages.results);

            return(result);
        }
Esempio n. 3
0
        public TreeNode CreateSpaceTreeNode(Result space)
        {
            TreeNode result = new TreeNode(space.name);

            if (space == null)
            {
                return(result);
            }

            string childUrl  = AppSettingsHelper.GetValue(Strings.BASEURL_KEY) + space._expandable.homepage + Strings.CHILDPAGE_PATH;
            var    rootPages = HttpClientHelper.ExecuteGet <ChildPagesOutput>(childUrl, this.logger);

            CreateIndividualTreeNode(result, rootPages.results);

            return(result);
        }
Esempio n. 4
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);
                }
            }
        }
Esempio n. 5
0
 public AllSpaces ExecuteWeb(string payload, string credentials)
 {
     return(HttpClientHelper.ExecuteGet <AllSpaces>(AppSettingsHelper.GetValue(Strings.CREATE_SPACEURL_KEY), payload, credentials, this.logger));
 }
Esempio n. 6
0
 public AllSpaces Execute()
 {
     return(HttpClientHelper.ExecuteGet <AllSpaces>(AppSettingsHelper.GetValue(Strings.CREATE_SPACEURL_KEY), this.logger));
 }
 public ChildPagesOutput Execute(string id)
 {
     return(HttpClientHelper.ExecuteGet <ChildPagesOutput>(string.Format(AppSettingsHelper.GetValue(Strings.GET_CHILDPAGES_URL), id), this.logger));
 }
        public PageByTitleAndKeyOutput GetPageByKeyAndTitle(string parentKey, string pageTitle)
        {
            string url = string.Format(AppSettingsHelper.GetValue(Strings.GET_PAGEBY_TITLE_KEY_URL), pageTitle, parentKey);

            return(HttpClientHelper.ExecuteGet <PageByTitleAndKeyOutput>(url, this.logger));
        }