public DynamicLayoutController(IGlassMapperService glassMapperService, ILogService logger)
 {
     _glassMapperService = glassMapperService;
     _logger             = logger;
 }
 public SearchController(IGlassMapperService glassMapperService, ILogService logService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
 }
Exemplo n.º 3
0
 public LocationsService(ILogService logService, IGlassMapperService glassMapperService)
 {
     _logService         = logService;
     _glassMapperService = glassMapperService;
 }
 public AccordionController(IGlassMapperService glassMapperService, ILogService logService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
 }
Exemplo n.º 5
0
        private string GenerateSiteMapXML(IEnumerable <ISiteMapItem> siteMapItemsList, string siteMapBaseDomain, ILogService logService, IGlassMapperService glassMapperService)
        {
            logService.Info("Entering SiteMapGenerator :: ProcessSiteMapData");
            var sitecoreSitemap = new DataSet()
            {
                EnforceConstraints = false
            };

            string xmlAsString = string.Empty;

            try
            {
                XNamespace xmlns = "http://www.sitemaps.org/schemas/sitemap/0.9";
                XNamespace xsi   = "http://www.w3.org/2001/XMLSchema-instance";

                var sitemaproot = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

                //add the namespace to xml document
                var sitemapRootElement = new XElement(xmlns + "urlset", new XAttribute(XNamespace.Xmlns + "xsi", xsi));

                foreach (var item in siteMapItemsList)
                {
                    // regular Page items
                    sitemapRootElement.Add(new XElement(xmlns + "url",
                                                        new XElement(xmlns + "loc", string.Format("{0}{1}", siteMapBaseDomain, item.PageUrl.TrimEnd('/'))),
                                                        new XElement(xmlns + "lastmod", item.UpdatedDate.ToString(item.UpdatedDate == DateTime.MinValue ? "yyyy-MM-ddThh:mm:ss" : "yyyy-MM-ddThh:mm:sszzz")),
                                                        new XElement(xmlns + "changefreq", "weekly"),
                                                        new XElement(xmlns + "priority", "0.5")));
                }

                //append the root element with it's contents to the root item to construct the full xml data set
                sitemaproot += sitemapRootElement;

                XmlDocument scSitemapXml = new XmlDocument();
                scSitemapXml.LoadXml(sitemaproot);

                using (XmlNodeReader nodeReader = new XmlNodeReader(scSitemapXml))
                {
                    sitecoreSitemap.ReadXml(nodeReader);
                }

                XmlDocument sitemapDocument = new XmlDocument();
                sitemapDocument.LoadXml(sitecoreSitemap.GetXml());

                XmlAttribute xmlnXsi        = null;
                XmlAttribute xmlnImage      = null;
                XmlAttribute schemaLocation = null;

                xmlnXsi       = sitemapDocument.CreateAttribute("xmlns:xsi");
                xmlnXsi.Value = @"http://www.w3.org/2001/XMLSchema-instance";
                sitemapDocument.DocumentElement.SetAttributeNode(xmlnXsi);

                xmlnImage       = sitemapDocument.CreateAttribute("xmlns:image");
                xmlnImage.Value = @"http://www.google.com/schemas/sitemap-image/1.1";
                sitemapDocument.DocumentElement.SetAttributeNode(xmlnImage);

                var location = @"http://www.sitemaps.org/schemas/sitemap/0.9 
                                http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd 
                                http://www.google.com/schemas/sitemap-image/1.1 
                                http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd";

                System.Collections.Specialized.NameValueCollection listItems = WebUtil.ParseUrlParameters(location);
                StringBuilder s = new StringBuilder();
                foreach (string textItem in listItems.Keys)
                {
                    s.Append(listItems[textItem].ToString());
                    s.Append(" ");
                }
                schemaLocation       = sitemapDocument.CreateAttribute("xsi", "schemaLocation", "");
                schemaLocation.Value = s.ToString();
                sitemapDocument.DocumentElement.SetAttributeNode(schemaLocation);

                xmlAsString = sitemapDocument.OuterXml;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                sitecoreSitemap.Dispose();
            }
            logService.Info("Exiting SiteMapGenerator :: ProcessSiteMapData");

            return(xmlAsString);
        }
Exemplo n.º 6
0
 public AnalyticsService(IGlassMapperService glassMapperService)
 {
     _glassMapperService = glassMapperService;
 }
 public NavigationController(IGlassMapperService glassMapperService, ILogService logService, INavigationService navigationService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
     _navigationService  = navigationService;
 }
Exemplo n.º 8
0
 public CarouselController(IGlassMapperService glassMapperService, ILogService logService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
 }
 public MetaDataController(IGlassMapperService glassMapperService, ILogService logService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
 }
 public HeaderController(IGlassMapperService glassMapperService, ILogService logService)
 {
     _glassMapperService = glassMapperService;
     _logService         = logService;
 }
Exemplo n.º 11
0
 public GeneralContentController(IGlassMapperService glassMapperService, ILogService logger)
 {
     _glassMapperService = glassMapperService;
     _logger             = logger;
 }