示例#1
0
        private void createFullSite()
        {
            // 完整安装
            CmsInstaller  x1 = ObjectContext.Create <CmsInstaller>();
            LinkInstaller x2 = ObjectContext.Create <LinkInstaller>();

            // 门户首页
            IMemberApp mappPortal = x1.CreatePortal(ctx, "首页", "default");

            // 新闻
            IMemberApp mappNews = x1.CreateNews(ctx, "新闻资讯", "news");

            // 论坛
            ObjectContext.Create <ForumInstaller>().Init(ctx, "讨论区", "bbs");

            // 微博
            ObjectContext.Create <MicroblogInstaller>().Init(ctx, "微博", "t");

            // 瀑布流
            ObjectContext.Create <WaterfallInstaller>().Init(ctx, "图片", "pic");

            // 下载
            ObjectContext.Create <DownloadInstaller>().Init(ctx, "资源下载", "download");

            // 博客
            x2.AddBlog(ctx, "博客", "blog");

            // 群组
            x2.AddGroup(ctx, "群组", "group");

            // 用户
            x2.AddUser(ctx, "用户列表", "user");

            // tag
            x2.AddTag(ctx, "Tag", "tags");


            // 设置安装完毕
            config.Instance.Site.IsInstall = true;
            config.Instance.Site.Update("IsInstall", true);

            // 生成静态页面
            HtmlInstallerHelper htmlHelper = ObjectContext.Create <HtmlInstallerHelper>();

            htmlHelper.MakeHtml(ctx, mappPortal, mappNews);
        }
示例#2
0
        private void createCmsSite()
        {
            CmsInstaller  x1 = ObjectContext.Create <CmsInstaller>();
            LinkInstaller x2 = ObjectContext.Create <LinkInstaller>();

            // 门户首页
            IMemberApp mappPortal = x1.CreatePortal(ctx, "首页", "default");

            // 新闻
            IMemberApp mappNews = x1.CreateNews(ctx, "新闻资讯", "news");

            // 设置安装完毕
            updateSiteDone();

            // 生成静态页面
            HtmlInstallerHelper htmlHelper = ObjectContext.Create <HtmlInstallerHelper>();

            htmlHelper.MakeHtml(ctx, mappPortal, mappNews);
        }