- Inside the MvcSiteMapProvider - Part 1
- Inside the MvcSiteMapProvider - Part 2: Dynamic node providers
- Inside the MvcSiteMapProvider – Part 3: The ISiteMapVisibilityProvider
- Inside the MvcSiteMapProvider - Part 4: The IAclModule
- Inside the MvcSiteMapProvider - Part 5: The ISiteMapNodeUrlResolver
Because of this I decided to create a series of in-depth posts about the internals of the MvcSiteMapProvider, and give some advices on how to improve performance. The first part is about how the main part of the provider is implemented.
The DefaultSiteMapProvider
The DefaultSiteMapProvider implements the abstract StaticSiteMapProvider implemented in .NET. The reason of choosing this as the base class instead of the abstract SiteMapProvider class, is that a XML sitemap file is recommended as a starting point, as this is much easier to control (this is my recommendation, not the authors). You can still generate a dynamic part using DynamicNodeProviderBase which is explained on the “Dynamic sitemaps” wiki page. If you don’t want to use the sitemap file, checkout “Defining sitemap nodes in code”.The DefaultSiteMapProvider is the class tasked with generating the sitemap and reading the custom settings from the web.config file. Except for this the class doesn’t do much, as the hard work is done by the StaticSiteMapProvider from .NET.
The “Registering the provider” wiki page on GitHub provides a good overview of the possible settings, default values and their meaning. Starting from version 3.2.2, the following settings can be defined indirectly using the dependency injection facilities in MVC:
- nodeKeyGenerator
- controllerTypeResolver
- actionMethodParameterResolver
- aclModule
- siteMapNodeUrlResolver
- siteMapNodeVisibilityProvider
- siteMapProviderEventHandler
No comments:
Post a Comment