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.Platform.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
Name | Type | Description | Default | Options |
---|---|---|---|---|
ContentTypeIds | Guid[] | An array of the content types supported by the activity story type. This will usually only be the type implementing the interface. | ||
IsCacheable | bool | A flag to allow caching of the output of GetPreviewHtml() and GetViewHtml(). | ||
StoryTypeDescription | string | A description of the activity story type. | ||
StoryTypeId | Guid | A Guid uniquely identifying the activity story type. | ||
StoryTypeName | string | A readable name for the type of activity story created for this item. For example, blog posts use “Blog Post Activity”. | ||
VaryCacheByUser | bool | A 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
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
storyId | Guid | Story Id | Required | ||
userId | int | User Id | Required |
Return Type
bool
string GetPreviewHtml(IActivityStory story, Target target);
This should return a short summary of the activity story, usually a single sentence.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
story | IActivityStory | Story | Required | ||
target | Target | Target | Required |
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
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
story | IActivityStory | Story | Required |
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
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
story | IActivityStory | Story | Required | ||
target | Target | Target | Required |
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
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
controller | IActivityStoryController | Controller | Required |