/// <summary> /// This will create a notification type used by the module and also handle the actions that must be associated with it. /// </summary> /// <remarks>This should only ever run once, during 1.0.0 install (via IUpgradeable). /// </remarks> public static void AddNotificationTypes() { var actions = new List<NotificationTypeAction>(); var deskModuleId = DesktopModuleController.GetDesktopModuleByFriendlyName("DNNQA").DesktopModuleID; var objNotificationType = new NotificationType { Name = Constants.NotificationQaFlag, Description = "Q&A Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(objNotificationType.Name) != null) return; var objAction = new NotificationTypeAction { NameResourceKey = "AcceptInvite", DescriptionResourceKey = "AcceptInvite_Desc", APICall = "DesktopModules/DNNQA/API/SocialModuleService.ashx/ActionMethod", Order = 1 }; actions.Add(objAction); NotificationsController.Instance.CreateNotificationType(objNotificationType); NotificationsController.Instance.SetNotificationTypeActions(actions, objNotificationType.NotificationTypeId); }
private static void AddCoreNotificationTypesFor620() { DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "AddCoreNotificationTypesFor620"); var actions = new List<NotificationTypeAction>(); //Friend request var type = new NotificationType { Name = "FriendRequest", Description = "Friend Request" }; actions.Add(new NotificationTypeAction { NameResourceKey = "Accept", DescriptionResourceKey = "AcceptFriend", APICall = "DesktopModules/InternalServices/API/RelationshipService/AcceptFriend" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); //Follower type = new NotificationType { Name = "FollowerRequest", Description = "Follower Request" }; NotificationsController.Instance.CreateNotificationType(type); //Follow Back type = new NotificationType { Name = "FollowBackRequest", Description = "Follow Back Request" }; actions.Clear(); actions.Add(new NotificationTypeAction { NameResourceKey = "FollowBack", DescriptionResourceKey = "FollowBack", ConfirmResourceKey = "", APICall = "DesktopModules/InternalServices/API/RelationshipService/FollowBack" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); //Translation submitted type = new NotificationType { Name = "TranslationSubmitted", Description = "Translation Submitted" }; NotificationsController.Instance.CreateNotificationType(type); }
private static void UpgradeToVersion733() { var notificationType = new NotificationType { Name = "NewUnauthorizedUserRegistration", Description = "New Unauthorized User Registration Notification" }; NotificationsController.Instance.CreateNotificationType(notificationType); var actions = new List<NotificationTypeAction> { new NotificationTypeAction { NameResourceKey = "AuthorizeUser", DescriptionResourceKey = "AuthorizeUserDescription", APICall = "DesktopModules/InternalServices/API/NewUserNotificationService/Authorize" }, new NotificationTypeAction { NameResourceKey = "RejectUser", DescriptionResourceKey = "RejectUserDescription", APICall = "DesktopModules/InternalServices/API/NewUserNotificationService/Reject" } }; NotificationsController.Instance.SetNotificationTypeActions(actions, notificationType.NotificationTypeId); }
private void AddNotificationTypes() { var type = new NotificationType { Name = "HtmlNotification", Description = "Html Module Notification" }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { NotificationsController.Instance.CreateNotificationType(type); } }
public void CreateNotificationType(NotificationType notificationType) { Requires.NotNull("notificationType", notificationType); Requires.NotNullOrEmpty("notificationType.Name", notificationType.Name); if (notificationType.DesktopModuleId <= 0) { notificationType.DesktopModuleId = Null.NullInteger; } notificationType.NotificationTypeId = _dataService.CreateNotificationType(notificationType.Name, notificationType.Description, (int)notificationType.TimeToLive.TotalMinutes == 0 ? Null.NullInteger : (int)notificationType.TimeToLive.TotalMinutes, notificationType.DesktopModuleId, GetCurrentUserId()); }
private void AddNotificationTypes() { var actions = new List<NotificationTypeAction>(); //DesktopModule should not be null var deskModuleId = DesktopModuleController.GetDesktopModuleByFriendlyName("Social Groups").DesktopModuleID; //GroupPendingNotification var type = new NotificationType { Name = "GroupPendingNotification", Description = "Group Pending Notification", DesktopModuleId = deskModuleId}; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { actions.Add(new NotificationTypeAction { NameResourceKey = "Approve", DescriptionResourceKey = "ApproveGroup", APICall = "DesktopModules/SocialGroups/API/ModerationService.ashx/ApproveGroup" }); actions.Add(new NotificationTypeAction { NameResourceKey = "RejectGroup", DescriptionResourceKey = "RejectGroup", APICall = "DesktopModules/SocialGroups/API/ModerationService.ashx/RejectGroup" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); } //GroupApprovedNotification type = new NotificationType { Name = "GroupApprovedNotification", Description = "Group Approved Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { NotificationsController.Instance.CreateNotificationType(type); } //GroupCreatedNotification type = new NotificationType { Name = "GroupCreatedNotification", Description = "Group Created Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { actions.Clear(); actions.Add(new NotificationTypeAction { NameResourceKey = "RejectGroup", DescriptionResourceKey = "RejectGroup", ConfirmResourceKey = "DeleteItem", APICall = "DesktopModules/SocialGroups/API/ModerationService.ashx/RejectGroup" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); } //GroupRejectedNotification type = new NotificationType { Name = "GroupRejectedNotification", Description = "Group Rejected Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { NotificationsController.Instance.CreateNotificationType(type); } //GroupMemberPendingNotification type = new NotificationType { Name = "GroupMemberPendingNotification", Description = "Group Member Pending Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { actions.Clear(); actions.Add(new NotificationTypeAction { NameResourceKey = "Approve", DescriptionResourceKey = "ApproveGroupMember", ConfirmResourceKey = "", APICall = "DesktopModules/SocialGroups/API/ModerationService.ashx/ApproveMember" }); actions.Add(new NotificationTypeAction { NameResourceKey = "RejectMember", DescriptionResourceKey = "RejectGroupMember", APICall = "DesktopModules/SocialGroups/API/ModerationService.ashx/RejectMember" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); } //GroupMemberApprovedNotification type = new NotificationType { Name = "GroupMemberApprovedNotification", Description = "Group Member Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { NotificationsController.Instance.CreateNotificationType(type); } //GroupMemberRejectedNotification type = new NotificationType { Name = "GroupMemberRejectedNotification", Description = "Group Rejected Notification", DesktopModuleId = deskModuleId }; if (NotificationsController.Instance.GetNotificationType(type.Name) == null) { NotificationsController.Instance.CreateNotificationType(type); } }
private static void AddCoreNotificationTypesFor620() { var actions = new List<NotificationTypeAction>(); //Friend request var type = new NotificationType {Name = "FriendRequest", Description = "Friend Request"}; actions.Add(new NotificationTypeAction { NameResourceKey = "Accept", DescriptionResourceKey = "AcceptFriend", APICall = "DesktopModules/InternalServices/API/RelationshipService.ashx/AcceptFriend" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); //Follower type = new NotificationType { Name = "FollowerRequest", Description = "Follower Request" }; NotificationsController.Instance.CreateNotificationType(type); //Follow Back type = new NotificationType { Name = "FollowBackRequest", Description = "Follow Back Request" }; actions.Clear(); actions.Add(new NotificationTypeAction { NameResourceKey = "FollowBack", DescriptionResourceKey = "FollowBack", ConfirmResourceKey = "", APICall = "DesktopModules/InternalServices/API/RelationshipService.ashx/FollowBack" }); NotificationsController.Instance.CreateNotificationType(type); NotificationsController.Instance.SetNotificationTypeActions(actions, type.NotificationTypeId); //Translation submitted type = new NotificationType { Name = "TranslationSubmitted", Description = "Translation Submitted" }; NotificationsController.Instance.CreateNotificationType(type); }