The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Customized Content Rating for SharePoint

By: Andrew Gelina
Jan. 28, 2009 08:01 PM

I wanted to share with you a recent client undertaking involving adding "star rating" and comments to SharePoint content.  As usual, clients prefer not to build everything from scratch, so I looked what was available via 3rd party options and found 2 potentially viable solutions:

SharePoint Document Rating System  from codeplex:  http://www.codeplex.com/spdocrating and a licensed offering from KwizCom:  http://www.kwizcom.com/

At the time, the codeplex solution seemed a little more difficult to deal with, requiring content types and multiple columns in a list to function.  These column also appeared to be based on non-standard formats, and it was not straightforward to use the columns as managed properties to create more fine-tuned search options.

Since the KwizCom solution was simply a custom field type installed into SharePoint based on a common decimal base type, it seemed much easier to implement.  The downside was that it was some custom code, not open source, and it was entirely obfuscated so when I needed to make some adjustments based on my requirements, I was really stuck with what they gave me.  Here's what I did in case someone is thinking about doing this:

I added their custom field to my SharePoint environment and created a site column from it called Ratings.  Below is a screen shot of what this looks like in a list/library

ratings1 ratings2

The above shows what the column looks like and what it shows you when you hover over the item.  When you click on the item you get a pop up where you can rate and read comments similar to this:

ratings3

ratings4

Ok, so the easy part is done:  Install the product and add it to a list, and fill out some data.  They give you that for free :)  Now I had to come up with my own solution for the next 2 problems.  First, I needed to include the ratings for documents in search results.  It turns out to be pretty easy, but there were a couple wrinkles.

1.  I had to copy some images over from the KwizCom installation location to where the layout images live in the 12 hive here:  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES

2.  Then I had to modify the Search Results page (Search Core Results) to include my column in the XML, and then add a series of XSL "when" to display the star rating image AND the link to the comments as this was a requirement.

<xsl:when test="contentrating='1'"> - <img align="top" style="cursor:pointer;" onclick="window.ratingelement=this.parentNode;commonShowModalDialog('/_layouts/RatingRedirect.aspx?ItemURL={url}&amp;SiteName={sitename}&amp;a=1' ,'dialogHeight:450px;dialogWidth:350px;scroll:no;toolbar:no;status:no;resizable:no;', null, this.parentNode);" src="_layouts/KWizCom_RatingSolution/Images/1.0.gif"/></xsl:when>

The savvy of you may look at this XSL and wonder what "RatingRedirect.aspx" is.  Well, this is something I had to come up with because the KwizCom code is locked down.  Essentially I had to write a gateway page that took the querystring data available in the search results page and send it to a location that had the ability to look up the proper data required by the KwizCom page to load rating details.  The aspx page code I wrote looks like this:

public partial class RatingRedirect : System.Web.UI.Page
   
{
       
protected void Page_Load(object sender, EventArgs e)
       
{
           
ProcessRedirect();
       
}

       
private void ProcessRedirect()
       
{
           
string itemURL = Request.QueryString["ItemURL"];
           
string siteUrl = Request.QueryString["SiteName"];
           
string destination = Request.QueryString["a"];

           
using (SPSite mySite = new SPSite(siteUrl))
           
{
               
using (SPWeb myWeb = mySite.OpenWeb())
               
{
                   
SPListItem item = myWeb.GetListItem(itemURL);
                   
if (item != null)
                   
{
                       
if (destination == "1")
                       
{
                           
Response.Redirect(item.Web.Url + "/_layouts/KWizCom_RatingSolution/RatingPopup.aspx?itemId=" + item.ID + "&listId={" + item.ParentList.ID + "}");
                       
}
                       
else if (destination == "2")
                       
{
                           
Response.Redirect(item.Web.Url + "/_layouts/KWizCom_RatingSolution/CommentsPopup.aspx?itemId=" + item.ID + "&listId={" + item.ParentList.ID + "}");

                       
}
                   
}
                   
else
                   
{
                       
Response.Write("<br>   Sorry, this item cannot be rated.");
                   
}
               
}
           
}

       
}
   
}

The basics here are that I need to some ListItem data that is completely unavailable at the search results page.

Also consider that only list items can contain ratings.  Much of the unratable content can be exluded from search results using contentclass exclusions in your search scopes, but the one that tripped me up was a standard site aspx page.  If the page did not live in a library but was returned in search results, it would display with zero ratings.  When a user clicked on the details they would receive an error because this was an unratable item.  You see my rudimentary error handling section in the code above to at least inform people about the status.

We also added a higher level check in the XSL to only return rating data from content sources that actually had the rating installed.  Other SharePoint web applications or site collections within the SSP that does not contain rating data needs to be excluded.

These changes allowed my search results to show the ratings details AND allowed users to view the comments AND add their own comments right from the search results page.  The only hiccup is that until another crawl is run, the changes won't be shown in the search results because that data is pulled from the index and not in real time.  A small price to pay.

ratings5

Finally, I had to deploy this.  Essentially the client wanted to add this to any document libraries that already existed in their site collection.  It seems every client requires me to write a tool that iterates over a site collection and checks for something in each web/list.  It's either inheritance, permissions, features, etc. that need to be set for every list if some condition is met.  So I had some code I could re-use.  I won't paste the whole thing here, but it was pretty simple:

I iterated over every site and did the following:  checked for each list to see if it inherited from base templates of document library or link lists.  If so, I iterated over the fields to see if the Rating field was present.  If not, I would add the field to the list, then add it to the default view of the list. 

Then you have to "tickle" the list, and un-tickle it.  This one was critical.  Due to the nature in which this data is stored, there is an inherent bug with the KwizCom solution.  Their design created a hidden list per web that holds the rating data.  This list is not created until a least one rating is made in the web.  This code must not run with elevated permissions because users without proper permissions to create the list will receive an error.  It's odd that they missed this because their solution only requires read access in order to rate items, so they must have written elevated permission code elsewhere in their solution.

At any rate, the tickle adds a rating to the first item in the list, updates the item, then removes the rating.  This ensures the container list exists moving forward.

All in all it did not take too long to implement and the 3rd party price was pretty inexpensive.

I hope this helps,

-Ryan Thomas

Read the original blog entry...

Published Jan. 28, 2009— Reads 871
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Andrew Gelina
Andrew Gelina brings over 12 years of software architecture and development experience to his role as CEO of Syrinx Consulting, where he is responsible for the strategic direction, technology focus, operations management, and growth of the firm.

Prior to joining Syrinx in 2003, Andrew helped build Web Technology Partners into a leading software engineering consulting firm before selling it in 2000 to Monster.com, the global online career and recruitment resource. During the next three years at Monster, he developed software and managed projects for virtually every area of Monster's operations, from CRM integration to e-commerce to high-traffic, high-volume Web development. He also worked closely with Microsoft to scale its .NET platform to Monster's huge transaction volumes.

Andrew has also worked in several other areas of technology leadership, performing technical due diligence for companies considering acquisitions and selling professional services. He started his career at EDS, helping them develop cellular billing and switch interface software to support the emerging wireless industry.

He graduated cum laude from the University of Massachusetts at Amherst, where he received a bachelor's degree in operations management. Andrew is a member of the CEO Roundtable of the Massachusetts Technology Leadership Council.

Andrew and his 35-member team work on-site with clients all over New England.

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
Teamsters' Drive Up Standards Bus Campaign Reaches Milestone 300th Win
Chrysler Group's 'It's Halftime in America' Super Bowl Video Earns Second Place in YouTube's Ad Blitz 2012 Contest
U.S. Census Bureau Daily Feature for February 18
U.S. Census Bureau Black History Month Feature for February 18
Following Is a Test Release
President of the Independent Libya Foundation Announces Vision Statement for Libya on the Anniversary of the Libyan Revolution
Former Congressman and Dukes of Hazzard Star Ben Jones Blasts Nascar Decision

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window