November Happy Hour will be moved to Thursday December 5th.

Class ProjectActivityFeed

A feed to read activities related to a project. Can be used to retrieve project activities or to subscribe to changes.

Inheritance
System.Object
ProjectActivityFeed
Namespace: EPiServer.DataAbstraction.Activities
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public abstract class ProjectActivityFeed : Object

Constructors

ProjectActivityFeed()

Declaration
protected ProjectActivityFeed()

Properties

Instance

Gets the currently configured instance of the ProjectActivityFeed.

Declaration
public static ProjectActivityFeed Instance { get; }
Property Value
Type Description
ProjectActivityFeed

Methods

add_ActivityCreated(AsyncEventHandler<ProjectActivityCreatedEventArgs>)

Declaration
public void add_ActivityCreated(AsyncEventHandler<ProjectActivityCreatedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityCreatedEventArgs> value

add_ActivityDeleted(AsyncEventHandler<ProjectActivityDeletedEventArgs>)

Declaration
public void add_ActivityDeleted(AsyncEventHandler<ProjectActivityDeletedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityDeletedEventArgs> value

add_ActivityUpdated(AsyncEventHandler<ProjectActivityUpdatedEventArgs>)

Declaration
public void add_ActivityUpdated(AsyncEventHandler<ProjectActivityUpdatedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityUpdatedEventArgs> value

ListActivitiesAsync(ContentReference, Int32)

List all Activity instances for a content version that is related to a project.

Declaration
public abstract Task<IEnumerable<Activity>> ListActivitiesAsync(ContentReference contentLink, int projectId)
Parameters
Type Name Description
ContentReference contentLink

The content to get project related activities for

System.Int32 projectId

The related project

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Activity>>

A list of activities related to the content version and project

Remarks

Will only return content related activities that has occured after the version was added to the project.

ListActivitiesAsync(Int32)

Lists all Activity instances related to the specified Project

Declaration
public virtual Task<IEnumerable<Activity>> ListActivitiesAsync(int projectId)
Parameters
Type Name Description
System.Int32 projectId

The identity of the project to load activities for.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Activity>>

All activities related to the project.

ListActivitiesAsync(Int32, IEnumerable<ContentReference>)

List all Activity instances for a set of content versions that is related to a project.

Declaration
public virtual Task<IEnumerable<Activity>> ListActivitiesAsync(int projectId, IEnumerable<ContentReference> contentLinks)
Parameters
Type Name Description
System.Int32 projectId

The related project

System.Collections.Generic.IEnumerable<ContentReference> contentLinks

The content to get project related activities for

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Activity>>
Remarks

Will only return content related activities that has occured after the version was added to the project.

ListActivitiesAsync(Int32, IEnumerable<ContentReference>, Int64, Int32)

List a paged set of Activity instances for a set of content versions that is related to a project.

Declaration
public virtual Task<PagedActivityResult> ListActivitiesAsync(int projectId, IEnumerable<ContentReference> contentLinks, long startIndex, int maxCount)
Parameters
Type Name Description
System.Int32 projectId

The related project

System.Collections.Generic.IEnumerable<ContentReference> contentLinks

The content to get project related activities for

System.Int64 startIndex

The index for where only activities with a lower index will be returned. If no startIndex is given it will return the latest activities.

System.Int32 maxCount

The maximum number of activities to return.

Returns
Type Description
System.Threading.Tasks.Task<PagedActivityResult>
Remarks

Will only return content related activities that has occured after the version was added to the project.

ListActivitiesAsync(Int32, Int64, Int32)

Lists a paged set of Activity instances related to the specified Project.

Declaration
public abstract Task<PagedActivityResult> ListActivitiesAsync(int projectId, long startIndex, int maxCount)
Parameters
Type Name Description
System.Int32 projectId

The identity of the project to load activities for.

System.Int64 startIndex

The index for where only activities with a lower index will be returned. If no startIndex is given it will return the latest activities.

System.Int32 maxCount

The maximum number of activities to return.

Returns
Type Description
System.Threading.Tasks.Task<PagedActivityResult>

All activities related to the project.

Remarks

To get the latest activities set startIndex to 0 or long.MaxValue. In the next paged set as "index of last entry in previous set" - 1.

ListRelatedProjectsAsync(Int64)

List all projects related to the provided Activity.

Declaration
public abstract Task<IEnumerable<int>> ListRelatedProjectsAsync(long activityId)
Parameters
Type Name Description
System.Int64 activityId

The identity of the activity.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Int32>>

A list of related project ids

Remarks

Can be used for example from an event handler to ActivityCreated to determine if the created activity is related to a project.

LoadActivityAsync(Int64)

Loads a single Activity together with related comments.

Declaration
public abstract Task<Activity> LoadActivityAsync(long activityId)
Parameters
Type Name Description
System.Int64 activityId

The identity of the activity

Returns
Type Description
System.Threading.Tasks.Task<Activity>

An activity

OnActivityCreated(ProjectActivityCreatedEventArgs)

Called to raise event ActivityCreated

Declaration
protected virtual Task OnActivityCreated(ProjectActivityCreatedEventArgs e)
Parameters
Type Name Description
ProjectActivityCreatedEventArgs e

The event argument

Returns
Type Description
System.Threading.Tasks.Task

OnActivityDeleted(ProjectActivityDeletedEventArgs)

Called to raise event ActivityDeleted

Declaration
protected virtual Task OnActivityDeleted(ProjectActivityDeletedEventArgs e)
Parameters
Type Name Description
ProjectActivityDeletedEventArgs e

The event argument

Returns
Type Description
System.Threading.Tasks.Task

OnActivityUpdated(ProjectActivityUpdatedEventArgs)

Called to raise event ActivityUpdated

Declaration
protected virtual Task OnActivityUpdated(ProjectActivityUpdatedEventArgs e)
Parameters
Type Name Description
ProjectActivityUpdatedEventArgs e

The event argument

Returns
Type Description
System.Threading.Tasks.Task

remove_ActivityCreated(AsyncEventHandler<ProjectActivityCreatedEventArgs>)

Declaration
public void remove_ActivityCreated(AsyncEventHandler<ProjectActivityCreatedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityCreatedEventArgs> value

remove_ActivityDeleted(AsyncEventHandler<ProjectActivityDeletedEventArgs>)

Declaration
public void remove_ActivityDeleted(AsyncEventHandler<ProjectActivityDeletedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityDeletedEventArgs> value

remove_ActivityUpdated(AsyncEventHandler<ProjectActivityUpdatedEventArgs>)

Declaration
public void remove_ActivityUpdated(AsyncEventHandler<ProjectActivityUpdatedEventArgs> value)
Parameters
Type Name Description
AsyncEventHandler<ProjectActivityUpdatedEventArgs> value

Events

ActivityCreated

Occurs when a new Activity is added to the activity log.

Declaration
public event AsyncEventHandler<ProjectActivityCreatedEventArgs> ActivityCreated
Event Type
Type Description
AsyncEventHandler<ProjectActivityCreatedEventArgs>

ActivityDeleted

Occurs when an Activity is marked for deletion in the activity log.

Declaration
public event AsyncEventHandler<ProjectActivityDeletedEventArgs> ActivityDeleted
Event Type
Type Description
AsyncEventHandler<ProjectActivityDeletedEventArgs>

ActivityUpdated

Occurs when an existing Activity in the activity log is updated.

Declaration
public event AsyncEventHandler<ProjectActivityUpdatedEventArgs> ActivityUpdated
Event Type
Type Description
AsyncEventHandler<ProjectActivityUpdatedEventArgs>

Extension Methods