Workspace 6.21.5
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
WorkspacePlugin Class Referenceabstract

Base class for all workspace plugin classes. More...

#include <Workspace/Application/workspaceplugin.h>

Inheritance diagram for WorkspacePlugin:
[legend]

Public Types

using PreviousVersionNameMap = QMap< QString, QString >
 
using size_type = size_t
 
using WorkspacePluginList = QList< WorkspacePlugin * >
 

Public Member Functions

 WorkspacePlugin (const QString &name, const QString &displayName, const QString &version, const QString &buildDescription=QString::null)
 
 WorkspacePlugin (const QString &name, const QString &displayName, int versionMajor, int versionMinor, int versionRevision, const QString &buildDescription=QString::null)
 
virtual ~WorkspacePlugin ()
 
virtual PluginConfigcreatePluginConfig ()
 
virtual PluginMenucreatePluginMenu ()
 
const QString & getBuildDescription () const
 
virtual QStringList getCustomWidgetPaths () const
 
virtual const DataExecution::DataFactorygetDataFactory (const QString &dataType) const
 
const DataExecution::DataFactorygetDataFactory (size_type index) const
 
virtual QString getDefaultHelpPagePath () const
 
virtual QString getDefaultIconPath () const
 
virtual WorkspacePluginList getDependencies () const
 
const QString & getDisplayName () const
 
virtual QString getHelpFile () const
 
const QString & getLibraryFileName () const
 
virtual QStringList getLicensePaths () const
 
const QString & getName () const
 
size_type getNumDataFactories () const
 
size_type getNumOperationFactories () const
 
size_type getNumWidgetFactories () const
 
virtual const DataExecution::OperationFactorygetOperationFactory (const QString &opType, bool ignoreAliasedOperations=false) const
 
const DataExecution::OperationFactorygetOperationFactory (size_type index) const
 
virtual QString getPackageURI () const
 
virtual const PreviousVersionNameMapgetPreviousNames () const
 
const QString & getVersion () const
 
const Widgets::WidgetFactorygetWidgetFactory (size_type index) const
 
virtual bool isVisible () const
 
void logText (const QString &message)
 
virtual void onWorkspaceClose ()
 
void setLibraryFileName (const QString &fileName)
 
virtual bool setup ()=0
 
virtual bool setupAuthenticationProvider (Authentication::ProviderManager &manager)
 
virtual bool setupSchedulerProvider (DataExecution::SchedulerProviderManager &manager)
 
void showHelp (const QMap< QString, QUrl > &links, const QString &keyword="")
 
void showHelp (const QString &keyword)
 
void showHelp (const QUrl &url)
 
bool wasPreviouslyNamed (const QString &oldName) const
 

Static Public Attributes

static const QString DEFAULT_ICON_PATH = "images:/Workspace/core/operation_icon.png"
 

Protected Member Functions

bool addFactory (const DataExecution::DataFactory &factory)
 
bool addFactory (const DataExecution::OperationFactory &factory)
 
bool addFactory (const DataExecution::TypeAdaptorFactory &factory, bool replaceExisting=false)
 
bool addFactory (const Widgets::WidgetFactory &factory)
 
bool addTranslation (const QString &fileName="")
 
void addWorkspaceCollection (const QString &location)
 
const DataExecution::DataFactoryforwardDataFactoryRequest (const QString &pluginName, const QString &dataType) const
 
const DataExecution::OperationFactoryforwardOperationFactoryRequest (const QString &pluginName, const QString &opType) const
 
virtual const DataExecution::DataFactorygetAliasedDataFactory (const QString &dataType) const
 
virtual const DataExecution::OperationFactorygetAliasedOperationFactory (const QString &opType) const
 

Detailed Description

Plugins need to be created as a shared library (lib*.so under unix and *.dll under Windows). Each such plugin must have a singleton which is a subclass of WorkspacePlugin, and it must also define (and publicly export) a C function called getWorkspacePlugin() like so:

extern "C"
{
}
CSIRO_IMPORTSPEC CSIRO::Application::WorkspacePlugin * getWorkspacePlugin()
Definition: applicationsupportplugin.cpp:159
Base class for all workspace plugin classes.
Definition: workspaceplugin.h:98

The workspace application (or an application which uses it as a shared library) will look for getWorkspacePlugin() in the plugin's shared library and call it to retrieve the Plugin instance for that library. It will then call that plugin instance's setup() function, which is responsible for things like registering the plugin's factories, allocating any internal objects, etc.

A Plugin must have a unique name across all loaded plugins. Any attempt to load a plugin whose name matches that of any currently loaded plugin will fail. See the constructor documentation for more details.

WARNING: WORKSPACE_PLUGIN_API_VERSION which is defined in the top level Workspace CMakeLists.txt must be incremented if the signature of this class changes in any way.

See also
setup()

Member Typedef Documentation

◆ PreviousVersionNameMap

using PreviousVersionNameMap = QMap<QString, QString>

A map of versionNumber->name, indicating the version at which the plugin stopped using that particular name.e.g. "3.0" -> "www.csiro.au/cfd/workspace" indicates that at version 3.0, the workspace plugin no longer used that name.

◆ size_type

using size_type = size_t

◆ WorkspacePluginList

Constructor & Destructor Documentation

◆ WorkspacePlugin() [1/2]

WorkspacePlugin ( const QString &  name,
const QString &  displayName,
int  versionMajor,
int  versionMinor,
int  versionRevision,
const QString &  buildDescription = QString::null 
)
Parameters
nameThe plugin name, which must be unique across all workspace plugins that an application might load.
displayNameThe plugin display name, which should be unique across across all workspace plugins that an application might load, but it does not have to be.
versionMajorThe major part of the plugin version in major.minor.revision form.
versionMinorThe minorpart of the plugin version in major.minor.revision form.
versionRevisionThe revision part of the plugin version in major.minor.revision form.
buildDescriptionOptional build description, this could be used for providing build ID or version control revision number.

Any attempt to load a plugin whose name matches that of any currently loaded plugin will fail. A good strategy for naming a plugin is to specify it as a URL, with the domain name being that of your company or a domain name over which you have control. The path of the URL should specify the particular plugin, with different plugins having different paths. For example:

www.csiro.au/workspace/solvers
Workspace * workspace
Definition: mongodbremotescheduler.cpp:171

The display name should then be set to something more human-friendly and perhaps slightly more descriptive. For the above example, a suitable display name might be something like "CSIRO CFD solvers".

This constructor is the preferred form where the version number needs to have greater resistance to tampering, such as when it is used as part of licensing functionality.

See also
getName(), getDisplayName(), getVersion(), getBuildDescription()

◆ WorkspacePlugin() [2/2]

WorkspacePlugin ( const QString &  name,
const QString &  displayName,
const QString &  version,
const QString &  buildDescription = QString::null 
)
Parameters
nameThe plugin name, which must be unique across all workspace plugins that an application might load.
displayNameThe plugin display name, which should be unique across across all workspace plugins that an application might load, but it does not have to be.
versionThe plugin version. The recommended form of a version number is major.minor.revision where major, minor and revision are all integers. The revision part of the version number can be omitted, but it is recommended that all three parts be present, even if set to zero. This makes for more consistent version number handling over the life of the plugin.
buildDescriptionOptional build description, this could be used for providing build ID or version control revision number.

Any attempt to load a plugin whose name matches that of any currently loaded plugin will fail. A good strategy for naming a plugin is to specify it as a URL, with the domain name being that of your company or a domain name over which you have control. The path of the URL should specify the particular plugin, with different plugins having different paths. For example:

www.csiro.au/workspace/solvers

The display name should then be set to something more human-friendly and perhaps slightly more descriptive. For the above example, a suitable display name might be something like "CSIRO CFD solvers".

Clients should generally prefer the other overload of the constructor, since it enforces the preferred form of the version number.

See also
getName(), getDisplayName(), getVersion(), getBuildDescription()

◆ ~WorkspacePlugin()

~WorkspacePlugin ( )
virtualdefault

Clean up private implementation.

Member Function Documentation

◆ addFactory() [1/4]

bool addFactory ( const DataExecution::DataFactory factory)
protected
Parameters
factoryThe data factory to add to the plugin.
Returns
True if the factory could be added, or false if there is already a factory loaded with the same name in this plugin. An error message will be printed to standard output if factory could not be added.

No check is made to see if the plugin which supplies factory has also been added to the application (this is not a requirement).

Warning
Do not call this function in a plugin's constructor. The C++ standard does not guarantee any particular order of creation of static objects in different compilation units. Therefore, there is no guarantee that a data factory will be valid in a plugin's constructor. A plugin should only call addFactory() from within its setup() function.

◆ addFactory() [2/4]

bool addFactory ( const DataExecution::OperationFactory factory)
protected
Parameters
factoryThe operation factory to add to the plugin.
Returns
True if the factory could be added, or false if there is already a factory loaded with the same name in this plugin. An error message will be printed to standard output if factory could not be added.

No check is made to see if the plugin which supplies factory has also been added to the application (this is not a requirement).

Warning
Do not call this function in a plugin's constructor. The C++ standard does not guarantee any particular order of creation of static objects in different compilation units. Therefore, there is no guarantee that an operation factory will be valid in a plugin's constructor. A plugin should only call addFactory() from within its setup() function.

◆ addFactory() [3/4]

bool addFactory ( const DataExecution::TypeAdaptorFactory factory,
bool  replaceExisting = false 
)
protected
Parameters
factoryThe type adaptor factory to add.
replaceExistingIf a TypeAdaptorFactory has previously been added (to convert between two types) then the default behaviour of this method will simply ignore the adding of another TypeAdaptorFactory for converting between the (already supported) types. If however the provided TypeAdaptorFactory should replace the existing factory then setting the replaceExisting parameter to true will enforce this.
Returns
True if the factory could be added, or false if the factory has already been added. If an adaptor already exists for the same source and destination data type, a warning message will be output, but the factory will be added anyway (in such cases, factory will never be used unless the existing factory with the same source and destination type is removed).

This function is a convenience. It simply calls the DataFactory::addAdaptorFactory() function of factory's source type. This overload function is included to allow plugin subclasses to add a TypeAdaptorFactory in the same way as all the other factories it supplies.

No check is made to see if the plugin which supplies factory has also been added to the application (this is not a requirement). Similarly, no check is made to see if the plugin which supplies the source and destination factories of the adaptor have been added to the application either (again, this is not a requirement).

Warning
Do not call this function in a plugin's constructor. The C++ standard does not guarantee any particular order of creation of static objects in different compilation units. Therefore, there is no guarantee that a data factory will be valid in a plugin's constructor. A plugin should only call addFactory() from within its setup() function.

◆ addFactory() [4/4]

bool addFactory ( const Widgets::WidgetFactory factory)
protected
Parameters
factoryThe widget factory to add to the plugin.
Returns
True if the factory could be added, or false if the factory has already been loaded in this plugin. An error message will be printed to standard output if factory could not be added.

No check is made to see if the plugin which supplies factory has also been added to the application (this is not a requirement).

Warning
Do not call this function in a plugin's constructor. The C++ standard does not guarantee any particular order of creation of static objects in different compilation units. Therefore, there is no guarantee that a widget factory will be valid in a plugin's constructor. A plugin should only call addFactory() from within its setup() function.

◆ addTranslation()

bool addTranslation ( const QString &  baseFileName = "")
protected
Parameters
baseFileNameThe base part of the translator's file name. For instance, if the translation file for the English language is foobar_en_US.qm then the base file name is simply "foobar". The addTranslation() function will try appending various locale-specific suffixes following the rules for QTranslator::load(). Note that if this parameter is an empty string, the result of getName() converted to lowercase will be used instead. If getName() returns something that looks like a path or URL, only the filename part will be used.

This function will attempt to find an appropriate translation file in the install areas for the base file name baseFileName. It would be customary to make the baseFileName similar to the plugin's name.

Returns
True if the translation file was found and installed, false otherwise.
See also
setupTranslators(), getWorkspaceInstallAreas()

◆ addWorkspaceCollection()

void addWorkspaceCollection ( const QString &  location)
protected
Parameters
locationThe file, directory, url or Qt resource path to add to the workspace collection. It will be added as a non-saveable location, meaning that the location is only used for this particular application process. Whenever the settings are saved, the specified location is not included unless it was already part of the saveable locations.

◆ createPluginConfig()

PluginConfig & createPluginConfig ( )
virtual

This function will be called by clients wanting to create a widget for configuring this plugin. The default implementation creates a widget with simple text indicating that the plugin has no editable configuration items. Those plugins wishing to provide some kind of QWidget-based configuration will need to subclass PluginConfig, but if no configuration is needed then the PluginConfig header file does not need to be included and therefore no reference to QWidget will be made.

Ownership of the instance returned by this function will be given to the caller. At some point, the caller must then call the PluginConfig's destroy() function when it is finished with it.

Returns
A new instance of a PluginConfig object for this plugin.

Reimplemented in RemoteExecutionSettingsPlugin, and RenderingPlugin.

◆ createPluginMenu()

PluginMenu & createPluginMenu ( )
virtual

This function will be called by clients wanting to use the plugin to extend the Workspace editor by adding a custom menu to the menu bar. The default implementation does nothing (it adds an EmptyPluginMenu which is ignored). Those plugins wishing to provide a custom menu will need to subclass PluginMenu.

Ownership of the instance returned by this function will be given to the caller. At some point, the caller must then call the PluginMenu's destroy() function when it is finished with it.

Returns
A new instance of a PluginMenu object for this plugin.

◆ forwardDataFactoryRequest()

const DataFactory * forwardDataFactoryRequest ( const QString &  pluginName,
const QString &  dataType 
) const
protected
Parameters
pluginNameThe name of the plugin to forward the request to.
dataTypeThe data type whose factory should be found.
Returns
The data factory for the specified type, or a null pointer if the specified plugin cannot supply it.
See also
getDataFactory(), forwardOperationFactoryRequest()
Warning
You must ensure that it is not possible for a set of factories to call this function in such a way as to pass the request around in an infinite loop. No tests are made for this by the workspace itself.

◆ forwardOperationFactoryRequest()

const OperationFactory * forwardOperationFactoryRequest ( const QString &  pluginName,
const QString &  opType 
) const
protected
Parameters
pluginNameThe name of the plugin to forward the request to.
opTypeThe operation type whose factory should be found.
Returns
The operation factory for the specified type, or a null pointer if the specified plugin cannot supply it.
See also
getOperationFactory(), forwardDataFactoryRequest()
Warning
You must ensure that it is not possible for a set of factories to call this function in such a way as to pass the request around in an infinite loop. No tests are made for this by the workspace itself.

◆ getAliasedDataFactory()

const DataFactory * getAliasedDataFactory ( const QString &  dataType) const
protectedvirtual
Parameters
dataTypeName of a data type.

If a data type is renamed, this function provides a backwards compatibility mechanism so that the plugin can provide the new factory that corresponds to an old name. By default, this function returns a null pointer, but subclasses can override it to provide an appropriate factory if a data type is renamed. Note that this function is only called by getDataFactory() if it could not find the factory from the plugin directly. Subclasses can assume that the request for dataType will only be made when the plugin has already been correctly identified by name (ie no functionality is provided for renaming a plugin).

Returns
The factory that should be used for data objects of the type dataType, or a null pointer if no appropriate factory exists.

Reimplemented in ApplicationSupportPlugin, DataAnalysisPlugin, DistributedPlugin, Hdf5Plugin, HeterogeneousParallelComputingPlugin, MeshPlugin, PackagePlugin, PythonPlugin, RenderingPlugin, SshPlugin, WorkflowToolsPlugin, and BuiltinPlugin.

◆ getAliasedOperationFactory()

const OperationFactory * getAliasedOperationFactory ( const QString &  opType) const
protectedvirtual
Parameters
opTypeName of an operation.

If an operation is renamed, this function provides a backwards compatibility mechanism so that the plugin can provide the new factory that corresponds to an old name. By default, this function returns a null pointer, but subclasses can override it to provide an appropriate factory if an operation is renamed. Note that this function is only called by getOperationFactory() if it could not find the factory from the operation factory manager. Subclasses can assume that the request for opType will only be made when the plugin has already been correctly identified by name (ie no functionality is provided for renaming a plugin).

Returns
The factory that should be used for operations of the type opType, or a null pointer if no appropriate factory exists.

Reimplemented in ApplicationSupportPlugin, DataAnalysisPlugin, DistributedPlugin, Hdf5Plugin, HeterogeneousParallelComputingPlugin, MeshPlugin, PackagePlugin, PythonPlugin, RenderingPlugin, SshPlugin, WorkflowToolsPlugin, and BuiltinPlugin.

◆ getBuildDescription()

const QString & getBuildDescription ( ) const
Returns
The build description of the plugin, as passed to the constructor.

◆ getCustomWidgetPaths()

QStringList getCustomWidgetPaths ( ) const
virtual
Returns
A list of additional path prefixes to use when searching for custom .ui files when creating widgets for operation, inputs and outputs.

The custom widget paths would normally be specified using the "widgets" resource search path. A typical example would be something like widgets:MyPluginPath where MyPluginPath would be an area below which you put all your plugin's custom widget .ui files. If you use the widgets: prefix instead of just an ordinary (absolute or relative) file path, then the paths you specify will be interpretted as being relative to the application's default search paths. This is normally what you want, since plugins should generally install their custom .ui files in their own directory below the common widgets directory in the install area. This directory structuring is used by both the widget style sheets (in the styles directory) and by the custom widget .ui files.

If you follow the directory structure recommended above, then your .ui files should be found without having to do anything else. When a plugin is loaded by the PluginManager, it looks at the directory in which the plugin was located and it searches for a widgets directory related to that location. See PluginManager::loadPlugin() for more details about this directory structure.

See also
WidgetManager::createWidget()

Reimplemented in ApplicationSupportPlugin, DataAnalysisPlugin, DistributedPlugin, Hdf5Plugin, MeshPlugin, PackagePlugin, PythonPlugin, RenderingPlugin, WorkflowToolsPlugin, and BuiltinPlugin.

◆ getDataFactory() [1/2]

const DataFactory * getDataFactory ( const QString &  dataType) const
virtual
Parameters
dataTypeName of a data type whose factory is requested.

If dataType is not a directly known factory name, an alias is also checked for by calling the getAliasedDataFactory() function.

Returns
The factory that should be used for data of the type dataType, or a null pointer if no appropriate factory exists.
Note
Subclasses would not normally override this function. One case where they may wish to, however, is if they want to forward the request to a different plugin. This may be required if a plugin is refactored or renamed, but developers wish to keep old workspaces working.

◆ getDataFactory() [2/2]

const DataFactory * getDataFactory ( size_type  index) const
Parameters
indexThe index into this plugin's data factory array for the data factory to retrieve.
Returns
The data factory at the specified index, or a null pointer if index is not valid.
See also
getNumDataFactories()

◆ getDefaultHelpPagePath()

QString getDefaultHelpPagePath ( ) const
virtual

◆ getDefaultIconPath()

QString getDefaultIconPath ( ) const
virtual
Returns
The default icon path (generally a resource path) for all operations in this plugin. Individual operations can override this by using the DEFINE_WORKSPACE_OPERATION_WITH_ICON macro, and specifying a unique path.

Reimplemented in DistributedPlugin, MeshPlugin, and RenderingPlugin.

◆ getDependencies()

WorkspacePlugin::WorkspacePluginList getDependencies ( ) const
virtual

return A list of plugins this plugin depends on - the PluginManager will ensure these have been loaded before setup() is called.

Reimplemented in Hdf5Plugin, and MeshPlugin.

◆ getDisplayName()

const QString & getDisplayName ( ) const
Returns
The display name of the plugin, as passed to the constructor.

The display name is used in things like dialog boxes when the plugin needs to be identified in human-readable form. It would typically be used instead of the name if the user might see it in the graphical user interface.

Unlike the name returned from getName(), the display name does not have to be unique among all loaded plugins. Nevertheless, it would be confusing to have two different plugins with the same display name, so it should be chosen with a reasonable likelihood of being unique.

◆ getHelpFile()

QString getHelpFile ( ) const
virtual
Returns
The path to the .qch file for the plugin, or an empty string if no help file is associated with the plugin.

The help file name would normally be specified using the "help" resource search path. A typical example would be something like help:MyPluginPath/somefile.qch where MyPluginPath would be an area below which you put all your plugin's help files, examples, etc. If you use the help: prefix instead of just an ordinary (absolute or relative) file path, then the path you specify will be interpretted as being relative to the application's default search paths. This is normally what you want, since plugins should generally install their help files in their own directory below the common doc directory in the install area.

Reimplemented in BuiltinPlugin.

◆ getLibraryFileName()

const QString & getLibraryFileName ( ) const
Returns
The full path with file name of the library that was loaded to provide this plugin. If for some reason the plugin was not loaded from a separate file (eg the plugin was built as a static library and linked in directly to the application), an empty string will be returned.

◆ getLicensePaths()

QStringList getLicensePaths ( ) const
virtual
Returns
A list of licenses paths the plugin need to display in workspace-gui.

◆ getName()

const QString & getName ( ) const
Returns
The name of the plugin, as passed to the constructor.

The name is what is used internally to identify the plugin. It must be unique among all loaded plugins.

◆ getNumDataFactories()

WorkspacePlugin::size_type getNumDataFactories ( ) const
Returns
The number of data factories provided by this plugin. This will be the exact number of times the plugin has called the addFactory() function with a unique data factory.

◆ getNumOperationFactories()

WorkspacePlugin::size_type getNumOperationFactories ( ) const
Returns
The number of operation factories provided by this plugin. This will be the exact number of times the plugin has called the addFactory() function with a unique operation factory.

◆ getNumWidgetFactories()

WorkspacePlugin::size_type getNumWidgetFactories ( ) const
Returns
The number of widget factories provided by this plugin. This will be the exact number of times the plugin has called the addFactory() function with a unique widget factory.

◆ getOperationFactory() [1/2]

const OperationFactory * getOperationFactory ( const QString &  opType,
bool  ignoreAliasedOperations = false 
) const
virtual
Parameters
opTypeName of an operation whose factory is requested.
ignoreAliasedOperationsSet to true to bypass calling the getAliasedOperationFactory function (false by default)

If opType is not a directly known factory name, an alias is also checked for by calling the getAliasedOperationFactory() function.

Returns
The factory that should be used for operations of the type opType, or a null pointer if no appropriate factory exists.
Note
Subclasses would not normally override this function. One case where they may wish to, however, is if they want to forward the request to a different plugin. This may be required if a plugin is refactored or renamed, but developers wish to keep old workspaces working.

◆ getOperationFactory() [2/2]

const OperationFactory * getOperationFactory ( size_type  index) const
Parameters
indexThe index into this plugin's operation factory array for the operation factory to retrieve.
Returns
The operation factory at the specified index, or a null pointer if index is not valid.
See also
getNumOperationFactories()

◆ getPackageURI()

QString getPackageURI ( ) const
virtual
Returns
A unique URI that can be used to record the origin of this plugin for provenance recording purposes. This URI should be unique for each platform and released of this plugin.

An example implementation might be: return getName() + "/" + getVersion() + "/" + System::Utilities::getPlatformString() + "/" + System::Utilities::getPlatformArchitectureString();

Reimplemented in ApplicationSupportPlugin, DataAnalysisPlugin, HeterogeneousParallelComputingPlugin, MeshPlugin, PackagePlugin, PythonPlugin, RemoteExecutionSettingsPlugin, RenderingPlugin, SshPlugin, BuiltinPlugin, and HelpPlugin.

◆ getPreviousNames()

const WorkspacePlugin::PreviousVersionNameMap & getPreviousNames ( ) const
virtual
Returns
A map of versionNumber -> name, indicating the version at which the plugin stopped using that particular name. e.g. "3.0" -> "www.csiro.au/cfd/workspace" indicates that at version 3.0, the workspace plugin no longer used that name.

Reimplemented in ApplicationSupportPlugin, DataAnalysisPlugin, MeshPlugin, PackagePlugin, PythonPlugin, RemoteExecutionSettingsPlugin, RenderingPlugin, SshPlugin, BuiltinPlugin, and HelpPlugin.

◆ getVersion()

const QString & getVersion ( ) const
Returns
The version of the plugin, as passed to the constructor.

◆ getWidgetFactory()

const WidgetFactory * getWidgetFactory ( size_type  index) const
Parameters
indexThe index into this plugin's widget factory array for the widget factory to retrieve.
Returns
The widget factory at the specified index, or a null pointer if index is not valid.
See also
getNumWidgetFactories()

◆ isVisible()

bool isVisible ( ) const
virtual

A plugin may be made invisible when it is an implementation detail. One example of this is when a plugin is refactored or renamed, but the developer wants to allow old workspaces to keep working. In such a case, the plugin is retained but made invisible, and all its getOperationFactory() and getDataFactory() functions forward to the new plugin(s). The old plugin would not add any data or operation factories of its own.

Returns
True if the plugin should be made visible to the user. Plugins are visible by default.

Reimplemented in SshPlugin, and HelpPlugin.

◆ logText()

void logText ( const QString &  message)
Parameters
messageThe text to send to the log.

◆ onWorkspaceClose()

void onWorkspaceClose ( )
virtual

This function will be called by the workspace application whenever a workspace is closed. A close event could occur whenever 'New', 'Load' or 'Close' are pressed in workspace-gui, for example.

Reimplemented in RenderingPlugin.

◆ setLibraryFileName()

void setLibraryFileName ( const QString &  fileName)
Parameters
fileNameThe full path with file name of the library that was loaded to provide this plugin.

Client code would not normally call this function. In the majority of cases, PluginManager would call this function after it has successfully loaded the plugin as the last step in the plugin loading process. The only reason for client code to set this for themselves is if they have passed the plugin to the PluginManager directly (ie the plugin was loaded outside of the PluginManager for some reason).

See also
getLibraryFileName()

◆ setup()

virtual bool setup ( )
pure virtual

This function will be called by the workspace application when the plugin is loaded. The function must register all factories it supplies (operations, data objects, etc.) with calls to addFactory(). Note that this function is the only place where addFactory() should be called (ie never in a plugin's constructor). A plugin may also do any other processing it requires in setup() before the plugin is used.

Returns
True if successful, false otherwise. If the plugin is being loaded and setup() returns false, the loading of the plugin is assumed to have failed and it will therefore not be available to clients.
See also
setupSchedulerProvider(), setupAuthenticationProvider()

Implemented in ApplicationSupportPlugin, DataAnalysisPlugin, DistributedPlugin, Hdf5Plugin, HeterogeneousParallelComputingPlugin, MeshPlugin, PackagePlugin, PythonPlugin, RemoteExecutionSettingsPlugin, RenderingPlugin, SshPlugin, WorkflowToolsPlugin, BuiltinPlugin, and HelpPlugin.

◆ setupAuthenticationProvider()

bool setupAuthenticationProvider ( Authentication::ProviderManager manager)
virtual

This function will be called by the workspace application when the plugin is loaded. The function must register all authentication providers it supplies with calls to manager.addProvider(). Note that this function is the only place where addProvider() should be called (ie never in a plugin's constructor).

Returns
True if successful, false otherwise. If the plugin is being loaded and setupScheduler() returns false, the loading of the plugin is assumed to have failed and it will therefore not be available to clients.
See also
setup(), setupSchedulerProvider()

Reimplemented in BuiltinPlugin.

◆ setupSchedulerProvider()

bool setupSchedulerProvider ( DataExecution::SchedulerProviderManager manager)
virtual

This function will be called by the workspace application when the plugin is loaded. The function must register all schedulers it supplies with calls to manager.addProvider(). Note that this function is the only place where addProvider() should be called (ie never in a plugin's constructor).

Returns
True if successful, false otherwise. If the plugin is being loaded and setupScheduler() returns false, the loading of the plugin is assumed to have failed and it will therefore not be available to clients.
See also
setup(), setupAuthenticationProvider()

Reimplemented in DistributedPlugin, RemoteExecutionSettingsPlugin, SshPlugin, and BuiltinPlugin.

◆ showHelp() [1/3]

void showHelp ( const QMap< QString, QUrl > &  links,
const QString &  keyword = "" 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
linksA list of links to present to the user. These will typically be a set of matching topics for a phrase the user entered or that match some other criteria.
keywordKeyword associated with the help

◆ showHelp() [2/3]

void showHelp ( const QString &  keyword)
Parameters
keywordThe help topic to show. The keyword should exist somewhere in the set of help collections that would be loaded.

Plugins can call this function to indicate that they would like to show help for the specified topic or keyword. Applications without a user interface (eg workspace-batch) will simply ignore this call, since there is no way to show help to the user. However, if an application has enabled help support, then calling this function will result in the help window being shown and the specified topic being loaded into the help viewer.

See also
HelpWindow

◆ showHelp() [3/3]

void showHelp ( const QUrl &  url)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
urlSpecifies a help URL directly. This is not normally called, since calling with a keyword tends to be more robust.

◆ wasPreviouslyNamed()

bool wasPreviouslyNamed ( const QString &  oldName) const
Returns
True if this plugin previously used oldName as its unique name.

Member Data Documentation

◆ DEFAULT_ICON_PATH

const QString DEFAULT_ICON_PATH = "images:/Workspace/core/operation_icon.png"
static

Need to initialise this outside the class.