Jan Tielens' Bloggings

Joy, frustration, excitement, madness, aha's, headaches, ... codito ergo sum!

  • SharePoint Document Library Event Handlers & "Locked for Editing" Status

    In my previous post I described a problem I was having while implementing a generic SharePoint Document Library Event Handler. When you save a document from Office 2003 (for example Word 2003) into a SharePoint Document Library, the document item in the library is “locked for editing” as long as the Office 2003 application stays open. This can be a problem, for example when you want the Event Handler to update a field of the document item when it’s submitted to the Document Library. There are no problems when using the web interface, but when a user does this by using Office 2003 you’ll end up with the following exception:
    Microsoft.SharePoint.SPException: Document Locked
    The document you are attempting to edit is locked and cannot be updated.  It may be in use by another user or undergoing content indexing.

  • My SharePoint Workflow Pet Project Update

    Another day off, so another few hours to spend on cool coding stuff! In my last post I introduced you my new “pet project”: a generic SharePoint Document Library event handler that can be used for simple workflow and approval scenarios. Thanks to all the people who contacted me! Gerry posted a long reply in which he made the trade-off of developing your own workflow solution or buying a commercial product, and he would go for a commercial product. I appreciate Gerry’s opinion but let me set some things straight: it’s not my intention to compete in any way with commercial products like K2.NET, Teamplate or even BizTalk (although that would be cool ;-). They offer a lot more features, they have support and they are scalable and reliable. In the company I work for, we use Windows SharePoint Services to provide team sites to a group of people working on the same project. Sometimes there’s the need to have a very simple approval scenario, for which in my opinion the commercial solutions would be overkill and far too expensive (go talk to our management). Since we are a bunch of IT-people we can develop for each scenario a custom Event Handler implementation, which will work fine. But I just hate to create for each scenario a different Event Handler (I’m pretty quickly bored when doing repetitive work, you can ask Raf). That’s why I’ve come up with a more generic approach: a configurable Event Handler that will suit simple workflows. So will it be a better solution than the commercial ones: definitely not. Will it be as a reliable as the commercial products: probably not but I don’t intend to use it for critical processes. Will it be cheaper: I do think so since I’m developing it in my spare time (current rate €0.00 / hour, anyone want to pay more?) and configuration will be a matter of tweaking an XML file or something like that. Maybe the most important reason for me to start this project was the I’m intrigued by that kind of stuff. I want to know: can I make something like that, which problems will I have to conquer?

  • Simple Workflows and Approval Routes in SharePoint

    UPDATE: Visit the GotDotNet Workspace to download the engine!

    Quite a lot of people are asking if Windows SharePoint Services offers workflows and/or approval routes. The answer is: no, not out-of-the-box. You can fairly easy extend SharePoint and attach an event handler to a document library. This event handler is nothing more than a .NET class that implements the IListEventSink interface and contains some logic corresponding to the desired actions. For more information around this topic you can read Patrick Tisseghem’s excellent article, or  this article from the MSDN Library. The downside of this approach is that for each specific workflow or approval route you need to code an event handler.Unless you create something more generic and configurable: let me introduce you to my new “pet project”!

    I’ve created a generic event handler for SharePoint document libraries, that easily can be configured to create any workflow or approval route. Consider following approval route scenario to get an idea what you can accomplish with this event handler:
    There is a SharePoint site with three document libraries: Work In Progress, In Review and Reviewed. Contributors can submit documents in the Work In Progress library, every contributor of the site has access to that library. Documents in this library have a custom choice field, named Status with following possible values: Work in progress, Ready to publish and Declined. Once a document in the library gets the Ready to publish status (assigned by the contributor), the document will move to the In Review document library. Only people that are Reviewers can access this library. The library also has a custom choice field, named Approval, which can have these values: Approve and Decline. Once a Reviewer has reviewed the document, he or she can set the Approval property to Approve or Declined. When the document is declined, it will be moved back to the Work In Progress document library. When to document is approved it will be moved to the Reviewed document library, which can be accessed by every member of that site.

  • Bugfix for What's New Web Part & RSS Feed for SharePoint

    Several people reported some problems with the What’s New RSS Feed for SharePoint and the What’s New WebPart. When a user doesn’t has access to a SharePoint list, both components will try to obtain the necessary rights: the webpart will prompt for a new login and the RSS Feed will produce some “unexpected behaviour”. Before I jump into the technical details, here are the links to download the latest versions:

  • Creating InfoPath Processing Instructions in BizTalk Server 2004

    InfoPath has a little bit of magic in it. I’m not talking about the cool features for creating and using rich XML based forms, but I mean the magic that happens when you save the contents of an InfoPath form in a XML file. Although the result is just a file with the XML extension, it seems even the Windows Explorer is enchanted, it displays an InfoPath icon for the XML file. When double click the file, InfoPath will be opened, the corresponding InfoPath form will be loaded and the data from the XML file is showed in the form.

    So what’s causing of all this wizardry? If you open the XML file with Visual Studio.NET for example so we can see the actual XML content, you can see that are some XML directives (starting with ?mso) that you wouldn’t expect:

  • Generating RSS Feeds for SharePoint Sites

    UPDATED HERE!!

    Today I have a day off, so I decided to work a little bit on my “pet project”: RSS generation for SharePoint sites. Scoble asked for it when I released my RSS Reader Webpart. I know there are some good solutions for this problem available (for example from Siegfried Weber and DevHawk), but I was intrigued by this problem so I decided to craft one myself. Et voila: the What’s New Rss Feed for SharePoint was born (see the end of the post for downloads). I’ve re-used to logic of the What’s New Web Part to retrieve the latest changes on a SharePoint site so I won’t go into detail about that part of the code. The general idea behind this is that the code will go through all the lists on a SharePoint site (you can exclude specific lists) and retrieves the latest changed items (you can specify how many).