March 2008 - Posts

Mijn eerste verjaardag

Time flies when you're having fun; my little girl is already one year old. She's the reason why I don't have that much time to blog anymore as I used to have; and I love it. :-)

Yesterday I finally had some time to finish a project I've been working on for some time: the Autocomplete Text Field for SharePoint 2007. Click here for a small demo screencast on Soapbox, or download the high resolution video from the CodePlex site.

The idea is pretty simple: you've got a SharePoint list (or document library) that contains some interesting lookup data, now you can make use of the Autocomplete Text Field to display a textbox to the user that will show a dropdown list of items that start with the text the user already entered. When the user types more (or less) text, the dropdown list will adapt to that and update the contents. All of this is made available as a new column type (aka custom field type) in SharePoint 2007. The beauty of this field is that it doesn't need to do a page postback to refresh the data, the ASP.NET AJAX extensions are used to fetch the data in the background.

When the column is added to a SharePoint list or document library, the user can customize by defining various settings:

  • Column name: the name of the column
  • Description: the description of the column
  • Required: if the column should contain text or if it can stay empty
  • Lookup list: the list in which the column should do the lookup, this list can be selected from a dropdown
  • Autocomplete interval: the number of milliseconds after which the lookup list will appear
  • Items to display: the maximum number of items to display in the lookup list
  • Minimum prefix length: the minimum number of charactes which should be typed before the lookup list will appear
  • Show animations: enable or disable the fading effects when the lookup list is shown or hidden

For more information, the download and the source code; visit the SmartTools for SharePoint Codeplex site. Be aware that if you want to make use of this column, the ASP.NET AJAX extensions must be installed and configured on your SharePoint sites!! (more info here)

A long, long time ago, back in the SharePoint 2003 days, I created some pretty popular web parts which filled in some gaps the out-of-the-box functionality left open. In SharePoint 2007 most of those web parts are obsolete; for example the Breadcrumbs web part is not necessary anymore since SharePoint 2007 has breadcrumbs by default. But a lot of people contacted me to ask for a SharePoint 2007 version of the What's New web part. This web part displayed a list of new and changed items on site. It's arguable that this functionality is not needed anymore because in SharePoint 2007 we have RSS feeds, the Content Query Web Part (MOSS only) etc. But apparently some people like the simplicity of the original What's New web part so much ... and just for those people I've create a new SharePoint 2007 What's New web part! :-)

Of course the new version is better and improved! Internally it's making use of the SPSiteDataQuery class so it can also aggregate new and changed items from multiple sites (recursive from the current level, or the complete site collection). The web part has following configuration parameters:

  • Settings group
    • Number of items to show: determines the maximum number of items to show in the What's New web part.
    • Scope of the Query: determines where the What's New web part will check for new or changed items, possible values:
      • Site: the current site only
      • Recursive: the current site plus all the sub sites of the current site
      • Site Collection: the entire site collection of which the current site is a member
    • Cache interval: the number of seconds the results shown in the What's New web part will be cached. This cache is per user. After a change to the properties of the What's New web part, the cache is cleared automatically to reflect the changes.
    • Excluded Content Types: a list of content types which will be excluded from the results shown in the What's New web part. The list is separated with the ; character. For example "Folder;Task" will excluded all changes and additions of Folder and Task items.
    • Show header row: enables or disables the header row of the results list.
    • Group items on date: enables or disables grouping of the results based on their date
    • Allow group collapse: enables or disables the ability to collapse the groups if the Group items on date setting is enabled.
  • Columns to show: you can choose which columns you want to show in the results list
    • Modified: the Modified timestamp, including the date and time
    • Time: the modified time (excluding the date part)
    • Date: the modified date (excluding the time part)
    • List: a link to list or document library containing the item
    • Site: a link to the site of the list or document library containing the item
    • Modified By: the account who changed or added the item

The installation is very easy (and completely documented), there is a setup wizard that will guide you through the process (thank you WSPBuilder and SharePoint Solution Installer!). For more information, download and source code; visit the SmartTools for SharePoint CodePlex site.

[Cross posted from my photo blog] My dear friend and esteemed colleague Kevin DeRudder is hosting a photowalk in his home town: Gent (Belgium), next Saturday (22th of March). And of course everyone is invited: geeks, non-geeks, hobbyists, amateurs, professionals ... Kevin has created a nice outline of the day that starts at 2pm, you can find more details in the Photowalk Belgium group on Flickr (discussion here). The agenda is still open so feel free to comment and contribute. When you want to join, just drop a line in the Flickr group discussion (or on this blog if you don’t have a Flickr account). If you miss the 2pm start time: I'll do my best to post some updates on our location on my twitter account. If you want to join but don't know any of us, we'll be the geeky looking group with a higher-than-average-number-of-camera's-per-person. I'll bet Kevin will be wearing his famous "I'm blogging this" t-shirt:

I'm Blogging This

If you are wondering; Kevin does have a head. :-) I hope to see you all next Saturday in Gent!

The SPWebConfigModification class allows developers to write code that will make modifications to the web.config files of SharePoint sites. This is quite often necessary when you want to deply SharePoint customizations together with configuration settings. Using the SPWebModification class is not without any danger! :-) You can mess up your web.config files especially if you don't think about how you want to be able to undo your changes. Mark Wagner wrote an excellent article about the best practices related to the SPWebConfigModification class; required reading for every SharePoint developer. Mark explains some very important things you should know to get started:

  • To save the modifications, you must use of the following code:
    myWebApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
    myWebApp.Update();
  • Only call this code once in your feature handler, otherwise you get the error "A web configuration modification operation is already running."

Great info Mark, and please do create an complete example of the best practices, packaged in a feature!

Did you ever want to integrated Silverlight with SharePoint? Check out the brand new Silverlight Blueprint for SharePoint site: http://www.ssblueprints.net/sharepoint/ !

At U2U we've created the six samples of the Blueprint that illustrate the integration options. You can read more details on Patrick's blog and Karine's blog (she posted some screenshots). The Blueprint will also be announced by Bill Gates during the SharePoint Conference keynote later today, the SharePoint team blogged about the other announcements as well (SharePoint Online and Microsoft Search Server 2008 Epxress).

On a personal note I would like to congratulate Karine, she has worked very hard to get everything done on time. Karine, you can be proud of this one!

More Posts