예제 #1
0
 public IEnumerable <PageScoreNode> GetHierarchyFromCache()
 {
     try
     {
         var nodeCollection = _typedPublishedContentQuery.TypedContentAtRoot();
         return(_pageScoreNodeHelper.GetPageScoresFromCache(nodeCollection));
     }
     catch (Exception)
     {
         return(null);
     }
 }
예제 #2
0
        //[OutputCache(Duration = 3600)]
        public ActionResult Sitemap(RenderModel model, string xml)
        {
            if (!string.IsNullOrWhiteSpace(xml))
            {
                var sitemap = new Sitemap();

                var root         = typedPublishedContentQuery.TypedContentAtRoot().FirstOrDefault();
                var contentItems = new List <IPublishedContent>();
                contentItems.Add(root);
                foreach (var child in root.Descendants())
                {
                    contentItems.Add(child);
                    if (child.Descendants().Any())
                    {
                    }
                    contentItems = contentItems.Concat(child.Descendants()).ToList();
                }

                foreach (var content in contentItems.Where(x => x.IsVisible()))
                {
                    sitemap.Add(new Url
                    {
                        ChangeFrequency = ChangeFrequency.Daily,
                        Location        = content.UrlAbsolute(),
                        Priority        = 0.5,
                        TimeStamp       = content.CreateDate
                    });
                }
                return(this.Content(sitemap.ToXml(), "text/xml"));
            }
            else
            {
                return(this.CurrentTemplate(model));
            }
        }
예제 #3
0
 public IEnumerable <IPublishedContent> GetTypedContentAtRoot()
 {
     return(_umbracoContentQuery.TypedContentAtRoot());
 }
 public IEnumerable <IPublishedContent> TypedContentAtRoot()
 {
     return(_typedContentQuery == null
         ? TypedDocumentsAtRoot(_contentCache)
         : _typedContentQuery.TypedContentAtRoot());
 }