Пример #1
0
 private bool ShowInSiteMap(PageData page)
 {
     //// Might want to only expose project page types.
     //if(!(page is MyProjectPageBase))
     //{
     //    return false;
     //}
     if (!page.IsIndexablePageType())
     {
         return(false);
     }
     if (!page.CheckPublishedStatus(PagePublishedStatus.Published))
     {
         return(false);
     }
     if (!_filterAccessWrapper.QueryDistinctAccessEdit(page, AccessLevel.NoAccess))
     {
         return(false);
     }
     //// Dynamic property: Checkbox for including/excluding page instance in sitemap.xml. For an overridable dynamic property checkbox
     //// wrapper, see https://blog.mathiaskunto.com/2015/02/09/custom-property-checkbox-wrapper-as-dynamic-property-in-episerver-7-5/
     //if (!(page as MyProjectPageBase).IncludeInSitemap)
     //{
     //    return false;
     //}
     return(true);
 }
Пример #2
0
        private void ContentEvents_PublishedContent(object sender, ContentEventArgs e)
        {
            PageData page = e.Content as PageData;

            if (page == null)
            {
                return;
            }

            // Page is home page
            if (page.ContentLink.ID == ContentReference.StartPage.ID)
            {
                if (page.StopPublish.HasValue)
                {
                    this._homeIsUnPublished = page.StopPublish <= DateTime.Now;
                }

                // In event "Publishing", homeIsPublished was false, now it is. Send a recrawl
                if (this._homeIsUnPublished && page.CheckPublishedStatus(PagePublishedStatus.Published))
                {
                    string url = _siteimproveHelper.GetExternalUrl(page);
                    if (url != null)
                    {
                        _siteimproveHelper.PassEvent("recrawl", url, this._settingsRepository.GetToken());
                    }
                    this._homeIsUnPublished = false;
                    return;
                }
            }

            if (!this._settingsRepository.GetSetting().NoRecheck)
            {
                if (page.CheckPublishedStatus(PagePublishedStatus.Published))
                {
                    string url = _siteimproveHelper.GetExternalUrl(page);
                    if (url != null)
                    {
                        _siteimproveHelper.PassEvent("recheck", url, this._settingsRepository.GetToken());
                    }
                }
                else
                {
                    _siteimproveHelper.PassEvent("recheck", "", this._settingsRepository.GetToken());
                }
            }
        }
Пример #3
0
        public static bool ShouldExcludePage(PageData page)
        {
            if (page == null)
            {
                return(true);
            }

            if (!IsAccessibleToEveryone(page))
            {
                return(true);
            }

            if (!page.CheckPublishedStatus(PagePublishedStatus.Published))
            {
                return(true);
            }

            if (!IsVisibleOnSite(page))
            {
                return(true);
            }

            if (IsLink(page))
            {
                return(true);
            }

            if (!IsSitemapPropertyEnabled(page))
            {
                return(true);
            }

            if (page.PageLink == ContentReference.WasteBasket)
            {
                return(true);
            }

            if (page.IsDeleted)
            {
                return(true);
            }

            if (!page.HasTemplate())
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
        public static bool FilterPage(PageData page)
        {
            if (page == null)
            {
                return(true);
            }

            if (!IsAccessibleToEveryone(page))
            {
                return(true);
            }

            if (!page.CheckPublishedStatus(PagePublishedStatus.Published))
            {
                return(true);
            }

            if (!page.IsVisibleOnSite)
            {
                return(true);
            }

            if (IsLink(page))
            {
                return(true);
            }

            if (!IsSitemapPropertyEnabled(page))
            {
                return(true);
            }

            if (page.PageLink == PageReference.WasteBasket)
            {
                return(true);
            }

            return(false);
        }
Пример #5
0
        public static bool FilterPage(PageData page)
        {
            if (page == null)
            {
                return true;
            }

            if (!IsAccessibleToEveryone(page))
            {
                return true;
            }                                             

            if (!page.CheckPublishedStatus(PagePublishedStatus.Published))
            {
                return true;
            }

            if (!page.IsVisibleOnSite)
            {
                return true;
            }

            if (IsLink(page))
            {
                return true;
            }

            if (!IsSitemapPropertyEnabled(page))
            {
                return true;
            }

            if (page.PageLink == PageReference.WasteBasket)
            {
                return true;
            }

            return false;
        }
Пример #6
0
 private bool IsPageHasPublished(PageData pageData)
 {
     return(pageData != null && pageData.CheckPublishedStatus(PagePublishedStatus.PublishedIgnoreStopPublish));
 }
Пример #7
0
 public static bool IsPublished(this PageData item)
 {
     return(item.CheckPublishedStatus(PagePublishedStatus.Published));
 }
 private bool ShouldIndexPage(PageData page)
 {
     return(page.CheckPublishedStatus(PagePublishedStatus.Published));
 }