Catalog events - best way to get notifications?

Vote:
 

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: http://world.episerver.com/documentation/Class-library/?documentId=commerce/7.5/16185B93. 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: http://world.episerver.com/documentation/developer-guides/commerce/catalogs/catalog-content/catalog-events/. 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.

Regards

Anders

#176054
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.