Welcome to L-Space Design Forums Sign in | Join | Faq

Google Site Map for ASP.NET

Started by AerosSaga at 08-07-2005 13:46. Topic has 6 replies.

   

Print Search
Sort Posts:    
   08-07-2005, 13:46
AerosSaga is not online. Last active: 3/19/2006 4:59:03 AM AerosSaga

Top 10 Posts
Joined on 08-08-2005
Posts 2
Google Sitemap & DasBlog
I have a dnn installation installed at http://scottschecter.net that I just bought your google sitemap module for. I also have a DasBlog installation at the same ip address at http://blog.scottschecter.net, would it create a google sitemap of my DasBlog installation? I know you pass portal id, would there be any way to get it to work with dasblog?

Thanks

Scott


   Report 
   08-07-2005, 16:23
admin is not online. Last active: 7/23/2010 6:57:35 AM admin

Top 10 Posts
Joined on 06-16-2005
Auckland, New Zealand
Posts 62
Re: Google Sitemap & DasBlog

You are licensed for any site on that IP address, so you are 'allowed' to have a version for your DasBlog site.

There are two ways you can do this. 

Firstly, you can create a class that inherits from "LSpaceDesign.GoogleSiteMap.SiteMapLoader" and implement code that reads the DasBlog database and creates an XmlDocument that conforms to the GoogleSiteMap schema.

Secondly, included in the LSpaceDesign.GoogleSiteMap dll is a class called XmlBasedMap, which can take an XML file, and an XSLT file, and uses those to produce an XmlDocument that conforms to the GoogleSiteMap schema.

If you would like the code for generating and populating a schema I'll post and example shortly.


Roger Willcocks
Software Engineer MSCD.NET
L-Space Design
http://www.l-space-design.com/
"Putting your experience to work"
   Report 
   08-07-2005, 16:58
admin is not online. Last active: 7/23/2010 6:57:35 AM admin

Top 10 Posts
Joined on 06-16-2005
Auckland, New Zealand
Posts 62
Example of a site map creation method

Example of a site map creation method

public class SampleLoader : LSpaceDesign.GoogleMap.SiteMapLoader {

    public SampleLoader() {

    }

    private static string inPath = ""; //static member variable
 

    public override XmlDocument GetSiteMap()
    {
      if (inPath.Length < 1) //Need to initialize
      {
            lock (typeof(GoogleMap))
            {
                  if (inPath.Length < 1)
                  {
                        try
                        {
                              inPath = "" + ConfigurationSettings.Instance().Settings["SourceXmlFile"];
			      //Hash table of 'extra' settings in provider section of web.config
                              if (inPath.IndexOf(':') < 0)
                              {
                                    XmlBasedMap.inPath = HttpContext.Current.Server.MapPath(XmlBasedMap.inPath);
                              }
                        }
                        catch
                        {
                        }
  
                }
            }
      }
//Set up fixed document structure
      XmlDocument siteMap = new XmlDocument();
      siteMap.AppendChild(siteMap.CreateXmlDeclaration("1.0", "UTF-8", null));
      XmlNode urlSet = siteMap.CreateElement("urlset");
      XmlAttribute ns = siteMap.CreateAttribute("xmlns");
      ns.Value = "http://www.google.com/schemas/sitemap/0.84";
      urlSet.Attributes.Append(ns);
      siteMap.AppendChild(urlSet);
// End set up document


      string defaultChangeFreq = "" + ConfigurationSettings.Instance().Settings["ChangeFreq"];
      if (defaultChangeFreq.Length < 1)
      {
            defaultChangeFreq = "monthly";
      }

	// GET LIST OF VALID URLS HERE
	// You might do DB access, read a file, etc (example uses a PageInfo object)
            ArrayList urls = new ArrayList();

           
            foreach (PageInfo p in urls)
            {
                  if (isValid(p)) //Do a check to determine if you want to include the page
                  {
                        XmlElement nodeChangeFreq = siteMap.CreateElement("changefreq");
			if((p.ChangeFreq == null) || (p.ChangeFreq.Length < 1)) {
	                        nodeChangeFreq.InnerText = defaultChangeFreq;
			} else {
	                        nodeChangeFreq.InnerText = p.ChangeFreq;
			}
                        XmlElement nodePriority = siteMap.CreateElement("priority");
                        nodePriority.InnerText = p.Priority;
                        XmlElement nodeLastMod = siteMap.CreateElement("lastmod");
                        nodeLastMod.InnerText = p.LastModified.ToString("yyyy-MM-dd");
                        XmlElement nodeLoc = siteMap.CreateElement("loc");
                        nodeLoc.InnerText = p.Url;
                        XmlElement nodeUrl = siteMap.CreateElement("url");
                        nodeUrl.AppendChild(nodeLoc);
                        nodeUrl.AppendChild(nodeLastMod);
                        nodeUrl.AppendChild(nodeChangeFreq);
                        nodeUrl.AppendChild(nodePriority);
                        node1.AppendChild(nodeUrl);
                  }
            }
      }
      return siteMap;
    }
}


Roger Willcocks
Software Engineer MSCD.NET
L-Space Design
http://www.l-space-design.com/
"Putting your experience to work"
   Report 
   08-07-2005, 17:17
AerosSaga is not online. Last active: 3/19/2006 4:59:03 AM AerosSaga

Top 10 Posts
Joined on 08-08-2005
Posts 2
Re: Example of a site map creation method
Thanks when I'm done I'll send it back to you in case you wan't to include it or anyone else is interested.

   Report 
   08-07-2005, 21:51
admin is not online. Last active: 7/23/2010 6:57:35 AM admin

Top 10 Posts
Joined on 06-16-2005
Auckland, New Zealand
Posts 62
Re: Example of a site map creation method
Much appreciated.  Let me know if I can help in any way.
Roger Willcocks
Software Engineer MSCD.NET
L-Space Design
http://www.l-space-design.com/
"Putting your experience to work"
   Report 
   03-13-2006, 3:01
Anonymous
Re: Example of a site map creation method
could you please provide me web links about the MCSD.NET trainning CBTs on C# Track.
i will be thankful to you

regards
AJ
    
   03-13-2006, 14:44
admin is not online. Last active: 7/23/2010 6:57:35 AM admin

Top 10 Posts
Joined on 06-16-2005
Auckland, New Zealand
Posts 62
Re: Example of a site map creation method

MCSD .NET training is basically not relevant now.  Starting in approximately one month it will be replaced by the MCPD Enterprise certification instead.  The exams for that are not yet publically available, and the preparation material is not very good at all.

If you are wanting basic 'parrot' learning, testking.com is a good place to get exam questions from.

If you would prefer to do actual hands on practical testing, there are many hot labs and trainingg exercises available from Microsoft for free.

try this:  http://www.google.com/search?hl=en&q=site%3Amicrosoft.com+hot+lab+free+online+%22C%23%22&meta=

to see links to many examples.

The best option would be to sign up to things like the MSDN Flash.  There are often special notices and offers, such are 2 for 1, or free resit exams, reduced price sftware, etc.


Roger Willcocks
Software Engineer MSCD.NET
L-Space Design
http://www.l-space-design.com/
"Putting your experience to work"
   Report 
L-Space Design ... » L-Space Design ... » Google Site Map... » Google Sitemap & DasBlog

   

Powered by Community Server, by Telligent Systems