コード例 #1
0
        void Handle(Input.Restore Action)
        {
            this.Transaction.Rollback();

            DataHelper helper = new DataHelper();

            helper.ClearData();
            helper.GenerateData();

            this.RefreshData();
        }
コード例 #2
0
        public void Register()
        {
            RegisterPartials();

            Application.Current.Use(new HtmlFromJsonProvider());
            Application.Current.Use(new PartialToStandaloneHtmlProvider());

            Handle.GET("/website/help?topic={?}", (string topic) =>
            {
                var json = new CmsHelp();
                return(json);
            });

            Handle.GET("/website/cleardata", () =>
            {
                DataHelper helper = new DataHelper();

                helper.ClearData();

                return(200);
            });

            Handle.GET("/website/resetdata", () =>
            {
                DataHelper helper = new DataHelper();

                helper.ClearData();
                helper.GenerateData();

                return(200);
            });

            Handle.GET("/website", () =>
            {
                return(Self.GET("/website/cms"));
            });

            Handle.GET("/website/cms", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms");

                    return master;
                }));
            });

            Handle.GET("/website/cms/surfaces", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/surfaces");

                    return master;
                }));
            });

            Handle.GET("/website/cms/blendingpoints", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/blendingpoints");

                    return master;
                }));
            });

            Handle.GET("/website/cms/catchingrules", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/catchingrules");

                    return master;
                }));
            });

            Handle.GET("/website/cms/pinningrules", () =>
            {
                return(Db.Scope <MasterPage>(() =>
                {
                    MasterPage master = this.GetMasterPageFromSession();

                    master.RefreshCurrentPage("/website/partials/cms/pinningrules");

                    return master;
                }));
            });
        }
コード例 #3
0
        public void Register()
        {
            RegisterPartials();

            Handle.GET("/website/standalone", () => {
                Session session = Session.Current;

                if (session != null && session.Data != null && session.Data is StandalonePage) {
                    return session.Data as StandalonePage;
                }

                StandalonePage standalone = new StandalonePage();

                if (session == null) {
                    session = new Session(SessionOptions.PatchVersioning);
                }

                standalone.Session = session;
                standalone.User = Self.GET("/sc/mapping/user", () => new Page());

                return standalone;
            });

            Handle.GET("/website/cleardata", () => {
                DataHelper helper = new DataHelper();

                helper.ClearData();

                return 200;
            });

            Handle.GET("/website/resetdata", () => {
                DataHelper helper = new DataHelper();

                helper.ClearData();
                helper.GenerateData();

                return 200;
            });

            Handle.GET("/website/cms", () => {
                return Db.Scope<StandalonePage>(() => {
                    StandalonePage master = this.GetMaster();

                    master.RefreshCurrentPage("/website/partials/cms");

                    return master;
                });
            });

            Handle.GET("/website/cms/templates", () => {
                return Db.Scope<StandalonePage>(() => {
                    StandalonePage master = this.GetMaster();

                    master.RefreshCurrentPage("/website/partials/cms/templates");

                    return master;
                });
            });

            Handle.GET("/website/cms/sections", () => {
                return Db.Scope<StandalonePage>(() => {
                    StandalonePage master = this.GetMaster();

                    master.RefreshCurrentPage("/website/partials/cms/sections");

                    return master;
                });
            });

            Handle.GET("/website/cms/urls", () => {
                return Db.Scope<StandalonePage>(() => {
                    StandalonePage master = this.GetMaster();

                    master.RefreshCurrentPage("/website/partials/cms/urls");

                    return master;
                });
            });

            Handle.GET("/website/cms/maps", () => {
                return Db.Scope<StandalonePage>(() => {
                    StandalonePage master = this.GetMaster();

                    master.RefreshCurrentPage("/website/partials/cms/maps");

                    return master;
                });
            });
        }