The configurer

The configurer class is the main entry point for a plugin and every plugin needs one. It allows you to add resources to the frontend, manage configurations, listen on events and do Spring related things.

The class needs to implement the interface com.novomind.ishop.core.plugin.config.PluginConfigurer or derive from the abstract class com.novomind.ishop.core.plugin.config.PluginConfigurerAdapter. The PluginConfigurerAdapter is recommended as this adapter already overwrites all methods so you only need to overwrite those that your plugin needs.

The configurer is referenced in the manifest file:

<metadata>
  <ishop:ishop-plugin>
    <ishop:configurer>com.novomind.plugin.helloworld.DefaultPluginConfigurer</ishop:configurer>
  </ishop:ishop-plugin>
</metadata>

A sample configurer may look like this

@Configuration
@ComponentScan(basePackageClasses = DefaultPluginConfigurer.class)
public class DefaultPluginConfigurer extends PluginConfigurerAdapter {

  @Override
  public void configureViewSnippetMapping(final ViewSnippetConfigurer configurer) {
    // do configuration here
  }

  @Override
  public void configureConfigurationTemplate(final ConfigurationTemplateConfigurer configurer) {
    // do configuration here
  }
}

Configure view snippets

Overwrite the configureViewSnippetMapping method to configure the view snippets. View snippets allow you to embed JSPs into the novomind iSHOP frontend.

See chapter viewsnippets for more details.

Configure the plugin configuration

Each plugin can be configured individually. The configuration can be managed in the novomind iSHOP backoffice.

Overwrite the configureConfigurationTemplate method to edit the plugins configuration.

See chapter Configuration for more details.

Configure events

Overwrite the configureEvents method if you want your plugin to react to events sent out by the novomind iSHOP.

See chapter events for more details.

Spring

The configurer class is the base for the Spring application context iSHOP creates exclusively for the plugin.

See chapter Spring to find out more about this.