SIGN UP MEMBER LOGIN:    
ARTICLE

Working with SharePoint Ratings

Posted by Bhushan Gawale Articles | SharePoint August 26, 2011
As we know that with the launch of SharePoint 2010 version, we got new social features like content tagging and content rating. For content ratings, we can rate the different contents in the list and libraries in range of 0 to 5.
Reader Level:

Recently I was doing some R&D with the SharePoint Ratings and so thought to share my thoughts.

As we know that with the launch of SharePoint 2010 version, we got new social features like content tagging and content rating. For content ratings, we can rate the different contents in the list and libraries in range of 0 to 5.

For example: I have a publishing site and the pages library, so I need to have functionality such that the end users should be able to rate the pages inside the pages library.

How to do this?

For any list or library, there is a link to set the rating capability. When you go to the List and then in its settings, there you can see the link named as "Rating Settings". After you click on that, a page opens where you can enable and disable this setting.

Ok so far so good. ? But what happens in the background?

Well, I have observed that when you enable ratings on any list or library, the two Site Columns/Fields gets added to the SharePoint list. Obviously those get added to hold this rating as a metadata.

Which are those fields?

Field names are:

Display Name Internal Name GUID
1. Rating (0-5)   AverageRating  {5a14d1ab-1513-48c7-97b3-657a5ba6c742} 
2. Number of Ratings  RatingCount  {b1996002-9167-45e5-a4df-b2c41c6723c7} 

                                                        
And here is the screen shot after enabling the rating on pages list

Pages_ImageLib.jpg

Rating is the asynchronous event and we talk about social features, they gets saved in social database which gets created when you have activated the user profile service application. So in short, to use rating you should have a user profile service running in your farm.

There is one timer job "User Profile Service Application - Social Rating Synchronization" job which by default runs after every hour and aggregates all the ratings.

Why ratings disappear after page refresh?

I was also puzzled by a question that when we try to rate a page in pages library and then refresh the page, ratings given were disappearing. Why?

So answer is the Timer Job. As this job runs every hour, so unless and until the job has run and aggregated the ratings, we don't see the ratings which were given. So I changed the job schedule to run every minute to have immediate effects.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor