Try our conversational search powered by Generative AI!

Catalog events - best way to get notifications?


Hi forum

I'm trying to get notifications when something changes in the Catalog, so that I can update my Solr index. Data is imported using the CatalogImportExport method.

I have taken a look at the CatalogEventListenerBase, and registered my listener this way:

[ServiceConfiguration(typeof(CatalogEventListenerBase), Lifecycle = ServiceInstanceScope.Singleton)]
public class MyCatalogListener : CatalogEventListenerBase{...}

This seems to work, and my code gets called. At least sometimes.

When changes are made to a CatalogNode, the NodeUpdating and NodeUpdated methods are called. However I'm actually only interrested in the entries since that is what I'm indexing. I guess i could try to load all entries below the affected nodes, but based on other issues, I know that Episerver already does this somewhere else, and it can take some time to complete, so I don't want to do this twice.

I have then found the EPiServer.Events.ChangeNotification.IChangeProcesser interface, and found a way to receive CatalogEntryChange notifications. Now I get notified about each affected entry when a node is changed. However the remarks for the CatalogEntryChange class says that this is for Internal Use Only: This document is for version 7.5, so perhaps it is not something that is going to change very soon?

Then I have found some documentation on this page: This lists three new ways of receiving events.

So now I start get confused :)

I would like to be notified about modifications to CatalogEntries in at least these situations:

  1. Entry created/modified/deleted (modifications include modifications only to metafields)
  2. CatalogNode modifications/deletions, so that I can reindex all child entries. Hopefully I don't have to load the child entries myself, if Episerver already loads them.
  3. NodeRelation created/moved(?)/deleted, so that I can reindex entries when they change place in the hierarchy or are removed from the hierarchy

Do you know if there is one place where I can get all these notifications? And also the notifications that I have forgotten to mention, but that I just can't live without :)

Thank you for your help.



Mar 08, 2017 16:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.