ExtensionManager (hwx.common)

The ExtensionManager class is used to register and load user-defined extensions in the Extension Manager.

An extension provides the means to extend the application through shared libraries or scripts. Use extensions to create new clients, profiles, contexts, model views etc. Sample extensions that illustrate the various use cases are included in the Extension Manager. All the extensions located under the default extensions directory (/Documents/Altair/CustomPlugins) specified under the preferences dialog are automatically registered by the Extension Manager.

An Extension is a physical folder with extension.xml and related scripts and resources placed in it. An extension.xml is the manifest file for the extension that defines metadata of the extension such as name, version, minimum supported product version etc.

Table 1. Supported attributes in extension.xml

Attributes Description
name Name of the Extension
minProductVersion The minimum version of the product that is supported by this extension.
description A short description about this extension that is displayed in the Extension Manager user interface.
documentation HTML file with the detailed description of the extension that can be opened in a web browser through the Extension Manager UI.
author The author of this extension.
script Script that should be executed when this extension is loaded.
resources Location of the resourcess’ directory relative to the extensions’ directory.
settings An xml file that defines the settings of this extension.
advancedToolTip An xml file that defines the tooltips related to this extension.
workFlowHelp An xml file that defines the workflow help content of this extension.
required The plugin that should be loaded as a pre-requisite for this extension.
extends The plugin after which this plugin is an auto loaded.
client The name of the client that is implemented in this extension or the name of the client to which the profile implemented in this extension belongs to.
profile The name of the profile implemented in this extension.

Public Methods

getExtensionManager ()
load (self, pluginName=’’)
onAboutToLoad (self, pluginName)
onAboutToUnload (self, pluginName)
onLoad (self, pluginName)
onUnLoad (self, pluginName)
register (self, pluginPath=’’)
unload (self, pluginName=’’)
unregister (self, pluginName=’’)

Method Details

getExtensionManager()

Returns the singleton instance of the Extension Manager.

load(self, pluginName='')

Load the extension. Only registerd plugin’s can be loaded

param pluginName:
 The name of the plugin to be loaded.
type pluginName:
 str
onAboutToLoad(self, pluginName)

Callback before any plugin is loaded.

User can add custum checks before loading a perticular plugin.

param pluginName:
 The name of the plugin about to load.
type pluginName:
 str
onAboutToUnload(self, pluginName)

Callback before any plugin is unloaded.

User can add some clean-up code before plugin is unloaded.

param pluginName:
 The name of the plugin about to load.
type pluginName:
 str
onLoad(self, pluginName)

Callback immediately after any plugin is loaded.

User can add custom methods that get executed after loading a plugin.

param pluginName:
 The name of the plugin about to load.
type pluginName:
 str
onUnLoad(self, pluginName)

Callback after any plugin is unloaded.

User must remove all the actions (page/spritegroup/action) in this callback.

param pluginName:
 The name of the plugin about to load.
type pluginName:
 str
register(self, pluginPath='')

Registers the extension. All registered extensions are available in the product for load/unload operations.

param pluginPath:
 The file path, where the extension need to be loaded.
type pluginPath:
 str
raises:FileNotFoundError – In case pluginPath is not a file.
unload(self, pluginName='')

Unloads the extension.

param pluginName:
 The name of the plugin to be loaded.
type pluginName:
 str
unregister(self, pluginName='')

Unregisters the extension.

param pluginName:
 The name of the plugin to be unregistered.
type pluginName:
 str