Files
Umbraco-CMS/src/Umbraco.PublishedCache.NuCache/Compose/NotificationsComposer.cs

24 lines
1.3 KiB
C#
Raw Normal View History

2021-03-25 14:51:00 +01:00
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
Netcore: Migrate RepositoryBase and ContentTypeServiceBase events (#10141) * Remove ScopeEntityRemove from ContentRepositoryBase and rely on "ing" notifications * Remove old event handler from ContentEventsTests * Remove ScopedVersionRemove from ContentRepositoryBase and rely on service notifications instead * Remove unused ScopedVersionEventArgs from ContentRepositoryBase * Migrate ScopeEntityRefresh to notification pattern Unfortunately it's still published from the repository base * Add simple content type notifications * Publish Notifications instead of events in ContentTypeServiceBase for simple events * Switch OnChanged to use Notifications for ContentTypeServices * Publish notifications instead of raising ScopedRefreshedEntity on ContentTypeServiceBase * Hook up to the new ContentType notifications * Remove DistributedCacheBinderTests There are no longer any events to really test on. * Remove ContentTypeChange EventArgs * Remove ContentService_Copied from DistributedCacheBinder It's no longer used * Cleanup * Cleanup * Removed uncommented code * Fixed issue with unattented installs * Re-add ContentTreeChangeNotification to DistributedCache * Add new notification for ScopedEntityRemove Marked as obsolete/hidden in editor, since this should only be used for nucache for now, and should really be changed in the future * Mark Refresh notifications as obsolete/hidden These should not be used anywhere outside Nucache, and should be changed to tree change at some point. * Raise ScopedEntityRemoveNotification on repos and use in nucache Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 12:17:11 +02:00
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
2021-03-25 14:51:00 +01:00
namespace Umbraco.Cms.Infrastructure.PublishedCache.Compose
{
2021-03-26 16:49:16 +01:00
public sealed class NotificationsComposer : ICoreComposer
2021-03-25 14:51:00 +01:00
{
2021-03-26 16:49:16 +01:00
public void Compose(IUmbracoBuilder builder) =>
Netcore: Migrate RepositoryBase and ContentTypeServiceBase events (#10141) * Remove ScopeEntityRemove from ContentRepositoryBase and rely on "ing" notifications * Remove old event handler from ContentEventsTests * Remove ScopedVersionRemove from ContentRepositoryBase and rely on service notifications instead * Remove unused ScopedVersionEventArgs from ContentRepositoryBase * Migrate ScopeEntityRefresh to notification pattern Unfortunately it's still published from the repository base * Add simple content type notifications * Publish Notifications instead of events in ContentTypeServiceBase for simple events * Switch OnChanged to use Notifications for ContentTypeServices * Publish notifications instead of raising ScopedRefreshedEntity on ContentTypeServiceBase * Hook up to the new ContentType notifications * Remove DistributedCacheBinderTests There are no longer any events to really test on. * Remove ContentTypeChange EventArgs * Remove ContentService_Copied from DistributedCacheBinder It's no longer used * Cleanup * Cleanup * Removed uncommented code * Fixed issue with unattented installs * Re-add ContentTreeChangeNotification to DistributedCache * Add new notification for ScopedEntityRemove Marked as obsolete/hidden in editor, since this should only be used for nucache for now, and should really be changed in the future * Mark Refresh notifications as obsolete/hidden These should not be used anywhere outside Nucache, and should be changed to tree change at some point. * Raise ScopedEntityRemoveNotification on repos and use in nucache Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 12:17:11 +02:00
builder
.AddNotificationHandler<LanguageSavedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberDeletingNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ContentRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MediaRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberRefreshNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ContentTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MediaTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<MemberTypeRefreshedNotification, PublishedSnapshotServiceEventHandler>()
.AddNotificationHandler<ScopedEntityRemoveNotification, PublishedSnapshotServiceEventHandler>()
;
2021-03-25 14:51:00 +01:00
}
}