-
Notifications
You must be signed in to change notification settings - Fork 3
How to create CRCE plugin or indexer
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):
-
Create new Maven module under Modules in CRCE project.
-
In module
pom.xml
set build plugin, symbolic name, namespace and parent as shown in example plugin. -
Ensure that this new module is set as module in
crce-modules-parent pom.xml
. -
In
crce-defaul-modules pom.xml
has to be dependency to this new Maven module. -
Create main class of new plugin (example implementation is here). This class has to implement
Plugin
interface or it can extendsAbstractPlugin
.AbstractPlugin
class has default implementation ofPlugin
interface which can be modified. If the new plugin has to be CRCE indexer it needs to extendsAbstractResourceIndexer
. For more information about indexers see below. -
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 ofPlugin
interace. -
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.
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.
[ CRCE wiki ]