THE UMBRACO EVENT MODEL

The event model that Umbraco employs is great for interacting with content and media and intercepting or injecting actions into the workflow as Umbraco's node lifecycle is executed. Again, the aim of this book is to introduce you to the concepts and not delve into granular details. In short, having access to these event hooks provides you with the ability to add workflows and integrate third-party and a host of other applications.

Event Hooks

Every action in the Umbraco process is covered by the event model, which makes subscribing to any of these events with just a few lines of code possible. Table 12-1 lists all the available event hooks and in what context they are relevant. This is a listing of all the events that you can tap into. For more specific examples of when these are used, see the sample code in the “Event Samples” section.

TABLE 12-1: Event Hooks

EVENT CONTEXT EVENT NAME
Accessumbraco.cms.businesslogic.web.Access
  • BeforeSave
  • AfterSave
  • New
  • BeforeAddProtection
  • AfterAddProtection
  • BeforeRemoveProtection
  • AfterRemoveProtection
  • BeforeAddMemberShipRoleToDocument
  • AfterAddMemberShipRoleToDocument
  • BeforeRemoveMemberShipRoleToDocument
  • AfterRemoveMemberShipRoleToDocument
  • BeforeRemoveMembershipUserFromDocument
  • AfterRemoveMembershipUserFromDocument
  • BeforeAddMembershipUserToDocument
  • AfterAddMembershipUserToDocument
BaseTreeumbraco.cms.presentation.Trees.BaseTree
  • BeforeNodeRender
  • AfterNodeRender
CMSNodeumbraco.cms.businesslogic.CMSNode

Get Umbraco User's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.