C# Класс Decision.Common.Sitemap.SitemapGenerator

Generates sitemap XML.
Показать файл Открыть проект

Защищенные методы

Метод Описание
GetSitemapDocuments ( IReadOnlyCollection sitemapNodes ) : List

Gets the collection of XML sitemap documents for the current site. If there are less than 25,000 sitemap nodes, only one sitemap document will exist in the collection, otherwise a sitemap index document will be the first entry in the collection and all other entries will be sitemap XML documents.

GetSitemapUrl ( int index ) : string

Gets the URL to the sitemap with the specified index.

LogWarning ( Exception exception ) : void

Logs warnings when a sitemap exceeds the maximum size of 10MB or if the sitemap index file exceeds the maximum number of allowed sitemaps. No exceptions are thrown in this case as the sitemap file is still generated correctly and search engines may still read it.

Приватные методы

Метод Описание
CheckDocumentSize ( string sitemapXml ) : void

Checks the size of the XML sitemap document. If it is over 10MB, logs an error.

CheckSitemapCount ( int sitemapCount ) : void

Checks the count of the number of sitemaps. If it is over 50,000, logs an error.

GetSitemapDocument ( IEnumerable sitemapNodes ) : string

Gets the sitemap XML document for the specified set of nodes.

GetSitemapIndexDocument ( IEnumerable sitemaps ) : string

Gets the sitemap index XML document, containing links to all the sitemap XML documents.

Описание методов

GetSitemapDocuments() защищенный Метод

Gets the collection of XML sitemap documents for the current site. If there are less than 25,000 sitemap nodes, only one sitemap document will exist in the collection, otherwise a sitemap index document will be the first entry in the collection and all other entries will be sitemap XML documents.
protected GetSitemapDocuments ( IReadOnlyCollection sitemapNodes ) : List
sitemapNodes IReadOnlyCollection The sitemap nodes for the current site.
Результат List

GetSitemapUrl() защищенный абстрактный Метод

Gets the URL to the sitemap with the specified index.
protected abstract GetSitemapUrl ( int index ) : string
index int The index.
Результат string

LogWarning() защищенный Метод

Logs warnings when a sitemap exceeds the maximum size of 10MB or if the sitemap index file exceeds the maximum number of allowed sitemaps. No exceptions are thrown in this case as the sitemap file is still generated correctly and search engines may still read it.
protected LogWarning ( Exception exception ) : void
exception System.Exception The exception to log.
Результат void