Archives

Archives / 2006 / July
  • Dead or alive, you're coming with me

    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.

  • It's all about balance in the universe

    Seems a lot of people are scratching their heads at Micrsoft’s move to charge $1.50 per download on the Office Beta. They’re wondering (besides money I guess) what the rationale behind this move is. It’s really quite simple.

    In the universe there must be balance. With the charge for the Office download, Microsoft is offsetting the cost of making the MSDN Library downloads now free. With darkness there is light. With Office there is MSDN.

    Pretty clear to me ;)

  • Composite UI Application Block - Soup to Nuts - Getting Started

    I’m currently helping some teams move towards creating Smart Client applications. As part of that move, I’m also introducing them to use the Composite UI Application Block (CAB) which will ease the pain of building the UI, separating it, and generally making it a better life than just writing plain old boring Windows Form apps.

    So this begins a series of blogs on writing applications using CAB. The series starts super simple, with a bare minimal example and compares the differences between a regular WinForm app and one written using the CAB. In this series, we’ll just keep building on each example to another and finish off with an n-tier, service-oriented solution that employs the CAB and does some pretty cool stuff. I won’t reveal what the app is but you can figure it out as we go along.

    The next series to follow-up this series will go beyond just the CAB and describe the Smart Client Software Factory (SCSF) which not only uses CAB but adds a million other things. Think of CAB as Windows Forms on steroids and the Smart Client Software Factory as CAB on steroids. It’s going to be a blast.

    By now, you’re probably wondering why a little ol’ SharePoint MVP like me is blubbering on about writing Smart Clients but hang in there, they’ll be more than your share of SharePoint stuff by the time we’re finished.

    Rules of Engagement

    Just a couple of notes on this blog series. All the examples are written in C#. If you’re looking for VB.NET samples you won’t get them here as I just prefer C# (feel free to build your sample in VB.NET if that’s your cup’o’tea). Also these samples are built with Visual Studio 2005 just because a) the CAB is .NET 2.0 based and b) the SCSF is Visual Studio 2005 based. I think there might be a version of CAB for 1.1 (not sure) but Smart Client development and Click Once was never great with .NET 1.1 and it’s 2006 so get off yer 1.1 butts and move on up to the new neighbourhood.

    Getting Started

    Okay, let’s get this party started. We have to walk before we run so this blog entry is just going to create the minimal app. We’ll highlight the differences between what you get with an auto-generated WinForm app vs. what you need to do to create the minimal CAB app. It doesn’t do anything at this point (not even “Hello World” on the screen) but every journey starts with the first step.

    To get going:

    1. Install the CAB using the link above and follow the instructions for installation
    2. Create a new Windows Application using the Create Project option in Visual Studio. Just the typical application (call it WindowsApplication1) with a single Windows Form.
    3. Add a reference to the following assemblies: Microsoft.Practices.Composite.UI; Microsoft.Practices.Composite.UI.WinForm; Microsoft.Practices.ObjectBuilder.

    Next we’re going to create a WorkItem. A WorkItem is A WorkItem is a run-time container for components that are working together to fulfill a use case. These components may consist of SmartParts (no, not those SmartParts), controllers, services, UIElements, and other components. You can use a WorkItem to encapsulate different use cases or areas of an application to share events and state. However, if you overuse WorkItems and make them too fine grained, or if you build your WorkItem classes inconsistently, you may end up with an application that is difficult to maintain. You need at least one WorkItem in your application so let’s create one:

    1. Create a new class called Form1WorkItem
    2. Add Microsoft.Practices.CompositeUI to the using statements at the top of the file
    3. Change the Form1WorkIem class to inherit from the WorkItem class

    Your Form1WorkIem class should look like this now:

        1 using System;

        2 using System.Collections.Generic;

        3 using System.Text;

        4 using Microsoft.Practices.CompositeUI;

        5 

        6 namespace WindowsApplication1

        7 {

        8     public class Form1WorkItem : WorkItem

        9     {

       10     }

       11 }

    What we’ll do to CAB-enable the application is one more change. This is to the Program.cs file that is the main entry point for the application. Here’s the default one from Visual Studio:

        1 using System;

        2 using System.Collections.Generic;

        3 using System.Windows.Forms;

        4 

        5 namespace WindowsApplication1

        6 {

        7     static class Program

        8     {

        9         /// <summary>

       10         /// The main entry point for the application.

       11         /// </summary>

       12         [STAThread]

       13         static void Main()

       14         {

       15             Application.EnableVisualStyles();

       16             Application.SetCompatibleTextRenderingDefault(false);

       17             Application.Run(new Form1());

       18         }

       19     }

       20 }

    Nothing special here but we’re going to transform this by doing the following:

    1. Add Microsoft.Practices.CompositeUI.WinForms to the using statements of the file
    2. Change the Program class from static to public
    3. Inherit from the FormShellApplication class in CAB
    4. Modify the Main method to support CAB

    Here’s the modified version of the Program class that supports the CAB (also note the change from static to public):

        1 using System;

        2 using System.Collections.Generic;

        3 using System.Windows.Forms;

        4 using Microsoft.Practices.CompositeUI.WinForms;

        5 

        6 namespace WindowsApplication1

        7 {

        8     public class Program : FormShellApplication<Form1WorkItem, Form1>

        9     {

       10         /// <summary>

       11         /// The main entry point for the application.

       12         /// </summary>

       13         [STAThread]

       14         static void Main()

       15         {

       16             new Program().Run();

       17         }

       18     }

       19 }

    The only difference here is that we derive our application from FormShellApplication (a generic class in the CAB), passing the WorkItem class and the Form class we created. Also the startup in Main has changed to call the Program classes run (defined in the FormShellApplication class) rather than the standard Application.Run(). As we’re setting the value of the form in the FormShellApplication via generics so there’s no need for us to pass the Form class to the Application class like we did in regular .NET. There’s a nice blog entry here by Brad Wilson on describing the FormShellApplication class (and other classes in the CAB) which you might want to take a peek at.

    That’s it. Build the solution (hopefully you shouldn’t have any errors) and run the app with F5 (or Ctrl+F5).

    Amazing huh? This looks and behaves no different than a regular WinForm app but it’s now CAB enabled and almost ready to go. As I said, this is a super simple example and doesn’t even display “Hello World” or anything. With the tires kicked, we’re ready to start adding form and functionality the CAB way!

    So what did we get out of this post? Hopefully you can see the (minor) differences between a regular Windows application and a CAB-enabled one (pretty simple huh?) and your project is now ready to start using features of the Composite UI Application Block. We’ll start exploring what you can do in the next entry in this series.

  • SharePoint Knowledgebase Project on CodePlex

    As I mentioned last week, I have a new project in the works. The SharePoint Knowledgebase Web Part that should fill the gap for those looking to build this kind of beast on SharePoint. It has a new home on CodePlex, right next to the SharePoint Forums Web Part.

    Will fill in the details this week on it on the sites Wiki including screenshots and other good info. Forums are open for discussion now, suggestions, etc. and the issue tracker will fill up with the initial production release which will be September 15th. A beta release will be available August 15th which will weed out any bugs before production.

    As with the SharePoint Forums, I'll be managing the project using Scrum, the Issue Tracker as my backlog, and the release system on CodePlex. I've staggered the releases of this web part to fall in the middle of the month so now you'll get two updates a month from me. One for the Forums, and the other for the Knowledgebase.

    Enjoy!

  • Doing Scrum with CodePlex

    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.

  • The Full SharePoint Monty

    A good friend of mine, fellow co-worker, and all around nice guy is now blogging about SharePoint. Monty Grusendorf got setup on SharePoint Blogs a few days ago, but I was waiting for him to post something more than “Hello World” to unleash him to the cold unforgiving handful of people that stumble on this site looking for Hunter S. Thompsons’ musings. So now he’s blogged about a nice SharePoint nugget. The other day he said hey, did you know about this? While I am the wise old SharePoint guru (or the crazy old unabomber, not sure which) this information was new to me. Very cool (although it would have been much cooler with screenshots Monty, hint, hint). I won’t give away the gold so you’ll have to check out his blog to see what it’s all about. Here’s to seeing more SharePoint blogging goodness from Monty.

  • What's in a name?

    I’m really digging the series of blog posts over at Coding in an Igloo (an Edmontonian) that cover Code Naming Conventions. Normally blog entries are either just talking about one thing (say the naming of classes) while others try to cram everything into on post and really don’t cover it. Here he runs the entire gammet, from soup to nuts and everything in between. It’s a very complete reference and not only has his ideas of what is works for him, but why, which is as important as to the what.

    Here’s what he’s posted so far:

    Next up is UI Controls which I think is always a point of discussion. I personally use the txtFirstName convention, although I flip flopped between that and the firstNameTextBox idea for awhile but landed back with the control name flair. I think UI controls is the only place where our big, fat ugly aunt from the Hungarian hills shows it’s face, and it doesn’t seem that bad?

     

    Anyways, great series so I highly recommend following it. I’m sure at the end of the posts you could simply snag all the entries and use them as-is for your own standards.

  • Model-View-Presenter Pattern with SharePoint Web Parts

    So what’s this MVP thing? Bil’s an MVP so now he’s a pattern? I don’t get it.

    Well, not quite.

    Model-View-Presenter (MVP) is a fairly new(er) term for an old(er) pattern in Software Design. Its similar (but not necessarily the same) as the Model-View-Controller pattern (MVC) that you may have heard of or seen around. MVP is a pattern that will abstract away the display of data from a user interface. This is done for a few benefits, like being able to test a UI without a UI (yeah, let that one cook in your noodle for a minute or two). It also reinforces your domain model so you’re not doing screwy things like writing logic decisions (should I display a row of information if the user has permisions or not) in the user interface. Bad, bad place to do this.

    Quoting Martin Fowler, the MVP pattern “Separates the behavior of a presentation from the view while allowing the view to receive user events.”

    So MVP is a great pattern for doing UI elements, and keeping your domain logic where it belongs (read: in the domain silly), while maintaining a good, clear separation from the UI. In essence, the view subscribes to events and the presenter, well, “presents” them to the UI. The UI then figures out how to update itself and doing crazy user interface stuff like change lists of data or display rows of information.

    Still with me? Imagine that Bert is the View, Ernie is the Presenter, and Mr. Hooper is the Model. Mr. Hooper has some jellybeans for sale at his store. Ernie can go to Mr. Hoopers store and find out how many jellybeans he has for sale today. Ernie will tell Bert this so Bert can update the Sesame Street website. Ernie doesn’t know anything about HTML but does have the information Bert needs to do his thing. Bert isn’t allowed to talk to Mr. Hooper or go anywhere near his store (after that last incident with Mr. Snuffleupagus and the latex) so Ernie heads out to Mr. Hoopers store and counts the number of jellybeans he has for sale. He comes home and tells this to Bert. This is how Bert gets the information he needs to update the website. Got it?

    The thing about MVP is that UI doesn’t really care how (or for that matter where) the data came from. The presenter just gives it to the UI in pieces. The UI is a dumb animal (and should be) and should only know simple things like adding items to a drop down list, or displaying a grid of information. User interfaces are stupid and should never get any smarter than knowing about the UI. Much like any project manager.

    Okay, let’s get into this and walk through an example of creating the MVP pattern with SharePoint Web Parts. There’s an excellent article on The Code Project that describes the MVP pattern in-depth here. I’ve adapted it to use a SharePoint Web Part instead of an ASP.NET page for this article.

    Side note: This is the first of two articles I’m going to do on the MVP pattern. The first is going to be for .NET 1.1 (Visual Studio 2003) and SharePoint v2 (or 2003 if you prefer). The second article will come later and be written in .NET 2.0 (Visual Studio 2005) and SharePoint v3 (or 2007). The two articles show the same pattern, but are implemented differently as I can make use of Generics and other features of the Web Part framework. I just thought I would kick it off with a 2003 demo so anyone writing Web Parts for SharePoint today could make use of it.

    The View

    No, not that crappy TV show with Starr Jones quitting over the number of M&Ms she needs, but rather the “V” in “MVP”. The View is responsible for exposing the data we want to the user interface. You might say that’s what say a class inherited from WebPart does. Well, yes, but since we want to tell the view (indirectly) what to update and we don’t want to know about UI type control things (listboxes, drop down lists, data grids, etc.) we need something called a View. The View gets implemented as an interface and as you know in .NET, you can implement as many interfaces as you want on a class.

    Here’s a simple view that has one property of type DateTime called CurrentTime that any class implementing this interface must create the setter for.

        1 using System;

        2 

        3 namespace WebPartMVP

        4 {

        5     public interface ICurrentTimeView

        6     {

        7         DateTime CurrentTime {set;}

        8     }

        9 }

    The Presenter

    The Presenter is the guy behind the curtain that makes the magic happen. The Presenter marries the view and the model together in a harmonious fashion, wiring itself up to events that are triggered from the view. When the view requests a change, it does so through the Presenter and the Presenter (talking to the Model) will respond accordingly. Finally the View updates itself via the UI (whatever that UI may be, a User Control, WinForm, WebForm, or in our case a SharePoint Web Part).

    Our presenter is simple and will do two things. First, it gets created using an object passed into the constructor that conforms to the ICurrentTimeView interface. Next, it provides a public method called InitView that will initialize the view when called. Here’s the code for our Presenter:

        1 using System;

        2 

        3 namespace WebPartMVP

        4 {

        5     public class CurrentTimePresenter

        6     {

        7         private ICurrentTimeView _view;

        8 

        9         public CurrentTimePresenter(ICurrentTimeView view)

       10         {

       11             _view = view;

       12         }

       13 

       14         public void InitView()

       15         {

       16             _view.CurrentTime = DateTime.Now;

       17         }

       18     }

       19 }

    The Model

    This is the class that represents the data we want to present. As you may not need to expose your entire domain object graph to the UI, this might be a subset or slice through that data. Whatever is relevant to the UI and the properties you need to expose. Our Model is going to be simple and we don’t have a class for it. It’s just what gets set during the initialization of the view but you could create your own Model class or have the Presenter talk to a Facade or Service object to get data. In this example, the Service object is the current DateTime instance.

    Bringing it all Together

    Let’s bring this puppy home. So we have a view interface, and we have a presenter that will take an interface of that type during construction. First we need to add the ICurrentTimeView interface to our Web Part and implement the member(s) that it describes. Here’s what that looks like in our Web Part:

        1 using System;

        2 using System.ComponentModel;

        3 using System.Web.UI;

        4 using System.Web.UI.WebControls;

        5 using System.Xml.Serialization;

        6 using Microsoft.SharePoint;

        7 using Microsoft.SharePoint.Utilities;

        8 using Microsoft.SharePoint.WebPartPages;

        9 

       10 namespace WebPartMVP

       11 {

       12     [DefaultProperty("Text"),

       13         ToolboxData("<{0}:WebPart1 runat=server></{0}:WebPart1>"),

       14         XmlRoot(Namespace="WebPartMVP")]

       15     public class WebPart1 : Microsoft.SharePoint.WebPartPages.WebPart, ICurrentTimeView

       16     {

       17         private const string defaultText = "";

       18         private string text = defaultText;

       19 

       20         [Browsable(true),

       21             Category("Miscellaneous"),

       22             DefaultValue(defaultText),

       23             WebPartStorage(Storage.Personal),

       24             FriendlyName("Text"),

       25             Description("Text Property")]

       26         public string Text

       27         {

       28             get

       29             {

       30                 return text;

       31             }

       32 

       33             set

       34             {

       35                 text = value;

       36             }

       37         }

       38 

       45         protected override void RenderWebPart(HtmlTextWriter output)

       46         {

       47             output.Write(SPEncode.HtmlEncode(Text));

       48         }

       49 

       52         public DateTime CurrentTime

       53         {

       54             set

       55             {

       56                 Text = value.ToLongDateString();

       57             }

       58         }

       59     }

       60 }

    This is just the generated Web Part you get from the template in Visual Studio 2003, except we’ve got two new things. First the CurrentTime property, which is an implemention of the ICurrentTimeView interface and the interface has been added to our Web Part declaration.

    The CurrentTime implementation is up to us and in our case, we’re going to set our Text property to it. When the Web Part renders, it will render out the Text property that will get set.

    So how does the Presenter talk to the View? We need to add one more thing to our Web Part. In the override to the OnLoad method, we’re going to create the presenter object and initialize it like so:

       39 protected override void OnLoad(EventArgs e)

       40 {

       41     CurrentTimePresenter presenter = new CurrentTimePresenter(this);

       42     presenter.InitView();

       43 }

    Remember we said that the CurrentTimePresenter class takes in “this” (meaning the Web Part object) to its constructor. CurrentTimePresenter actually wants an object that implements the ICurrentTimeView interface. It doesn’t matter what object it is, or what it’s derived from, it only pays attention to the interface. Then it calls the “InitView” method of the view. That’s not part of the Web Part, but it will talk to the Web Part through it’s CurrentTime property.

    It’s all about misdirection. Like magic.

    This is a simple example. A more concise example is to have a backend data source (either a SharePoint list or a SQL database) feed the data through the Model (using a Data Access Layer or something). Or you can have the Presenter fetch the data through a Facade for the business layer (again calling some external data source via a DAL). Also you can have multiple properties and methods on your view interface (that your Web Part will have to implement). Use your imagination. Remember to keep your UI thin and simple. You’ll probably need one View and one Presenter to keep things clean but they’re simple to make and easy to use.

    The killer gain here? First, I can unit test my presenter and model (and view) without SharePoint. No, I can’t get SharePoint data without SharePoint but remember when we created the Presenter in the Web Parts OnLoad event? Notice it passes “this” as a parameter, but the CurrentTimePresenter class doesn’t know anything about Web Parts. That’s the magic of interfaces and designing by contract. The CurrentTimePresenter class expects an object that implements ICurrentTimeView. The Web Part is derived from this so it can be passed into the Presenters constructor. The Presenter couldn’t care less about the other “SharePoint” stuff, it’s just going to call the implementation(s) of the views interface(s).

    Also notice that the ICurrentTimeView implementation (the CurrentTime property) isn’t a SharePoint property, but it does set one internally. This is hidden from the Presenter so the Web Part could have just as easily set a text box, filled a data grid, or updated some AJAXy-type control (again, use your imagination). When the Presenter updates the Model, it does so through public properties that are defined in ICurrentTimeView. Again, it doesn’t know that this is updating a property on a SharePoint Web Part and couldn’t care less, it just knows that somewhere (somehow) the UI is going to make it work.

    Neat huh?

    Okay, go forth and code.

  • Which BDC tool should I use?

    I was a little confused (as I often am) earlier today as I noticed Todd Baginski has put together a tool he called the “MOSS BDC MetaData Manager”. Catchy name but didn’t I just hear this tune? There’s a CodePlex project underway called the “Database Metadata Generator for the Business Data Catalog”. Okay, not as catchy but isn’t this essentially the same tool? Not quite.

    Todd explains he looked at the project on CodePlex and there are differences between his tool and that one. He outlined them in his blog which I’ll share here:

    Features Todd’s tool has that the CodePlex one does not:

    • Granularity: Allows you to create BDC components (LOB Systems, LOB System Instances, Elements, and Methods) independently of each other.  The application on CodePlex creates one LOB System, one LOB System Instance, an Entity and two Methods.  My application allows you to add LOB Systems, LOB System Instance, Entities, and Methods on an ad hoc basis so the Application Definition can grow over time. 
    • Support for SQL Server Authentication. 
    • Ability to query objects in the BDC (LOB Systems, LOB System Instances, Entities). 
    • Column selection capability instead of returning all the columns in a given table. 
    • LOB System Instance configuration.  Authentication Mode, Database Access Provider and Connection Pooling can be individually selected and customized per LOB System Instance. 
    • SQL Server 2000 and SQL Server 2005 support (I'm not sure if the CodePlex application supports SQL Server 2000 because I did not test it against SQL Server 2000).  I tested the CodePlex application with the AdventureWorks database in SQL Server 2005 and the application threw an Exception.  I believe this is due to the fact that all the tables in the AdventureWorks database do not have dbo as their owner. 
    • Database selection capabilities that allow you to browse through the database server to find the database and table you are looking for. 
    • Export to XML capabilities. 
    • SSP Administration web site built into the application. 
    • Guided help and instructions for end users. 
    • Help system not only describes how to perform tasks but also educates the user on the various BDC components and how they relate to each other. 
    • UX: Easier to work with than the command line (that's just my personal point of view) and provides the context as well as the status of the current BDC elements as you work with them.

    Features the CodePlex tool that Todd’s does not:

    • The ability to generate a SpecificFinder Method.  (I will be adding this functionality later in the week.  I wanted to get my head around the BDC object model before I tackled this functionality.) 
    • The ability to execute the program via the command line or a batch file.

    Like he said, he’ll be adding the SpecificFinder method later this week and executing from the command line, well, might be value-added but I’m not so sure given all the “extra” capability that Todd has already baked into his tool.

    Botton line, get Todd’s tool and you’ll be good to go, creating application definitions at the flick of a mouse. If you haven’t figured out what the BDC is all about and what it can do, please dive in (a good starter is here). It’s going to be the unsung hero of SharePoint 2007 IMHO (I’m also giving a presentation at this fall’s DevConnections in Vegas on the BDC and will be using Todd’s tool for some of the demos as I can’t really create a definition in an hour AND present all the other stuff).

  • Introducing, the SharePoint Knowledge Base Web Part!

    Hey, what's a girl to do when his brain is just cooking with goofy ideas. With more ideas than can fill the Exxon Valdez, but not enough time to do them here's the latest chicken scratch courtesy of your friendly neighborhood MVP.

    The SharePoint Knowledge Base Web Part!

    It's a single web part (backed by multiple lists again, seems to work for my SharePoint Forums Web Part) that let's you create questions, assign them to categories, and rate and comment on them. I've dug around the net on various knowledge base software and pulled together the features that I think makes up a good kb web part. Here's a rundown of the features:

    • Ability to add as many questions as you like
    • Ability to add and categorize questions into categories (including multiple categories for a single question)
    • Search capabilities to find questions and answers
    • Rating for each question (was this helpful - yes/no)
    • Add comments for each question
    • Moderation of questions (or you can leave it open so questions are published immediately)
    • View questions by category (with number of questions displayed)
    • Quickly jump to any category instantly from the main page
    • Assign related questions to other questions
    • Attach any number of files to a question

    Of course, no announcement would be worth it's dirt without opening the kimono so here's some screenies:

    The main display of searching, selection by category, and the category display:

    spkbmain

    Displaying a single question with option to print, email, add comments, etc.

    spkbquestion

    Watch for a release later this month (probably after the August drop of the SharePoint Forums, need to get a new project setup on CodePlex for this ;)

    kick it on SharePointKicks.com

  • The Lighter side of being an Architect

    I wasn’t sure what to call this blog entry so maybe it’s mis-titled. As odd as it may sound, this entry stemmed from a conversation that’s going on over in Rory’s side of the web where he praises Carl Franklin on his community efforts. I threw in my own “praise the world” type comments, but there was a link to a site called Design Patterns for .NET. This of course peaked my interest, but some of the comments Rob Daigneau made about what is a software architect triggered something in me noggin.

    Everyone and his brother has written what a software architect is (and is not), comparisons abound on how software architecture is like building architecture, blah, blah, blah, blah, blah. I don't know what Rob Daigneau is (other than an Enterprise Architect for Monster.com, and after this post I can probably kiss any hopes of working for them goodbye), but he misses out on what I think is the key elements of what software architecture (and Architects) is about.

    It's really not about patterns and technology. Really. Sure, they're an integral part and any good Architect needs those skills but they're just mechanics. Anyone (with the right aptitude) can pick these up (how do I make pretty UML diagrams, what is n-tier, etc.). IMHO the key things architecture is about is:

    • Communication
    • Abstraction
    • Negotiation
    • Influence

    A good architect excels at these attributes because they have no power, only persuasion to influence, and they need to know how to communicate what they're thinking so everyone understands them. I wanted to present my take on some things that make up a good Architect.

    Communication
    Everyday the architect on a project is trying to tell someone something. You’re the liaison between the business and the geeks. You’re the instigator of change. You’re the guy who’s trying to demonstrate to the client that before they sink $5 trillion dollars into this IT project the concept is sound and the team can deliver what the business wants. You’re also the guy (or girl) who’s telling the business that you’ve heard what they want and think you know what they said. The rubber hits the road when you tell the story back to them and see if you were listening correctly. Finally, your the guy who’s trying to bring the stone tablets down from the mountain to the nerds who are going to build this monstrosity you’ve architected. Somehow, using a combination of knowledge of the requirements, kung-fu coding skills, and an understanding of your model, they need to create it. Yes, even if you are building your own system (I like Architects who code and I would like to think I’m one of them) you need to know the intent of what you’re building. Drive by coding and architecture on the cuff because you’re stuck down a dark Architectural alley is no way to build a solid system.

    Abstraction
    We all know there’s abstraction in the domain and I’m not really talking about coding abstractions here or implementing interfaces for unit testing. I’m not even talking about technical abstraction (from an infrastructure perspective). No, this kind of abstraction goes hand in hand with your ability to understand the business requirements asked of you. And your ability to Architect a solution that meets those requirements. Something that does incorporate the technology you need and solve the problem at hand (whatever that problem is). If you’re too close to trees to see the forest, how can you really see the big picture of what needs to be done? I’m also not talking about big design up front (BDUF) or anything. Just simply being able to abstract yourself away from the techno-babble the geeks of the world will get wrapped up in and the little nuances the business wants from a solution perspective. It’s nice they want blue buttons and an user interface that’s “intuitive” but if you’re not solving the problem asked of you and reaching the overall goal with the entire solution, what exactly are you building? A great looking UI that moves data around? Where's the business value in that?

    Negotiation
    It’s all about compromise. There are so many times you’re going to have to hold your Architecture nose because of the horrible smell you’re about to create because some network junky says you can’t have unsecured traffic over HTTP on port 80. You can come up with an architecture for a system that is technically perfect, but you have to live within the constraints of whatever infrastructure you build it on (or in). Corporate intranets and network security paranoidites are out to lock down and otherwise curb your seemingly elegant solution. For this you need to be able to compromise and find a balance. For this you need to negotiate. Sometimes it with the technicians who refuse to punch a hole in their firewall just so you can get FTP traffic flowing, other times it’s the customer who flatly refuses to back down on the sub-second response they want (without paying for the infrastructure upgrade needed to make it happen). There are negotiations to take place and through your bargaining skills, you’ll find that sweet spot that will make everyone happy.

    Influence
    There is no power. If you, as an Architect, think you have the power to move things and leap tall requirements in single bound, think again. The customer is always right, and usually holds the dollarinos that feed your family. They’re not going to care that you think a SmartClient n-tier approach to solving their problem is better than a 3–tier application with a web front-end. They just want to do their business. And power over the developers who are building this thing? That’s an entirely different influence you have to master, since they look at you as a techno-dweeb who can barely code your way out of a paper bag. Not even the coolest looking UML or class diagram (even if there such a beast) is going to persuade them that your kung-fu is any better than theirs. Bone up on how to influence people. There are many self-help books out there that are good for this.

    Now a few things about this post. I don’t get into the differences between the various architect flavours out there. Software, Solutions, Data, Enterprise. An Architect is an Architect is an Architect. The core skills are there for all of them, the media and technical skills just vary.

    Well, maybe I’m the one that’s completely off my rocker here but these are my views of architecture from the software space and it’s my blog and I can rant if I want to, so there. YMMV.

  • Kicking the SharePoint beast

    First off, thanks to everyone who's been contributing stories to SharePointKicks.com, kicking stories, and generally promoting the site by providing "kick" links in your own blog posts. SharePointKicks is growing and growing (which is a good thing) and becoming a great resource to filter out only the good stuff.

    Also props to Gavin Joyce who has singlehandidly (is that a word? where is my Websters plug-in?) been updating his kicks sites, and generally adding features as he can find time. Its interesting to see that DotNetKicks and SharePointKicks are the guinea pigs that get the first kick at the can for the new features (no pun intended). Maybe an indication of how popular kicks is.

    The recent updates are well recieved and will let you sort (using no-postback ajax techniques) the latest stories and top stories (based on number of kicks) from the last day, week, month, and year. There's also tagging which was added a few releases ago. This lets you add additional filters to posts so you can submit a story to the Community category, but then tag it with something like MOSS, Development, or Customization (or create your own tag). The tags display is based on how many items are tagged with that word, so larger tags will have more stories associated with it (very much like Community Server has with it's tagging system). I'm sure there's an official name for this who tagging concept and there's probably an entire blog dedicated out there that describes the origins (feel free to put a link in the comments if you know or come across it).

    Anyways, thanks again to everyone in the community for making SharePointKicks a great SharePoint resource (and so quickly!). Please do continue to contribute, kick things, and generally pimp it to the world as you can find the time. Also if you do have suggestions on SharePointKicks feel free to send them to me at info@sharepointkicks.com. Some of these suggestions may make themselves into the kicks software Gavin puts together and would show up on all the kicks sites, so consider your contribution not just to the SharePoint community but the development community at large.

  • SharePoint Projects on CodePlex

    Just wanted to highlight the current SharePoint projects listed on CodePlex.

    SharePoint Community Kit
    This project is used for the development of the SharePoint Community Kit, which consists of a Standard Edition and multiple specialized and value add editions, each of which enables practically anyone to create very quickly a functional community website on Windows SharePoint Services V3 or Microsoft Office SharePoint Server 2007.  
     
    SharePoint Stramit Document Library Browser
    SharePoint Stramit Document Library Browser is a free package of 3 Treeview WebPart for the SharePoint document library. I have always complained about the lack of navigation options that are in the the document library feature of SharePoint. Lots of people speak about migrating all shared documents from a WSS site.

    SharePoint Learning Kit
    The SharePoint Learning Kit is a community-source eLearning tool that integrates with Learning Gateway. Rich content is supported with full SCORM 2004 compliance and basic functions are supported for any electronic document.  
     
    Windows Sharepoint Services Site Directory Web Part Project
    This is a security trimmed Windows Sharepoint Services Web Part project that will display to the user the sites that s/he has access to. It uses a simple hierarchic tree view to provide easy navigation and access to all the permissible sites, and uses the built-in sharepoint icons to display the types of the sites.  
     
    Office SharePoint Server Search Web Parts
    Powerful, extensible web parts for Office SharePoint Server search.  
     
    SharePoint Forums Web Part
    The SharePoint Forums Web Part is a free, open source, single web part that provides a more feature rich discussion board for SharePoint Portal Server and Windows SharePoint Services based sites.  
     
    Database Metadata Generator for the Business Data Catalog
    A tool that automatically generates database metadata for Office SharePoint Server 2007’s Business Data Catalog.  
     
    RSS FeedReader
    An aggregate syndicated feed reader for SharePoint in web part format. This web part is designed to display several RSS and Atom feeds in a single web part with configurable option such as what to display and caching capabilities for the feed data.

    Most of the projects are active and have releases. One of them, the Office SharePoint Server Search Web Parts, seems already abandoned with no releases and no sight or sound of the owner even in it’s forums. Otherwise, SharePoint is alive and well on CodePlex. Here’s to seeing more SharePoint oriented projects up there!

     

  • SharePoint Forums Language Pack

    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.

    EDIT: Just updated the release of the language pack to version 11 with the addition of the Ukranian language and a spelling correction to the Russian language files.

  • SharePoint Learning Kit now available on CodePlex

    CodePlex just keeps getting groovier and groovier with SharePoint projects. Here's the latest. It's the SharePoint Learning Kit and the first Community Technology Preview (CTP) is available for you to download. For those of you familiar with Class Server, this is the same thing. For those that are not familiar with it here's the blurb from the site:

    SharePoint Learning Kit (SLK) is a SCORM 2004-conformant e-learning delivery and tracking application built as a SharePoint v3 solution. It works with either Windows SharePoint Services 2007 or SharePoint Portal Server 2007, and has the following core features:

    • Supports SCORM 1.2, SCORM 2004, and Class Server content, allowing users to store and manage this content in SharePoint document libraries.
    • Supports a learner-centric or instructor-led (assigned) workflow.
    • Allows assignment, tracking and grading of both e-learning and non-e-learning content.

    In this CTP you can install and configure the SLK Solution and use it to assign SCORM 2004 content on a SharePoint site. Learners can view a list of their assignments with the assignment list web part, and can interact with the assigned content. The learner's interactions are stored in the SLK database.

    This CTP also has SDK and source code downloads for developers to review SLK and the underlying Microsoft Learning Components (MLC) API to determine whether it might be suitable for their applications.

    Very cool stuff. You can check it out here on it's new CodePlex home.

  • DotNetNuke and SharePoint, part deux

    First off I have a tremendous amount of respect for Shaun Walker and the DotNetNuke guys. They took a free sample starter application from Microsoft and created an entire after-market. Just look at how you go online and pay $30 for a DNN skin or $50 for a DNN module. No really, I'm not being asinine here. I really do respect them, the community that’s grown up around their efforts, the work they do and the future that DNN brings.

    Shaun has put together a giant matrix of DNN features and how they par up against SharePoint (2003 version, SPS and WSS v2 so I'll consider the features of both as the one column in his matrix) and the upcoming Microsoft Office SharePoint Server (MOSS) 2007. He also throws in ASP.NET 2.0 which is good, but for this lengthy discussion I'll just ignore it.

    I’m not going to nitpick about the things that are ticked on the DNN site but not the SharePoint one (unless they should be) but mostly focus on his comments on the DNN benefits column as I think some of them need either explanation or comparison to say a SharePoint benefit for the same bullet point. If a DNN benefit is stated, I just want to be sure it’s not being overstated where SharePoint does the same job (or vice-versa).

    I wanted to cover in-depth a few things he mentions, some things he omits, places where I don’t agree with his statements and my own reflections on the comparison. As you may know I did the big DNN vs. SharePoint showdown of my own awhile ago (which got a lot of great discussion going and feedback, including great stuff from Shaun) so let's see where this one goes. Overall he does a good job of making the comparison and it’s going to be a great reference for the future. Consider this blog post my Coles Notes (or Cliff’s Notes for you guys down south) on Shaun’s matrix. Here are Bil’s Notes ;)

    Usability

    • A couple of points that need help here. The DNN benefits listed are things like “unlimited pages per site” and “unlimited modules per page”. While SharePoint does have some published limits, I have yet to see anyone exceed or come close to them (except maybe Microsoft themselves). And after you get 10 or 20 modules (or Web Parts) on a page any page is going to become un-usable, no matter what the technology is due to the fact you’re pulling so much data down. It’s like users that say they want 10,000 rows on a web page. Can you do it? Sure, if you like waiting for 5 minutes for each page refresh.
    • Using a DataView Web Part I can put the same module on as many pages as I want. I don’t see how this is any different than what DNN does today (although setting a module to show up on each page is sometimes a good thing, sometimes a bad thing [like when you want to get rid of it]).
    • Site Search. I feel this is a bit of a red herring. The DNN benefit is that DNN doesn’t use any third party components to do it’s search. However neither does SharePoint. SPS search is done by the search engine, and WSS only installs use SQL Servers full-text search. One would argue that DNN does use a component to do its search, it’s the custom component of DNN itself (which I don’t think allow me to extend it to say search PDF files for example like I can with custom IFilters). Again, I might be wrong here so feel free to correct me please.
    • DNN benefits are that it uses site and page templates with content. We have this already in SharePoint 2003 with the built-in templates (Team Site, etc.) and sites you can create as well with 2007 you get master page support and layout template support (in addition to site templates again). Dead heat IMHO.

    Bundled Functionality

    • A few things are missing from the SharePoint columns here as SharePoint does come with discussion forums (crappy ones, grab mine instead, shameless plug), photo gallery (Picture Library), survey, etc. The other argument here is that it comes with the Custom List template which is the basis for anything you want. So technically, while it doesn’t come OOTB in SharePoint, I can certainly create a FAQ, Blog, or Feedback list in minutes. Okay, you might say I’m stretching on something like the Blog and that could be true. In any case, things like the Custom Forms/Tables should be checked in the SharePoint column as that’s what the Custom List template really is (and personally is better than what DNN provides but I’m a little biased).

    Membership & Roles

    • I didn’t realize DNN had support for extending the roles provider, but since SharePoint 2007 is based on ASP.NET memberships I would suggest that this can be done as well (but I could be wrong as I’ve never tried to extend the built-in providers in .NET)
    • Security role trimming. DNN lists this as a benefit (with trimming for control visibility) and last time I checked I get that with MOSS 2007 (finally) so don’t know how this is a benefit over SharePoint (2003 for sure as it just plain sucked on hiding things users couldn’t do).

    Application Extensibility

    • I have a bit of a problem with the Developer Tool Support. DNN cites a benefit of supporting the free Web Developer editions and SQL 2005 Express. Contrary to popular belief, I can build Web Parts with the free .NET SDK and a command line, so I don’t need any IDE (professional or otherwise). WSS also makes use of SQL Server 2005 Express for it’s datastore, so not sure how DNN shows this as a benefit. As for the Visual Studio item templates which are not checked for SharePoint, there are web templates available for the IDE (true, no “Express” templates) and the 2007 ones will come along when the product is released. A keen person with some time on their hands could whip up a SharpDevelop (a free, open source, .NET IDE) template if they wanted to for SharePoint. After all, it’s just a class library at the end of the day.

    Designer Extensibility

    • Definitely kudos to DNN for zip deployments!

    Site Extensibility

    • I’m a little confused by Site Virtualization comment. DNN says it “supports multiple virtual sites from a single application/database based on URL”. Personally I can create a gaggle of sites on one IIS server and differentiate them with host headers. True, I don’t want to create more than say 10 or 20 on a single server, but I can do it. I can also create a larger gaggle of site collection or even sites (all with different URLs under say different hosts using host headers). Maybe I’m missing something here.

    Localization

    • Again, single zip distribution for localization files (and not using satellite assemblies) is a bonus on the DNN site. No arguments here.

    Document Management

    • I have a problem with this section. Okay, he does check off “Secure Document Storage” for DNN but cites that DNNs benefit is that it can store the document on the file system or the database. Okay, in a simple world I guess I’ll buy that as a benefit but calling any document storage a document management feature is thin. If this was a SharePoint matrix list, it would blow away DNN since DNN doesn’t provide check-in/check-out or versioning (let alone any of the records management features coming in MOSS). But yes, storing documents on the file system might be useful as the database storage does take up extra space however you don’t get full text search throughout documents in DNN which is what the extra storage is required for (there are always trade offs), so this is a toss up to me.

    Infrastructure

    • No Multiple Database Support for SharePoint? Not sure what he’s referring to (and again this might be my lack of understanding of the inner workings of DNN) but I can certainly create a cluster of SQL servers in a farm and have my SharePoint content databases split across them. Sorry, but when Microsoft can host 30,000 team sites in their data centre that’s multiple database support (and then some) to me. Not sure if DNN scales out to that as I don’t know of any really large DNN sites (but feel free to provide some examples as I don’t know everything). I do agree the XCOPY deployment would be grand for SharePoint, but I just think it’s out of the question given all the moving parts it has (see below for more details on the power of PAs that DNN has).

    Community

    • I don’t know why, but Shaun failed to mention the SharePoint 2003 (and 2007) support forums. Basically there are 4 (or 6 or 8 I can never keep track) managed newsgroups as well as various community forums (like SharePointU for example) and mailing lists (sharepointdiscussions on Yahoo Groups) that all provide this. True, there isn’t a support forum environment like DNN has, running on the SharePoint site at Microsoft but I don’t see NGs being that far off from this (plus the fact that SharePoint forums/newsgroups get hundreds if not thousands of posts a day). So I believe he should have included SharePoint here.

    Pricing

    • I agree that DNN is free (as in beer) but for example, my web host (webhost4life) provides me with a “free” WSS site (it’s the one running the Application Templates site and some SharePoint sandbox/showcase work). I consider it free because I pay for hosting there, just like my ASP.NET hosting that runs my “free” DNN site. So what’s the difference? Sure, if I was hosting the system myself I would have to pay for a Windows 2003 Server license and there’s an external connector fee (which I think is what he’s referring to with the $40k) but again, if I host my WSS site somewhere else I don’t need to worry about that. Of course there are problems with that too (like I personally can’t deploy my own custom Web Parts on a hosted environment). For a good example of where MOSS 2007 is going as far as hosting intranet facing sites goes, check out Ian Morrish’s site as it looks great and runs 2007 so you can see everything SharePoint will offer in this arena.

    Wrap-up

    It’s interesting the comments by Joe Brickman on deployment and extensibility. He points to my recent NAnt post on creating an MSI for my Web Part and how you’ll lose people in a hosted environment. I totally agree and think that the PA (Packaged Assembly) system of DotNetNuke is the cat’s meow. I mean, the fact I can download a PA from a vendor and upload it and have it install on my host (no matter what priviledges my host gives me, as long as I have host rights on the DNN system I install which I would) it’s awesome to have new functionality in seconds.

    I don’t know if SharePoint will get to that (although the Feature Management system is a step towards that, but you still have to have access to the host to make the feature available). In fact I pondered building my own PA-like system for SharePoint that would allow you to upload a zip file with web parts, etc. through a Web Part and it would deploy itself much like how PAs work.

    However I do see a downside here.

    I haven’t heard in the DNN community and don’t know the inner workings of DNN to know if it will do security-like checks on a PA so who’s to say that I can create, build, distribute, and release a malignant trojan-like PA on the DNN community. Really. Create a wonderful looking module, offer it for free and have everyone install it. Then months later take down the entire DNN community (or a large part of it) with a module. Yes, a bit extreme but remember the little Sheep desktop gizmo that was floating around years ago? Nobody knew where it came from but everyone ran it. Imagine if the “Users Online” module for DNN was like that? (okay, I’ll stop as we’re getting into Conspiracy Theory territory here and it’s silly).

    That’s the downside I see but again, I think the PA distribution system is great and many steps above and beyond what SharePoint has.

    Of course, there’s things missing from the matrix since it’s told from the DNN perspective. Like the fact that MOSS has this incredibly complicated “people” network. Just by reading or contributing to someone’s document, or being a member on their site puts them in my social network. This networking aspect is huge and nothing like it exists in anything I’ve seen in DNN. So there are gaps, but there always will be. If the story was told from the SharePoint perspective, it would talk about all these features and leave DNN in the dust in some areas (and miss out in others), like DNN does with SharePoint.

    In the end, again, its up to you to decide. Like any good craftsman, choose the right tool for the right job. I think the 2007 version (now that it’s built on ASP.NET 2.0 and they’ve started to think about external users seriously now) will be a step up. Projects like the SharePoint Community Kit will help this effort.

    It’s up to you to choose and remember to choose wisely.

  • Adding SharePoint Forums Web Part to a page

    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=1.1.0.0, 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.

  • SharePoint Forums 1.1 Released

    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.

    Enjoy!

  • Automating your Web Part builds (and distribution) with WPPackager and NAnt

    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">

        3 

        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" />

        9 

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

       44 

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

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

       47             <fileset>

       48                 <include name="SharePointForums-1.1.0.0.xml" />

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

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

       51             </fileset>

       52         </copy>

       53 

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

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

       56             <arg value="SharePointForums-1.1.0.0.xml" />

       57         </exec>

       58 

       59     </target>

       60 

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

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

       63     </target>

       64 

       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-1.1.0.0.xml file:

        1 <?xml version="1.0" ?>

        2 

        3 <!--

        4     WPPackager file for SharePoint Forums Web Part

        5     Version 1.1.0.0

        6     GAC install

        7 -->

        8 

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

       10 

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

       12 

       13     <MSI

       14         Name="SharePointForums-1.1.0.0"

       15         Version="1.1.0.0"

       16         Manufacturer="Bil Simser" />

       17 

       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-1.1.0.0.MSI 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:

    dist:

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

    BUILD SUCCEEDED

    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.