Skip to content

Notifications (Events)

ContentLock publishes standard Umbraco INotification events so you can react to lock/unlock and call activity using ordinary INotificationHandler<T> / INotificationAsyncHandler<T> handlers — no dependency on ContentLock beyond the notification types themselves.


NotificationPublished FromPayload
ContentLockedNotificationContentLockService.LockContentAsync(), after a lock is createdLockItem: ContentLockOverviewItem
ContentUnlockedNotificationContentLockService.UnlockContentAsync(), after a lock is removedContentKey: Guid, UnlockedByUserKey: Guid, UnlockedByUserName: string

These mirror the WebRTC call lifecycle already broadcast over SignalR (see SignalR Events).

NotificationPublished FromPayload
CallInitiatedNotificationThe hub routes a call offer to the calleeCallerUserKey, CallerUserName, CalleeUserKey, CalleeUserName, Timestamp
CallDeclinedNotificationThe callee explicitly declines an incoming callSame shape as above
CallMissedNotificationThe ring times out unansweredSame shape as above
CallEndedNotificationA call ends — either an explicit hang-up or a party disconnecting mid-callSame shape as above

Handlers are registered the same way as any other Umbraco notification, in your own IComposer:

using ContentLock.Notifications;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
public class MyContentLockNotificationsComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.AddNotificationAsyncHandler<ContentLockedNotification, MyContentLockedHandler>();
builder.AddNotificationAsyncHandler<ContentUnlockedNotification, MyContentUnlockedHandler>();
}
}
public class MyContentLockedHandler : INotificationAsyncHandler<ContentLockedNotification>
{
public Task HandleAsync(ContentLockedNotification notification, CancellationToken cancellationToken)
{
// notification.LockItem.NodeName, .CheckedOutBy, .Key, etc.
return Task.CompletedTask;
}
}

A handler that throws is logged and swallowed by ContentLock — it will never prevent a lock, unlock, or call from completing normally.