SaaS CMS has officially launched! Learn more now.

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
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction.Activities
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public abstract class ProjectActivityFeed

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

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 void OnActivityCreated(ProjectActivityCreatedEventArgs e)
Parameters
Type Name Description
ProjectActivityCreatedEventArgs e

The event argument

OnActivityDeleted(ProjectActivityDeletedEventArgs)

Called to raise event ActivityDeleted

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

The event argument

OnActivityUpdated(ProjectActivityUpdatedEventArgs)

Called to raise event ActivityUpdated

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

The event argument

Events

ActivityCreated

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

Declaration
public event EventHandler<ProjectActivityCreatedEventArgs> ActivityCreated
Event Type
Type Description
System.EventHandler<ProjectActivityCreatedEventArgs>

ActivityDeleted

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

Declaration
public event EventHandler<ProjectActivityDeletedEventArgs> ActivityDeleted
Event Type
Type Description
System.EventHandler<ProjectActivityDeletedEventArgs>

ActivityUpdated

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

Declaration
public event EventHandler<ProjectActivityUpdatedEventArgs> ActivityUpdated
Event Type
Type Description
System.EventHandler<ProjectActivityUpdatedEventArgs>

Extension Methods