Programmer : CloudView Programmer : Customizing CloudView : Packaging Custom Components as Plugins
 
Packaging Custom Components as Plugins
 
Package a Plugin
Deploy a Plugin
Work with Plugins in Development Mode
Plugins are components or resources that can be hot plugged without restarting the product. They are installed in the DATADIR, and are therefore instance-wide.
You can upload plugins using the Administration Console.
To load your custom code in Exalead CloudView, you must package it as a CVPlugin.
Packaging your code as a plugin allows Exalead CloudView to:
Detect it automatically.
List the possible components for a given role (like "all custom prefix handlers").
Provide information about the default configuration.
Package a Plugin
A CVPlugin is a simple ZIP file containing the following structure:
/lib/
myjar1.jar
myjar2.jar
/META-INF/
cvplugin.properties
cvplugin.properties can contain the following keys:
plugin.description
plugin.version
plugin.copyright
plugin.author
The JARs must contain the components and their associated classes, including config classes. A plugin ZIP file can include several components. All of them are taken into account.
// Optionally a set of hints about the content
components.widgets = MyWidget1, MyWidget2
components.resources = MyResource1
components.cvcomponents = MyClass1, MyClass2

// CVComponents are usually automatically detected, but this may be required for specific use cases.

// Optionally, a set of properties about a given component
component.MyResource1.license = Commercial, contact foo@acmecorp.com
Each plugin is loaded in its own classloader, avoiding many common conflict cases.
Deploy a Plugin
You can deploy your plugins using the Administration Console or the cvadmin tool on the command line.
Install a Plugin in the Administration Console
1. Go to Deployment > Plugins
2. Click Upload plugin and browse for your file.
Install a Plugin on the Command Line
You can install plugins regardless of whether the Exalead CloudView product is running or stopped.
1. Go to <DATADIR>/bin and run:
./cvadmin plugins
2. Enter:
Note: For multihost installs, run this command on the master host to distribute the plugin to all hosts automatically.
3. Restart the processes for which you are going to use its components, typically the search­server, or analyzer.
You can then use the plugin.
List Installed Plugins
1. From the <DATADIR>/bin, get the list of the installed Exalead CloudView plugins:
./cvadmin plugins list
Uninstall a Plugin
1. From the <DATADIR>/bin, get the list of the installed Exalead CloudView plugins:
./cvadmin plugins list
2. Remove the plugin:
./cvadmin plugins remove name=myplugin
Work with Plugins in Development Mode
The process of packaging as a ZIP and then installing can be too time-consuming at the development stage, when you generally do not need full versioning and multiple-host installations, but do need a short testing cycle.
In that case, you can use dev plugins, as you do not need to package them as ZIP. Instead, you copy the JAR file.
The limitation is that dev plugins are not automatically distributed on all instances of the Exalead CloudView cluster.
1. Upload your JAR to: <DATADIR>/extrajava/devplugins/<MY_PLUGIN_NAME>/lib
Typically, you can put all your JARs in the same plugins folder. A default folder, default_dev_plugin exists.
Recommendation: Because of potential class conflicts, it is better to create your own dev plugins folder.
2. Restart the processes for which you are going to use its components, typically the searchserver, or analyzer.