Windows SharePoint Services Tips

If you are working with the WSS 3 SDK, you may have noticed that some of the method names are confusing.  The reason has something to do with the legacy naming from the old SharePoint Team Services, but you can avoid the confusion by keeping the following terminology in mind when you are reading the WSS doc.

  • Site  = Site Collection
  • Web = Site
  • RootWeb =  Top Level Site

Below is a sample code that will hopefully clear this up.

SPWebService webService = SPWebService.ContentService;
SPWebApplicationCollection webAppColl = webService.WebApplications;

foreach (SPWebApplication webApp in webAppColl)
{
    Console.WriteLine("Web App Name = " + webApp.Name);
    SPSiteCollection siteColl = webApp.Sites;

    foreach (SPSite site in siteColl)
    {
        SPWeb web = site.RootWeb;
        Console.WriteLine("Top Level Site Title = " + web.Title);
     }
}

Hope this helps.

 

Phong Hoang

Development Manager

ImageSource, Inc.

Share on LinkedIn   Share on Twitter

One thought on “Windows SharePoint Services Tips

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s