I haven't found that much information online about how to utilize the Social Part of SharePoint 2013 by Server Object Model. To understand and follow my question better i recommend you going to this site.
Lets say I have a Feature Receiver that is fired when i certain site is created and I would like to take advantage of the
Follow Content Feature but instead of every time a site is created i would like to make the person that created the site automatically follow that site.
Does anyone got experience with working with the Social functionallity in SharePoint 2013? If so would be awesome with a summary how to use the different Social methods.
From what I've understood from reading about this you need to create a "Actor" to represent the item or in my case the site.
SocialActorInfo which takes to properties ContentUri and ActorType.
SocialActorInfo actorInfo = new SocialActorInfo(); actorInfo.ContentUri = contentUrl; actorInfo.ActorType = contentType;
Find and Check if that Actor is followed by the current user
Then you have to check if that SocialActor is Followed by the current user.
ClientResult<bool> isFollowed = followingManager.IsFollowed(actorInfo);
Follow/Unfollow the Site/Item
ClientResult<SocialFollowResult> result = followingManager.Follow(actorInfo); clientContext.ExecuteQuery(); "followingManager.UnFollow(actorInfo);"
If I want to follow a site, what kind of ActorTypes are there?
How do i do this with server-side code?
Microsoft says: When users follow documents, sites, or tags, status updates from documents, conversations on sites, and notifications of tag use show up in their newsfeed. The features related to following content can be seen on the Newsfeed and the Following content pages.
SharePoint Server 2013 provides the following APIs that you can use to programmatically follow content:
- Client object models for managed code
- NET client object model
- Silverlight client object model
- Mobile client object model
- Representational State Transfer (REST) service
- Server object model
Link to Follow Content in SharePoint 2013, I can just find how to do it with REST or CSOM.