コード例 #1
0
        public string GetPageContent(string url)
        {
            _logger.Debug("GetPageContent - Processing request for page: {0}", url);
            string pageContent;

            if (_pageFactory.TryFindPageContent(url.ParseUrl(), out pageContent))
            {
                return(pageContent);
            }
            return(pageContent);
        }
コード例 #2
0
        protected virtual string GetPageContent(string url, Localization localization)
        {
            string cmUrl = GetCmUrl(url);

            using (new Tracer(url, cmUrl))
            {
                IPageFactory pageFactory = DD4TFactoryCache.GetPageFactory(localization);
                string       result;
                pageFactory.TryFindPageContent(GetCmUrl(url), out result);
                return(result);
            }
        }
コード例 #3
0
        private SiteMapNode ReadSitemapFromXml(string sitemapUrl)
        {
            _logger.Debug(">>ReadSitemapFromXml", LoggingCategory.Performance);
            SiteMapNode rootNode = null;

            NodeDictionary = new Dictionary <string, SiteMapNode>();

            string sitemap;

            if (!_pageFactory.TryFindPageContent(sitemapUrl, out sitemap))
            {
                sitemap = emptySiteMapString();
            }
            _logger.Debug(string.Format("loaded sitemap with url {0}, length {1}", sitemapUrl, sitemap.Length), LoggingCategory.Performance);

            XDocument xDoc = XDocument.Parse(sitemap);

            _logger.Debug("parsed sitemap into XDocument", LoggingCategory.Performance);

            //XElement siteMapRoot = xDoc.Element("siteMap");
            XElement siteMapRoot = xDoc.Root;


            try
            {
                rootNode = new TridionSiteMapNode(this, String.Empty, "root_" + _pageFactory.PageProvider.PublicationId, String.Empty, String.Empty, String.Empty, new ArrayList(), new NameValueCollection(), new NameValueCollection(), String.Empty);
                _logger.Debug("created root node", LoggingCategory.Performance);
                AddNode(rootNode);
                _logger.Debug("added root node", LoggingCategory.Performance);

                //Fill down the hierarchy.
                AddChildren(rootNode, siteMapRoot.Elements(), 1);
            }
            catch (Exception e)
            {
                Exception e2 = e;
            }
            _logger.Debug("<<ReadSitemapFromXml", LoggingCategory.Performance);
            return(rootNode);
        }