Welcome to MSDN Blogs Sign in | Join | Help

How We Did It: NewsGator Social Sites 2.0 - Enhanced Social Computing on the SharePoint Platform

Overview

NewsGator Social Sites extends Microsoft Office SharePoint Server 2007 with social feedback (i.e. bookmarking, tagging, commenting), social networking, and community functionality by leveraging the SharePoint platform and social computing services provided by NewsGator Enterprise Server. SharePoint is a great foundation for social computing application development and can be easily extended through web parts and web services.

Before we get into the technical details of how the Social Sites product was developed, let's talk about the business problems that we are trying to solve, which include:

  • Provide a unified user experience for information aggregation, discovery, and consumption as well as social feedback.
  • Enable cross-organization online communities that facilitate ad-hoc collaboration as well as knowledge capture and sharing.
  • Improve people and expertise finding by extending the SharePoint user profile system to include additional information about the user as well as the user's activities.
  • Optimize the SharePoint user interface to provide a more dynamic and intuitive user experience.

To solve these problems, our developers implemented a rich set of XML endpoints that extend the SharePoint runtime and make data available to AJAX enabled web parts. We also implemented a set of AJAX enabled web services and a JavaScript library to abstract these calls. Finally, we implemented it all with lightweight web parts using the open source SharePoint AJAX Toolkit that use simple XSLT rendering along with a common NewsGator script library built with ASP.NET AJAX.

To create cross-organizational communities, we used these same AJAX components but packaged them together into a community oriented bundle, and extended the SharePoint team site model with a set of templates and community metadata that integrate with the NewsGator enterprise feed server. We also extended the security model of SharePoint to allow for public communities where the community can manage its own security. Because the security and collaborative needs can vary from one organization to another, we implemented all of the functionality as SharePoint Features that can be deployed, enabled, and controlled according to an organization's governance policies—whether it's a free-for-all model like we use on our own intranet, or a locked-down model like some of our customers in the financial services industry, or somewhere in between.

SharePoint Content Enhancements

Tagging, Read State, and Relevance

Sitting on top of SharePoint's content rendering layer, we've implemented a syndication-based extension layer that adds tagging, read state, and relevance metadata. By enabling read state universally, a user can choose to dismiss items as read, and can always see a fresh stream of information in SharePoint. The rich metadata layer is available through an RSS API at the site level, such as http://sharepoint/site1/list.rss?feed=announcements, which would return an optimized version of the RSS stream for the Announcements list with added NewsGator metadata including read state, relevancy, and tagging. We chose RSS as a core platform component based on the RSS support built into SharePoint and the seamless integration with our own web services. In a web part, the Announcements RSS feed might look something like the following:

We've also included an AJAX-enabled API for tagging and read state that is available both as web services and through a supported JavaScript library. The JavaScript library is integrated into the user interface as the view is rendered with XSLT using the SharePoint AJAX Toolkit, and can also be integrated into custom views as well through our JavaScript API. Here's what the AJAX architecture of the SharePoint list view looks like, where we get content from SharePoint, glue metadata on top of it, and return it to the client through the AJAX framework.

While our web parts include slightly more code, the basic web part extends the XmlWebPart of the SharePoint AJAX Toolkit and simply includes the XML endpoint, the XSLT endpoint (used for a client side transform), and the JavaScript library for NewsGator's Social Sites API. The SharePoint AJAX Toolkit makes AJAX web part programming really simple for our developers -- in the web part, the developer can specify the XML endpoint and the XSLT source, any custom JavaScript, and then the web part just takes care of the rest. If you'd like to implement a custom AJAX web part based on our API, you could use the following code:

using System;

using System.Web.UI;

using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint;

 

namespace Litware.NGWebParts

{

    /// <summary>

    /// An example web part

    /// </summary>

    public class SocialAnnouncentsWebPart : SharePoint.Ajax.WebParts.XmlWebPart

    {

        protected override void CreateChildControls()

        {

            base.CreateChildControls();

 

            // Include the NewsGator socialsites runtime-- includes the Social Sites JS files:

            this.Controls.Add(

                new NewsGator.Enterprise.SharePoint.WebParts.ClientRuntimeControl()

                );

           

            // Add the Litware Social script library:

            this.AtlasScriptManager.Scripts.Add(

                new ScriptReference("/_layouts/Litware/LitwareSocial.js"));

 

        }

        /// <summary>

        /// Use this to set the XML/XSLT paths, typically from Web Part properties.

        /// </summary>

        protected override void OnPreRender(EventArgs e)

        {

            base.OnPreRender(e);

            this.XmlUrl = SPContext.Current.Web.Url +  "/list.rxx?feed=announcements";

            // Usee a custom XSLT

            this.XsltUrl = "/_layouts/Litware/XSLT/announcements.xslt";

        }

    }

}

Using this same approach, you can build custom versions of many NewsGator Social Sites data objects that are exposed as XML; including the Social Profile (an extension of the SharePoint User Profile), a syndication subscription list, communities that users are members of, tag clouds, or syndicated feeds of SharePoint content or of content from other RSS enabled data sources. Security is implemented throughout the NewsGator code that runs in SharePoint as well as the NewsGator Enterprise Server, which is the feed server that provides RSS, ATOM, OPML, and tagging for various data sources. Our API includes the following XML feeds, all of which are implemented in various web parts and AJAX controls in Social Sites: subscription list, SharePoint list feed, reading list (a group of internal and external feeds scoped to the SharePoint site level and available through OPML or a single aggregated feed), colleagues, SharePoint user profile data, site feeds (OPML for the SharePoint's syndicated feeds), trending data, and more. One of our favorite "easter egg" endpoints is Lawrence Liu's OPML, which contains a list of feeds that he maintains for the worldwide SharePoint community. The OPML is available publicly at http://services.newsgator.com/sharepoint/opml, but it's also available within the SharePoint context via Social Sites as the local endpoint: ll.opml.nges.

All of our service endpoints run within the SharePoint application to integrate with SharePoint's site context and security and also to enable AJAX integration from the Microsoft AJAX Library. Since we use the SharePoint AJAX Toolkit as our user interface library, we're able to implement and reuse most of our rendering/presentation logic through common XSLT files. Hence, we can focus more of our development efforts on creating the backend services utilizing SharePoint's API. This lets us quickly roll out new features by exposing new endpoints and writing a minimal script library. For example, the AJAX forums components that we're shipping in Social Sites 2.0 utilize the SharePoint Discussion Lists as the backend services. SharePoint provides a great foundation for custom applications by providing the security context, site context, and data storage, while its APIs make it easy to integrate custom solutions on top of the platform.

NewsGator Enterprise Server has had one of the best feed readers in the market. Adding the feed reader into SharePoint to provide a seamlessly integrated user experience just made sense—so in Social Sites 2.0, we're introducing the My Feeds reader, which brings all of your feed subscriptions into a single view within SharePoint. Here's a screenshot:

Integrating the reader was simple with the help of the SharePoint AJAX Toolkit and the APIs we already exposed—we simply transform the OPML of feed sources including your subscriptions or SharePoint site feeds, and then use the JavaScript API method SPNGES.NewsReader.Read(xmlUrl) to instantiate the reader. We implemented the reader with the following components:

  • A SharePoint ASPX page deployed as a Feature.
  • The existing Social Sites OPML and RSS API endpoints to enable feed lists and RSS content views.
  • Custom JavaScript for paging, resizing images, and social metadata.

Extending Team Sites for Social Sites Communities

SharePoint sites are a great way for people to come together to collaborate on a project, activity, or pretty much anything. When we wanted to implement online communities in Social Sites — an extension of the SharePoint team site just made sense. To create communities, we extended the team site with community metadata and integrated membership with NewsGator Enterprise Server, enabling group collaboration through community tagging, social bookmarking, and feed item interaction. We also integrated some custom web services for community interaction and made them available to the JavaScript API.

Before we talk about the technical implementation, here's a screenshot of a community straight from our Social Sites "dogfood" environment at NewsGator:

To implement the community functionality, we decided to create pages within a Feature that we could include in a site definition or access programmatically. So every tab in the community — Overview, Discussions, Feeds, Social Bookmarks, Members, and Documents — became a page that integrated a set of AJAX components pulled from our existing API. Here's what the CommunityPages development project structure looks like in Visual Studio — note that we're also using a Feature Receiver, so we can process the community on the server as well:

We also wanted to give our customers a way to extend the community functionality. While you can associate Features with site definitions, there isn't an out of the box way to associate Features with other Features. To address this and let our customers extend the community Feature, we came up with a Feature Stapling technique that lets customers implement custom Feature Receivers that are added onto our base Feature. To do this, we look for a Feature that has the feature name of our feature plus the ".Handler" extension. This lets our customers do anything they want to the community Feature such as adding pages, web parts, lists, or whatever else through the Feature Receiver. Here's the code for our Feature Stapling technique — feel free to leverage this in your own custom SharePoint applications:

using System;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Administration;

 

namespace NewsGator.Enterprise.SharePoint.Configuration

{

    /// <summary>

    /// Handles NewsGator initialization of the community creation.

    /// </summary>

    /// <remarks>

    /// </remarks>

    public class CommunityCreationFeatureReceiver : SPFeatureReceiver

    {

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { }

        public override void FeatureInstalled(SPFeatureReceiverProperties properties) { }

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { }

        public static Guid? CommunityReceiverGuid { get; set; }       

 

        /// <summary>

        /// Adds an extensibility hook to the community creation feature.

        /// </summary>

        /// <param name="properties">

        /// SPFeatureReceiverProperties represents the feature activation scope.

        /// Parent will return the Web

        /// </param>

        public override void FeatureActivated(SPFeatureReceiverProperties properties)

        {

            using (SPWeb web = properties.Feature.Parent as SPWeb)

            {

                if (CommunityCreationFeatureReceiver.IsCustom)

                {

                    web.Features.Add(CommunityReceiverGuid.Value);

                }

            }

        }

 

        private static object _isCustomizedLocker = new object();

        private static bool? isCustomized = null;

        /// <summary>

        /// Determines if there is a customization feature for this feature.

        /// </summary>

        /// <returns>true if a customization feature is installed, otherwise false</returns>

        public static bool IsCustom

        {

            get

            {

                if (CommunityReceiverGuid.HasValue

                    && CommunityReceiverGuid != Guid.Empty)

                    return true;

                else

                {

                    lock (_isCustomizedLocker)

                    {

                        try

                        {

                            SPFeatureDefinition customFeature =

                                SPFarm.Local.FeatureDefinitions[
                                   
"NewsGator.CommunityPages.Handler"];

                            if (customFeature != null)

                            {

                                CommunityReceiverGuid = customFeature.Id;

                                isCustomized = true;

                            }

                            else

                            {

                                isCustomized = false;

                                ReceiverGuid = Guid.Empty;

                            }                        

                        catch { isCustomized = false; ReceiverGuid = Guid.Empty;}

                    }

                    return isCustomized.Value;

                }

            }

        }       

    }

}

By leveraging the following components — the SharePoint platform and site framework, NewsGator Enterprise Server, a custom XML API that is targeted for AJAX application, along with the Microsoft AJAX Library plus our own AJAX framework extensions — we've been able to produce a highly effective social software application for the enterprise.

For more information about the SharePoint AJAX Toolkit, go to http://www.codeplex.com/sharepointajax. Note that this toolkit isn't a NewsGator product; rather, it's an independently maintained open source project.

For more information about NewsGator Social Sites, go to http://www.newsgator.com/Business/SocialSites.

Developing Social Software on the SharePoint Platform

If you're interested in developing social software on the SharePoint platform, here is a short list of guidelines from the NewsGator Social Sites development team for writing social software on the SharePoint platform.

  1. Embrace the SharePoint site architecture. SharePoint's site model provides the social context of the web application.
  2. Use SharePoint Features. Not all customers are going to want all of the features that your software provides, and not all customers will deploy them in the same way. SharePoint Features give the customer the power to implement your solutions as they see fit.
  3. Use the SharePoint user profile data and My Site functionality, which provide a rich person centric view of content and activities as well as a great extensibility point.
  4. Use common XML-based data formats when possible -- including RSS, ATOM and OPML -- enabling loose integration with third party servers and components as well as extensibility via custom development.
  5. Use AJAX functionality to provide a more interactive and efficient user experience.

About the Authors

Daniel Larson is a software minion at NewsGator, a co-author of the popular SharePoint developer book Inside Microsoft Windows SharePoint Services, and an active SharePoint MVP. Keep up with Dan via his blog at daniellarson.spaces.live.com.

Ashley Roach is a product manager at NewsGator and a connoisseur of fine wine. Keep up with Ashley via his blog at apr.vox.com.

Published Sunday, June 08, 2008 2:00 PM by sptblog

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# &raquo; How We Did It: NewsGator Social Sites 2.0 - Enhanced Social&#8230; A Side: What The World Is Saying About A Side

# Repost: how we did NewsGator Social Sites 2.0 - Enhanced Social Computing on the SharePoint Platform

Monday, June 09, 2008 3:42 AM by Roberdan

# NewsGator Social Sites Social Computing mit SharePoint

Ich teste gerade Newsgator Social Sites , die die SharePoint Plattform um verschiedene Web 2.0 Funktionen

Monday, June 09, 2008 7:09 AM by SharePoint, SharePoint and stuff

# NewsGator Social Sites Social Computing mit SharePoint

Ich teste gerade Newsgator Social Sites , die die SharePoint Plattform um verschiedene Web 2.0 Funktionen

Monday, June 09, 2008 7:55 AM by Mirrored Blogs

# SharePoint and Web 2.0, Enterprise

Web2.0/Enteprise2.0/Social Software A. Free Tools, AddOns and Solutions 1. Community Kit: Enhanced Blog

Monday, June 09, 2008 7:58 AM by SharePoint, SharePoint and stuff

# Link: How we did Social Sites 2.0

Today, we&#39;re shipping NewsGator Social Sites 2.0. Check out my guest post on the Microsoft SharePoint

Monday, June 09, 2008 2:35 PM by Mirrored Blogs

# re: How We Did It: NewsGator Social Sites 2.0 - Enhanced Social Computing on the SharePoint Platform

Feature activation dependency (associating features with other features) is in fact available out of the box with SharePoint, right?  http://blogs.msdn.com/mcsnoiwb/archive/2008/05/28/hidden-features-and-dependencies.aspx

Otherwise, great writeup.

Tuesday, June 17, 2008 2:02 PM by Mike M

# Repost: how we did NewsGator Social Sites 2.0 - Enhanced Social Computing on the SharePoint Platform

Friday, June 20, 2008 12:13 PM by Microsoft SharePoint Bloggers

# DHTML and AJAX in sharepoint sites (wss v3)

Hi, I am trying to add the Similie Timeline http://simile.mit.edu/timeline/docs/create-timelines.html to my sharepoint site using the Content Editor Web Part.  I have entered the code but had little success..[object error], any suggestions?

Monday, June 30, 2008 10:39 AM by Eric

# SharePoint My Sites Suck

OK, before we get started, let me admit up front that it is totally unfair to pick on My Sites at this

Thursday, April 16, 2009 2:53 PM by The Bamboo Team Blog

# SharePoint My Sites Suck

OK, before we get started, let me admit up front that it is totally unfair to pick on My Sites at this

Thursday, April 16, 2009 2:54 PM by The Bamboo Team Blog

# SharePoint and Web 2.0 Enterprise

Web2.0/Enteprise2.0/Social Software A. Free Tools, AddOns and Solutions 1. Community Kit: Enhanced Blog

Thursday, June 18, 2009 6:48 AM by Michael Greth [SharePoint MVP]

# re: How We Did It: NewsGator Social Sites 2.0 - Enhanced Social Computing on the SharePoint Platform

Monday, August 03, 2009 8:01 AM by web tasarım

# web tasarım

Wednesday, August 05, 2009 2:14 PM by web tasarım

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker