Пример #1
0
        /// <summary>
        /// We want to get the domains associated with the content node. This includes getting the allowed domains on the node as well as
        /// searching up the tree to get the parents nodes since they are inherited.
        /// </summary>
        /// <param name="content"></param>
        /// <param name="includeChildren"></param>
        /// <returns></returns>
        public List <string> GetUrlsForNode(IContent content, bool includeDescendants = false)
        {
            List <string> urls = new List <string>();

            string url = GetUrl(content);

            urls.AddRange(UrlHelper.MakeFullUrlWithDomain(url, GetDomains(new List <string>(), content)));

            urls.AddRange(GetotherUrls(content));

            if (includeDescendants)
            {
                var numDescendants = contentService.CountDescendants(content.Id);
                if (numDescendants > 0)
                {
                    long outParam;
                    foreach (IContent desc in contentService.GetPagedDescendants(content.Id, 0, numDescendants, out outParam))
                    {
                        urls.Add(GetUrl(desc));
                        urls.AddRange(GetotherUrls(desc));
                    }
                }
            }

            urls = urls.Where(x => x.Contains("http")).ToList();

            return(urls);
        }
 public int CountDescendants(int parentId, string documentTypeAlias = null)
 {
     return(inner.CountDescendants(parentId, documentTypeAlias));
 }