public void Execute(IFormLogger logger, string name, string key, string description, string parentKey)
        {
            logger.Log("Grabbing structure ...");
            var rootSpace = ExecuteNonCurl(createSpaceUrl, JsonConvert.SerializeObject(CreateSpaceInstance(name, key, description)));

            logger.Log("Created Root Space ...");
            foreach (ConfluencePage page in this.structure)
            {
                var rootPage = CreateChildPage(createPageUrl, JsonConvert.SerializeObject(CreateChildPageInstance(rootSpace.key, rootSpace.homepage.id, page.Title, page.Content)));
                logger.Log(string.Format("Created the root page : {0}", page.Title));
                foreach (ConfluencePage t in page.ChildPages)
                {
                    CreateChildPage(createPageUrl, JsonConvert.SerializeObject(CreateChildPageInstance(rootSpace.key, rootPage.id.ToString(), t.Title, t.Content)));
                    logger.Log(string.Format("Created the child page : {0}", t.Title));
                }
            }

            logger.Log("Updating parent Space.");

            var parentBusinessCase = GetPageByKeyAndTitle(parentKey, AppSettingsHelper.GetValue(Strings.PARENT_BUSINESS_CASE_TITLE_KEY));

            if (parentBusinessCase != null)
            {
                if (parentBusinessCase.results.Count() == 1)
                {
                    var    r    = parentBusinessCase.results.FirstOrDefault();
                    string html = r.body.storage.value;
                    html = html.Replace("\"", @"'");

                    int index = html.IndexOf("</ul>");

                    var    childBusinessCase = GetPageByKeyAndTitle(rootSpace.key, AppSettingsHelper.GetValue(Strings.PARENT_BUSINESS_CASE_TITLE_KEY));
                    string newHtml           = html.Insert(index, string.Format(@"<li><a href='{0}'>{1}</a></li>", ExtractLinkFromChildBusinessCase(childBusinessCase), rootSpace.name));

                    UpdatePageInput p = new UpdatePageInput();
                    p.id = r.id;
                    p.body.storage.value = newHtml;
                    p.space.key          = parentKey;
                    p.title          = r.title;
                    p.version.number = r.version.number + 1;
                    UpdateParentPage(p.id, p);
                    logger.Log("Done updating the project parent page.");
                }
                else
                {
                    logger.Log("Cannot find the Business Case Parent Page.");
                }
            }
            else
            {
                logger.Log("Cannot find the parent page.");
            }



            logger.Log("Task Complete.");
        }
        public UpdatePageOutput UpdateParentPage(string pageId, UpdatePageInput param)
        {
            string url = string.Format(AppSettingsHelper.GetValue(Strings.UPDATEPAGE_URL_KEY), pageId);

            return(HttpClientHelper.ExecutePut <UpdatePageOutput>(url, JsonConvert.SerializeObject(param), this.logger));
        }