API plugin - RapturePlatform/Rapture GitHub Wiki

Plugin API

The plugin API is used to manipulate information about stored plugins in the system. A plugin is a set of scripts, type and data definitions.

getInstalledPlugins

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
List<PluginConfig> retVal = pluginApi.getInstalledPlugins();
retVal = baseAPI.doPlugin_GetInstalledPlugins();

Entitlement: /admin/main

Lists plugins in the system.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getPluginManifest

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
PluginManifest retVal = pluginApi.getPluginManifest(manifestUri);
retVal = baseAPI.doPlugin_GetPluginManifest(manifestUri);

Entitlement: /admin/main

Retrieves the manifest for a plugin.

Function Parameters

Parameter Type Description
manifestUri String

Return value

Type Description
PluginManifest
Types used in this function

PluginManifest

This is a more detailed variant of PluginConfig that details the complete contents of a version of a plugin instance.

Field Type
contents List(PluginManifestItem)
depends Map(String, PluginVersion)
description String
plugin String
version PluginVersion

recordPlugin

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.recordPlugin(plugin);
retVal = baseAPI.doPlugin_RecordPlugin(plugin);

Entitlement: /admin/main

Retrieves the manifest for a plugin.

Function Parameters

Parameter Type Description
plugin PluginConfig

Return value

Type Description
void
Types used in this function

PluginConfig

Holds config information for the main object used by the Plugin API.

Field Type
depends Map(String, PluginVersion)
description String
plugin String
version PluginVersion

installPlugin

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.installPlugin(manifest, payload);
retVal = baseAPI.doPlugin_InstallPlugin(manifest, payload);

Entitlement: /admin/main

Installs the plugin and updates the registry.

Function Parameters

Parameter Type Description
manifest PluginManifest
payload Map<String,PluginTransportItem>

Return value

Type Description
void
Types used in this function

PluginManifest

This is a more detailed variant of PluginConfig that details the complete contents of a version of a plugin instance.

Field Type
contents List(PluginManifestItem)
depends Map(String, PluginVersion)
description String
plugin String
version PluginVersion

installPluginItem

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.installPluginItem(pluginName, item);
retVal = baseAPI.doPlugin_InstallPluginItem(pluginName, item);

Entitlement: /admin/main

Installs a single item from a plugin to allow clients to operate in a low-memory environment

Function Parameters

Parameter Type Description
pluginName String
item PluginTransportItem

Return value

Type Description
void
Types used in this function

PluginTransportItem

The PluginTransportItem is an internal class used by the PluginInstaller. It carries the encoded form of a Rapture object between the PluginInstaller and the Rapture server.

Field Type
uri String
content ByteArray
hash String

uninstallPlugin

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.uninstallPlugin(name);
retVal = baseAPI.doPlugin_UninstallPlugin(name);

Entitlement: /admin/main

Removes a plugin.

Function Parameters

Parameter Type Description
name String

Return value

Type Description
void

uninstallPluginItem

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.uninstallPluginItem(item);
retVal = baseAPI.doPlugin_UninstallPluginItem(item);

Entitlement: /admin/main

Removes an item from a plugin.

Function Parameters

Parameter Type Description
item PluginTransportItem

Return value

Type Description
void
Types used in this function

PluginTransportItem

The PluginTransportItem is an internal class used by the PluginInstaller. It carries the encoded form of a Rapture object between the PluginInstaller and the Rapture server.

Field Type
uri String
content ByteArray
hash String

deletePluginManifest

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.deletePluginManifest(manifestUri);
retVal = baseAPI.doPlugin_DeletePluginManifest(manifestUri);

Entitlement: /admin/main

Removes plugin Manifest but does not uninstall any referenced items.

Function Parameters

Parameter Type Description
manifestUri String

Return value

Type Description
void

getPluginItem

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
PluginTransportItem retVal = pluginApi.getPluginItem(uri);
retVal = baseAPI.doPlugin_GetPluginItem(uri);

Entitlement: /admin/main

Gets the encoding for a Rapture object given its URI.

Function Parameters

Parameter Type Description
uri String

Return value

Type Description
PluginTransportItem
Types used in this function

PluginTransportItem

The PluginTransportItem is an internal class used by the PluginInstaller. It carries the encoded form of a Rapture object between the PluginInstaller and the Rapture server.

Field Type
uri String
content ByteArray
hash String

verifyPlugin

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
Map<String,String> retVal = pluginApi.verifyPlugin(plugin);
retVal = baseAPI.doPlugin_VerifyPlugin(plugin);

Entitlement: /admin/main

Verifies that the contents of a plugin match the hashes in the manifest.

Function Parameters

Parameter Type Description
plugin String

Return value

Type Description
Map<String,String>

createManifest

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.createManifest(pluginName);
retVal = baseAPI.doPlugin_CreateManifest(pluginName);

Entitlement: /admin/main

create an empty manifest on the server with version 0.0.0

Function Parameters

Parameter Type Description
pluginName String

Return value

Type Description
void

addManifestItem

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.addManifestItem(pluginName, uri);
retVal = baseAPI.doPlugin_AddManifestItem(pluginName, uri);

Entitlement: /admin/main

add an object on the server to a plugin manifest on the server

Function Parameters

Parameter Type Description
pluginName String
uri String

Return value

Type Description
void

addManifestDataFolder

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.addManifestDataFolder(pluginName, uri);
retVal = baseAPI.doPlugin_AddManifestDataFolder(pluginName, uri);

Entitlement: /admin/main

add uris within the specified docpath root. If no type is specifed in the uri, use all four of doc, blob, series, and sheet. Example1: //myProject/myfolder adds all four types. Example2: blob://myproject/myfolder adds only blobs

Function Parameters

Parameter Type Description
pluginName String
uri String

Return value

Type Description
void

removeManifestDataFolder

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.removeManifestDataFolder(pluginName, uri);
retVal = baseAPI.doPlugin_RemoveManifestDataFolder(pluginName, uri);

Entitlement: /admin/main

remove uris within the specified path. If no type is specifed in the uri, use all four of doc, blob, series, and sheet.

Function Parameters

Parameter Type Description
pluginName String
uri String

Return value

Type Description
void

setManifestVersion

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.setManifestVersion(pluginName, version);
retVal = baseAPI.doPlugin_SetManifestVersion(pluginName, version);

Entitlement: /admin/main

refresh the MD5 checksums in the manifest and set the version for a manifest on the server

Function Parameters

Parameter Type Description
pluginName String
version String

Return value

Type Description
void

removeItemFromManifest

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
void retVal = pluginApi.removeItemFromManifest(pluginName, uri);
retVal = baseAPI.doPlugin_RemoveItemFromManifest(pluginName, uri);

Entitlement: /admin/main

remove an item from the manifest of a plugin on the server

Function Parameters

Parameter Type Description
pluginName String
uri String

Return value

Type Description
void

exportPlugin

HttpPluginApi pluginApi = new HttpPluginApi(loginApi);
String retVal = pluginApi.exportPlugin(pluginName, path);
retVal = baseAPI.doPlugin_ExportPlugin(pluginName, path);

Entitlement: /admin/main

Export a plugin as a single blob. We pass in a parent path; the blob will be generated somewhere under that path, in a non-predictable location. The location is returned.

Function Parameters

Parameter Type Description
pluginName String
path String

Return value

Type Description
String
⚠️ **GitHub.com Fallback** ⚠️