ActivityEvent.CreateActivityEvent Method
SharePoint 2010
Static method that creates an ActivityEvent object and associates it with an ActivityType object.
Assembly: Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
public static ActivityEvent CreateActivityEvent( ActivityManager objManager, long activityTypeId, Entity owner, Entity publisher )
Parameters
- objManager
- Type: Microsoft.Office.Server.ActivityFeed.ActivityManager
The ActivityManager object that is responsible for gathering this ActivityEvent.
- activityTypeId
- Type: System.Int64
The identifier of the ActivityType with which this ActivityEvent is associated. This type defines the display formatting of the event.
- owner
- Type: Microsoft.Office.Server.ActivityFeed.Entity
The entity that owns this ActivityEvent.
- publisher
- Type: Microsoft.Office.Server.ActivityFeed.Entity
The entity that publishes this ActivityEvent.
Create Activity Events -- working around admin restriction
See this sample for a way to work around the requirement that only UPA admins can create activity events. You can store information about each event in a list and then create the events by using a timer job:
http://archive.msdn.microsoft.com/doclibactivityevent
- 3/22/2011
- crowleyj
Other ways to create activity feed entries...
Most of the code samples show using this method to create activity feed events, but with the restriction of having to be an administrator, this seems to limit the ability to use this in any code executed by an end user -- for example, the send link to colleague sample. Why would this be a demonstrated way of creating an activity feed event if this method can only be executed by user profile service application administrators?
- 7/30/2010
- Christopher Quick