Exemplo n.º 1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

            if (Body.IsQueryExists("Gather") && Body.IsQueryExists("GatherRuleNameCollection"))
            {
                var userKeyPrefix = StringUtils.Guid();
                var parameters    = AjaxGatherService.GetGatherParameters(PublishmentSystemId, Body.GetQueryString("GatherRuleNameCollection"), userKeyPrefix);
                RegisterScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxGatherService.GetGatherUrl(), parameters, userKeyPrefix, AjaxGatherService.GetCountArrayUrl());
            }
            else if (Body.IsQueryExists("GatherDatabase") && Body.IsQueryExists("GatherRuleNameCollection"))
            {
                var userKeyPrefix = StringUtils.Guid();
                var parameters    = AjaxGatherService.GetGatherDatabaseParameters(PublishmentSystemId,
                                                                                  Body.GetQueryString("GatherRuleNameCollection"), userKeyPrefix);
                RegisterScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxGatherService.GetGatherDatabaseUrl(), parameters, userKeyPrefix, AjaxGatherService.GetCountArrayUrl());
            }
            else if (Body.IsQueryExists("GatherFile") && Body.IsQueryExists("GatherRuleNameCollection"))
            {
                var userKeyPrefix = StringUtils.Guid();
                var parameters    = AjaxGatherService.GetGatherFileParameters(PublishmentSystemId,
                                                                              Body.GetQueryString("GatherRuleNameCollection"), userKeyPrefix);
                RegisterScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxGatherService.GetGatherFileUrl(), parameters,
                                                           userKeyPrefix, AjaxGatherService.GetCountArrayUrl());
            }
            //----------------------------------------------------------------------------------------//
            else if (Body.IsQueryExists("CreateChannelsOneByOne") && Body.IsQueryExists("ChannelIDCollection"))
            {
                foreach (var channelId in TranslateUtils.StringCollectionToIntList(Body.GetQueryString("ChannelIDCollection")))
                {
                    CreateManager.CreateChannel(PublishmentSystemId, channelId);
                }

                PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString("已成功将栏目放入生成队列"));
            }
            else if (Body.IsQueryExists("CreateContentsOneByOne") && Body.IsQueryExists("NodeID") &&
                     Body.IsQueryExists("ContentIDCollection"))
            {
                foreach (var contentId in TranslateUtils.StringCollectionToIntList(Body.GetQueryString("ContentIDCollection")))
                {
                    CreateManager.CreateContent(PublishmentSystemId, Body.GetQueryInt("NodeID"),
                                                contentId);
                }

                PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString("已成功将内容放入生成队列"));
            }
            else if (Body.IsQueryExists("CreateByTemplate") && Body.IsQueryExists("templateID"))
            {
                CreateManager.CreateFile(PublishmentSystemId, Body.GetQueryInt("templateID"));

                PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString("已成功将文件放入生成队列"));
            }
            else if (Body.IsQueryExists("CreateByIDsCollection") && Body.IsQueryExists("IDsCollection"))
            {
                foreach (var nodeIdContentId in
                         TranslateUtils.StringCollectionToStringCollection(Body.GetQueryString("IDsCollection")))
                {
                    var pair = nodeIdContentId.Split('_');
                    CreateManager.CreateContent(PublishmentSystemId, TranslateUtils.ToInt(pair[0]),
                                                TranslateUtils.ToInt(pair[1]));
                }

                PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString("已成功将文件放入生成队列"));
            }
            //---------------------------------------------------------------------------------------//
            else if (Body.IsQueryExists("SiteTemplateDownload"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var parameters = AjaxOtherService.GetSiteTemplateDownloadParameters(Body.GetQueryString("DownloadUrl"),
                                                                                    Body.GetQueryString("DirectoryName"), userKeyPrefix);
                RegisterScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetSiteTemplateDownloadUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
            else if (Body.IsQueryExists("SiteTemplateZip"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var parameters = AjaxOtherService.GetSiteTemplateZipParameters(Body.GetQueryString("DirectoryName"), userKeyPrefix);
                RegisterScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetSiteTemplateZipUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
        }
Exemplo n.º 2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

            if (AuthRequest.IsQueryExists("CreateChannelsOneByOne") && AuthRequest.IsQueryExists("ChannelIDCollection"))
            {
                foreach (var channelId in TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("ChannelIDCollection")))
                {
                    CreateManager.CreateChannel(SiteId, channelId);
                }

                LayerUtils.CloseAndOpenPageCreateStatus(Page);
                //PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString(SiteId, "已成功将栏目放入生成队列"));
            }
            else if (AuthRequest.IsQueryExists("CreateContentsOneByOne") && AuthRequest.IsQueryExists("channelId") &&
                     AuthRequest.IsQueryExists("contentIdCollection"))
            {
                foreach (var contentId in TranslateUtils.StringCollectionToIntList(AuthRequest.GetQueryString("contentIdCollection")))
                {
                    CreateManager.CreateContent(SiteId, AuthRequest.GetQueryInt("channelId"),
                                                contentId);
                }

                LayerUtils.CloseAndOpenPageCreateStatus(Page);
                //PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString(SiteId, "已成功将内容放入生成队列"));
            }
            else if (AuthRequest.IsQueryExists("CreateByTemplate") && AuthRequest.IsQueryExists("templateID"))
            {
                CreateManager.CreateFile(SiteId, AuthRequest.GetQueryInt("templateID"));

                LayerUtils.CloseAndOpenPageCreateStatus(Page);
                //PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString(SiteId, "已成功将文件放入生成队列"));
            }
            else if (AuthRequest.IsQueryExists("CreateByIDsCollection") && AuthRequest.IsQueryExists("IDsCollection"))
            {
                foreach (var channelIdContentId in
                         TranslateUtils.StringCollectionToStringCollection(AuthRequest.GetQueryString("IDsCollection")))
                {
                    var pair = channelIdContentId.Split('_');
                    CreateManager.CreateContent(SiteId, TranslateUtils.ToInt(pair[0]),
                                                TranslateUtils.ToInt(pair[1]));
                }

                LayerUtils.CloseAndOpenPageCreateStatus(Page);
                //PageUtils.Redirect(ModalTipMessage.GetRedirectUrlString(SiteId, "已成功将文件放入生成队列"));
            }
            //---------------------------------------------------------------------------------------//
            else if (AuthRequest.IsQueryExists("SiteTemplateDownload"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var downloadUrl   = TranslateUtils.DecryptStringBySecretKey(AuthRequest.GetQueryString("DownloadUrl"));
                var directoryName = PathUtils.GetFileNameWithoutExtension(downloadUrl);

                var parameters = AjaxOtherService.GetSiteTemplateDownloadParameters(downloadUrl, directoryName, userKeyPrefix);
                LtlScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetSiteTemplateDownloadUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
            else if (AuthRequest.IsQueryExists("SiteTemplateZip"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var parameters = AjaxOtherService.GetSiteTemplateZipParameters(AuthRequest.GetQueryString("DirectoryName"), userKeyPrefix);
                LtlScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetSiteTemplateZipUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
            else if (AuthRequest.IsQueryExists("SiteTemplateUnZip"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var parameters = AjaxOtherService.GetSiteTemplateUnZipParameters(AuthRequest.GetQueryString("FileName"), userKeyPrefix);
                LtlScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetSiteTemplateUnZipUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
            //---------------------------------------------------------------------------------------//
            else if (AuthRequest.IsQueryExists("PluginDownload"))
            {
                var userKeyPrefix = StringUtils.Guid();

                var parameters = AjaxOtherService.GetPluginDownloadParameters(AuthRequest.GetQueryString("DownloadUrl"), userKeyPrefix);
                LtlScripts.Text =
                    AjaxManager.RegisterProgressTaskScript(AjaxOtherService.GetPluginDownloadUrl(), parameters, userKeyPrefix, AjaxOtherService.GetCountArrayUrl());
            }
        }