Social Architecture of SharePoint
Paul J. SwiderCTO
Level: Intermediate
Agenda Community Sites
Template Creation and ManagementDiscussions and ModerationDiscovery and MembershipReputation Model
Agenda (Continued) My Site
Microblogging, statusFollowingTasks
OM and Programming API’s
MY SITE
My Site Host – Home Page
Profile (person.aspx)
My Site Hubs
• Hubs are found in global navigation• Newsfeed (security trimmed)
– Following – Everyone– Mentions
• SkyDrive– Recent Documents on Office 365
• Sites
Search Posts and Feeds
• Can be used instead of REST• Developer topics
Following Sites and People
• Following Infrastructure is the same as 2010– Stored in User Profile Database– 2 Million Items per UP Database
• Integration with Consolidated Feeds Web part
• People can see who are their followers
Following People
• Ability for users to receive system notifications for a site
• Site conversations and activities are received in consolidated feeds web part
• Site Admin can control at library level
Following Sites
• Track and get information on document changes and activities
• When a document or metadata changes new system feed is posted– People following get notified– Not meant to replace alerts
Document Following
Document Call Out
• A single aggregated view of all SharePoint, Exchange and Project task items
• Work Management Service Application• Aggregated tasks can be synced with
Exchange
My Tasks
My Site, Profile Data
• Data stored in personal site and velocity cache• Two lists: Microfeed list and Social List• Profile database still used for following people and tags
• Used to store user generated activities• Users control system activities which
show as activity feeds• User activity available to all authenticated
users, some system activities are security trimmed
• New events trigger a new item in the list and the Velocity Cache
Microfeed List
Distributed Cache in SharePoint 2013
• Aggregation of most social activities• Doesn’t work without a My Site• Can create limited social experience
Social List
COMMUNITY SITES
Communities
Communities Design
• Community site template Id=62• CommunityEventReceiver fires when activated• Asynchronous updates - beware of save
conflicts• The Community Site provides a forum
experience and reputation model. It does not expose a specific API– Use SharePoint site and list APIs directly to extend its
functionality– Discussion Board Template Type = 108
Community Template
Categories
• Ratings and comments not in socialdb• Reputation is based on Community silos• Can use Feature Stapling to add
reputation functionality across the communities
Ratings and Reputation
• Points• Configurable• Gift Badges
Badges
OM AND API FOR MY SITE AND SOCIAL
My Site Social API
• Working with social feeds• Following people and content (documents, sites, and tags),
• Working with social data• Working with user properties. • Add social features to a custom app or extend the social features
Extending Social Features
API’s for Social Features
2013 App Model
App Permission Scopes
UserProfiles and People• New client-side UserProfile Object
• Provides methods you can use to create a personal site
• Does not contain the user properties that the server-side UserProfile object contains.
• Use the PersonProperties object and its UserProfileProperties property for Server Side
New Objects for People• SocialActor object represents users (and
other entities) for feed and following activities• SPSocialActor used for server OM
• PersonProperties object contains general user properties and user profile properties
• PersonProperties is the primary API for accessing user properties from client-side code
• CSOM: SocialFollowingManager• JSOM: SocialFollowingManager• REST:
http://<mySiteUri>/_api/social.following• SSOM: SPSocialFollowingManager
Instance of Following Manager
• CSOM: GetFollowers• JSOM: getFollowers• REST: GET
http://<mySiteUri>/_api/social.following/my/Followers
• SSOM: GetFollowers
GetFollowers
• CSOM: Follow (StopFollowing)• JSOM: follow (stopFollowing)• REST: POST
http://<mySiteUri>/_api/social.following/Follow (http://<mySiteUri>/_api/social.following/StopFollowing) and pass the actor parameter in the request body
• SSOM: Follow (StopFollowing)
Follow an Item
• http://<mySiteUri>/– Maps back to My Site host
• http://<siteUri>/– Any site within the scope of the User Profiles service
application
• _Api always on the right of the path
REST API
REST Services for Social Features• Social features in the REST service• http://<mySiteUri>/_api/social.feed• http://<mySiteUri>/_api/social.following• http://<siteUri>/_api/
SP.UserProfiles.PeopleManager
• HTML and JavaScript control• Supports Claims• Same Properties as Server Control• SPClientPeoplePicker
Client-side People Picker
• // Get the people picker object from the page.
var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;
• // Get information about all users.
var users = peoplePicker.GetAllUserInfo(); var userInfo = ''; for (var i = 0; i < users.length; i++) { var user = users[i]; for (var userProperty in user) { userInfo += userProperty + ': ' + user[userProperty] + '<br>'; } } $('#resolvedUsers').html(userInfo);
Code for People Picker
Deprecated Features
• Microsoft.Office.Server.ActivityFeed
• Activityfeed.aspx replaces with REST API
• Recent Activities Web Part replace with Newsfeed web Part
Deprecated Features
• Some Activity events
• SocialFollowingManager replaces much of Colleagues
• Organization Profiles
• My Links