Using Activity Feeds with the Object Model
Applies to: SharePoint Server 2010
Activity feeds are streams of social networking activities in Microsoft SharePoint Server 2010 that are generated, tracked, and displayed, both to the users who have generated the events and to colleagues who choose to follow the activities of other users. The activity feed stream generated by SharePoint Server 2010 is based on the .NET 3.5 SyndicationFeed object model. This means that activity feeds in SharePoint Server 2010 can be serialized to the Atom 1.0 and RSS 2.0 protocols, just like feeds generated by using the SyndicationFeed object model. For more information about how to syndicate activity feeds, see the CreateFeed, FillFeed, and CreateAndFillFeed methods of the ActivityEventsCollection class.
High-Level Object Model Design
An activity feed consists of ActivityEvent objects. Each ActivityEvent represents a single social networking activity (such as tagging a URL or rating a document or site) and contains all of the information needed to display it on a Web page. Each ActivityEvent object has an ActivityTypeID property that associates it with an ActivityType. ActivityType objects define the display for the events with which they are associated.
Each ActivityType object contains an ActivityTemplates property. This property contains a collection of ActivityTemplate objects. The ActivityTemplate class contains properties that connect it to display templates, defined in resource files, that you must create and deploy with any custom applications that you build for creating and gathering activity events in an activity feed. For instructions about how to create a resource file, see Creating Resource Files.
When you build custom applications for gathering existing activity events, you must start with the ActivityManager, which you construct from an instance of SPServiceContext. The ActivityManager contains methods for gathering all existing instances of ActivityEvent objects. It also contains a collection of ActivityApplication objects (in its ActivityApplications property).
The ActivityApplication object manages a collection of ActivityType objects. When you build custom ActivityType objects, you must create ActivityApplication objects to manage them.
For a code example that creates a custom activity gatherer, see Microsoft SharePoint Server 2010: Activity Feeds Console Application.