I'm currently building an app that will parse all of the Audit entries in a site collection and send out a pretty email to users.
My problem is that the emails should be based on a particular web (essentially an email summarizing the changes that happened to each subsite). Apparently, there is no information in the SPAuditEntry object about the web it came from except for the DocLocation property.
This means I can get any of the following DocLocations (ItemType = Document, Event = Update):
- sites/MySiteCollection/Documents/This is a test.doc
- sites/MySiteCollection/Reporting Templates/audit.xml
- sites/MySiteCollection/Lists/Reporting Metadata/1_.000
- sites/MySiteCollection/MySubSite1/Lists/Announcements/2_.000
- sites/MySiteCollection/MySubSite1/Template Documents/SampleTestEmail.doc
I'm thinking I can probably figure out the web from the URL by using SPSite.AllWebs.Names if I have to.
Q: How do I figure out which SPWeb a particular SPAuditEntry comes from?