Quick Reference: Custom Hooks API
The table below provides a quick reference to Custom Hook methods. For full Custom Hooks API documentation, see Custom Hooks API Documentation.
Method | Arguments | Description |
---|---|---|
OnNew | IPage page IUserWriteSession session | This method is invoked after a new content node is created. Use Cases:
|
OnRename | string oldName string newName IPage page IUserWriteSession session | This method is invoked after a Page is renamed. Caution Assigning this method to Page.Name inside the method creates an
infinite loop. Use Cases:
|
OnBeforeAssign | IPage page IUserWriteSession session | This method is invoked before a Page is assigned to a User. Caution Calling Page.AssignUser or Page.AssignGroup inside this method
creates an infinite loop. |
OnAfterAssign | IPage page IUserWriteSession session | This method is invoked after a Page is assigned to a User. Caution Calling Page.AssignUser or Page.AssignGroup inside this method
creates an infinite loop. Use Cases:
|
OnBeforeCheckIn | IPage page bool recursive IUserWriteSession session | This method is invoked before a Page is checked in. |
OnAfterCheckIn | IPage page bool recursive IUserWriteSession session | This method is invoked after a Page is checked in. Use Cases:
|
OnBeforeCheckOut | IPage page bool recursive IUserWriteSession session | This method is invoked before a Page is checked out. Use Case: Check out companion content such as components, so the user can work on all the content at once. |
OnAfterCheckOut | IPage page bool recursive IUserWriteSession session | This method is invoked after a Page is checked out. |
OnBeforeCopy | IPage sourcePage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked before a Page gets copied. Use Case: Create a version of a piece of content. |
OnAfterCopy | IPage sourcePage IPage newPage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked after a Page gets copied. Use Case: Update a piece of content on the new page to indicate something about the sources, such as the version of the page that was copied or categories that were applied. |
OnBeforeDelete | IPage page UserWriteSession session | This method is invoked before a Page is moved to the recycle folder, where it can be deleted, permanently. Use Cases:
|
OnAfterDelete | string pageId bool permanent IPage page IUserWriteSession session | This method is invoked after a Page is moved to the recycle folder. Use Cases:
|
OnBeforeMarkForPublish | IPage page bool recursive IEnumerable markedTargets IEnumerable unmarkedTargets IUserWriteSession session | This method is invoked before a Page is marked or unmarked for publish. Use Case: Verify that certain data is present, otherwise cancel the action. |
OnAfterMarkForPublish | T contentItem bool recursive IEnumerable<PublishingTargetWithMarkedVersion> markedTargets IEnumerable<IPublishingTarget> unmarkedTargets IUserWriteSession session | This method is invoked after a Page is marked or unmarked for publish. Use Cases:
|
OnBeforeMove | IPage sourcePage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked before a Page is moved to another location. Use Case: Cancel the move if the destination is unacceptable. |
OnAfterMove | IPage sourcePage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked after a Page is moved to another location Use Cases:
|
OnBeforePasteSpecial | IPage sourcePage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked before a Page gets copied via special command. On the CMS UI, the Paste Special command is executed via drag-and-drop by pressing Alt instead of Ctrl. At its core, the Paste Special command is just a copy command, which this hook method invoked. Use Case: Ensure certain values are set correctly, and cancel the paste if they aren't. |
OnAfterPasteSpecial | IPage sourcePage IPage newPage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked after a Page gets copied via special command. On the CMS UI, the Paste Special command is executed via drag-and-drop by pressing Alt instead of Ctrl. At its core, the Paste Special command is just a copy command, which this hook method invoked. Use Cases:
|
OnBeforeRollback | IPage page IUserWriteSession session | This method is invoked before a Page is rolled back to its previous version. |
OnAfterRollback | IPage page IUserWriteSession session | This method is invoked after a Page is rolled back to its previous version. Use Cases:
|
OnBeforeUndoCheckOut | IPage page bool recursive IUserWriteSession session | This method is invoked before a Page abandons its checked-out version and goes back to a checked in-state. |
OnAfterUndoCheckOut | IPage page bool recursive IUserWriteSession session | This method is invoked after a Page abandons its checked-out version and goes back to a checked in-state. Use Case: Save information about page content before it's lost by undoing check-out. |
OnBeforeCrossLocaleCopy | IPage sourcePage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked before a non-Region-Root Page gets copied to under another Region Root. |
OnAfterCrossLocaleCopy | IPage sourcePage IPage newPage IPage targetPage EnumCopyActions relation IUserWriteSession session | This method is invoked after a non-Region-Root Page gets copied to under another Region Root. Use Cases:
|
OnBeforeRegionRootCopy | IPage sourcePage IPage targetPage EnumCopyActions relation string targetLocale IUserWriteSession session | This method is invoked before a Region Root Page is cloned to another Region Root Page, with lingual maps established between the two Regions. |
OnAfterRegionRootCopy | IPage sourcePage IPage newPage IPage targetPage EnumCopyActions relation string targetLocale IUserWriteSession session | This method is invoked after a Region Root Page is cloned to another Region Root Page, with lingual maps established between the two Regions. Use Cases:
|
OnBeforeEmptyRecycleFolder | IPage recycleFolder IUserSession session | This method is invoked before all Pages in the recycle folder are permanently
removed. Use Case: Write a log file of all the items that were inside the recycle folder. |
OnAfterEmptyRecycleFolder | IPage recycleFolder IUserSession session | This method is invoked after all Pages in the recycle folder are permanently
removed. Use Case: Send an email with the contents of the log file to previous owners of the items that were removed. |
OnCategoryCreated | ICategoryNode category IUserWriteSession session | This method is invoked after a Category Node is created. Use Case: Create a matching category in a secondary system, such as a database or marketing system. |
OnCategoryRenamed | string oldName string newName ICategoryNode category IUserWriteSession session | This method is invoked after a Category Node was created. Caution Assigning to CategoryNode.Name in this method creates an infinite
loop. Use Cases:
|
OnBeforeCategoryDelete | ICategoryNode category IUserWriteSession session | This method is invoked before a Category Node is deleted. |
OnAfterCategoryDelete | ICategoryNode category IUserWriteSession session | This method is invoked after a Category Node is deleted. Use Cases:
|
OnUserCreated | IUser user IUserWriteSession session | This method is invoked after a User is created. Use Cases:
|
OnUserGroupCreated | IUserGroup userGroup IUserWriteSession session | This method is invoked after a UserGroup is created. Use Cases:
|
OnBeforeUserDelete | IUser user IUserWriteSession session | This method is invoked before a User is deleted. |
OnAfterUserDelete | IUser user IUserWriteSession session | This method is invoked after a User is deleted. Use Cases:
|
OnBeforeUserGroupDelete | IUserGroup userGroup IUserWriteSession session | This method is invoked before a UserGroup is deleted. |
OnAfterUserGroupDelete | IUserGroup userGroup IUserWriteSession session | This method is invoked after a UserGroup is deleted. Use Cases:
|
OnBeforeWorkflowAdvance | ITransition transition IUserWriteSession session | This method is invoked before a Workflow advances through a Transition. |
OnAfterWorkflowAdvance | ITransition transition IUserWriteSession session | This method is invoked after a Workflow advances through a Transition. Use Cases:
|
OnBeforePublish | IPublishingTarget pubTarget bool fullPublish IEnumerable pagesToPublish IUserWriteSession session | This method is invoked before a Publishing Task is submitted. Use Cases:
|
OnPublishComplete | IPublishingTarget pubTarget bool fullPublish IEnumerable pagesToPublish Exception publishError IUserWriteSession session | This method is invoked after a Publishing Task is completed. Use Cases:
Warning In CMS 10.0–10.5, the custom hook method
OnPublishComplete failed if an error or cancellation occurred during a
publish operation. In CMS 10.5+, the OnPublishComplete method always
executes, even after a publish interruption. Developers who relied on the previous
behavior in their Custom Hooks code must update their code to account for this
change. |
OnBeforeEntitySave | IEntity entity IUserWriteSession session | This method is invoked before any type of Ingeniux CMS CSAPI entity object is saved. |
OnBeforeUpload | IUserWriteSession session ref System.IO.Stream uploadStream refstring filename refstring targetPhysicalFolder | This method is invoked before the Ingeniux CMS site's server processes a file upload. |
OnAfterUpload | IUserWriteSession session System.IO.FileInfo uploadedFile int fileSize | Overloaded method. This method is invoked after the Ingeniux CMS site's server processes a file upload. Signed 32-bit integer. Framework type: System.Int32. |
OnAfterUpload | IUserWriteSession session System.IO.FileInfo uploadedFile long fileSize | Overloaded method. This method is invoked after the Ingeniux CMS site's server processes a file upload. Signed 64-bit integer. .NET Framework type: System.Int64. |
OnBeforeLogout | IReadonlyUser user | This method is invoked before a user attempts to log out. |
OnAfterLogout | string loggedOutUserId | This method is invoked after a user logged out. |
OnAssetCategorizationChange | ICategoryNode categoryIAsset assetEnumCategorizationAction action | This method is invoked for an Asset when its categorization changes. |
OnPageCategorizationChange | ICategoryNode category IPage page EnumCategorizationAction action | This method is invoked for a Page when its categorization changes. |
OnBeforeWorkflowAdvanceAsset | ITransition transition IAsset asset IWorkflow workflow IUserWriteSession session | This method is invoked for an Asset before a Workflow advances through a Transition. |
OnAfterWorkflowAdvanceAsset | ITransition transition IAsset asset IWorkflow workflow IUserWriteSession session | This method is invoked for an Asset after a Workflow advances through a Transition. |
OnNewAsset | IAssetItem asset Stream file IUserWriteSession session | This method is invoked after a new Asset node is created. |
OnUpdateAsset | IAssetItem asset Stream newFile IUserWriteSession session | This method is invoked when an Asset is updated. |
OnRenameAsset | string oldName string newName IAssetItem contentItem IUserWriteSession session | This method is invoked after an Asset is renamed. |
OnBeforeAssignAsset | IAssetItem contentItem IUserWriteSession session | This method is invoked before an Asset is assigned to a User. |
OnAfterAssignAsset | IAssetItem contentItem IUserWriteSession session | This method is invoked after an Asset is assigned to a User. |
OnBeforeCheckInAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked before an Asset is checked in. |
OnAfterCheckInAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked after an Asset is checked in. |
OnBeforeCheckOutAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked before an Asset is checked out. |
OnAfterCheckOutAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked after an Asset is checked out. |
OnBeforeCopyAsset | IAssetItem sourcecontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked before an Asset gets copied. |
OnAfterCopyAsset | IAssetItem sourcecontentItem IAssetItem newcontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked after an Asset gets copied. |
OnBeforeDeleteAsset | IAssetItem contentItem IUserWriteSession session | This method is invoked before an Asset is moved to the recycle folder, where it can be deleted, permanently. |
OnAfterDeleteAsset | string contentItemId bool permanent IAssetItem contentItem IUserWriteSession session | This method is invoked after an Asset is moved to the recycle folder. |
OnBeforeMarkForPublishAsset | IAssetItem contentItem bool recursive IEnumerable markedTargets IEnumerable unmarkedTargets IUserWriteSession session | This method is invoked before an Asset is marked or unmarked for publish. |
OnAfterMarkForPublishAsset | IAssetItem contentItem bool recursive IEnumerable markedTargets IEnumerable unmarkedTargets IUserWriteSession session | This method is invoked after an Asset is marked or unmarked for publish. |
OnBeforeMoveAsset | IAssetItem sourcecontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked before an Asset is moved to another location. |
OnAfterMoveAsset | IAssetItem sourcecontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked after an Asset is moved to another location. |
OnBeforeRollbackAsset | IAssetItem contentItem IUserWriteSession session | This method is invoked before an Asset is rolled back to its previous version. |
OnAfterRollbackAsset | IAssetItem contentItem IUserWriteSession session | This method is invoked after an Asset is rolled back to its previous version. |
OnBeforeUndoCheckOutAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked before an Asset abandons its checked-out version and goes back to a checked in-state. |
OnAfterUndoCheckOutAsset | IAssetItem contentItem bool recursive IUserWriteSession session | This method is invoked after an Asset abandons its checked-out version and goes back to a checked in-state. |
OnBeforeCrossLocaleCopyAsset | IAssetItem sourcecontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked before a non-Region-Root Asset gets copied to under another Region Root. |
OnAfterCrossLocaleCopyAsset | IAssetItem sourcecontentItem IAssetItem newcontentItem IAssetFolder targetcontentItem IUserWriteSession session | This method is invoked after a non-Region-Root Asset gets copied to under another Region Root. |
OnBeforeRegionRootCopyAsset | IAssetItem sourcecontentItem IAssetFolder targetcontentItem string targetLocale IUserWriteSession session | This method is invoked before a Region Root Asset is cloned to another Region Root Asset, with lingual maps established between the two Regions. |
OnAfterRegionRootCopyAsset | IAssetItem sourcecontentItem IAssetItem newcontentItem IAssetFolder targetcontentItem string targetLocale IUserWriteSession session | This method is invoked after a Region Root Asset is cloned to another Region Root Asset, with lingual maps established between the two Regions. |
OnBeforeEmptyAssetRecycleFolder | IAssetFolder recycleFolder IUserSession session | This method is invoked before all Assets in the recycle folder are removed, permanently. |
OnAfterEmptyAssetRecycleFolder | IAssetFolder recycleFolder IUserSession session | This method is invoked after all Assets in the recycle folder are removed, permanently. |
OnAfterEntitySave | IEntity entity IUserWriteSession session | This method is invoked after any type of Ingeniux CMS CSAPI Entity object was saved. |