Initial Thoughts

Aug 11, 2008 at 9:32 PM

After some intial testing, this project looks pretty good. I'm impressed with the completeness of the project - good documentation, wsp ready for install, and fitting in seamlessly with the MOSS interface - if you didn't know, you'd think it was part of the product. Here are a couple observations and a question:

I couldn't get the restore working without first installing SP1; I assume everyone has that installed by now, but I started on an almost clean VPC, and was getting rather confused until I installed the service pack. The export seemed to be happening, but no import/restore.

Have you done any testing on database growth rates? Since this is only an 'alpha' release, I suspect not, but it's something to bear in mind, particularly on large farms and if the include dependencies box is checked.

My question - in good stsadm extension tradition, do you have a custom stsadm extension that will set the web part page history on a document library? I might have quite a few I may need to configure this on.

Thanks for all your hard work,

Nathaniel Suda

Aug 17, 2008 at 4:30 PM

Nathaniel - thanks for your help with testing this and providing some feedback!  To answer your questions - no, I've not yet done any testing of database growth but you're right that it should be something that users should be mindful of.  I've also not created an STSADM command to enable this but it's a good idea and if I have time I'll look into it.  Also - all my testing was done on SP1 - I'd really encourage people to deploy SP1 if you haven't already, there's just too many fixes in it.  I do need to do some testing against the infrastructure update but haven't had time as of late.

Thanks again for your feedback - it's most appreciated!!!


Sep 5, 2008 at 8:14 PM

Many thanks.  I'm using Telerik's RAD Editor and found I needed your WSP to allow my users to 'revert back to a prior posting' and get the RIGHT Telerik RAD Editor content.

Now I am thinking a little higher up the food chain and need your help.  Here's where I am stuck.

I see in your documentation that I have to manually set the Web Part History Settings  (enable web part page history = true).

Do you know if there is any way I can code this into a feature?  See I already have a feature that installs a custom workflow and sets the search visibiltiy to "always include ASPX" pages.  All of this is kinda standard stuff.  So what I'd like to do is autmate these settings too.

Is there a way in Code to get access to your Enable Web Part Page History setting?


Sep 6, 2008 at 3:21 PM
Tom - thanks for the feedback - to enable the history for a list via code all you have to do is add the appropriate event receivers.  Take a look at the source of the ListSettingsPage.cs file (in the ApplicationPages folder of the source) - you should be able to easily pull out the elements you need in order to add the event receivers.  If you think there's a benefit to it I could look into pulling this code out into a helper class that could be called from an external assembly referencing it.
Sep 9, 2008 at 8:23 PM

So far so good with the WPH solution - with one exception. On one site collection it doesn't work. What I mean by that is the versions are being created without problem, but they are not restoring. Initially the server didn't have SP1 installed (forgot to check again), so I installed it, but no change. I've created a new site collection on the same box, and on that new site collection web part versions restored without a problem. I've looked through the SharePoint logs, but couldn't see anything. Do you have any thoughts as to why one site collection won't restore web part versions but another will? I've tried reinstalling the feature, creating new webs, but no luck.

Best regards,

Sep 10, 2008 at 3:50 AM
Nathaniel - thanks again for all your feedback - to be honest I'm not sure why the restore isn't working.  It's almost like the event receivers are picking up the event or something which doesn't make sense because you said that it's at least storing the version history.  Is there any possibility that you can step through the code with visual studio to see where it's failing or else send me an export of the site collection that's failing?
Sep 24, 2008 at 12:06 PM

Thanks for your reply, I only just saw it last night - I must have missed the email update. I didn't manage to get to the bottom of it, but I suspect it has to do with the event receivers not attaching properly - or the ItemUpdated event being bypassed - possibly to do with a property of the item. I'll let you know how I get on.

One other thing I thought I'd mention - when I downloaded the source and tried to build, it threw a few errors. The problem was the reference to Microsoft.SharePoint.ApplicationPages. For those like me who haven't worked with this class (or even knew it existed), you can find it here:

C:\inetpub\wwwroot\wss\Virtual Directories\<your site>\_app_bin

There are a few others in there which look interesting. Once the reference was pointed to the correct directory, the project built successfully.

Best regards,


Sep 24, 2008 at 9:19 PM

I found the source of the problem, but I'm not sure why it's failing.

The following line of code in ItemUpdating gets hit on a restore action:
properties.AfterProperties["VersionID"] = "RESTORE_" + properties.AfterProperties["VersionID"];

But ItemUpdated exits on these lines
if (!properties.ListItem.Properties[HistoryHelper.PROP_VERSIONID_KEY].ToString().StartsWith("RESTORE_"))

I managed to use a temp file on the file system to check if the event was a restore or a simple update, clearly that isn't ideal, but it should work reasonably well. Any thoughts? Again, I'm only having this problem with one site collection.

Best regards,