Fear and Loathing : SharePoint Forums News Feed 
Wednesday, May 09, 2007  |  From Fear and Loathing : SharePoint Forums

As I continue to cleanup my projects on CodePlex, I've posted the latest version of the source code for my SharePoint Forums Web Part. This is version 1.2 that was released in August (better late than never?).

If you're interested in contributing/enhancing the project please do so. Right now I'm juggling a bunch of projects with lots of team members so it might take some time to get you added to the team if you're interested. If you are interested in modifying the codebase then Scott Hanselman has a great blog entry here on creating patches. You can simply submit a patch file to me (via email) and I'll add it to the codebase. This way you don't have to sign up for a CodePlex account and go through setting up all those tools. Your choice but please consider contributing to the project.

The source code does not include the 2007 version as that will be released under the Community Kit for SharePoint project (CKS) which also lives on CodePlex (surprise surprise). I'm donating the 2007 version to CKS but in reality just simply having it hosted under that project. It'lll be the same Web Part however hopefully we'll have some more bodies working on it under CKS.

You can download the source code directly from here (sort of direct since direct file links don't work anymore on CodePlex) or through a TFS client (Teamprise, Team Explorer, etc.) if you're signed up on the site via the latest change set here.

Tuesday, January 02, 2007  |  From Fear and Loathing : SharePoint Forums

Just wanted to let everyone know I've updated the plan for the release of the SharePoint Forums and SharePoint Knowledgebase Web Parts. These are the dates as I can commit to them now (crazy holiday schedule and stuff that just prevented me from getting the job done):

SharePoint Forums v2.0.0.0

  • Prod: Feb-12-2007

SharePoint Knowledgebase v1.0.0.0

  • Beta: Jan-29-2007
  • Prod: Feb-26-2007

Not a lot of information on the Knowledgebase Web Part yet (other than this post). Feel free to log your own features/enhancements in the Issue Tracker yourself and vote to shape the feature list!

Tuesday, January 02, 2007  |  From Fear and Loathing : SharePoint Forums

The guys at CodePlex updated the site some time ago implementing a "digg" like feature where you can vote for an issue and bump it up in priority. It's really slick and helps keep things in sight and what's important to you. So if you get a chance to visit the SharePoint Forums Web Part site on CodePlex here over the next while, take a look through the Issue Tracker and vote on your favorites. This is for tracking bugs but also includes new features and enhancements.

Now I just need to bust my butt to get this (and other things) done asap (like the long overdue 2007 update and some bug fixing that has to be done).

Wednesday, August 09, 2006  |  From Fear and Loathing : SharePoint Forums

Just in case you see a weird error in the new SharePoint Forum Web Part with regards to translations, several strings were added to the *.LNG files to finish off the translations. Please check the default language file that comes with the install on the missing ones (I’ll try posting a more detailed blog later with a list of them in it) and update your own language file accordingly. Also if you can flip the updated language file back to me I’ll update the language pack file release and make it available to everyone. Thanks.

Tuesday, August 08, 2006  |  From Fear and Loathing : SharePoint Forums

Okay, here it is kids, the August (1.2) release of the SharePoint Forums Web Part. This release includes the following features/fixes:



  • Navigation menu to quickly jump to anywhere on the system
  • Ability to place forums and categories in whatever display order you want
  • Topic title/full body message search with links to topics/forums
  • Ability to configure date format displays


  • Support for ASP.NET 2.0 installations on WSSv2 and SP2
  • Order of forums is fixed to allow “bumping” of topics
  • Post count display fixed on home page
  • Last post date/time display fixed


  • Topics now require a subject before being created
  • When replying to a specific message (not the entire thread) you can now preview the message you’re replying to

Sounds like fun? Go grab it here. Just install the MSI over the old version. Your data files will not be affected. If you are upgrading from 1.1 then please follow these instructions (included in the DrinkMe.txt file) to perform the upgrade:

If you are upgrading from version 1.1 to 1.2 please do the following:

  • Install the 1.2 MSI
  • Add the following to web.config anywhere inside the <configuration> section:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <assemblyIdentity name="BilSimser.SharePoint.WebParts.Forums" publicKeyToken="e516dadc23877c32" />
    <bindingRedirect oldVersion="" newVersion="" />
  • Perform and IISRESET
  • Refresh the page where your Forums Web Part lives
  • Voila! Version 1.2.

Note: If you’re still running 1.0 you can do the same, just change to

Please let me know via email if you have any questions/problems.

Tuesday, August 08, 2006  |  From Fear and Loathing : SharePoint Forums

There are a lot of great articles out there that talk about how you can leverage the SharePoint style of drop-down menus (you know that cool looking javascript menu) and creating your own. All of them require you to write some HTML and/or JavaScript and embed this into a CEWP on a page. This is fine, but when you’re building your own Web Parts, you might want something a little simpler.

In working on the SharePoint Forums Web Part, I wanted to create a drop-down menu populated by some of the links in the system and the categories and forums so someone could easily jump to a forum immediately. Most forums use a standard web drop-down list but since I had the SharePoint menu javascript already at my disposal I thought I would use it. So I put together this little class that creates me a menu, lets me add items to it, then just spits out the HTML that I can render to my page. Here’s the full class:

    1 /*

    2  * SharePointMenus.cs

    3  * Dynamic SharePoint-style menus in C#

    4  *

    5  * Copyright (c) 2006 by Bil Simser, bsimser@shaw.ca

    6  *

    7  * This work is licensed under the Creative Commons

    8  * Attribution-NonCommercial-ShareAlike 2.5 License.

    9  *

   10  * To view a copy of this license, visit

   11  * http://creativecommons.org/licenses/by-nc-sa/2.5/

   12  * or send a letter to Creative Commons, 559 Nathan

   13  * Abbott Way, Stanford, California 94305, USA.

   14 */


   16 using System;

   17 using System.Text;

   18 using System.Xml;


   20 namespace BilSimser.SharePoint.WebParts.Forums.Utility

   21 {

   22     /// <summary>

   23     /// Small helper class that will build out a menu in

   24     /// the SharePoint drop down style for adding to HTML output.

   25     /// </summary>

   26     public class SharePointMenu

   27     {

   28         #region Fields


   30         private string _header;

   31         private XmlElement _currentNode;

   32         private XmlElement _rootNode;

   33         private XmlDocument _xmlDocument;


   35         #endregion


   37         #region Constructors


   39         public SharePointMenu(string title)

   40         {

   41             createHeader(title);

   42             createXmlDocument();

   43         }


   45         #endregion


   47         #region Properties


   49         private string Header

   50         {

   51             set { _header = value; }

   52             get { return _header; }

   53         }


   55         #endregion


   57         #region Public Methods


   59         public void AddMenuItem(string title, string url)

   60         {

   61             AddMenuItem(title, url, string.Empty);

   62         }


   64         public void AddMenuItem(string title, string url, string imageUrl)

   65         {

   66             XmlElement childNode = _xmlDocument.CreateElement("ie:menuitem", "http://www.tempuri.com");

   67             childNode.SetAttribute("id", "MSO_MyMenu_Link1");

   68             childNode.SetAttribute("title", title);

   69             if(imageUrl != string.Empty)

   70                 childNode.SetAttribute("iconSrc", imageUrl);

   71             childNode.SetAttribute("onMenuClick", string.Format("BLOCKED SCRIPTwindow.location.href='{0}';", url));

   72             childNode.InnerText = title;

   73             _currentNode.AppendChild(childNode);

   74         }


   76         public void AddSeparator()

   77         {

   78             XmlElement childNode = _xmlDocument.CreateElement("ie:menuitem", "http://www.tempuri.com");

   79             childNode.SetAttribute("type", "separator");

   80             _currentNode.AppendChild(childNode);

   81         }


   83         public void AddSubMenu(string title)

   84         {

   85             AddSubMenu(title, string.Empty);

   86         }


   88         public void AddSubMenu(string title, string imageUrl)

   89         {

   90             XmlElement childNode = _xmlDocument.CreateElement("ie:menuitem", "http://www.tempuri.com");

   91             childNode.SetAttribute("type", "submenu");

   92             if(imageUrl != string.Empty)

   93                 childNode.SetAttribute("iconSrc", imageUrl);

   94             _currentNode.AppendChild(childNode);

   95             _currentNode = childNode;

   96             AddLabel(title);

   97         }


   99         public void CloseSubMenu()

  100         {

  101             _currentNode = _rootNode;

  102         }


  104         public void AddLabel(string title)

  105         {

  106             XmlElement childNode = _xmlDocument.CreateElement("ie:menuitem", "http://www.tempuri.com");

  107             childNode.SetAttribute("type", "label");

  108             childNode.InnerText = title;

  109             _currentNode.AppendChild(childNode);

  110         }


  112         public override string ToString()

  113         {

  114             StringBuilder sb = new StringBuilder();

  115             sb.Append(Header);

  116             sb.Append(_xmlDocument.InnerXml);

  117             return sb.ToString();

  118         }


  120         #endregion


  122         #region Private Methods


  124         private void createXmlDocument()

  125         {

  126             _xmlDocument = new XmlDocument();

  127             _rootNode = _xmlDocument.CreateElement("menu", "http://www.tempuri.com");

  128             _rootNode.SetAttribute("id", "MSO_MyMenu");

  129             _rootNode.SetAttribute("class", "ms-SrvMenuUI");

  130             _xmlDocument.AppendChild(_rootNode);

  131             _currentNode = _rootNode;

  132         }


  134         private void createHeader(string title)

  135         {

  136             Header = string.Format("<div class=\"ms-HoverCellInActive\" "+

  137                 "onmouseover=\"this.className='ms-HoverCellActive'\""+

  138                 "onmouseout=\"this.className='ms-HoverCellInActive'\">"+

  139                 "<a id=\"MSO_MyMenuLink\" title=\"{0}\" style=\'CURSOR: hand\''+

  140                 "onclick=\"MSOWebPartPage_OpenMenu(MSO_MyMenu, this);\""+

  141                 "tabindex=\"0\">{0}<img alt=\"{0}\" src=\"/_layouts/images/menudark.gif\""+

  142                 "align=\"absBottom\"></a></div>", title);

  143         }

  144         #endregion

  145     }

  146 }


It’s not beautiful and there are a lot of improvements you can make. For example, some of the names are hard coded and should be generated dynamically and keeping track of the submenu levels should be something managed outside of the class. However it works and is easy to use.

To use it, just drop this class into your project and you can create a menu with a few lines of code like this:

    7 public class TestMenu

    8 {

    9     public void CreateHtmlMenu()

   10     {

   11         SharePointMenu menu = new SharePointMenu("My Menu");

   12         menu.AddMenuItem("First Item", "http://www.microsoft.com");

   13         menu.AddMenuItem("Second Item", "http://www.slashdot.org");

   14         menu.AddSeparator();

   15         menu.AddMenuItem("Last Item", "http://www.example.com");

   16     }

   17 }


That will get you a simple menu with a few items. Then in your RenderWebPart, or wherever you’re writing out the Web Part contents just write it out:

   19 public override void RenderWebPart(HtmlTextWriter writer)

   20 {

   21     SharePointMenu menu = new SharePointMenu("My Menu");

   22     menu.AddMenuItem("First Item", "http://www.microsoft.com");

   23     menu.AddMenuItem("Second Item", "http://www.slashdot.org");

   24     menu.AddSeparator();

   25     menu.AddMenuItem("Last Item", "http://www.example.com");

   26     writer.WriteLine(menu.ToString());

   27 }


You can also create multiple level menus and submenus. Just call the AddSubMenu method(s) in the class (with or without an image). When you call AddSubMenu, any future calls to AddMenuItem will just add it to that submenu. When you want to back out of the menu, just call the CloseSubMenu method. Like I said, it’s not pretty as it really only supports 1 level of menus and will always back out to the root. However it can be modified and updated with a little work to support unlimited submenus, dynamic generation of IDs, etc. Use your imagination.

Here’s the menu for the SharePoint Forums Web Part which sparked creating this class. The categories and forums are dynamically generated based on what the user can see, etc. and the menu is built up based on options in the system and what the user can do. Looks pretty slick and only took a few lines of code:


So have fun with it and feel free to modify it. If you do extend/enhance it let me know and I’ll update the resource. You can grab the class file here for use in your program. It’s released under the Creative Commons License.

Monday, August 07, 2006  |  From Fear and Loathing : SharePoint Forums

The work is almost done on version 1.2 of the SharePoint Forums Web Part. The release will go out later tonight after I chow down some food and build the package. A full list of changes will accompany the post when the release goes out but here’s some screenies of what’s coming down the pipe.

Replies with previews:


Full text search on titles and messages:


Sortable Forums and Categories:


See ya in a few hours!

Monday, August 07, 2006  |  From Fear and Loathing : SharePoint Forums

I’m just getting ready to release version 1.2 of the SharePoint Forums Web Part. One feature was the ability to control the date and time display for users. This has been added and documented on the CodePlex wiki here.

The SharePoint Forums Web Part (version 1.2 and higher) provides the ability to set the default date/time format when displaying dates in the system. This is used on the last post of a topic, individual messages, and user profiles. Basically anywhere a date/time stamp is displayed you have control over the format.

The format is based on how your server is set so "d" on a US setting is Month/Day/Year whereas on a Canadian setting it's Day/Month/Year. The following values will produce the output shown for August 7, 2006 at 11:30:00 AM:

d - 8/7/2006
D - Monday, August 07, 2006
f - Monday, August 07, 2006 11:30 AM
F - Monday, August 07, 2006 11:30:00 AM
g - 8/7/2006 11:30 AM
G - 8/7/2006 11:30:00 AM
m,M - August 07
r,R - Mon, 07 Aug 2006 11:30:00 GMT
s - 2006-08-07T11:30:00
t - 11:30 AM
T - 11:30:00 AM
u - 2006-08-07 11:30:00Z
U - Monday, August 07, 2006 5:30:00 PM
y - August, 2006

You can also create a custom pattern using the following formatters. This means that if you don't like any of the formats above, you can just create your own and really personalize the forums.

d - The day of the month. Single-digit days will not have a leading zero.
dd - The day of the month. Single-digit days will have a leading zero.
ddd - The abbreviated name of the day of the week, as defined in AbbreviatedDayNames.
dddd - The full name of the day of the week, as defined in DayNames.
M - The numeric month. Single-digit months will not have a leading zero.
MM - The numeric month. Single-digit months will have a leading zero.
MMM - The abbreviated name of the month, as defined in AbbreviatedMonthNames.
MMMM - The full name of the month, as defined in MonthNames.
y - The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.
yy - The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyyy - The year in four digits, including the century.
gg - The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.
h - The hour in a 12-hour clock. Single-digit hours will not have a leading zero.
hh - The hour in a 12-hour clock. Single-digit hours will have a leading zero.
H - The hour in a 24-hour clock. Single-digit hours will not have a leading zero.
HH - The hour in a 24-hour clock. Single-digit hours will have a leading zero.
m - The minute. Single-digit minutes will not have a leading zero.
mm - The minute. Single-digit minutes will have a leading zero.
s - The second. Single-digit seconds will not have a leading zero.
ss - The second. Single-digit seconds will have a leading zero.
f - The fraction of a second in single-digit precision. The remaining digits are truncated.
ff - The fraction of a second in double-digit precision. The remaining digits are truncated.
fff - The fraction of a second in three-digit precision. The remaining digits are truncated.
ffff - The fraction of a second in four-digit precision. The remaining digits are truncated.
fffff - The fraction of a second in five-digit precision. The remaining digits are truncated.
ffffff - The fraction of a second in six-digit precision. The remaining digits are truncated.
fffffff - The fraction of a second in seven-digit precision. The remaining digits are truncated.
t - The first character in the AM/PM designator defined in AMDesignator or PMDesignator, if any.
tt - The AM/PM designator defined in AMDesignator or PMDesignator, if any.
z - The time zone offset ("+" or "-" followed by the hour only). Single-digit hours will not have a leading zero. For example, Pacific Standard Time is "-8".
zz - The time zone offset ("+" or "-" followed by the hour only). Single-digit hours will have a leading zero. For example, Pacific Standard Time is "-08".
zzz - The full time zone offset ("+" or "-" followed by the hour and minutes). Single-digit hours and minutes will have leading zeros. For example, Pacific Standard Time is "-08:00".
: - The default time separator defined in TimeSeparator.
/ - The default date separator defined in DateSeparator.
% c  - Where c is a format pattern if used alone. The "%" character can be omitted if the format pattern is combined with literal characters or other format patterns.
\ c  - Where c is any character. Displays the character literally. To display the backslash character, use "\\".

Note: these are all standard .NET formaters for DateTimeInfo, but documented here for users of the Web Part who are not .NET developers.

Monday, July 31, 2006  |  From Fear and Loathing : SharePoint Forums

Just a short post today (actually, now that it's finished it's pretty long but there's no much technical content here) as I'm shuffling things around schedule wise and just wanted to let you know where things are. This also talks about some dead projects that are being resurrected and others that are being reborn. Yeah, I'm all about software reincarnation.

First up is scheduling for the SharePoint Forums Web Part. Releases are going to be the first Monday of each month so if the first is a Tuesday, it shuffles ahead to the next week (the 6th of the month). Yeah, I could choose the day before but then it wouldn't give me those extra few days so cut me some slack. The next release of the forums is 1.3 (it was called 2.0 but it hasn't got that mature yet) and will work in WSS ASP.NET 2.0 setups and implement various bug fixes and new features. The 2.0 release will be the one that fully leverages MOSS 2007 as there are some major changes to architecture and the deployment (it will be a solution deployment rather than an MSI, and available as a feature you can turn on or off). That is expected to come along in the September drop.

The SharePoint Knowledgebase release will be the middle of each month (even with a vast team of coding monkeys, I can only get so much done on the 1st of any given month) and the first release has been pushed out the middle of September. I was going to have a release for August, but there's just too much going on where I'll be incognito (i.e. without 'puter) that I can't spin it. The first release will be pretty close to fully featured as there's only so much a knowledge base can do, however please post your ideas in the forums (there hasn't been much activity there) and let me know what you want to see (or confirm that it's there).

As for dead or resurrected projects, there are two. First is the highly anticipated (based on emails I get) SharePoint Builder. This is my visual Xml editor for ONET.XML and SCHEMA.XML files. Yes, it's still alive and kicking however while I was waiting for a stable release of MOSS, other things stacked up so it got shuffled to the back burner. It's back and you'll be hearing from it soon. It's now using the Smart Client Software Factory from Microsoft and has a lot of great features (like remote editing of XML files) and will have full support for MOSS 2007 (while maintaining compatibility with 2003 site definitions). Watch for it in the Sept-Oct timeframe and new screenshots/news in the coming weeks.

The final project is one that hurts me, but makes sense. A couple of months ago I launched my SharePointForge site. Basically a project hosting site for SharePoint projects. The problem was that I had my fingers in too many cookie jars so I couldn't dedicate the time I wanted to the site. CodePlex came and is providing a good place for hosting projects (strangely enough SharePointForge basically looked like CodePlex but on steroids, even before I had seen CodePlex) and really I wasn't able to get into the business of hosting peoples source code. So SharePointForge is dead (sort of) and is being reborn. Like the Phoenix, it's transmogrifying into a new site. It's much like the old SharePointForge concept, but won't offer hosting. I can't announce what this is about, but you'll be hearing and seeing the site in the next couple of weeks.

Most of the shuffle is due to a vacation I'm taking (gasp, horror of horrors). As a consultant, it's actually hard to take a vacation because a) you don't get paid for it and b) you're always thinking about the next project you're working on and trying to squeeze that into some insane schedule (at least I am).

Anyways, Bil is a busy boy but life is good so enjoy it.

Monday, July 24, 2006  |  From Fear and Loathing : SharePoint Forums

I thought I would share a little insight into my brain on planning releases for my SharePoint Forums Web Part using the Scrum development process and what CodePlex has to offer to support this approach.

As you know, CodePlex is a community site that hosts the forums project and there are a few nice tools they’ve baked into the system that help me plan my work a little better. Even though I’m a one-man team (although I’m just ramping up to expand this) I still follow Scrum to plan out the releases and manage the work. Here’s how it breaks down.

The entire Issue Tracker is my Product Backlog. I export all unassigned items to a CSV file via CodePlex online. Then I apply a filter to be able to sort and view the data. Each Sprint is 1 month, delivering on (or about) the 1st of the month. Before I export the work items, I add the next sprint release date and version so it’s available in the filtered data (I have to assign something so it shows up in the filtered data list but I just move this item back to unassigned when I load up the spreadsheet to work.

Two more things I do is assign new columns to the spreadsheet after the export. First is my story points column. Rather than working on hours for estimating, I use points. Each item gets either 1, 2, 3, 5, or 8 points assigned to it. Nothing is larger than 8 points (meaning it’s going to be a lot of work). More on the point system later. Second is a priority column. CodePlex provides High, Medium, Low for priority but for Scrum you have to use numbers. There can be only 1 number one priority (even if multiple people are working on the system). After all, if everything is High how do you know what one you do first?

Then I’ll do a couple of sorts and filters. First I sort out the features from the issues (bugs) from the tasks. Tasks are just things that have to get done, and depending on whether or not they have enough priority they’ll get included in the next release. It’s give and take whether I include a feature or a bug or a task in the next release, although I’ll try to include bug fixes before features and features before tasks (at least I try to plan it that way). Once I’ve gone back and forth with each item, I’ll give it a priority. The decision on what goes before what is driven by the community (that’s you) and my own judgement of what’s important. Bugs that are really stopping people from using the system easily get higher priority than new features that nobody wants. On the flipside, features that people really really want will take priority over low priority bugs that people rarely stumble over or care about. They’ll all get done, but as I only have a finite time, I try to position things higher up the priority scale to get the best bang for my buck.

So now I’ve got a modified backlog with a list of items sorted by priority and a column showing how many story points it will take for each item. There are tasks that will be added later, but for now each story has it’s own weight based on things like how complex it is, if there’s already existing infrastructure in SharePoint to leverage, is this something I’ve done before, can I find an example on the web as to how to do this. Stuff like that. Now it’s time to figure out how many things I can fit into the iteration. I’ve time boxed the iteration at 1 month however contrary to popular belief, I don’t work full-time on this so it’s really more like a couple of hours every few nights. At my current velocity I can finish off 15 points per iteration. How did I arrive at this number? Based on the two releases I have, that’s how many points I finished previously. So for me, 15 points is a months worth of work doing a few hours here and there.

Now its time to go through the list and see what fits. If I can cleanly find 15 points from say the first 4–6 items, I just call it a day and that’s the release. If I can’t, then I need to shift some priorities around. Sometimes a #5 item gets shifted down to #7 because it’s too big to fit into the rest of the available points and item #6 will. It’s just numbers and works out well. Once this is done, I assign the items to that release number on the CodePlex site and export those items to a new worksheet which becomes my Sprint Backlog for the next release (I only priortize and estimate one release ahead).

They’ll be adjustments. With each release I look over how many points I completed and see if my velocity is improving (or not). This has an effect of auto-correcting my estimates. If I keep going at my current estimate of 15 points per iteration, I’m fine but if I find that I only deliver 10 by the time the end of the month comes I know that I under-estimated on 5 points. I’ll take a look at where that way (perhaps it was a feature I thought I knew what was required to make happen, but got bogged down by details). Cosequently, as I might bring on more people the number of points we achieve could go up but it doesn’t change how simple or complex something is. In any case, I’ll correct the project velocity as things change and hopefully estimating will get a little better on the next release.

Yeah, it’s a lot of work for a one-man project that comes out every month and there’s the danger of me running too many projects at this speed. However it gives me a good feeling that I know what the month of work is going to look like, I can pretty confidently estimate how many features are going to be delivered with the next release, and I can talk to people during the month about what’s coming which should hopefully help me plan the next release after that.

It’s not pure Scrum either as in 1 Sprint = 1 Release = 1 Month, but it works for me.

Sunday, July 09, 2006  |  From Fear and Loathing : SharePoint Forums

I’ve put together a language pack (just a zip file) for the latest release of the SharePoint Forums Web Part. Thanks to the efforts of people in the community, there’s a translation file for German (1031) and the Russian (1049) languages. Instructions on where to unzip the file are included in the zip and this file will be updated as more languages are translated and made available.

Please check out this page on the Wiki on how to create a translation file for your language. You can download the language pack from here on the CodePlex site.

Wednesday, July 05, 2006  |  From Fear and Loathing : SharePoint Forums

Okay, I've fixed the DWP error and created and replaced the MSI that was on CodePlex. Please download the current version from here if you're having problems adding the Web Part to a page (and don't want to manually edit the file).

Let me know if there are any problems.

God, it's been a crazy morning. I need a vacation.

Wednesday, July 05, 2006  |  From Fear and Loathing : SharePoint Forums

Okay, stupid error that I need to fix later today when adding the SharePoint Forums Web Part to a Web Part Page.

When an assembly with SafeControl entries is installed in the GAC (like this version is) the DWP file requires that the <Assembly> tag is a fully qualified one (with the public key token, etc.). This is to distinguish it from other assemblies.

The DWP file that is installed doesn't contain the fully qualified name, only the assembly name so SharePoint throws a hissy fit and says it's not safe.

So to fix this:

  1. Navigate to your wpcatalog folder under c:\inetpub\wwwroot (or wherever SharePoint is installed to)
  2. Manually find and edit (with Notepad or something) the BilSimser.SharePoint.WebParts.Forums*.dwp file
  3. Change the <Assembly> tag to read:
    <Assembly>BilSimser.SharePoint.WebParts.Forums, Version=, Culture=neutral, PublicKeyToken=e516dadc23877c32</Asssembly>
  4. Now you can import the web part onto a page from the virtual gallery.

The <Assembly> tag should match the entry in the SafeControls entry in your web.config file.

Stupid error that I should have realized. I'll rebuild the MSI (again) and update it for those that will download it later today.

Sorry about that folks. Sometimes coffee just isn't enough.

Wednesday, July 05, 2006  |  From Fear and Loathing : SharePoint Forums

Happy times are here again. I’ve finished the packaging and released version 1.1 of the SharePoint Forums Web Part. This contains a fairly large chunk of bug fixes and new functionality. Here’s a rundown:

  • Installation. Installation is HUGELY simplified. Just download the MSI and run it. Yeah, should have done that a long time ago.
  • Language Support. This release includes a language file (currently only english is available) with translatable strings from the Web Part. The file is just an xml file and you can create your own (using the existing one as a template) and deploy your own language resources (just drop the file onto the server and go). More instructions on creating additional languages will be available on the Wiki shortly and more translatations are to come with upcoming releases (I didn’t get to externalize them all, but it’s a start).
  • Date Sorting. Forums and topics were being displayed backwards (oldest to newest) so this has been corrected to “bump” the latest posts to the top
  • Todays Topics. You can now click on a link to show all the topics posted today.
  • RSS feeds. Each forum has it’s own unique RSS feed you can subscribe to.
  • Cleanup of display. A few links (like Delete Topic) have been cleaned up and put in a better place to make it easier to find. Other minor fixes to the display.
  • Performance. This was a big boo-boo I made. Now the forums load in under a second (no matter how many posts you have).
  • New Admin Functions. There’s a couple of new admin functions like recalcuating the totals (sometimes they get out of whack), deleting all the forums and restarting, and creating a set of sample data to play around with.

Hope you like it! Keep your suggestions coming in the Discussion Forums and Issue Tracker. Next drop is in August (we’re now on monthly drop cycles) with anonymous users, NNTP synchronization, ASP.NET 2.0 and MOSS 2007 support!

You can grab the file from the Releases section on CodePlex or directly from here.


Wednesday, July 05, 2006  |  From Fear and Loathing : SharePoint Forums

I’m just finishing up the packaging for the new version of the SharePoint Forums Web Part tonight and thought I would share with you some ideas and concepts around the packaging and distribution of it.

Thanks to Paul Schaeflin who took time out of his busy schedule to put together a CAB installer for me. It was great but I thought I could improve on his foundation. I used that as a basis, but then went back to an additional friend, WPPackager. WPPackager is a sweet little tool that will package up your Web Part assemblies, resources, and additional files and create an MSI for you. The end user just runs the MSI without any fuss or mess screwing around with web.config or custom policy files. There’s a great MSDN article that explains how to use the tool with some examples. Check it out here.

Anyways, so I use NAnt for my builds (free, open source, blah, blah, blah) and with NAnt you can practically automate anything. Here’s part of my NAnt build file for SharePoint Forums:

    1 <?xml version="1.0"?>

    2 <project name="SharePoint Forums Web Part" default="deploy">


    4     <property name="config.build" value="Debug" />

    5     <property name="output.dir" value="build" />

    6     <property name="deploy.dir" value="C:\Inetpub\wwwroot\bin" />

    7     <property name="resource.dir" value="C:\Inetpub\wwwroot\wpresources\BilSimser.SharePoint.WebParts.Forums" />

    8     <property name="wppackager.dir" value="C:\Program Files\WPPackager" />


   43     <target name="dist" description="create a distribution MSI for the web part" depends="build">


   45         <!-- Copy the files needed by WPPackager to the build directory -->

   46         <copy todir="${output.dir}" flatten="true">

   47             <fileset>

   48                 <include name="SharePointForums-" />

   49                 <include name="src\Manifest.xml" />

   50                 <include name="src\SharePointForums.dwp" />

   51             </fileset>

   52         </copy>


   54         <!-- Use WPPackager to create a MSI -->

   55         <exec program="WPPackager.exe" basedir="${wppackager.dir}" workingdir="${output.dir}">

   56             <arg value="SharePointForums-" />

   57         </exec>


   59     </target>


   61     <target name="install" description="installs the web part using the MSI installer" depends="dist">

   62         <exec program="SharePointForums-" basedir="${output.dir}" />

   63     </target>


   65 </project>


It’s fairly long and I’ve removed some of the targets for clarity but let’s break it down here. The default target is “deploy” which will in turn call “build” which first calls “clean”. These do what you think and deploy just copies the files to the “C:\Inetpub\wwwroot\bin” directory (or wherever you run your SharePoint server from).

The target we’re interested here is “dist”. The “dist” target will do three things:

  • Clean out the build directory and rebuild the system
  • Copy all the distribution files needed for the distribution
  • Execute the WPPackager.exe program and create an MSI

The build is done through the “build” dependency target which compiles the solution file but first executes the “clean” target which just deletes the build directory. All files are output first to the build directory (here specified as the variable ${output.dir}. This keeps all the dll files in one place rather than hunting all over for a Debug or Release directory.

The WPPackager program needs a single file which contains instructions to build the MSI. Here’s the SharePointForums- file:

    1 <?xml version="1.0" ?>


    3 <!--

    4     WPPackager file for SharePoint Forums Web Part

    5     Version

    6     GAC install

    7 -->


    9 <Wppackager xmlns="http://schemas.microsoft.com/WebPart/v1/Wppackager">


   11     <Manifest FileName="Manifest.xml" />


   13     <MSI

   14         Name="SharePointForums-"

   15         Version=""

   16         Manufacturer="Bil Simser" />


   18 </Wppackager>

Not much to look at. This just tells WPPackager that I’m building an MSI, giving it a name and version and manufacturer (that’s ME!). The Manifest.xml is the standard one from SharePoint that just lists the assemblies we’re including and the SafeControl entries (these are added to the web.config file auto-magically when the MSI is run).

The WPPackager needs all the files that are going into the distribution (much like if you were using a CAB project in Visual Studio to build a CAB) so the build script (using the “copy” task) copies the Manifest.xml and SharePointForums.dwp file from the Web Part directory into the build directory so WPPackager can find it when it runs.

Finally WPPackager is run using the “exec” task as shown here. This will create SharePointForums- in the output directory.

I also use an install target that will run the MSI after it’s built. I do this on a clean system just to test the build and install to make sure everything works (note to self: I’ll probably add an “un-install” target for rolling it back, if I can figure out how to execute the MSI backwards).

One note is on the output of WPPackager. You’ll see something like this:


     [copy] Copying 3 files to 'C:\dev\BilSimser.SharePoint\WebParts\ForumSingleSolution\build'.
     [exec] Success: MSI Installer: 'SharePointForums-' created successfully from 'SharePointForums-'.
     [exec] Note: 'SharePointForums-' is not signed. Consider signing 'SharePointForums-' so that the user can identify the source of the MSI.


Total time: 6.2 seconds.

The MSI that gets created is unsigned (and will be untrusted on the installing sever when it’s run). I didn’t want to get into the details of signing here but check out this article on using SignTool. Once you install SignTool you can do something like this in your build file:

signtool sign /a MyFile.msi

Which will sign the file with the best certificate it can find. I haven’t tried it so you’ll have to check it out yourself (I just need to get around to installing the Platform SDK, something I normally don’t do). Until then you’ll just have to trust me ;)

That’s about it for automating your distributions with NAnt. A similar build could be created with MSBuild and it’s format so I may create that when I move the project over to the 2007 platform later this month. Otherwise, with a few simple tools and commands you can have a nice little automated MSI builder so you don’t have to put your users through hell (like I did) on editing web.config files manually and trying to locate the “bin” folder (sorry about that guys).

BTW, WPPackager is being discontinued. Please read, speak up, and support the post here from Maurice Prather on it. Personally it’s a nice tool once you get to know it. It’s not perfect, but at least it a) creates an MSI for you b) inserts the SafeControl entries for you and c) will apply a custom policy file for you (it copies whatever is there and adds your own policy entries). Additionally, it will roll all this back all these changes when you un-install the Web Part from the Add/Remove Program Files menu. You could probably do the same with a custom installer but then you need to mess with the web.config file (finding the right node, adding entries to it, etc.) and backing up and creating custom policy files (as well as rolling this back during an un-install). Neither rocket nor science, but not just a few if/then/else statements either so WPPackager helps. A lot.

At this point, there’s no slick way I know of to install Web Parts in 2007 (yet), although Todd Baginski’s SharePoint Feature Manager is looking good, but it still needs things to manage and won’t install the Web Parts/Solutions for you. Hopefully someone will have something put together (perhaps a resurrection of WPPackager?) for 2007 as we really do need to in order to deliver packages to you, the consumer, and not have you go through crazy setups like in the past (or is it the present?).

Watch for the Web Part release later tonight on CodePlex.

Monday, June 26, 2006  |  From Fear and Loathing : SharePoint Forums

The biggest problem that I keep hearing about with the SharePoint Forums Web Part is installation. I think there is a flaw so that you will, almost always, get at least one error on security but with a page refresh this goes away (at least with all the tests I've done where I'm running as non-admin, non-Full trust, I get this).

However the biggest problem that everyone is talking about is the steps they're going through installing the web part and the errors they're getting. Here's an example:

"I've read all the documetation and followed it exactly and installed the dll files in the c:\inetpub\wwwroot directory but it still doesn't work."

Okay, this is wrong. The documentation does not say this, it says to find the directory where SharePoint is installed and in a default setup it will be this. It also says to create the "bin" folder (where the assemblies are) if it doesn't exist.

It's feedback like this that is causing problems with people installing the web part.

I'll be the first to admit, if the documentation is wrong (and it might be) then I'll update it so that anyone can install this. I'll also be the first to admit that if you've never installed a custom web part (and there are a lot of people that haven't) that these instructions can be a little daunting. We are working on an installer to make it as idiot-proof as possible and hopefully reduce it to a one-click install. The problem is that there are several moving parts that need to happen for the web part to make it into a virgin system including:

  • Copying the assemblies to the "bin" folder
  • Adding the SafeControl entries to the web.config file
  • Creating a custom policy file
  • Setting the custom policy file in the web.config
  • Adding an assembly to the "gac"

These are non-trivial steps, but as far as I know I've documented them as much as possible on the Wiki site. So please refer to the installation instructions here first and foremost. Also remember to click on the hyperlink for each step, as it contains a more detailed set of instructions.

Like I said, if the instructions are incorrect or missing information (even the smallest thing) please let me know. Did I screw up? Maybe? Did you just assume things and skip steps? Possibly. I've been communicating with a *lot* of people and *almost* everytime, they've just ignored what the documentation said and put things in weird places (I even had one guy that copied the dll files to the 60 hive, which is just completely wrong).

Okay, enough of my ranting. Since I can't be at everyones machine to do the install for them the documentation (until a complete installer comes along) is the next best thing. Please help make it a complete and accurate document.


Tuesday, June 20, 2006  |  From Fear and Loathing : SharePoint Forums

Just a quick update on the SharePoint Forums project. I’ve moved the next release (v1.1.0.0) out to July 1st. It’s just too close to TechEd and I wasn’t able to actually get any work done while I was there (no surprise). The monthly iterations will continue, but they’ll start on the first of the month. This just gives me a little time to get things going. Also the roadmap is being planned out for the August and beyond releases which will include new functionality and support Office 2007 installations.

Also when you’re reporting issues, can you please provide some information about your setup. It’s important to know if you’re on a SharePoint Portal Server install, or just a Windows SharePoint Services setup (or a Small Business Server setup) and if you’ve installed ASP.NET 2.0 on WSS or something crazy like that. It’ll help track down problems much faster for me.


Wednesday, June 14, 2006  |  From Fear and Loathing : SharePoint Forums

I didn’t get a chance to blog yesterday as it was a full day for me but here’s the recap as there were many things going on all over the place and the entire day is a bit of a blur (much like this blog entry is looking right now after 3 hours of sleep).

I was manning the Technical Learning Center (TLC) in the Offiice area. I’ll be here all week at various times so drop by and chat. It was great talking to everyone as there were so much diversity and different problems. It’s always interesting to talk to people about real world scenarios and see what people are doing (or wanting to do) with SharePoint. This helps me direct content to you that is most appropriate and valuable to you so please keep it coming (if you’re not here at TechEd or can’t catch up with me there’s always email). TechEd is such a great show and one of the biggest benefits (IMHO) is not the sessions, it’s not the keynotes, it’s not even the schwag (did I even say that?) but it’s the personal networking. I speak to more people in the Technical Learning Center than I ever have and either helped solved peoples problems, hooked up with new people and got them hooked on the SharePoint drug, or strengthened old contacts.

I had a great opportunity of meeting with Jim Newkirk for lunch and we spent a good hour or two talking about NUnit, Agile development, Team Rooms, Agile at Microsoft, and of course CodePlex. Jim had a session this morning on patterns which filled three rooms (and was packed). It was a great overview of patterns but just scratches the surface, but I prefer to see this kind of content come out of Microsoft . Don’t get me wrong, the other stuff that’s product based is great too (and much needed) but seeing Agile and Pattern sessions (even if they are high level) is a good thing. If you get a chance to drop by the Patterns and Practices guys, please do. They do good work.

Jim is full time on CodePlex and it’s growing like gangbusters, even if it hasn’t been fully released for primetime yet by Microsoft (but they’re getting there). There are some great things happening with CodePlex so time will tell as the story unfolds and we see more good stuff from the team. It was however, a discussion with Jim that led to meeting Korby Parnell, one of the key guys behind CodePlex. In discussions with Korby, Lawrence Liu, Chad Hower, and others there are some adjustments I’m making in the SharePoint Forums project.

Korby and CodePlex

First off, I’m moving to a scheduled monthly iteration. I’m still a one-man team (but don’t intend to keep it that way) but want to follow a regular schedule. Monthly iterations sounds good from a management perspective and they’ll be enough time to work on each release and get features baked in that are value-added.

The first of the new features that arose out of discussions Tuesday is anonymous support. Currently all users have to be a member of a SharePoint site which is great for intranets, but if you want to host SharePoint Forums on an internet facing site, it just doesn’t works (to be honest, I don’t know what it will do yet so I have to see but I’m pretty sure it won’t work). In any case, I’m going to do some specific things around anonymous support. If a user hits the site and is anonymous, then they can get read access (configurable as to what access they have). Once they want to post they’ll need to be signed in so if they’re not, they’ll be whisked away to a new login/register page. Again, it’s up to you how much access they get on sign up so they can post or you can set it so they have to be approved first before their word can be heard. This will all be configurable per forum so you can have some forums open, some slightly locked down, and others completely verbotten to internet users. Also extranet users will look just like internet ones as far as the forums go, just behind the scenes we’ll store more info because right now users information (display name, email, etc.) is all coming from SharePoint. The forums only store the SharePoint ID for a lookup so this will change. Again, the forums are polymorphic in design so once a new version goes out, the lists will automatically be upgraded and transformed. There’s no data migration you’ll have to do. I think this is the best of both worlds.

The next thing is the introduction of an question/answer system. Currently with a message you can reply (or quote) and the message just shows up in the thread. For each forum, you’ll be able to flip a flag that turns it into a question/answer forum. This means that an additional link will appear next to the reply button called “Answer”. An answer is a reply, but just has different characteristics. As the thread owner, you’ll be able to look through the answers and click on a new button called “Accept” (which will be next to “Edit”). This will allow you to accept an answer as correct and give us a bit of ranking/rating system (for example you can get a list of threads with questions that are “unanswered”). Think of a system like Experts Exchange and you’ll get the idea.

I’ll be putting these in as work items on the CodePlex site and adding a few new releases to the release schedule for the next few months. There are additional features planned and actively being worked on so check out the release roadmap for more information. Speaking of the forums, I spent an exhausting 15 minutes yesterday porting the Web Part over to 2007 and have it running in my VM. If you’re in the TLC, drop by and take a look. There are some bugs due to deprecated features I’m using so I have to switch some controls over to their ASP.NET 2.0 counterparts, but it looks pretty good. Expect a 2007 version in the August drop.

Last night I was the recipient of the “Win a Date with Fitz” contest. Okay, there wasn’t a contest but it sounded good. Fitz and I headed out to see Dweezil Zappa and his band doing his Frank’s music in a show called “Zappa does Zappa”. Let me say that while I’m not a huge Zappa fan, I’m all for good music and yeah, this was good. Wait. Correct that. It was fantastic. Even better. It kicked any tech gadget I’ve seen so far (even the Sony Vaio and that’s saying a lot coming from me).

There are two truths to the world that I’ve come to learn. In every city, anywhere I go, there are two things that stand out. In Boston last night I discovered both of them. First, cabbies generally do not know where anything is. We hopped into the cab and told him we were going to the Orpheum. Blank stare. Okay, maybe he’s heard of it but not sure what we’re referring to (or something like it). A few more minutes of prodding and coaxing and he still didn’t get it. We told him the area it was in because hey, we’re strangers in a strange land and if we knew where it was we would be driving. Still nothing. Finally Fitz slogged out the Crackberry and looked it up (I’m sure he was using Google but I didn’t want to intrude). He called out the address. Still nothing.

Some neuron must have fired in the cabbies head as he just started driving and well, we eventually got there. I don’t know how but the cab came to a stop and apparently it was nearby (although we still couldn’t see it). No biggie. We hopped out and figured if we can’t find it, we’ll ask (men are not afraid to ask for directions to a concert, we just won’t do it in a car at a gas station). Luckily it was down at the end of alley so we’re good to go.

Oh yeah, the other truth. Bostonians wait until the last possible moment and *then* walk out in front of you. I watched two different occasions last night on the way to the Orpheum where someone would walk to the curb, wait, then when the light was red and cars were coming they decided to walk out. I’ve seen this happen other days as well so it must be true, as I now have 2 or 3 data points. Maybe it’s a Boston thing?

Anyways, we needed to grab some food before the concert and that’s when the fun began (actually it began when Fitz was googling the location but the real fun was just around the corner).

On the way to the substinance we happened along the alley where some bicycle cops have subdued someone and had them face planted on the sidewalk. Boston’s finest had just pulled up and was going to escort our friend to a nightly stay with them. There was opportunity for us to add insult to injury and perhaps accidently swipe the poor fellows head with Fitz’s boot, but we’re geeks and the passive type. Too bad I didn’t have the camera with me.

So yes, the music. Oh the music. It was loud, and great, and never ended. Steve Vai showed up and joined in the fun with a guitar solo the likes I’ve never seen before. 2 hours into the set it wound down as things finished up, but then it was the encore. Which lasted an entire hour. The encore was a series of solos, the sax player belting out someting that Lisa Simpson would be proud of, and duets between Dweezil and Steve finished up by a killer drum solo.


So that was yesterday, this is today and I’m back in the TLC with some sessions today, lots of talking, and more parties. The fun never stops in Boston.

Monday, June 05, 2006  |  From Fear and Loathing : SharePoint Forums

Okay, I’m human and prone to mistakes. I did a silly error when I released my SharePoint Forums Web Part in dynamically calculating post counts. I thought I was being smart by just using the value of the collection objects, trouble is that they’re all lazy loaded so when something like the stats come up for the site, every freakin’ message in the system gets loaded into memory.

Simple fix and will be included in the next release. For those of you with a few hundred messages (and growing) you’ll find a huge difference. I test filled the system with 100,000 messages (yes, you can do that in SharePoint lists if you do it right) and load times are back to under 1 second, which is where they should be.

Probably too many Fritos and Mountain Dew that night for this code monkey.

Friday, June 02, 2006  |  From Fear and Loathing : SharePoint Forums

I’m just going through a few hundred emails and RSS feeds as I do everyday and getting caught up (in addition to dusting off my workspace due to construction out back). I wanted to address a few things in the SharePoint Forums Web Part.

First is performance. Some people have mentioned it’s taking a long time to load the pages when there are a lot of posts. I’m going to do some more tests this weekend and see what’s going on. When I first built it, I had a small routine to fill the forums with 10 posts in 100 topics in 10 forums, which I thought was a good test (10,000 messages). Load times were negligible (less than 5s) even on my VM so I thought this was acceptable. I’ll go back and revisit this and might have to do something different for the June 19th release.

Second is deployment. I still get emails from people who are putting the files in the “web server extensions\bin” folder so obviously my instructions are not clear enough (or people are not reading). There are some that refuse to put my dll in the GAC which is fine (you can deploy that assembly to the bin folder if you want). And there are others that still have security problems. So I’m doing a couple of things to rectify this. First I’m going to recheck the impersonation code and run it on a portal with an account that absolutely has no permissions. I’ve done this before and it worked fine, but this time I’m going to set it up and screenshot/cast it so you’ll see the step-by-step which should help you configure it in your own environment. Second, I’m going to produce a special single-dll version of the code for the next release so you can just deploy the web part and not have to worry about where this file goes or do any ugly GAC stuff. Finally, I will get an installer working (and maybe take another stab at with the single assembly) but this probably won’t be ready for next release as I have too many things to do before now and then.

As for the source code, it is going to be posted on CodePlex and no, I’m not hiding anything. I’m just trying to figure out how to get the silly thing up there without having to “upsize” my 2003 project to a 2005 one. I wish the command line would just do a “tf -import” or something but it keeps looking like I have to import every file AND associate every checkin with a package. Oh, how much I LOVE Team Foundation.

And yes, I still need to post the Calgary Code Camp presentations and code. Watch for that this weekend.

 Fear and Loathing : SharePoint Forums News Feed 

Last edited Dec 7, 2006 at 10:16 PM by codeplexadmin, version 1


No comments yet.