SharePoint 2007 - Web Deleted and Web Deleting Events
I am currently writing a backup/restore/disaster recovery document for my current project and am in the process of describing how there is no out-of-the-box way to recover a web if it is deleted. Some type of recovery process would have to be instigated whether it be SQL restores, or Central Administration restores to another web, or stsadm, you get the idea. Not necessarily something that would take 5 minutes is my point here. Well, I was doing a little research and while perusing the SDK, as I do now almost daily, I discovered the following snippet, much to my dismay!
SPWebEventReceiver.WebDeleted Method & SPWebEventReceiver.WebDeleting Method
Web site deletion events occur only for the first Web site in a chain of sites. For example, if a Web site at http://TopSite/Site, which has the subwebs http://TopSite/Site/Subsite1 and http://TopSite/Site/Subsite2, is deleted in Office SharePoint Designer 2007, only one deletion event occurs, namely, for the http://TopSite/Site root Web site.
Yikes! Although that makes complete sense to me on some levels it makes absolutely no sense to me on others. The only way to do "stuff" when these sub webs and their subwebs are deleted, etc... is to write some custom code to iterate thru the entire collection of sub sites when a web is deleted, put it into an event handler and hook it up to your site/site collection/web application/farm so that it fires when any web is deleted.
In other words, this would be a cool feature to write (I think). Maybe I will get right on that after I finish the million and one other things I have to do. Why didn't MSFT do it? Maybe there is something I am not thinking about as I write this post. Does anyone have any thoughts?