Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm planning on implementing a system in MOSS 2007 that allows end users to rate and comment against each page on the site. I plan to create a comments list which has column to store the pages URL. I can foresee the situation however when a page has its URL changed or the page/site gets moved that it will lose a reference to all of its comments etc.

I could feasibly write an event receiver that watches for URL changes but I'm not sure I can capture site or page moves? Is there another identifier that would allow for 2 way referencing? i.e. A page can lookup all of its comments and a comment can find which page it was related to?

FYI - we have a fairly large site with 100's of subsites each with their own pages library. So any event receiver would need to be deployed across the board...

Thanks.

share|improve this question
add comment

2 Answers

You could use the SPFile.UniqueID

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.uniqueid.aspx As everything in a Sharepoint list is probably an SPFile, you can get the UniqueID of, well, every file in the lists.

We use this guid to maintain a list of url's of the pages and it works quite well.

share|improve this answer
add comment

Well i would suggest you to have a column created in you content type eg. PageUniqueID (text type) from which you inherit your page from. This can be a simple text field. Further you can write some code that generated a unique GUID and puts it into PageUniqueID field as soon as you create a page. Now in your comments list you can have a SourcePageID (text type) field where for each comment you could track its source page via this GUID value rather then its URL. Thus even if you move your site or page, your PageUniqueID would always be same and would always stay connected with the comments list and vise versa.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.