Spsatl2013 Introduction to the SharePoint's Social APIs

4,599 views
5,406 views

Published on

Developers Introduction to the SharePoint's Social APIs

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,599
On SlideShare
0
From Embeds
0
Number of Embeds
3,766
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Social Namespace: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.social.aspxUserProfiles Namespace: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.userprofiles.aspx
  • Social Namespace: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.social.aspxUserProfiles Namespace: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.userprofiles.aspx
  • JS Client OM: http://msdn.microsoft.com/en-us/library/jj193045.aspx
  • JS Client OM: http://msdn.microsoft.com/en-us/library/jj193045.aspxhttp://msdn.microsoft.com/en-us/library/jj642945.aspx
  • http://msdn.microsoft.com/en-us/library/jj822974.aspx
  • http://msdn.microsoft.com/en-us/library/jj193058.aspx#SPNETServerlanding_SocialSocial Classes: http://msdn.microsoft.com/en-us/library/jj193040.aspxWork with Social Feeds in SharePoint 2013: http://msdn.microsoft.com/en-us/library/jj163237.aspx
  • http://msdn.microsoft.com/en-us/library/jj193058.aspx#SPNETServerlanding_SocialSocial Classes: http://msdn.microsoft.com/en-us/library/jj193040.aspxWork with Social Feeds in SharePoint 2013: http://msdn.microsoft.com/en-us/library/jj163237.aspx
  • Grand Prize winner selectedfrom session winners
  • Spsatl2013 Introduction to the SharePoint's Social APIs

    1. 1. SPSATL 2013Intro to SharePoint’sSocial APIsSHAREPOINT SATURDAY ATLANTA – JUNE 8, 2013MIKE ORYSZAKBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK
    2. 2. SPSATL 2013About MeSenior SharePoint Solution Architect w/ B&R SolutionsMicrosoft SharePoint Server MVPLeader for Triangle SharePoint User Group (TriSPUG)Dev and Architect with MS stack since 1996Working with SharePoint since 2002Raleigh-Durham, NCScan the QR code for achance to win a prize!BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK2
    3. 3. 3 |SharePoint Saturday Atlanta3 |SharePoint Saturday Atlanta
    4. 4. 4 |SharePoint Saturday Atlanta4 |SharePoint Saturday Atlanta
    5. 5. 5 |SharePoint Saturday Atlanta5 |SharePoint Saturday Atlanta
    6. 6. 6 |SharePoint Saturday Atlanta6 |SharePoint Saturday Atlanta
    7. 7. SPSATL 2013SessionOverviewFeature OverviewAPI OptionsExamplesCloseoutTarget Audience:Developers looking to leverage orextend SharePoint’s Social Features.BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK7
    8. 8. SPSATL 2013Feature OverviewINTRO TO SHAREPOINT’S SOCIAL APISBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK8
    9. 9. SPSATL 2013SPSATL 2013Feature OverviewSocial PlatformMySite Host: Centralized Site Collection that supportsNewsfeed – Functions as a social hubAbout Me (Profile) Page – Displays information about the person, their expertise, and social activitiesPersonal Site: Individual Site Collections that containDocuments (personal and shared)BlogTasksAppsVersion Differences:In 2010 Newsfeed was pretty light; could not take action on messages About Me page less focused on social, more focused on organizationIn 2013 Newsfeed supports replies, likes, mentioning people. Newsfeed can function more like a social hub for things you are following. Ex. People, Documents, Sites, TagsBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK9
    10. 10. SPSATL 2013SPSATL 2013Feature OverviewSocial ContentSocial ContentConversationsTags/hashtagsNotesRatingsVersion Differences:In 2010 Newsfeed was pretty light; could not take action on messagesIn 2013Newsfeed extended to support conversations including replies, likes, mentioning people.Newsfeed can function more like a social hub for things you are following. Ex. People, Documents, Sites, TagsBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK10
    11. 11. SPSATL 2013API OptionsINTRO TO SHAREPOINT’S SOCIAL APISBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK11
    12. 12. SPSATL 2013SPSATL 2013Social API OptionsMultiple Options for interacting with social data and features.Ranked in recommended order of preference:Client Object Model for managed code (.NET, Silverlight, Mobile)Client Object Model for JavaScriptRest and ODataServer Object modelSoap based Web ServicesBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK12
    13. 13. SPSATL 2013SPSATL 2013Social API OptionsClient Object Model – ManagedCodeThis is Microsoft’s recommended approachProvides a wrapper for the REST based servicesUsed within the new SharePoint Apps or non-SharePoint Apps not running for the serverNamespaces:Microsoft.SharePoint.Client.SocialCore objects for interacting with social feeds, posts, and following dataMicrosoft.SharePoint.Client.UserProfilesContains objects for interacting with user profiles and attributesBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK13
    14. 14. SPSATL 2013SPSATL 2013Social API OptionsClient Object Model – ManagedCodeDiffers from Server OM in that it requires a Client Context and cannot hold an open connectionQuick Example – Load a User Profilestring spUrl = "http://serverName/";string user = "domainNameuserName";ClientContext context = new ClientContext(spUrl);PeopleManager peopleManager = new PeopleManager(context);PersonProperties props = peopleManager.GetPropertiesFor(user);clientContext.Load(props, p => p.AccountName, p => p.UserProfileProperties);clientContext.ExecuteQuery();string email = props.UserProfileProperties["Email"].ToString();string department = props.UserProfileProperties["Department"].ToString();BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK14
    15. 15. SPSATL 2013SPSATL 2013Social API OptionsClient Object Model – JavaScriptGreat for client-side customizations inside of SharePoint or externallyThis is the equivalent of what was previously accomplished with SPServicesNamespaces:SP.Sharing (/_layouts/sp.js)Contains objects for interacting with the sharing featuresSP.Social (/_layouts/sp.userprofiles.js)Core objects for interacting with social feeds, posts, and following dataSP.UserProfiles (/_layouts/sp.userprofiles.js)Contains objects for interacting with user profiles and attributesBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK15
    16. 16. SPSATL 2013SPSATL 2013Social API OptionsClient Object Model – JavaScriptSimilar to Client OM in that it requires a Client Context and cannot hold an open connectionQuick Example – Load a User Profilevar spUrl = "http://serverName/";var acctName = "domainNameuserName";var context = new SP.ClientContext(spUrl);var peopleManager = new SP.UserProfiles.PeopleManager(context);var profilePropertyNames = ["Email", "Department", “Title”];var userProperties = newSP.UserProfiles.UserProfilePropertiesForUser(context, acctName, profilePropertyNames);var props = peopleManager. getUserProfilePropertiesFor(userProperties);context.load(userProperties);context.executeQueryAsync(function () { "Email:" + alert(props[0] + " | Department: " + props[1] + " | Title: " +props[2]); }, function () { alert("Error Loading User Profile") });BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK16
    17. 17. SPSATL 2013SPSATL 2013Social API OptionsREST and ODataThe data is also available directly via the underlying REST servicesThese can be accessed from any languageREST EndpointsSocial Feed: http://<mySiteUri>/_api/social.feedRead or write to a user’s social feedSocial Following: http://<mySiteUri>/_api/social.followingRead or write following informationPeople Manager: http://<siteUri>/_api/SP.UserProfiles.PeopleManagerRead or write user profile informationBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK17
    18. 18. SPSATL 2013SPSATL 2013Social API OptionsServer Object ModelFull featured, and traditional developers are most comfortable hereRequires deployment through full trust, server solutionsSocial Namespaces:Microsoft.Office.Server.Social: Core objects for interacting with social feeds, posts, and following dataMicrosoft.Office.Server.SocialData: Core objects for interacting with social data such as tags and ratingsMicrosoft.Office.Server.UserProfiles: Contains objects for interacting with user profiles and attributesBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK18
    19. 19. SPSATL 2013SPSATL 2013Social API OptionsServer Object ModelOne difference with the Server OM is that it requires a Service Context to connect to theappropriate User Profile Service Application.Quick Example – Load a User ProfileSPContext context = SPContext.Current;string accountname = "domainNameuserName";SPServiceContext svcContext = SPServiceContext.GetContext(context.Site);UserProfileManager profileManager = new UserProfileManager(svcContext);UserProfile profile = profileManager.GetUserProfile(accountname);string email = profile["Email"].Value;BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK19
    20. 20. SPSATL 2013SPSATL 2013Social API OptionsSoap Based Web Service APIThese have officially been deprecated with SharePoint 2013.Previously released services still available, but no new investment.Migrate to another APIBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK20
    21. 21. SPSATL 2013ExamplesINTRO TO SHAREPOINT’S SOCIAL APISBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK21
    22. 22. SPSATL 2013ExamplesDemonstration.NET Client OMRead Profile PropertiesAccess Tags/Note DataServer OMRead Profile PropertiesBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK22
    23. 23. SPSATL 2013CloseoutINTRO TO SHAREPOINT’S SOCIAL APISBLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK24
    24. 24. SPSATL 2013Questions?BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK25
    25. 25. SPSATL 2013SPSATL 2013ResourcesMSDN API ReferencesChoose the right APIhttp://msdn.microsoft.com/en-us/library/jj164060.aspxServer Object Modelhttp://msdn.microsoft.com/en-us/library/jj193040.aspxClient Object Model.Net Client: http://msdn.microsoft.com/en-us/library/jj193046.aspxJavascript: http://msdn.microsoft.com/en-us/library/jj193045.aspxhttp://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.social.aspxMy Social Blog Postshttp://mikeoryszak.com/tag/social/Sample ProjectsABCLinkPad http://www.linqpad.net/BLOG: WWW.MIKEORYSZAK.COMTWITTER: @NEXT_CONNECTLINKEDIN: HTTP://WWW.LINKEDIN.COM/IN/MICHAELORYSZAK26
    26. 26.  @SPS_ATL #SPSATL speaker sponsorSession Prizes1 4 $25 gift cards2 4 $25 gift cards3 4 $25 gift cards4 4 $25 gift cards5 4 $25 gift cards

    ×