Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Code Camp 6 Site Url Handling talk outline

Below is the equivalent of my slide deck for the "Url Handling in Community Server" talk I prepared for New England Code Camp 6 last weekend in Waltham, MA.

-----------

To understand how Site Urls are handled in Community Server we want to begin by exploring the rich set of data created by the SiteUrlsData Provider in the form of the SiteUrls component, key values, navigation links, area locations, paths, reversepaths (patterns) and physical .aspx files with optionally defined query strings.  This file contains samples.

To build the rich set of data for url handling we'll use .NET techiques that include XML processing, string.formatting and regular expressions, using and extending the provider model, simple transformations, NameValueCollections and other key-value list types, and examples of data object handling.

Community Server Url Data is created by the SiteUrlsData Provider with source data located in the SiteUrls.config file. The SiteUrlsData Provider class is instantiated in the SiteUrls component class.

This post provides a general overview of SiteUrlsData, the content areas of the SiteUrls.config and various SiteUrls data objects.

Now we're going to look at how providers are loaded in Community Server.  CSConfiguration.cs loads assemblies in its GetProviders() method from assembly information contained in CommunityServer.Config <Providers /> definitions.  The loading process of the SIteUrlsData Provider takes place in SiteUrls.cs Instance(). 

Since we're now aware of the types of data available to us and the various objects inside the SiteUrls object, let's see how url data is generated by looking at core CS url functions.  We're going to perform a few global searches and see the many ways of retrieving url data in Community Server.

  • SiteUrls.Instance()
  • Globals.GetSiteUrls().Locations[
  • Globals.GetSiteUrls()
  • Urls.Instance().  (discover BlogUrls, FileUrls, ForumsUrls, GalleryUrls)
  • BlogUrls.Instance().Rss(this.CurrentWeblog.ApplicationKey)
  • Globals.GetSiteUrls().UrlData.FormatUrl(

 
We're going to take a closer look at the SiteUrls.config file, since it functions as the primary source of data for the SiteUrlsData Provider.  Before we do, however, let's quickly demonstrate how we can extend the SiteUrlData provider (extend any existing provider or add a new provider) in Community Server.  To see how this is done we'll look at both the source and the implementation of Ken Robertson's Qgyen.ExtendedUrlMapping module for CS 2.1. 

We saw the four primary areas of the SiteUrls.config XML file: locations, transformers, navigation and urls.  Now we're going to look at them in action.  We'll take a look at how SiteUrlsData processes the data found in each of the SiteUrls.config areas, then use the "weblogapplication" Url Element as a working example and walk through the SiteUrlsData CreateUrls() method to see how each element is converted to urls, key values, patterns or paths in conjunction with other elements found in the SiteUrls.config file.

Comments (0) | Post RSS RSS comment feed

Posted on 10/22/2006 8:49:30 PM by Dave Burke
Categories: Community Server
Tags: no tags for this post

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke