Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Plugins

rjrudin edited this page Mar 26, 2019 · 3 revisions

"Plugins" in this context refers to MarkLogic system plugins (not to be confused with Data Hub Framework plugins). As of version 3.13.0, ml-app-deployer includes support for making and installing plugins, along with uninstalling them as well.

For an example of this feature, please see the test for installing plugins, along with the example plugin directory.

Installing plugins

Installing plugins has the following default behavior:

  1. src/main/ml-plugins is the default path for finding plugins to install.
  2. Each plugin should be in its own directory under a plugin path - e.g. src/main/ml-plugins/variance would be the directory for a plugin presumably named "variance".
  3. ml-app-deployer will try to execute the "make" command in a plugin directory. To support this, a "Makefile" file is expected to be found in the directory, along with the C++ source files required for the plugin.
  4. ml-app-deployer will then insert the zip file (produced by making the plugin) into a database in MarkLogic. By default, this will be via a DatabaseClient that uses the port defined by appConfig.getRestPort(). This can be overridden by specifying a database name, in which case appConfig.getAppServicesPort() will be used for making a connection.
  5. Finally, ml-app-deployer will then install the plugin by evaulating an XQuery script using the MarkLogic plugin API.

Uninstalling plugins

Uninstalling plugins operates in a similar fashion to installing plugins, but instead of inserting a zip and installing a plugin from it, ml-app-deployer determines the "scope" of the plugin and then uninstalls it. The "scope" is read from the metadata.xml file that's generated when the plugin is compiled; thus, if that file doesn't exist, the "make" command will be executed.

Once the "scope" is determined, the MarkLogic plugin API is used to uninstall the plugin.

Properties

The following properties are available for configuring this feature (all, unless otherwise noted, were introduced in 3.13.0):

Property Description
mlPluginDatabaseName Database to insert plugin zips into; if set, then ml-app-deployer will connect via the App-Services app server to load the documents. No default value.
mlPluginInstallationEnabled Whether this feature is enabled. Defaults to true.
mlPluginPaths Comma-delimited list of plugin paths. Defaults to "src/main/ml-plugins".
mlPluginUriPrefix Prefix for the URI that a plugin zip is inserted into. Defaults to "/com.marklogic/plugins/".