My NewsDesk application is being live beta-tested since almost one year. It had to be used before it was finished, and I am still finishing off stuff. Priority on my list was a sitemap provider. I've been working on it most of the week, and like usual, most of my time has been spent at finetuning the manifest file. Setting up the modified dataprovider was easy. A few glitches pointed themselves out and were quickly corrected. Writing the code was a matter of one day. Making it all work together is where the problem lies.
Based on Chris Patera's blog, it seemed quite simple: create a class that inherrits from DotNetNuke.Services.Sitemap.SitemapProvider:Namespace KhmerSupport.Providers.NewsDesk
Public Class Sitemap
Inherits SitemapProvider
The rest of the application is still in vb.net, so I've hept this one in vb.net as well. I do not think this has to do with the issue. I then override the GetUrls function from the SitemapProvider class:
Public Overrides Function GetUrls(portalId As Integer, ps As DotNetNuke.Entities.Portals.PortalSettings, version As String) _
As List(Of SitemapUrl)
This function then has to build a list of SitemapUrl and return this list to the caller. Couldn't be simpler.
After I setup the new database structures, I created a rules editor that could calculate priority and changefrequency based on Sections and categories and the age of the article (when priority and changefrequency are not overridden by the article). This Rules Editor is a module on its own, a separate package in the manifest. This part, I got figured out.
Then I wrote the provider. On paper, all should work fine. I modified web.config to add the new sitemap provider:
<add name="KhmerSupportNewsDeskSiteMapProvider" type="KhmerSupport.Providers.NewsDesk.Sitemap, KhmerSupport.NewsDesk"
providerPath="~\DesktopModules\KhmerSupport.NewsDesk\Providers\SitemapProvider\KhmerSupport.NewsDesk.SitemapProvider\" />
The NewsDesk sitemap provider now shows up on the Admin>Search Engine Sitemap page and is enabled. That should do to make the sitemap provider work, isn't it? Sitemap cleared and clicked on the sitemap.aspx link: only the static pages show up. A breakpoint in the GetUrls function is not honored. No errors show up in the event viewer.
Chris' blog had a comment from Lance Long with a similar issue. It is however not clear if this got solved and how.
There is one point over which I have my doubts: the providerPath attribute that I am providing to the system. This is the path to the provider's project files and the vb source file. But on the production computer there is no such path. All code goes into KhmerSupport.NewsDesk.SitemapProvider.dll. The sitemap.xml file will not go to that folder, it must go to ~/Portals/[PortalId]/Sitemap/
I'd like to get this thing to work, so suggestions are more than welcome. I am currently in the 'hopeless' stage of the development cycle. :-(