Extensible is a great thing.
I'm having no luck adding in a new sitemap provider. :(
What I'm trying to accomplish is to read from a database and add the pages i find in there into the DotNetNuke sitemap , but for only 1 of my portals, the company i work for uses DNN for our mobile site and our blog portion of our classic site, but the classic site is in a different CMS system. (i have modified their code base to read the pages from the DNN DB and add them to that sitemap)
So now i just need to modify the blog site map to contain entries i read from a DB stored procedure.
I've tested the stored procedure with the DotNetNuke login and it works as expected.
I have the feeling i did a few steps wrong
I created a new project Called Mycompany.MoModufle.Components.Provider.SiteMap
in this i created SiteMap.cs
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using DotNetNuke.Services.Sitemap;
using MyCompany.MyModule;
using DotNetNuke.Common;
using DotNetNuke.Common.Internal;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Security.Permissions;
namespace MyCompany.MyModule.Components.Providers
{
public class SiteMap : SitemapProvider
{
#region Public Methods
public override List
GetUrls(int portalID, PortalSettings ps, string version)
{
var colEntries = new List();
DataTable RCMSUrls = new DataTable();
String RCMSUrl = ConfigurationManager.AppSettings["RCMSUrl"].ToString();
try {
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["SiteSqlServer"].ConnectionString);
sqlcon.Open();
SqlCommand command = new SqlCommand("RCMS.dbo.GetSitemapPages", sqlcon);
command.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapt = new SqlDataAdapter(command);
DataTable resultstable = new DataTable();
adapt.Fill(RCMSUrls);
SitemapUrl siteMapUrl;
// Loop through RCMSUrls sitemapDataTable adding them to the list of sitemapurls
foreach (DataRow dr in RCMSUrls.Rows)
{
siteMapUrl = new SitemapUrl();
siteMapUrl.Url = RCMSUrl + dr[1].ToString() + ".aspx";
siteMapUrl.LastModified = (DateTime)dr[2];
siteMapUrl.Priority = (float).5;
colEntries.Add(siteMapUrl);
}
}
catch (Exception ex)
{
}
SitemapUrl siteMapUrl2 = new SitemapUrl();
siteMapUrl2.Url = "http://www.google.com/no.aspx";
siteMapUrl2.LastModified = Convert.ToDateTime("01/20/2016 12:00 pm");
siteMapUrl2.Priority = (float).5;
colEntries.Add(siteMapUrl2);
//var cntentry = new CustomSiteMap();
//cntentry.GetPublishedPortalEntries(portalID);
return colEntries;
}
#endregion
}
}
this compiled into
E:\svn\CorpSite\DNN\DotNetNuke.Modules.CustomSiteMap\bin\MyCompany.MyModule.Components.Providers.SiteMap.dll
then i have modified my web.config as follows :
i have placed the compiled DLL into \D:\Inetpub\m.website\DesktopModules\MyCompany\Components\Providers\
I cleared the cache, restarted the app, cleared the sitemap cache, deleted the site map xmls, but my new sitemap provider just doesn't show up on the Admin >> Search Engine Site Map >. clear cache, but still my new sitemap provider doesn't show up..
??
i also tried deleting the sitemap.xmls off the server as well but still nothing.
one more note the Guide i used is for DNN 5.x
http://www.dnnsoftware.com/community-...
hopefully someone can spot what i did wrong.
thanks for your help!
:)