-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temp commit, move to cache refreshers.
- Loading branch information
Showing
7 changed files
with
190 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
using Umbraco.Cms.Core.Events; | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
|
||
namespace Umbraco.Cms.Core.Handlers; | ||
|
||
public class RoutingNotificationHandler | ||
: INotificationAsyncHandler<ContentPublishedNotification>, | ||
INotificationAsyncHandler<ContentDeletedNotification>, | ||
INotificationAsyncHandler<ContentUnpublishedNotification>, | ||
INotificationAsyncHandler<ContentSavedNotification> | ||
{ | ||
private readonly IDocumentUrlService _documentUrlService; | ||
private readonly IContentService _contentService; | ||
private readonly IIdKeyMap _idKeyMap; | ||
|
||
public RoutingNotificationHandler(IDocumentUrlService documentUrlService, IContentService contentService, IIdKeyMap idKeyMap) | ||
{ | ||
_documentUrlService = documentUrlService; | ||
_contentService = contentService; | ||
_idKeyMap = idKeyMap; | ||
} | ||
|
||
public async Task HandleAsync(ContentPublishedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.CreateOrUpdateUrlSegmentsAsync(notification.PublishedEntities); | ||
public async Task HandleAsync(ContentDeletedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.DeleteUrlsAsync(notification.DeletedEntities); | ||
public async Task HandleAsync(ContentUnpublishedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.DeleteUrlsAsync(notification.UnpublishedEntities); | ||
|
||
public async Task HandleAsync(ContentSavedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.CreateOrUpdateUrlSegmentsAsync(notification.SavedEntities); | ||
} | ||
// using Umbraco.Cms.Core.Events; | ||
// using Umbraco.Cms.Core.Models; | ||
// using Umbraco.Cms.Core.Notifications; | ||
// using Umbraco.Cms.Core.Services; | ||
// | ||
// namespace Umbraco.Cms.Core.Handlers; | ||
// | ||
// public class RoutingNotificationHandler | ||
// : INotificationAsyncHandler<ContentPublishedNotification>, | ||
// INotificationAsyncHandler<ContentDeletedNotification>, | ||
// INotificationAsyncHandler<ContentUnpublishedNotification>, | ||
// INotificationAsyncHandler<ContentSavedNotification> | ||
// { | ||
// private readonly IDocumentUrlService _documentUrlService; | ||
// private readonly IContentService _contentService; | ||
// private readonly IIdKeyMap _idKeyMap; | ||
// | ||
// public RoutingNotificationHandler(IDocumentUrlService documentUrlService, IContentService contentService, IIdKeyMap idKeyMap) | ||
// { | ||
// _documentUrlService = documentUrlService; | ||
// _contentService = contentService; | ||
// _idKeyMap = idKeyMap; | ||
// } | ||
// | ||
// // TODO move to content refreshers | ||
// public async Task HandleAsync(ContentPublishedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.CreateOrUpdateUrlSegmentsAsync(notification.PublishedEntities); | ||
// public async Task HandleAsync(ContentDeletedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.DeleteUrlsAsync(notification.DeletedEntities); | ||
// public async Task HandleAsync(ContentUnpublishedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.DeleteUrlsAsync(notification.UnpublishedEntities); | ||
// | ||
// public async Task HandleAsync(ContentSavedNotification notification, CancellationToken cancellationToken) => await _documentUrlService.CreateOrUpdateUrlSegmentsAsync(notification.SavedEntities); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters