Skip to content

How to create CRCE plugin or indexer

Vít Mazín edited this page Jan 8, 2020 · 3 revisions

How to create new CRCE plugin

Before creating new plugin, please see Metadata API page to understand what are basic objects that represents artifacts in CRCE.

Module crce-import-indexer was created as example CRCE plugin and indexer. Follow these steps to create CRCE plugin (all links will lead into example plugin implementation or into CRCE core classes):

  1. Create new Maven module under Modules in CRCE project.

  2. In module pom.xml set build plugin, symbolic name, namespace and parent as shown in example plugin.

  3. Ensure that this new module is set as module in crce-modules-parent pom.xml.

  4. In crce-defaul-modules pom.xml has to be dependency to this new Maven module.

  5. Create main class of new plugin (example implementation is here). This class has to implement Plugin interface or it can extends AbstractPlugin. AbstractPlugin class has default implementation of Plugin interface which can be modified. If the new plugin has to be CRCE indexer it needs to extends AbstractResourceIndexer. For more information about indexers see below.

  6. Create Activator class which extends OSGi activator. This class will be used by OSGi framework to create instance of plugin and it will also tell which other OSGi bundles should be injected to your classes. Main class of plugin has to be registered as implementation of Plugin interace.

  7. In root package of new plugin has to be file osgi.bnd which is used as configuration for OSGi framework. This file has to contain at least which class is used as OSGi activator.

How to create new CRCE indexer

Every steps are identical as if new plugin is created except step 5. Main class of new indexer has to extend AbstractResourceIndexer class. This class has to override methods of AbstractResourceIndexer as shown in example indexer.

For more informations how exactly is indexer called see Main filter chain page.

Clone this wiki locally