3

Looking at the documentation for UGC in Tridion SP1 2011, is it possible to dynamically query for "popular" content - so return all pages or components ordered by rating or number of comments?

The UGC commands seem to deal with comments/rating on an individual page/component - but not querying for content based upon that data.

Is something available in CD Web Service when you install UGC?

Cheers

Neil
  • 2,688
  • 1
  • 23
  • 32

1 Answers1

3

I can definitely answer this part of your question:

Is something available in CD Web Service when you install UGC?

Yes. When you install UGC, your CD Web Service will get new collections for these UGC item types:

  • Comments
  • ItemStats
  • Ratings
  • Users

You can get the most popular items like this:

.../odata.svc/ItemStats?$orderby=AverageRating desc

If you filter it first and then limit the number of results it'll probably result in a slightly faster query:

.../odata.svc/ItemStats?$orderby=AverageRating desc&$filter=AverageRating gt 0.0&$top=5

I expect that ItemStats are probably also available through the Java and .NET APIs.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks Frank. Reflecting on the DLLs I can see a Tridion.ContentDelivery.UGC.Web.Model.ItemStats and an Tridion.ContentDelivery.UGC.WebService.ItemStatsRetriever that can retrieve them for a given item URI - but it doesn't look like the APIs allow you specify any parameters like AverageRating - I guess we'd have to make this call like you've shown and handle the result ourselves. – Neil Nov 25 '12 at 20:46