Events

The event subsystem is based on Spring application events.

To register a listener for a specific event you need to create a class and define a method like this:

@Component
public class PluginEventListener {

  @EventListener
  public void productChanged(final ProductChangeEvent event) {}
  @EventListener
  public void productViewed(final ProductViewEvent event) {}

  @EventListener
  public void teaserClicked(final TeaserClickEvent event) {}
  @EventListener
  public void teaserViewed(final TeaserViewEvent event) {}
}

This class has to be registered as a Spring service and it`s methods get executed as soon as such an event is fired by the novomind iSHOP.

All available events are located in the package com.novomind.ishop.api.modules.event.model of the ishop-api project.