EventHub API

The GatherContent Connector have implemented event system by the conventions of Sitefinity. With the help of it developers can subscribe to various events and extend or change the workflow of the main import processes.

1. Import/Update events



  • IItemImporting - This interface is implemented by all events raised before item is imported (updated), e.g. before the item is saved. Subscribe to the event through the interface using the following code:


In the event handler you have access to the following properties:

  • Cancel - if set to true, the built-in logic for importing the item will be skipped. No logs will be saved.
  • SitefinityItem - the item that’s about to be imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this Sitefinity item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - gets or sets the Origin.
  • Importer - the importer that is about to be used.


The following example demonstrates how to cancel the importing and handle it with your own code logic:


  • IItemImported - This interface is implemented by all events raised after item is imported (updated). Subscribe to the event using the following code:


In the event handler you have access to the following properties:

  • SitefinityItem - the item that was imported.
  • GatherContentItem - the GatherContent item that was imported.
  • GatherContentItems - the collection of GatherContent items for that session that were or are about to be imported.
  • PreviousImportLog - The log for any other imports done in the past for this Sitefinity item.
  • CurrentImportLog - The log for the imported item that was written to the import history.
  • Mapping - The mapping configuration that was used to import the item.
  • Origin - Gets or sets the origin.
  • Importer - The importer that was used to import the item.


The following is a code example of the event handler:


2. Property resolve events

  • IPropertyResolving - This interface is implemented by all events that are raised before the property is transformed, e.g. before the value is transformed by the corresponding transformer and set to item. Use the following code to subscribe to the event:


In the event handler you have access to the following properties:

  • Cancel - if set to true, the built-in logic for property transforming and setting the value will be skipped.
  • SitefinityItem - the item that’s about to be imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this Sitefinity item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - gets or sets the Origin.
  • Transformer - the transformer that is about to be used on the property.
  • Importer - the importer that is about to be used.


The following is a code example of the event handler:


  • IPropertyResolved - This interface is implemented by all events that are raised after a property has been transformed, e.g. the property value was transformed by the corresponding property transformer. You can subscribe to the event the following way:


In the event handler you have access to the following properties:

  • SitefinityItem - the item that is about to be imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - Gets or sets the Origin.
  • Transformer - the transformer that was used for the property transformation.
  • Importer - the importer that is about to be used.
  • PropertyName - the Sitefinity property that was set.
  • Value - the transformed value that was set.


The following is a code example of the event handler:


3. Page Content apply events

  • IPageContentApplying - This interface is implemented by all events that are raised before a content is applied to a page.Subscribe to the event the following way:


In the event handler you have access to the following properties:

  • Cancel - if set to true, the built-in logic for page content applying will be skipped.
  • SitefinityItem - the item that’s about to be imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - Gets or sets the Origin.
  • Transformer - the transformer that is about to be used on the property.
  • Importer - the importer that is about to be used.
  • PageDraft - the page draft item for the page that is about to be imported.


The following is a code example of the event handler:


  • IPageContentApplied - This interface is implemented by all events that are raised after a content is applied to a page. Subscribe to the event the following way:


In the event handler you have access to the following properties:

  • SitefinityItem - the item that is about to be or was imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - Gets or sets the Origin.
  • Importer - the importer that is about to be used.
  • PageDraft - the page draft item for the page that is about to be or was imported.


The following is a code example of the event handler:


4. Page Control add events



  • IPageControlAdding - This interface is implemented by all events that are raised before adding a page control. Subscribe to the event the following way:


In the event handler you have access to the following properties:

  • Cancel - if set to true, the built-in logic for control adding will be skipped.
  • SitefinityItem - the item that is about to be imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - gets or sets the Origin.
  • Importer - the importer that is about to be used.
  • PageDraft - the page draft item for the page that is about to be imported.
  • Layout - the layout control that contains the placeholder where the page control is about to be added.
  • Placeholder - the placeholder where the page control is about to be added.
  • Value - the transformed field value that is about to be added.


The following is a code example of the event handler:


  • IPageControlAdded - This interface is implemented by all events that are raised after adding a page control. Subscribe to the event the following way:


In the event handler you have access to the following properties:

  • SitefinityItem - the item that is about to be or was imported.
  • GatherContentItem - the GatherContent item that’s about to be imported.
  • GatherContentItems - the all GatherContent items that are about to be imported in that importing session.
  • PreviousImportLog - the log for any other imports done in the past for this item.
  • CurrentImportLog - the log that is about to get written to the import history.
  • Mapping - the mapping configuration for the current item.
  • Origin - gets or sets the Origin.
  • Importer - the importer that is about to be used.
  • PageDraft - the page draft item for page that is about to be or was imported.
  • Layout - the layout control that contains the placeholder where the page control was added.
  • Placeholder - the placeholder where the page control was added.
  • Value - the transformed field value that was added.
  • AddedControl - the control that was added to the page in the corresponding placeholder.


The following is a code example of the event handler:


Note: Do not forget to include