Example #1
0
        internal SiteMapOrder(vw_carrot_Content c)
        {
            if (c != null) {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.SiteID = c.SiteID;
                this.Root_ContentID = c.Root_ContentID;
                this.PageActive = c.PageActive;
                this.ShowInSiteNav = c.ShowInSiteNav;
                this.Parent_ContentID = c.Parent_ContentID;
                this.NavMenuText = c.NavMenuText;
                this.FileName = c.FileName;
                this.NavOrder = c.NavOrder;

                if (this.Parent_ContentID.HasValue) {
                    this.NavLevel = 0;
                } else {
                    this.NavLevel = 10;
                }

                this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);
                this.CreateDate = site.ConvertUTCToSiteTime(c.CreateDate);
                this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);
            }
        }
Example #2
0
        internal SiteNav(vw_carrot_Content c)
        {
            if (c != null) {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.Root_ContentID = c.Root_ContentID;
                this.SiteID = c.SiteID;
                this.FileName = c.FileName;
                this.Thumbnail = c.PageThumbnail;
                this.ShowInSiteMap = c.ShowInSiteMap;
                this.BlockIndex = c.BlockIndex;
                this.PageActive = c.PageActive;
                this.CreateDate = site.ConvertUTCToSiteTime(c.CreateDate);
                this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);
                this.EditDate = site.ConvertUTCToSiteTime(c.EditDate);
                this.EditUserId = c.EditUserId;
                this.CreditUserId = c.CreditUserId;
                this.ShowInSiteNav = c.ShowInSiteNav;
                this.CreateUserId = c.CreateUserId;
                this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);
                this.ContentID = c.ContentID;
                this.Parent_ContentID = c.Parent_ContentID;
                this.TitleBar = c.TitleBar;
                this.NavMenuText = c.NavMenuText;
                this.PageHead = c.PageHead;
                this.PageText = c.PageText;
                this.NavOrder = c.NavOrder;
                this.TemplateFile = c.TemplateFile;
            }
        }
Example #3
0
        internal ContentPage(vw_carrot_Content c)
        {
            if (c != null)
            {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.Root_ContentID   = c.Root_ContentID;
                this.SiteID           = c.SiteID;
                this.Heartbeat_UserId = c.Heartbeat_UserId;
                this.EditHeartbeat    = c.EditHeartbeat;
                this.FileName         = c.FileName;

                this.CreateUserId = c.CreateUserId;
                this.CreateDate   = site.ConvertUTCToSiteTime(c.CreateDate);

                this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);
                this.EditDate   = site.ConvertUTCToSiteTime(c.EditDate);

                this.ShowInSiteMap = c.ShowInSiteMap;
                this.BlockIndex    = c.BlockIndex;
                this.PageActive    = c.PageActive;
                this.ShowInSiteNav = c.ShowInSiteNav;

                this.PageSlug    = c.PageSlug;
                this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);

                this.ContentID        = c.ContentID;
                this.Parent_ContentID = c.Parent_ContentID;
                this.IsLatestVersion  = c.IsLatestVersion;
                this.TitleBar         = c.TitleBar;
                this.NavMenuText      = c.NavMenuText;
                this.PageHead         = c.PageHead;
                this.PageText         = c.PageText;
                this.LeftPageText     = c.LeftPageText;
                this.RightPageText    = c.RightPageText;
                this.NavOrder         = c.NavOrder;
                this.EditUserId       = c.EditUserId;
                this.CreditUserId     = c.CreditUserId;
                this.TemplateFile     = c.TemplateFile;
                this.Thumbnail        = c.PageThumbnail;

                if (String.IsNullOrEmpty(this.PageSlug) && this.ContentType == ContentPageType.PageType.BlogEntry)
                {
                    this.PageSlug = c.FileName;
                }

                this.MetaDescription = c.MetaDescription;
                this.MetaKeyword     = c.MetaKeyword;

                this.VersionCount = c.VersionCount.HasValue ? c.VersionCount.Value : 0;
            }
        }
Example #4
0
        public SiteNav GetNextPost(Guid siteID, Guid rootContentID, bool bActiveOnly)
        {
            vw_carrot_Content c = CompiledQueries.GetNextPost(db, siteID, bActiveOnly, rootContentID);

            if (c != null)
            {
                return(new SiteNav(c));
            }
            else
            {
                return(null);
            }
        }
Example #5
0
        public List <SiteNav> GetPageCrumbNavigation(Guid siteID, string sPage, bool bActiveOnly)
        {
            vw_carrot_Content c = CompiledQueries.GetLatestContentByURL(db, siteID, false, sPage);

            if (c != null)
            {
                return(GetPageCrumbNavByContent(c, bActiveOnly));
            }
            else
            {
                return(new List <SiteNav>());
            }
        }
Example #6
0
        internal ContentPage(vw_carrot_Content c)
        {
            if (c != null) {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.Root_ContentID = c.Root_ContentID;
                this.SiteID = c.SiteID;
                this.Heartbeat_UserId = c.Heartbeat_UserId;
                this.EditHeartbeat = c.EditHeartbeat;
                this.FileName = c.FileName;

                this.CreateUserId = c.CreateUserId;
                this.CreateDate = site.ConvertUTCToSiteTime(c.CreateDate);

                this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);
                this.EditDate = site.ConvertUTCToSiteTime(c.EditDate);

                this.ShowInSiteMap = c.ShowInSiteMap;
                this.BlockIndex = c.BlockIndex;
                this.PageActive = c.PageActive;
                this.ShowInSiteNav = c.ShowInSiteNav;

                this.PageSlug = c.PageSlug;
                this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);

                this.ContentID = c.ContentID;
                this.Parent_ContentID = c.Parent_ContentID;
                this.IsLatestVersion = c.IsLatestVersion;
                this.TitleBar = c.TitleBar;
                this.NavMenuText = c.NavMenuText;
                this.PageHead = c.PageHead;
                this.PageText = c.PageText;
                this.LeftPageText = c.LeftPageText;
                this.RightPageText = c.RightPageText;
                this.NavOrder = c.NavOrder;
                this.EditUserId = c.EditUserId;
                this.CreditUserId = c.CreditUserId;
                this.TemplateFile = c.TemplateFile;
                this.Thumbnail = c.PageThumbnail;

                if (string.IsNullOrEmpty(this.PageSlug) && this.ContentType == ContentPageType.PageType.BlogEntry) {
                    this.PageSlug = c.FileName;
                }

                this.MetaDescription = c.MetaDescription;
                this.MetaKeyword = c.MetaKeyword;

                this.VersionCount = c.VersionCount.HasValue ? c.VersionCount.Value : 0;
            }
        }
Example #7
0
        private List <SiteNav> GetPageCrumbNavByContent(vw_carrot_Content content, bool bActiveOnly)
        {
            Guid siteID          = Guid.Empty;
            Guid rootContentID   = Guid.Empty;
            Guid?parentContentID = null;
            int  iOrder          = 1000000;

            List <SiteNav> lstContent = new List <SiteNav>();

            if (content != null)
            {
                rootContentID   = content.Root_ContentID;
                siteID          = content.SiteID;
                parentContentID = content.Parent_ContentID;
                SiteNav sn = new SiteNav(content);
                sn.NavOrder = iOrder + 100;
                lstContent.Add(sn);
            }

            if (rootContentID != Guid.Empty)
            {
                Guid?gLast = parentContentID;

                while (gLast.HasValue)
                {
                    SiteNav nav = GetPageNavigation(siteID, gLast.Value, false);
                    gLast = null;

                    if (nav != null)
                    {
                        nav.NavOrder = iOrder;
                        lstContent.Add(nav);
                        iOrder--;

                        gLast = nav.Parent_ContentID;
                    }
                }
            }

            SiteNav home = FindHome(siteID, false);

            home.NavOrder = 0;

            if (lstContent.Where(x => x.Root_ContentID == home.Root_ContentID).Count() < 1)
            {
                lstContent.Add(home);
            }

            return(lstContent.OrderBy(x => x.NavOrder).Where(x => x.PageActive == true && x.IsRetired == false && x.IsUnReleased == false || bActiveOnly == false).ToList());
        }
        public SiteNav GetLatestVersion(Guid siteID, bool bActiveOnly, string sPage)
        {
            SiteNav           content = null;
            vw_carrot_Content cont    = CompiledQueries.GetLatestContentByURL(db, siteID, bActiveOnly, sPage);

            if (cont != null)
            {
                content = new SiteNav(cont);
            }
            if (content == null && sPage == SiteData.DefaultDirectoryFilename)
            {
                content = FindHome(siteID, bActiveOnly);
            }
            return(content);
        }
		internal BasicContentData(vw_carrot_Content c) {
			if (c != null) {
				SiteData site = SiteData.GetSiteFromCache(c.SiteID);

				this.SiteID = c.SiteID;
				this.Root_ContentID = c.Root_ContentID;
				this.PageActive = c.PageActive;
				this.Parent_ContentID = c.Parent_ContentID;
				this.FileName = c.FileName;
				this.TemplateFile = c.TemplateFile;
				this.NavOrder = c.NavOrder;

				this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);
				this.CreateDate = site.ConvertUTCToSiteTime(c.CreateDate);
				this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
				this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);
			}
		}
Example #10
0
        internal BasicContentData(vw_carrot_Content c)
        {
            if (c != null)
            {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.SiteID           = c.SiteID;
                this.Root_ContentID   = c.Root_ContentID;
                this.PageActive       = c.PageActive;
                this.Parent_ContentID = c.Parent_ContentID;
                this.FileName         = c.FileName;
                this.TemplateFile     = c.TemplateFile;
                this.NavOrder         = c.NavOrder;

                this.ContentType = ContentPageType.GetTypeByID(c.ContentTypeID);
                this.CreateDate  = site.ConvertUTCToSiteTime(c.CreateDate);
                this.GoLiveDate  = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate  = site.ConvertUTCToSiteTime(c.RetireDate);
            }
        }
        private List<SiteNav> GetPageCrumbNavByContent(vw_carrot_Content content, bool bActiveOnly)
        {
            Guid siteID = Guid.Empty;
            Guid rootContentID = Guid.Empty;
            Guid? parentContentID = null;
            int iOrder = 1000000;

            List<SiteNav> lstContent = new List<SiteNav>();

            if (content != null) {
                rootContentID = content.Root_ContentID;
                siteID = content.SiteID;
                parentContentID = content.Parent_ContentID;
                SiteNav sn = new SiteNav(content);
                sn.NavOrder = iOrder + 100;
                lstContent.Add(sn);
            }

            if (rootContentID != Guid.Empty) {
                Guid? gLast = parentContentID;

                while (gLast.HasValue) {
                    SiteNav nav = GetPageNavigation(siteID, gLast.Value, false);
                    gLast = null;

                    if (nav != null) {
                        nav.NavOrder = iOrder;
                        lstContent.Add(nav);
                        iOrder--;

                        gLast = nav.Parent_ContentID;
                    }
                }
            }

            SiteNav home = FindHome(siteID, false);
            home.NavOrder = 0;

            if (lstContent.Where(x => x.Root_ContentID == home.Root_ContentID).Count() < 1) {
                lstContent.Add(home);
            }

            return lstContent.OrderBy(x => x.NavOrder).Where(x => x.PageActive == true && x.IsRetired == false && x.IsUnReleased == false || bActiveOnly == false).ToList();
        }