Suguk activity feed


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Introduce myself:Wes HackettPrincipal Solutions Architect at MS Gold Partner based in London
  • Run through the agenda itemsIntroduction > explanation of this sessionOut of the box > describing the out of the box behavioursArchitecture > describing the elements to the system and where a customisation fitsDevelopment > what tools and assemblies are involvedExtensibility > how to go about adding a new customisationKnown issues > covering off the known problems with the APIQuestions > Ask anything you wantUseful links > Some short links to useful information
  • In this section I’ll give a quick run down of this session
  • In this session I aim to provide the following:An overview of the native SharePoint 2010 activity system, what it is, how it worksDescribe how to extend it with your own custom activity itemsWe’ll be doing this by walking through a demo scenario
  • In this section I’ll describe what features come with SharePoint 2010
  • There are two types of activity feed views in SharePoint 2010:ConsolidatedThis shows the items being generated by your colleague networkPublishedThis shows activities by the individual
  • This is view of the Consolidated feed which lives on the NewsFeed page in the MySite host
  • Natively the activity system provides mainly Social and tagging activityNew membershipsSharing interestsTagging by a colleagueNote board postsTagging with my interestsRatingStatus messageNew colleague
  • Natively the activity system provides mainly Social and tagging activityJob title changeManager changeNew blog post (only if you created the blog using mysite.aspx?blog=1)Workplace anniversaryProfile updateUpcoming birthdayBirthdayUpcoming workplace anniversary
  • There are two ATOM feeds for the systemConsolidated which provides items for the colleagues of the calling userPublished which shows the items for the specified accountThere are NO WEB SERVICES
  • The Activity System also integrates into Outlook via the Social Connector.Items show up in the pane below a user in the main pane
  • In this section I’ll give a quick run down of the systems existing architecture
  • Explain each elementProfile DB holds the profile change logSocial DB holds the tagging, rating change logGatherer timerjobs, one for profile, one for socialPushes the data back into the Profile database via the APIWeb Part of ATOM page call the API to get Consolidated or Published item feeds
  • In this section I’ll give a quick run down of things you need to be able to extend the system
  • Tools you’ll needVisual Studio 2010CKSDevAssembliesMicrosoft.Office.ServerMicrosoft.Office.Server.UserProfiles
  • In this section I’ll go through a demo scenario
  • Scenario introductionSo for the purpose of an example we have been asked to provide the following functions:Provide a mechanism for a user to submit a suggestionPromote this suggestion to their colleaguesWord of warning, this code is NOT production ready and is to highlight the main Objects and Techniques you can use only.
  • As you can see the new extension slots in alongside the OOTBThe two elements are:Suggestions list event receiver > this adds a work item into the SPSite Work Items list for the new list itemTimer job gatherer > This reads the SPSite Work Items and processes them into Activity Events
  • So before we can dive into the Activity Extensions there is some plumbing neededThere is a new custom content type ‘Suggestion’ with a custom site column ‘Suggestion Details’There is then a list definition which is based off this content type to give us a repeatable method of providing ‘suggestion’ functionalityAn instance of this list in the siteWe won’t go through the code etc for this but it is in the solution
  • So lets take a closer look at how the solution is built upList event receiver to create work items for later processingThis is done for scaleThis could be replaced with some form of query within a timer job such as SPQuery or SPSiteDataQueryCould also use the change log to find changes to processTimer jobThis is the processing schedule for converting the work items into activity eventsThis is how the native functionality is invokedScales wellCustom gathererContains all the logic to create the work items for the publisher and colleaguesContains all the logic to register and unregister the activity application, activity types, activity templates
  • The list event handler is used to register the new item for later processingFires on Item Added event so we can generate new activity whenever a user adds a suggestionIt uses the ScheduledWorkItem approachYou have to elevate to be able to submit a new work item unless the user is a site collection administratorYou can check its working by opening the ScheduledWorkItems table in the content database. Obviously this is only for dev….
  • Activity ApplicationThis is the main container to register your types againstActivity TypesThese are the different types of activities that you wish to create such as ‘Colleague added’It makes the link to the resource string containing its name (used in the EditDetails.aspx)Holds a collection of Activity TemplatesActivity TemplatesThe template defines how the data will be displayedIt can be single or multi-valueSingle has a format which shows only one itemMulti uses a list of items and can display themTemplates are driven by a token approach which the web part will use
  • It takes the work items and passes each one to the gatherer for conversion into a ProcessingItemThen calls create events once all its work items collection has been processedThe timer job is there to provide a scheduled process
  • Provides a method to convert the list item to a processing itemDone to release the SP objects quicklyProvides a method to create a new Activity Event based on the information in the ProcessingItemProvides a method to publish activity events created by the item authorProvides a multi-cast method to push these activities to all the authors colleagues
  • In this section I’ll cover the limitations of the current version of the API
  • So this version is a great start but it isn’t perfect:Several of the important methods are missing:There is no API support for removing a customisation such as custom activity application and typesThere is no API support for removing individual items, so if someone posts a status that needs removing you have no officially supported means of removalPermissions:Some of the API actions require elevation and ‘Full Control’ permissions on the User Profile Service applicationNo likes and comments by defaultThe API doesn’t support this so if you want it you need to bespoke it
  • In this section please feel free to ask questions
  • In this section I’ll cover useful links that provide further work
  • Here are a collection of useful resources
  • Suguk activity feed

    1. 1. SharePoint 2010extending the activity feedWes HackettPrincipal Solutions Architect at Content and
    2. 2. agenda introduction out of the box architecture development extensibility known issues questions useful links
    3. 3. introduction
    4. 4. introductionaims of this session examine the native SharePoint 2010 activity feed describe how to extend it with custom activity types  walkthrough a demo scenario
    5. 5. out of the box
    6. 6. out of the boxactivity feed typesconsolidatedthe consolidated feed is all the activity events being generated by colleaguesshown on the Newsfeed pagepublishedThe published feed is all the activity events generated by that individualshown on the profile page
    7. 7. out of the boxnewsfeed page newsfeed page this is a picture of the native newsfeed page
    8. 8. out of the boxactivity types new membership sharing interests tagging by my colleague note board post tagging with my interests rating status message new colleague
    9. 9. out of the boxactivity types continued job title change manager change new blog post workplace anniversary profile update upcoming birthday birthday upcoming workplace anniversary
    10. 10. out of the boxatom feedsconsolidatedthe consolidated feed are all the activity events being generated by colleagueshttp://<MySiteHost>/_layouts/activityfeed.aspx?consolidated=truepublishedthe published feed are the activity events being generated by an individualhttp://<MySiteHost>/_layouts/activityfeed.aspx?publisher=<accountname>no web services
    11. 11. out of the boxOutlook 2010 integration Outlook 2010 has the ability to display the SharePoint Activity Feed configure using the Outlook 2010 Social Connector
    12. 12. architecture
    13. 13. architecture user profile gatherer web part timer or jobs ATOM activity social object user profile model user interface custom source
    14. 14. development
    15. 15. developmenttools and assemblies tools  Visual Studio 2010 + CKSDev  ULSViewer assemblies  Microsoft.Office.Server  Microsoft.Office.Server.UserProfiles
    16. 16. extensibility
    17. 17. scenariosuggestions box allow a user to make a suggestion on a site promote this suggestion to their colleagues NB: code example only NOT production ready
    18. 18. scenarioarchitecture user profile gatherer web part timer or jobs ATOM activity social object user profile model suggestions user suggestions gatherer interface list source timer job
    19. 19. scenariosome prepcontent type and site columnsprovides structure to the datalist definitionprovides a type of list with the content type and event receiver pre-boundlist instance in a siteprovides an instance for users to add suggestions
    20. 20. scenariosolution overviewlist event receiverthis registers items for processing by the timer jobone technique, others might use SPQuery or change log approachestimer jobprocesses the work items and passes them into the custom gathereruse a timer job for scale and security reasons, native approachcustom gathererthis is the element where activities are handledalso registers and unregisters the custom activity application
    21. 21. scenariolist event handler item added event  creates a ScheduledWorkItem with the information about the list item  you can confirm it has worked by checking the Content database table ‘ScheduledWorkItems’
    22. 22. scenarioActivity application register the Activity Application register the Activity Types  add activity templates Farm scoped feature  needs to be admin on the UPA
    23. 23. scenariotimer job adds each work item into the gatherer responsible for repeating the processing logic on a schedule
    24. 24. scenariocustom gatherer provides the SPListItem to ProcessingItem conversion provides the create activity event from ProcessingItem publishes the activity events publishes the activity events to the authors colleagues
    25. 25. known issues
    26. 26. known issuesit isn’t Facebookmissing methodsmost of the ‘remove’ methods have not been implementedeg. ActivityApplicationsCollection.Remove throws an exception ‘NotImplementedException’permissionssome actions require an elevated stateActivityEvent.CreateActivityEvent method requires ‘Full Control’ to the UPAno ‘likes’ and ‘comments’there is no API in place to support ‘likes’ and ‘comments’ a-la Facebookrestrictive API means to create advanced functionality needs other services
    27. 27. questions
    28. 28. useful links
    29. 29. useful linksroot of the MSDN namespace of the SharePoint SDK Activity Feed with ECM native