Reference - Global system events

Event categories (classes):

ObjectEvents

Namespace: CMS.DataEngine

Contains events that occur for all types of objects in the system. See also: Handling object events

Important

Use the following classes to access the object events in the API:

  • ObjectEvents – events triggered for all object types
  • <name>Info.TYPEINFO.Events – events triggered only for a specific object type, for example: UserInfo.TYPEINFO.Events

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

ObjectEventArgs

  • Object (BaseInfo)

Occurs when a new object is created.

To reliably handle all possible object creation events, you may also need to assign a matching handler to the BulkInsert event. The system triggers the BulkInsert event instead of Insert in certain cases, particularly for operations that can affect multiple objects.

Update

Before
After
Failure

ObjectEventArgs

  • Object (BaseInfo)

Occurs when the data of an existing object is updated.

To reliably handle all possible object update events, you may also need to assign a matching handler to the BulkUpdate event. The system triggers the BulkUpdate event instead of Update in certain cases, particularly for operations that can affect multiple objects.

Delete

Before
After
Failure

ObjectEventArgs

  • Object (BaseInfo)

Occurs when an object is deleted.

To reliably handle all possible object deletion events, you may also need to assign a matching handler to the BulkDelete event. The system triggers the BulkDelete event instead of Delete in certain cases, particularly for operations that can affect multiple objects.

BulkInsertBefore
After
Failure

BulkInsertEventArgs

  • InsertedObjects (IEnumerable<IInfo>)
  • TypeInfo (ObjectTypeInfo)
    __________________________________

Occurs when the system performs object creation operations that can affect multiple objects. To reliably handle all possible object creation events, assign matching handlers to both the BulkInsert and Insert events.

In certain cases, the system creates objects by directly inserting data into a database table (for example when importing contacts from CSV files). To cover these scenarios, you also need to assign an appropriate handler to the SqlEvents.BulkInsert event.

BulkUpdateBefore
After
Failure

BulkUpdateEventArgs

  • ChangedColumns (IEnumerable<string>)
  • TypeInfo (ObjectTypeInfo)
  • WhereCondition (IWhereCondition)
    _________________________________

Occurs when the system performs object update operations that can affect multiple objects. To reliably handle all possible object update events, assign matching handlers to both the BulkUpdate and Update events.

BulkDelete

Before
After
Failure

BulkDeleteEventArgs

  • TypeInfo (ObjectTypeInfo)
  • WhereCondition (IWhereCondition)
    ______________________________

Occurs when the system performs object deletion operations that can affect multiple objects. To reliably handle all possible object deletion events, assign matching handlers to both the BulkDelete and Delete events.

GetContent

Execute
___________

ObjectEventArgs

  • Content (string)

  • Object (BaseInfo)

Occurs before the system writes an object's data into smart search indexes (when building or updating indexes).

Allows you to determine exactly how search indexes store object content.

Example: Customizing the content of search indexes

LogChange

Before
After
Failure

LogObjectChangeEventArgs

  • Settings (LogObjectChangeSettings)
    _______________________________

Occurs when the system logs object changes for the purposes of staging and integration. For example, allows you to exclude specific objects from staging.

Example: Excluding content from staging and integration

CheckPermissions

Before
After
Failure

ObjectSecurityEventArgs

  • Object (BaseInfo)

  • Permission (PermissionsEnum)

  • User (UserInfo)

  • SiteName (string)

  • Result (AuthorizationResultEnum)
    ________________________________

Occurs when the system checks permissions for objects of the given type.
Sort

Before
After
Failure

ObjectSortEventArgs

  • Object (BaseInfo)

  • Ascending (bool)

  • OrderColumn (string)

  • NameColumn (string)_________
    _______________________________________

Occurs when sorting of objects is requested.

ChangeOrderBefore
After
Failure

ObjectChangeOrderEventArgs

  • Object (BaseInfo)

  • NewOrder (int)

  • RelativeOrder (int)

  • OrderColumn (string)_______
    ______________________________________

 Occurs when a change in the order of objects is requested.

GetData

Before
After
Failure

ObjectDataEventArgs

  • Data (DataSet)
  • Query (IObjectQuery)
  • TotalRecords (int)

Occurs when the system retrieves object data using the ObjectQuery API.

The Before event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the Data property of the handler's ObjectDataEventArgs parameter, which is empty by default in the Before event.

Use the After event type if you need to edit the data retrieved from Xperience in the Data property.

The TotalRecords property provides a number of total records in case paging is used. Use -1 to use the rows count of the Data property.

> Back to list of event categories

DocumentEvents

Namespace: CMS.DocumentEngine

Contains events fired when changes are made to pages.

Note:

Pages under workflow require a different approach to event handling. Use the events from the WorkflowEvents class instead of DocumentEvents.

For example, to handle the 'update' action for a page under workflow, use the SaveVersion event from WorkflowEvents instead of the DocumentEvents.Update event.

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

DocumentEventArgs

  • TargetParentNodeID (int)

  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new page is created.

InsertNewCulture

Before
After
Failure

DocumentEventArgs

  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new culture version is created for a page.

InsertLink

Before
After
Failure

DocumentEventArgs

  • TargetParentNodeID (int)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when creating new linked pages.

Update

Before
After
Failure

DocumentEventArgs

  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when an existing page is updated.

Move

Before
After
Failure

DocumentEventArgs

  • TargetParentNodeID (int)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is moved to a different position in the site's content tree.

Copy

Before
After
Failure

DocumentEventArgs

  • TargetParentNodeID (int)
  • IncludeChildren (bool)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new copy of a page is created.

Delete

Before
After
Failure

DocumentEventArgs

  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is deleted.

LogChange

Before
After
Failure

LogDocumentChangeEventArgs

  • Settings (LogDocumentChangeSettings)
    __________________________________

Occurs when the system logs page changes for the purposes of staging and integration. For example, allows you to exclude specific pages from staging.

Example: Excluding content from staging and integration

CheckPermissions

Before
After
Failure

DocumentSecurityEventArgs

  • Node (TreeNode)

  • Permission (PermissionsEnum)

  • User (UserInfo)

  • SiteName (string)

  • Result (AuthorizationResultEnum)
    _____________________________

Occurs when the system checks permissions for pages.

Note: This event does not occur on the live site. For checking permissions on the live site, see the AuthorizeDocument event. 

SortBefore
After
Failure

DocumentSortEventArgs

  • ParentNodeId (int)

  • Ascending (bool)
  • SortType (DocumentSortEnum) ________A_________________
Occurs when sorting of pages is requested.
ChangeOrderBefore
After
Failure

DocumentChangeOrderEventArgs

  • Node (TreeNode)

  • NewOrder (int?)
  • RelativeOrder (bool)
  • OrderType (DocumentOrderEnum)_________________________

Occurs when a change in the order of pages is requested.
GetDataBefore
After
Failure

DocumentDataEventArgs

  • Data (DataSet)
  • Query (IDocumentQuery)
  • TotalRecords (int)

Occurs when the system retrieves page data using the DocumentQuery API.

The Before event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the Data property of the handler's DocumentDataEventArgs parameter, which is empty by default in the Before event.

Use the After event type, when you want to edit the data retrieved from Xperience in the Data property.

The TotalRecords property provides a number of total records in case paging is used. Use -1 to use rows count of the Data property.

Search

CreateSearchFieldsExecute

CreateSearchFieldsEventArgs

  • Fields (IList<ISearchField>)
  • IndexInfo (ISearchIndexInfo)
  • IndexDataSource (SearchIndexDataSourceEnum)
  • SearchFields (IEnumerable<ISearchField>)

Occurs while (re)building a locally stored search index of the Pages type when the system prepares the collection of search fields.

Allows developers to add custom search fields to indexes. Such fields must be added via the Fields property of the handler's CreateSearchFieldsEventArgs parameter.

Values for the custom fields can be assigned for individual pages by handling the CreateSearchFieldsForPage event.

Example: Customizing the content of search indexes

CreateSearchFieldsForPageExecute

CreateSearchFieldsForPageEventArgs

  • Fields (IList<ISearchField>)
  • IndexInfo (ISearchIndexInfo)
  • IndexDataSource (SearchIndexDataSourceEnum)
  • Page (TreeNode)
  • SearchFields (IEnumerable<ISearchField>)

Occurs when the system indexes or updates a page for a locally stored search index of the Pages type. The event triggers separately for each indexed page.

Allows developers to add custom search fields to indexes and set their value for individual pages. Such fields must be added via the Fields property of the handler's CreateSearchFieldsForPageEventArgs parameter. Set field values using the Value property of the added ISearchField object.

Important: Any custom fields must first be registered into your indexes by handling the CreateSearchFields event.

Example: Customizing the content of search indexes

GetContentExecute

DocumentSearchEventArgs

  • Content (string)
  • Node (TreeNode)

  • Settings (SearchIndexSettingsInfo)
  • IndexInfo (ISearchIndexInfo)
  • SearchDocument (ISearchDocument)
  • IsCrawler (bool)

Occurs before the system writes a page's data into a search index (when building or updating indexes).

Allows you to determine exactly how search indexes store page content.

Examples: Customizing the content of search indexes

Page attachments

SaveAttachment

Before
After
Failure

DocumentEventArgs

  • Attachment (DocumentAttachment)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)
    __________________________

Occurs when a file attachment is added to a page or updated.

DeleteAttachment

Before
After
Failure

DocumentEventArgs

  • Attachment (DocumentAttachment)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)
    __________________________

Occurs when a file attachment is removed from a page.

Page security

AuthorizeDocument

Execute

DocumentAuthorizationEventArgs

  • User (UserInfo)

  • Document (TreeNode)

  • PermissionName (string)

  • AuthorizationResult (AuthorizationResultEnum)
    _______________________________________

Occurs when the system performs a security check for the permissions of a specific page.

You can modify the result of the security check by adding your own conditions and setting the AuthorizationResult property of the handler's DocumentAuthorizationEventArgs parameter.

FilterDataSetByPermissions

Execute

DocumentAuthorizationEventArgs

  • User (UserInfo)

  • Data (DataSet)

  • PermissionName (string)
    _______________________________________

Occurs when the system filters a set of pages according to the page permissions of a user.

You can modify the filtering by adding your own conditions and modifying the page data in the Data property of the handler's DocumentAuthorizationEventArgs parameter.

> Back to list of event categories

WorkflowEvents

Namespace: CMS.DocumentEngine

Contains events related to workflow and versioning actions.

Event

Event types

Handler parameters

Description

Approve
_______________________

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is approved to the next step.

Reject

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is rejected back to a previous step

Publish

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • PublishedDocument(TreeNode) - only in the After event

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page reaches the published step.

Archive

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is archived.

Action

Before
After
Failure
___________

WorkflowActionEventArgs<TreeNode, BaseInfo, WorkflowActionEnum>

Requires references to:

  • CMS.WorkflowEngine
  • CMS.DataEngine

Occurs when executing advanced workflow action steps.

Page versioning
SaveVersion

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • VersionHistory (VersionHistoryInfo)

  • VersionNumber (string)
  • VersionComment (string)
  • TreeProvider (TreeProvider)

Occurs when the edited version of a page is updated.
SaveAttachmentVersion

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • Attachment (DocumentAttachment)

  • TreeProvider (TreeProvider)

Occurs when an attachment is updated or inserted for the edited version of a page.
RemoveAttachmentVersion

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • Attachment (DocumentAttachment)

  • TreeProvider (TreeProvider)

Occurs when an attachment is removed for the edited version of a page.
Content locking
CheckOut

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is checked-out.
CheckIn

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is checked-in.
UndoCheckOut

Before
After
Failure

WorkflowEventArgs

  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a user performs the undo check-out action.

> Back to list of event categories

SecurityEvents

Namespace: CMS.Membership

Contains security and authentication events for the Xperience administration interface.

Note: SecurityEvents are only raised for the Xperience administration interface. The events do not occur when users sign in or out on the live site, which uses membership functionality based on ASP.NET Identity (as described in Integrating Xperience membership).

Event

Event types

Handler parameters

Description

Authenticate
_______________________
Execute
___________

AuthenticationEventArgs

  • User (UserInfo)

  • UserName (string)

  • Password (string)

  • SiteName (string)

Occurs when authenticating users into the administration interface.

See also: Handling custom administration authentication

AuthenticationRequestedExecute

AuthenticationRequestEventArgs

  • RequestedUrl (string)

Occurs when a user accesses a restricted section of Xperience and the user's authentication is required.

MultiFactorAuthenticate

Execute

AuthenticationEventArgs

  • User (UserInfo)
  • Passcode (string)
  • UserName (string)

Occurs when a user tries to sign in to Xperience with multi-factor authentication enabled.

See also: Handling custom multi-factor authentication

AuthorizeResource

Execute

AuthorizationEventArgs

  • User (UserInfo)

  • ResourceName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when checking permissions for modules.

AuthorizeClass

Execute

AuthorizationEventArgs

  • User (UserInfo)

  • ClassName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when performing security checks for object type or page type permissions.

AuthorizeUIElementExecute

AuthorizationEventArgs

  • User (UserInfo)

  • ElementName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when checking permissions for UI elements.

SignOut

Before
After
Failure

SignOutEventArgs

  • User (UserInfo)

  • SignOutUrl (string)

Occurs when a user signs out from the administration interface.

> Back to list of event categories

DataProtectionEvents

Namespace: CMS.DataProtection

Contains events related to protection of personal data in the system.

Event

Event types

Handler parameters

Description

RevokeConsentAgreementExecute

___________

RevokeConsentAgreementEventArgs

  • ConsentAgreement (ConsentAgreementInfo)
  • Consent (ConsentInfo)
  • Contact (ContactInfo)

Occurs when a consent agreement is revoked. When a contact's consent agreement is revoked, this event can be used to perform custom actions, such as terminating tracking of the contact or deleting personal data related to the contact.

See also: Creating consents, Working with consents

> Back to list of event categories

EventLogEvents

Namespace: CMS.EventLog

Contains events that occur when logging records into the system's event log.

Event

Event types

Handler parameters

Description

LogEvent
_______________________

Before
After
Failure
___________

LogEventArgs

  • Event (EventLogInfo)

___________________________

Occurs when the system logs a record into the event log. You can use the Before event to customizing the data logged for events or cancel logging for certain types of events. The After event allows you to perform custom actions after events are successfully logged, for example duplicate certain types of events into a custom log.

See also: Customizing event logging

> Back to list of event categories

StagingEvents

Namespace: CMS.Synchronization

Contains events that occur when using content staging for pages and objects.

Event

Event types

Handler parameters

Description

GetChildProcessingTypeExecute

StagingChildProcessingTypeEventArgs

  • ObjectType (string)

  • ParentObjectType (string)

  • ProcessingType (IncludeToParentEnum)

Occurs on the target server when processing create or update staging tasks that include the data of child or binding objects (once for each child or binding type).

For example, staging tasks for roles include the data of binding objects, such as user-role and role-permission relationships. When processing a create or update staging task for a role, the GetChildProcessingType event triggers separately for each binding type included in the role data.

You can use the event to customize how the system handles child and binding object data during staging. For more information, see Customizing staging of child and binding objects.

LogTask
_______________________

Before
After
Failure

StagingLogTaskEventArgs

  • Object (BaseInfo)

  • Task (StagingTaskInfo)

Occurs when creating staging tasks on the source server after a page or object is changed in the system.

See also:

Synchronize

Before
After
Failure

CMSEventArgs

Occurs on the source server when synchronizing staging tasks – once per synchronize action, even when processing multiple tasks.

SynchronizeTask

Before
After
Failure

StagingTaskEventArgs

  • Task (StagingTaskInfo)

Occurs on the source server when synchronizing staging tasks – separately for every processed task.

ProcessTask

Before
After
Failure
___________

StagingSynchronizationEventArgs

  • TaskType (TaskTypeEnum)

  • ObjectType (string)

  • TaskData (DataSet)

  • TaskBinaryData (DataSet)

  • TaskHandled (bool)
  • SyncManager (ISyncManager)

Occurs on the target server when processing incoming staging tasks.

The processing of the staging tasks then also triggers the corresponding DocumentEvents or ObjectEvents (Insert, Update, Delete, etc.).

> Back to list of event categories

IntegrationEvents

Namespace: CMS.Synchronization

Contains events that occur when synchronizing pages or objects between Xperience and other applications using the integration bus.

See also:

Event

Event types

Handler parameters

Description

LogInternalTask
_______________________

Before
After
Failure

IntegrationTaskEventArgs

  • Task (IntegrationTaskInfo)

  • Object (BaseInfo)

Occurs when creating outgoing integration tasks after a page or object in the system is changed.

LogExternalTask

Before
After
Failure
___________

IntegrationTaskEventArgs

  • Task (IntegrationTaskInfo)

  • Object (BaseInfo)

Occurs when the system creates incoming tasks provided by an integration connector.

> Back to list of event categories

ImportExportEvents

Namespace: CMS.CMSImportExport

Contains events related to import and export actions.

Event

Event types

Handler parameters

Description

Import
_______________________

Before
After
Failure

ImportBaseEventArgs

  • Settings (SiteImportSettings)

Occurs at the start of the import process.
ImportObject

Before
After
Failure

ImportEventArgs

  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported object.
ImportObjects

Before
After
Failure

ImportDataEventArgs

  • Settings (SiteImportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)

  • ParentImported (bool)

Occurs when importing sets of objects.
ImportBinding

Before
After
Failure

ImportEventArgs

  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported binding object.
ImportBindings

Before
After
Failure

ImportEventArgs

  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs when importing binding objects.
ImportChild

Before
After
Failure

ImportEventArgs

  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported child object.
ImportChildren

Before
After
Failure

ImportEventArgs

  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs when importing child objects.
GetImportData

Before
After
Failure

ImportGetDataEventArgs

  • Settings (SiteImportSettings)

  • Data (DataSet)
  • Object (BaseInfo)

  • ObjectType (string)
  • SiteObjects (bool)

  • SelectionOnly (bool)

Occurs when importing data. Allows you to work with the data set in the import package created for a specific object types.

  • Use the Before event type to modify the data in the import package (for example add data from an external source).
  • Use the After event type to modify the data after the import package has been loaded.
ProcessFileOperation

Before
After
Failure

ImportProcessFileOperationEventArgs

  • Operation (FileOperation)

  • Settings (SiteImportSettings)

Occurs when processing file/folder operations in the import package.
ImportCanceledExecute

ImportBaseEventArgs

  • Settings (SiteImportSettings)

Occurs when a user cancels the import process.
ImportErrorExecute
___________

ImportErrorEventArgs

  • Exception (Exception)

  • Settings (SiteImportSettings)

Fires when an error occurs during the import process.

Event

Event types

Handler parameters

Description

Export
_______________________

Before
After
Finished
Failure

ExportEventArgs

  • Settings (SiteExportSettings)

  • SiteObjects (bool)
    __________________________

Occurs at the start of the export process.
ExportObjects

Before
After
Failure

ExportEventArgs

  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)
    __________________________

Occurs when exporting objects.
GetExportData

Before
After
Failure

ExportGetDataEventArgs

  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • WhereCondition (string)

  • ChildData (bool)

  • SelectionOnly (bool)

  • Parameters(QueryDataParameters)
    ______________________________

Occurs when exporting data. Allows you to work with the data set in the export package created for specific object types.

  • Use the Before event type to extract data from the export package.
  • Use the After event type to modify the data in the export package.
SingleExportSelectionExecute

SingleExportSelectionEventArgs

  • Settings (SiteExportSettings)

  • InfoObject (BaseInfo)

  • SelectedObject (List<string>)
    __________________________

Occurs when selecting related objects during single object export. Allows you to attach related objects to the export package.
ExportCanceledExecute

ExportBaseEventArgs

  • Settings (SiteExportSettings)
    __________________________

Occurs when a user cancels the export process.
ExportErrorExecute
___________

ExportErrorEventArgs

  • Exception (Exception)
  • Settings (SiteExportSettings)
    __________________________

Fires when an error occurs during the export process.

> Back to list of event categories

DocumentImportExportEvents

Namespace: CMS.DocumentEngine

Contains events related to import and export of pages.

Event

Event types

Handler parameters

Description

ExportDocuments
_______________________

Before
After
Failure

DocumentsExportEventArgs

  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)
    __________________________

Occurs when exporting pages.

ImportDocument

Before
After
Failure

DocumentImportEventArgs

  • Document (TreeNode)
  • Settings (SiteImportSettings)

Occurs once for every imported page.
ImportDocuments

Before
After
Failure

DocumentImportEventArgs

  • Document (TreeNode)
  • Settings (SiteImportSettings)

Occurs when importing pages.

> Back to list of event categories

ColumnsTranslationEvents

Namespace: CMS.DataEngine

When transferring data between instances of Xperience (via import/export or staging), the IDs of objects can differ between the environments. Xperience automatically "translates" the ID values for system objects, but not for custom objects. For example, when you stage a custom table or page type that contains a custom field storing object IDs, the values may not match the IDs of the objects on the target server. The ColumnsTranslationEvents allow you to ensure that the IDs are translated correctly.

See also: Deploying objects with custom ID fields

Event

Event types

Handler parameters

Description

RegisterRecords
_______________________

Execute

ColumnsTranslationEventArgs

  • ObjectType (string)

  • Data (IDataContainer)

  • TranslationHelper (TranslationHelper)
    ______________________________

Occurs when exporting objects. Allows you to provide additional information for the translation of custom ID fields.

TranslateColumns

Execute
___________

ColumnsTranslationEventArgs

  • ObjectType (string)

  • Data (IDataContainer)

  • TranslationHelper (TranslationHelper)
    ______________________________
Occurs when importing objects. Allows you to translate the values of custom ID fields using the provided information.

> Back to list of event categories

ModulePackagingEvents

Namespace: CMS.Modules

Contains events that occur when the system generates installation packages for custom modules.

Event

Event types

Handler parameters

Description

BuildNuSpecManifest
_______________________

Before
After
Failure
___________

BuildNuSpecManifestEventArgs

  • Manifest (NuGet.Manifest)

  • NuSpecBuilder (CMS.Modules.NuSpecBuilder)

  • ResourceName (string)
    __________________________

Occurs when the system creates the .nuspec file for module NuGet packages. The file is an XML manifest containing package metadata. See the .nuspec reference for more information.

The event allows you to customize the package metadata for your modules:

  • The Before event type allows you to adjust the default nuspec content via the Xperience API – use the members of the NuSpecBuilder instance provided by the corresponding property of the handler's BuildNuSpecManifestEventArgs parameter.
  • Use the After event type if you wish to modify or completely replace the resulting nuspec manifest, which is accessible as an instance of the NuGet.Manifest class via the corresponding property of the handler's BuildNuSpecManifestEventArgs parameter.

The ResourceName property of the handler's BuildNuSpecManifestEventArgs parameter contains the code name of the module for which the package is being created.

> Back to list of event categories

BizFormItemEvents

Namespace: CMS.OnlineForms

Contains events related to form actions. See Working with form data using the API for an example.

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

BizFormItemEventArgs

  • Item (BizFormItem)

Occurs when inserting new form items (data records of on-line forms).
Update

Before
After
Failure

BizFormItemEventArgs

  • Item (BizFormItem)

Occurs when updating form data records.
Delete

Before
After
Failure
___________

BizFormItemEventArgs

  • Item (BizFormItem)

Occurs when deleting data records from forms.

> Back to list of event categories

CustomTableItemEvents

Namespace: CMS.CustomTables

Contains events related to custom table actions. See Custom table internals and API.

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

CustomTableItemEventArgs

  • Item (CustomTableItem)

Occurs when inserting new custom table items (data records stored in a custom table).
Update

Before
After
Failure

CustomTableItemEventArgs

  • Item (CustomTableItem)

Occurs when updating custom table items.
Delete

Before
After
Failure
___________

CustomTableItemEventArgs

  • Item (CustomTableItem)

Occurs when deleting custom table items.

> Back to list of event categories

EcommerceEvents

Namespace: CMS.Ecommerce

Contains events related to the E-commerce solution.

Event

Event types

Handler parameters

Description

NewOrderCreated

Execute

NewOrderCreatedEventArgs

  • NewOrder (OrderInfo)

Fires when a new order is created.

The event triggers only when the order is created based on an existing shopping cart. For example, the event does not trigger if an order is created within code using the OrderInfoProvider API.

OrderPaid

_______________________

Execute 

___________


OrderPaidEventArgs

  • Order (OrderInfo)

Fires when an order becomes paid.
ProductAddedToShoppingCartExecute

ProductAddedToCartEventArgs

  • AddedShoppingCartItem (ShoppingCartItemInfo)

Fires when a customer adds a product to their shopping cart.

The event occurs only once when multiple units of the same product are added to the cart within a single action (the ShoppingCartItem object available in the event's ProductAddedToCartEventArgs parameter can represent any number of product units).

> Back to list of event categories

NewsletterEvents

Namespace: CMS.Newsletters

Contains events related to Email marketing.

EventEvent typesHandler parametersDescription
ResolveMacros
_______________________
Before
After
Failure __________

ResolveMacrosEventArgs

  • MacroResolver (MacroResolver)
  • TextToResolve (string)
  • Newsletter (NewsletterInfo)
  • IssueInfo (IssueInfo)_______________________
Occurs when all email feed text macros are resolved.
GenerateQueueItemsBefore
After
Failure ____

GenerateQueueItemsEventArgs

  • Subscriber (SubscriberInfo)
  • Issue (IssueInfo)
  • EmailAddressBlocker (IEmailAddressBlocker)
  • GeneratedEmails (HashSet<string>)_______________________

Occurs when an email feed is sent to one or more recipients. You can use this event to manually add emails to the queue for custom recipients.

Note: The GeneratedEmails property is used only with Newsletter email feeds and its primary purpose is to check duplicates in the newsletter recipients.


GeneratePreviewBefore
After
Failure _

GeneratePreviewEventArgs

  • Subscriber (SubscriberInfo)
  • Issue (IssueInfo)
  • PreviewHtml (string)_______________________
Occurs when an email preview is generated for a recipient.
SubscriberUnsubscribesExecute

UnsubscriptionEventArgs

  • Newsletter (NewsletterInfo)
  • Email (string)
  • IssueID (int?)_______________________
Occurs when a recipient unsubscribes from an email feed.
SubscriberOpensEmailExecute

LinksEventArgs

  • IssueInfo (IssueInfo)
  • NewsletterInfo (NewsletterInfo)
  • AdditionalParameters (NameValueCollection) ____________________
Occurs when a recipient opens an email and the open email tracking feature is enabled.
SubscriberClicksTrackedLinkExecute

LinksEventArgs

  • IssueInfo (IssueInfo)
  • NewsletterInfo (NewsletterInfo)
  • AdditionalParameters (NameValueCollection) ____________________
Occurs when a recipient clicks an email link and the email link tracking feature is enabled.

> Back to list of event categories

WebAnalyticsEvents

Namespace: CMS.WebAnalytics

Event

Event types

Handler parameters

Description

CheckAnalyticsConsentExecute

CheckAnalyticsConsentEventArgs

  • ContactId (int) 

  • HasConsent (bool)

Occurs before the system logs any web analytics for visitors (before any processing of the visitor's personal data).

Allows you to disable logging of web analytics based on consent. Assign a handler to the event, create a condition according to your website's consent requirements, and set the HasConsent property of the handler's CheckAnalyticsConsentEventArgs parameter based on the result.

Example: Logging web analytics based on consent

CampaignLaunchedExecuteCMSEventArgs<CampaignInfo>Occurs when a campaign is launched (whether it was originally scheduled or launched directly).
CampaignUTMChangedExecuteCMSEventArgs<CampaignUTMChangedEventArgs>Occurs when the UTM parameter is changed for a campaign.

> Back to list of event categories

ContactManagementEvents

Namespace: CMS.ContactManagement

EventEvent typesHandler parametersDescription
ContactInfosDeleted Execute

ContactinfosDeletedHandlerEventArgs

  • DeletedContactsIds (IEnumerable<int>)

  • DeletedContactsGUIDs (IEnumberable<Guid>)

Occurs when two or more selected contacts are deleted.

When a single contact is deleted, the TypeInfoEvents.Delete event can be used on ContactInfo.TYPEINFO.

> Back to list of event categories

ActivityEvents

Namespace: CMS.Activities

Event

Event types

Handler parameters

Description

ActivityBulkInsertPerformed

Before
After
Failure

CMSEventArgs<IList<IActivityInfo>>

Fires when the system processes on-line marketing activities that are logged in memory, and bulk inserts them to the database.
ActivityProcessedInLogServiceExecute

CMSEventArgs<IActivityInfo>

Fires when an on-line marketing activity is logged and processed. At this point, the activity is only stored in the application memory (activities are regularly processed and saved in bulk to the database – see the ActivityBulkInsertPerformed event).

> Back to list of event categories

AutomationEvents

Namespace: CMS.Automation

Contains events related to marketing automation actions.

Event

Event types

Handler parameters

Description

MoveToNextStep
_______________________

Before
After
Failure

AutomationEventArgs

  • InfoObject (BaseInfo)

  • StateObject (AutomationStateInfo)

  • PreviousStep (WorkflowStepInfo)

Occurs when a contact in an automation process moves to the next step.
MoveToPreviousStep

Before
After
Failure

AutomationEventArgs

  • InfoObject (BaseInfo)

  • StateObject (AutomationStateInfo)

  • PreviousStep (WorkflowStepInfo)

Occurs when a contact in an automation process moves back to the previous step.
Action

Before
After
Failure
___________

WorkflowActionEventArgs<BaseInfo, AutomationStateInfo, AutomationActionEnum>

Requires references to:

  • CMS.WorkflowEngine
  • CMS.DataEngine
Occurs when the system executes a marketing automation action step.
ProcessTrigger

Before
After
Failure

AutomationProcessTriggerEventArgs

  • Options (IEnumerable<TriggerOptions>)

  • TriggerInfo (ObjectWorkflowTriggerInfo)

Occurs when processing triggers for automation processes. The system evaluates triggers periodically in bulk for a certain number of related contacts (represented by the collection in the Options property of the AutomationProcessTriggerEventArgs parameter).

Evaluates the trigger condition and allows you to, for example, insert data into the condition.

> Back to list of event categories

SystemEvents

Namespace: CMS.Base

Contains general system events.

Event

Event types

Handler parameters

Description

Exception
_______________________

Execute
___________

SystemEventArgs

  • Exception (Exception)

  • LogException (bool)

Fires when an unhandled exception occurs in the system.

> Back to list of event categories

SiteEvents

Namespace: CMS.SiteProvider

Contains events related to site actions.

Event

Event types

Handler parameters

Description

Delete
_______________________

Before
After
Failure
___________

SiteDeletionEventArgs

  • User (UserInfo)

  • Context (CMSActionContext)

  • Info (DeletionInfo)

Occurs when a site is deleted from the system.

> Back to list of event categories

SqlEvents

Namespace: CMS.DataEngine

Contains events related to the execution of queries and other database operations.

Event

Event types

Handler parameters

Description

BulkInsertBefore
After
Failure

BulkInsertDataEventArgs

  • Connection (IDataConnection)

  • InsertSettings (BulkInsertSettings)

  • SourceData (DataTable)

  • TargetTable (string)
Occurs when the system creates objects by directly inserting data into a database table (for example when importing contacts from CSV files).
ExecuteQuery
_______________________

Before
After
Failure
___________

ExecuteQueryEventArgs<DataSet>

  • Connection (IDataConnection)

  • Query (QueryParameters)

  • Result (DataSet)

Occurs when the system executes a database query.

Note: The ExecuteQuery event does NOT trigger when the system (or custom code) enumerates through the results of an ObjectQuery call. The ExecuteReader event is triggered instead.

See also: Working with database queries in the API

ExecuteNonQuery

Before
After
Failure

ExecuteQueryEventArgs<int>

  • Connection (IDataConnection)

  • Result (DataSet)

Occurs when the system executes a non-query database operation.

ExecuteScalar

Before
After
Failure

ExecuteQueryEventArgs<object>

  • Connection (IDataConnection)

  • Query (QueryParameters)

  • Result (DataSet)

Occurs when the system executes a scalar query.
ExecuteReader

Before
After
Failure

ExecuteQueryEventArgs<DbDataReader>

  • Connection (IDataConnection)

  • Result (DataSet)

Occurs when the system runs a database DataReader.

Note: This event is triggered when the system (or custom code) materializes an ObjectQuery call, typically by enumerating through the results. However, this is not the case for DocumentQuery calls, which trigger the ExecuteQuery event instead.

> Back to list of event categories

Application events

Xperience provides a set of events that you can use to customize the global behavior of the application.

ApplicationEvents

Namespace: CMS.Base

Contains events related to the application life cycle.

The following table lists the events that occur once in the application's life cycle, in order of execution:

Event

Event types

Handler parameters

Description

PreInitialized
_______________________
Execute
___________
EventArgs
___________________

Occurs when the application finishes pre-initialization (preparation of things unrelated to the database).

Handlers need to be assigned in the PreInit method of custom modules.

InitializedExecuteEventArgsOccurs when the application finishes initialization and starts (including all modules and the database connection). Handle this event to perform standard application start events.
PostStartExecuteEventArgs

Occurs at the end of the first application request. Allows you to perform asynchronous tasks needed for application startup.

Running long operations within this event's handlers can negatively affect the response time of the first request when starting the application.

End

Execute

EventArgs

Occurs when the application ends.

The following events occur as needed during the application life cycle:

Event

Event types

Handler parameters

Description

Error

Execute

EventArgsFires when an error occurs in the application.
SessionStartExecuteEventArgsOccurs when an HTTP session starts for a client.
SessionEndExecuteEventArgsOccurs when an HTTP session ends for a client. May not be raised if the application is configured to use a session state mode different than InProc.

RequestEvents

Namespace: CMS.Base

Contains events related to handling of requests. See also: ASP.NET Application Life Cycle Overview

The following table lists the request events in order of execution:

Event

Event types

Handler parameters

Description

PrepareExecute

EventArgs

Occurs before the request processing begins.
BeginExecute

EventArgs

Occurs when the request processing starts.

AuthenticateExecuteEventArgsOccurs when authenticating requests.
AuthorizeExecuteEventArgsOccurs when authorizing requests.
PostAuthorizeExecuteEventArgsOccurs after the request's user is authorized.
PostResolveRequestCacheExecuteEventArgs

Occurs when ASP.NET bypasses execution of the current handler and allows a caching module to serve the request from the cache.

MapRequestHandlerExecuteEventArgs

Occurs when a handler is selected to respond to the request.

PostMapRequestHandlerExecuteEventArgs

Occurs after the application has mapped the request to the appropriate event handler.

AcquireRequestState

Execute

EventArgs

Occurs when acquiring the state (for example session state) that is associated with the current request.

PostAcquireRequestStateExecuteEventArgsOccurs after the request state (for example session state) that is associated with the current request has been obtained.
EndExecuteEventArgsOccurs at the end of the request processing.

PreSendRequestHeaders

ExecuteEventArgsOccurs just before ASP.NET sends HTTP headers to the client.
RunEndRequestTasksExecuteEventArgsAllows you to execute background tasks at the end of the request processing. Running long tasks in this event's handlers can negatively affect the response time of requests.
Finalize
_______________________
Execute
___________
EventArgs
___________________
Occurs when the request is finalized. Use to cleanup and release any resources used by the request. Running long tasks in this event's handlers can negatively affect the response time of requests.

Handling other HttpApplication events

If you wish to handle HttpApplication events that are not available in the Xperience RequestEvents class, you need to create and register a custom HTTP module.

See Walkthrough: Creating and Registering a Custom HTTP Module for more information.

SessionEvents

Namespace: CMS.Membership

Contains events related to session management.

Event

Event types

Handler parameters

Description

UpdateSession

Before
After
Failure

CMSEventArgsOccurs when an HTTP session is updated.

UpdateSessionData

_______________________

Execute
___________


CMSEventArgs<SessionInfo>

  • Parameter (SessionInfo)

Occurs when the data of an HTTP session is updated.

> Back to list of event categories