The base interface allowing content, applications, and containers to interact with activity stories. Each type has a sub interface that also defines how to get the item.

IActivityStoryType is defined in the Telligent.Evolution.Extensibility.Content.Version1 namespace of Telligent.Evolution.Core.dll

Definition

interface IActivityStoryType : IPlugin
{
	Guid[] ContentTypeIds { get;  }
	bool IsCacheable { get;  }
	string StoryTypeDescription { get;  }
	Guid StoryTypeId { get;  }
	string StoryTypeName { get;  }
	bool VaryCacheByUser { get;  }
	bool CanDeleteStory(Guid storyId, int userId);
	string GetPreviewHtml(IActivityStory story, Target target);
	int? GetPrimaryUser(IActivityStory story);
	string GetViewHtml(IActivityStory story, Target target);
	void SetController(IActivityStoryController controller);
}

Properties

NameTypeDescriptionDefaultOptions
ContentTypeIdsGuid[]An array of the content types supported by the activity story type. This will usually only be the type implementing the interface.
IsCacheableboolA flag to allow caching of the output of GetPreviewHtml() and GetViewHtml().
StoryTypeDescriptionstringA description of the activity story type.
StoryTypeIdGuidA Guid uniquely identifying the activity story type.
StoryTypeNamestringA readable name for the type of activity story created for this item. For example, blog posts use “Blog Post Activity”.
VaryCacheByUserboolA flag to cache on a per user basis, particularly useful for security reasons.

Methods

bool CanDeleteStory(Guid storyId, int userId);

Used to check whether a user can delete an activity story.

Parameters

NameTypeDescriptionRequiredDefaultOptions
storyIdGuidStory IdRequired
userIdintUser IdRequired

Return Type

bool

string GetPreviewHtml(IActivityStory story, Target target);

This should return a short summary of the activity story, usually a single sentence.

Parameters

NameTypeDescriptionRequiredDefaultOptions
storyIActivityStoryStoryRequired
targetTargetTargetRequired

Return Type

string

int? GetPrimaryUser(IActivityStory story);

Returns the primary actor’s UserId for the given activity story. This is usually the creator of the item or originator of the event.

Parameters

NameTypeDescriptionRequiredDefaultOptions
storyIActivityStoryStoryRequired

Return Type

int?

string GetViewHtml(IActivityStory story, Target target);

This returns the full view of the activity story that will primarily be shown in the activity stream.

Parameters

NameTypeDescriptionRequiredDefaultOptions
storyIActivityStoryStoryRequired
targetTargetTargetRequired

Return Type

string

void SetController(IActivityStoryController controller);

This method is called each time the plugin is loaded. The controller gives privileged access to the plugin not available via the API. Whenever content is created, updated, or deleted, the controller should be used to notify Telligent Evolution of the event so the activity service can run any necessary updates.

Parameters

NameTypeDescriptionRequiredDefaultOptions
controllerIActivityStoryControllerControllerRequired