Archive for July, 2008

Frustrations with Check in/Check out event handlers

Thursday, July 31st, 2008

I wanted to write up some notes about a recent frustration I’ve had with Sharepoint 2007 events. I was asked to develop a (fairly simple) method of replicating the check in/check out event between a master Sharepoint site and several replica sites (Where the Sharepoint data has been replicated using my company’s own software). I’ve implemented a fairly simple system involving an event handler installed on the replica machines and a web service on the master. The concept is straightforward enough, and ensures that users are unable to check out documents that are already checked out elsewhere and that checked in data is up to date (as well as handling version numbers and undo check-out requests!).

The check in/check out system is not the focus of this blog entry. The frustration I spoke of earlier involves the SPItemEventProperties ErrorMessage property which can be set when you override the synchronous/asynchronous event functions.

So I have a class like this:


public class CheckingEvent : SPItemEventReceiver
{…
public override void ItemCheckingOut(SPItemEventProperties properties)
{
// business logic ……
// if something bad happens{…

properties.Cancel = true;
properties.ErrorMessage = “Isn’t this a bit buggy for an enterprise system?”;

;}

..Please excuse lack of indenting, I am still fighting with WordPress to be able to display code in a presentable fashion..

Updating the ErrorMessage property like this would normally display the error message within the browser…nice. Except in this case, checking out, it doesn’t work due to a bug in SharePoint! Instead we are treated to a message box appearing proudly displaying the words “Attempted to read or write protected memory“. Smashing..not..

At the moment, even with all the current service packs installed I can’t get the error message to appear correctly.

Currently the ONLY workaround I have found is to implement:

properties.Status = SPEventReceiverStatus.CancelNoError;


..instead. Which will display the standard error message. “You may not have permission to check out the document or it is already checked out or locked for editing by another user.” which isn’t great, but it at least makes my solution usable until Microsoft fix the bug.

Tags: ,
Posted in Sharepoint | 1 Comment »


Microsoft Sharepoint Office Application Developer Exam 70-542

Tuesday, July 22nd, 2008

While I was studying for the 70-542 Microsoft Office SharePoint 2007 Application developer exam, I became increasingly frustrated due to the lack of quality consolidated information on the web concerning the exam format and where to find information that would actually be relevant.

Having now passed the exam, I’ve written up my study notes here so that people who legitimatly want to study for this test can get a little bit of guidance. Good luck!

Tags:
Posted in Sharepoint | 8 Comments »


Removing SharePoint 2007

Monday, July 7th, 2008

I spent most of the day trying to un-install SharePoint completely from the only half decent development machine available to me.

The problem was that I installed MOSS over a working WSS site that had originally been installed over a working SharePoint 2003 portal site (This has been the only decent development machine available to me for a long time!!) This caused all sorts of horrible things to happen:

  • I couldn’t uninstall MOSS/SharePoint 2007 services from add remove programs (It pretty much ignored me).
  • In an attempt to resolve the above issue I reinstalled IIS, thinking that it would work if I cleared out all the sites and application pools. BIG MISTAKE.
  • In an attempt to fix the above, I ran the MOSS configuration wizard again which fell flat on its face.
  • Attempts to remove the server farm configuration from the command line tools failed. Probably due to the above three points.
  • Attempting to run the installer again failed, probably due to most of the above points.

Anyway, to cut a very long and boring story short. I found this (oh look somebody else using wordpressy-press-press thingy) on the web: Uninstalling MOSS 2007 manually

Basically, shutting down every SharePoint 2007 service left over. Removing a handful of registry keys, and deleting most of the left over directories, should be enough to allow you to run the installer again and start afresh. Blindingly obvious really when I think about it.

Tags:
Posted in Sharepoint | No Comments »


Why do people insist on BLOGGING everything?

Saturday, July 5th, 2008

Okay, so after many years of faithfully servicing the world with nothing – I have uninstalled the wonderfully simple ‘wheat blog’ software, flawed as it was. Against my better judgment I have installed the hugely popular and rather shiny word-press instead.

If I were the kind of person to use expressions such as “Paint me impressed” I would do so. Now. It’s very obvious why this is the most popular blogging software. It is polished like new school shoes, with every tiny feature subtly included and neatly presented. I no longer have to type anything in a text editor first, for example, everything is neatly spell checked – or underlined with available suggestions. I can add any kind of media I choose without having to edit any poncy HTML although the option to do so is readily available at the touch of a shiny blue button. Even though this blog will probably never be read by any individual possessing anything remarkably near sanity, it is all – in fact – good.

I must go and continue studying for my ridiculous Microsoft certification exam now.

Posted in General | 1 Comment »