Exemplo n.º 1
0
        /// <summary>
        /// Gets the SitemapNodes, looking up the page they point to automatically to get the accurate Document last modified.
        /// </summary>
        /// <param name="Path">The parent Nodealiaspath</param>
        /// <param name="ClassName">The Class Name to query</param>
        /// <param name="SiteName">The SiteName</param>
        /// <param name="Options">The Options</param>
        /// <returns>The SitemapNodes</returns>
        private IEnumerable <SitemapNode> GetSiteMapUrlSetForClassWithUrlColumn(string Path, string ClassName, string SiteName, SiteMapOptions Options)
        {
            var DocumentQuery = _Helper.GetDocumentQuery(Path, Options, ClassName);
            List <SitemapNode> SiteMapItems = new List <SitemapNode>();

            foreach (string RelativeUrl in _Helper.GetRelativeUrls(Path, ClassName, SiteName, Options))
            {
                // Get the page, Dynamic Routing already has it's own internal Caching and adds to the output cache
                var Page = (TreeNode)_DynamicRouteHelper.GetPage(RelativeUrl, Options.CultureCode, SiteName, new string[] { "DocumentModifiedWhen", "NodeID", "DocumentCulture" }, true);
                if (Page != null)
                {
                    SiteMapItems.Add(ConvertToSiteMapUrl(Page.RelativeURL, SiteName, Page.DocumentModifiedWhen));
                }
                else
                {
                    SiteMapItems.Add(ConvertToSiteMapUrl(RelativeUrl, SiteName, null));
                }
            }
            return(SiteMapItems);
        }