The base interface allowing content, applications, and containers to interact with notifications. Each type has a sub interface that also defines how to get the item.
INotificationType
is defined in the Telligent.Evolution.Extensibility.Content.Version1
namespace of Telligent.Evolution.Platform.dll
Definition
interface INotificationType : IPlugin { bool IsCacheable { get; } string NotificationTypeCategory { get; } string NotificationTypeDescription { get; } Guid NotificationTypeId { get; } string NotificationTypeName { get; } bool VaryCacheByUser { get; } bool CanDeleteNotification(Guid notificationId, int userId); string GetMessage(Guid notificationId, string target); string GetTargetUrl(Guid notificationId); void SetController(INotificationController controller); }
Properties
Name | Type | Description | Default | Options |
---|---|---|---|---|
IsCacheable | bool | A flag to allow caching of the output of GetMessage(). | ||
NotificationTypeCategory | string | The category to group the notification type into. | ||
NotificationTypeDescription | string | A description of the notification type. | ||
NotificationTypeId | Guid | A Guid uniquely identifying the notification type. | ||
NotificationTypeName | string | A readable name for the type of notification created for this item. For example, blog posts use “Blog Post Notification”. | ||
VaryCacheByUser | bool | A flag to cache on a per user basis, particularly useful for security reasons. |
Methods
bool CanDeleteNotification(Guid notificationId, int userId);
Used to check whether a user can delete a notification.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
notificationId | Guid | Notification Id | Required | ||
userId | int | User Id | Required |
Return Type
bool
string GetMessage(Guid notificationId, string target);
Returns the view of the notification for a given target (Html, Text, ShortText).
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
notificationId | Guid | Notification Id | Required | ||
target | string | Target | Required | Html, ShortText, Text |
Return Type
string
string GetTargetUrl(Guid notificationId);
Returns a target URL related to the notification
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
notificationId | Guid | Notification Id | Required |
Return Type
string
void SetController(INotificationController 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 notification service can perform any necessary updates.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
controller | INotificationController | Controller | Required |