コード例 #1
0
 private void loadCustomPages()
 {
     dt.PageData pd = new dt.PageData();
     homePageId        = pd.Create(homeMenuId, standardCatId, false, true, false, false, "", "UNI Foundation Homepage", "", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "default.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "This is the website's homepage.", userId);
     newsListPageId    = pd.Create(newsMenuId, standardCatId, false, true, false, false, "", "News Archive", "News Archive", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "newsList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published news.", userId);
     dstoryListPageId  = pd.Create(dstoryMenuId, standardCatId, false, true, false, false, "", "Donor Stories", "Donor Stories", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "dstoryList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published donor stories.", userId);
     collegeListPageId = pd.Create(collegeMenuId, standardCatId, false, true, false, false, "", "Colleges", "Colleges", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "collegeList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published college pages.", userId);
     dptListPageId     = pd.Create(dptMenuId, standardCatId, false, true, false, false, "", "Departments", "Departments", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "departmentList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published department pages.", userId);
     progListPageId    = pd.Create(progMenuId, standardCatId, false, true, false, false, "", "Programs", "Programs", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "programList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published program pages.", userId);
     givingPageId      = pd.Create(givingMenuId, standardCatId, true, true, true, true, "", "Giving Opportunities", "Giving Opportunities", "", true, true, true, true, false, true, ConfigurationHelper.PublicWebsiteRoot + UrlHelper.PUBLIC_STANDARD_PAGE + "?id=" + UrlHelper.PAGE_ID_PREFIX, "", userId);
 }
コード例 #2
0
ファイル: SystemLoader.cs プロジェクト: ic4f/oldcode
        private void loadPages()
        {
            Console.WriteLine("loading pages");
            DataTable dtMenu = new d.StagingMenuData().GetOrdered().Tables[0];

            d.PageData pd = new d.PageData();
            //create 10 pages for each menu
            string partialUrl = ba.UrlHelper.BuildPagePartialUrlByPageCategory(ba.PageCategoryCode.StandardPage);

            foreach (DataRow dr in dtMenu.Rows)
            {
                for (int i = 0; i < 10; i++)
                {
                    int menuId = Convert.ToInt32(dr[0]);
                    if (menuId != 1) //all except home
                    {
                        pd.Create(menuId, 1, true, true, true, true, "", "page title " + Convert.ToInt32(dr[0]) + "-" + i, getRandomText(4, 80), getRandomText(500, 5000),
                                  true, false, false, false, false, true, partialUrl, getRandomText(50, 500), 1);
                    }
                }
            }

            //assign menus to pages
            d.StagingMenuData smd = new d.StagingMenuData();
            int pageId;

            d.Page    page;
            DataTable dtPages;

            foreach (DataRow dr in dtMenu.Rows)
            {
                int menuId = Convert.ToInt32(dr[0]);
                if (menuId != 1)
                {
                    dtPages = pd.GetPublishedByMenuId(menuId);
                    pageId  = Convert.ToInt32(dtPages.Rows[rnd.Next(dtPages.Rows.Count)][0]);
                    page    = new d.Page(pageId);
                    smd.UpdatePage(menuId, pageId);
                }
            }
        }
コード例 #3
0
ファイル: SystemLoader.cs プロジェクト: ic4f/oldcode
        private void loadPageTags()
        {
            Console.WriteLine("loading page tags");
            d.PageTagData pt      = new d.PageTagData();
            DataTable     dtPages = new d.PageData().GetList();
            DataTable     dtTags  = new d.TagData().GetList();
            int           pageId;
            int           tagId;
            int           tagsToAdd;
            int           totalTags = dtTags.Rows.Count;

            foreach (DataRow dr in dtPages.Rows)
            {
                pageId    = Convert.ToInt32(dr[0]);
                tagsToAdd = rnd.Next(totalTags + 1);
                for (int i = 0; i < tagsToAdd; i++)
                {
                    tagId = Convert.ToInt32(dtTags.Rows[rnd.Next(totalTags)][0]);
                    pt.AddLink(pageId, tagId);
                }
            }
        }
コード例 #4
0
ファイル: SystemLoader.cs プロジェクト: ic4f/oldcode
        private void loadPageLabels()
        {
            Console.WriteLine("loading page labels");
            d.PageContentLabelData pl = new d.PageContentLabelData();
            DataTable dtPages         = new d.PageData().GetList();
            DataTable dtLabels        = new d.ContentLabelData().GetList();
            int       pageId;
            int       labelId;
            int       labelsToAdd;
            int       totalLabels = dtLabels.Rows.Count;

            foreach (DataRow dr in dtPages.Rows)
            {
                pageId      = Convert.ToInt32(dr[0]);
                labelsToAdd = rnd.Next(totalLabels + 1);
                for (int i = 0; i < labelsToAdd; i++)
                {
                    labelId = Convert.ToInt32(dtLabels.Rows[rnd.Next(totalLabels)][0]);
                    pl.AddLink(pageId, labelId);
                }
            }
        }