|
| 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 PluginConfig & | createPluginConfig () |
|
virtual PluginMenu & | createPluginMenu () |
|
const QString & | getBuildDescription () const |
|
virtual QStringList | getCustomWidgetPaths () const |
|
virtual const DataExecution::DataFactory * | getDataFactory (const QString &dataType) const |
|
const DataExecution::DataFactory * | getDataFactory (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::OperationFactory * | getOperationFactory (const QString &opType, bool ignoreAliasedOperations=false) const |
|
const DataExecution::OperationFactory * | getOperationFactory (size_type index) const |
|
virtual QString | getPackageURI () const |
|
virtual const PreviousVersionNameMap & | getPreviousNames () const |
|
const QString & | getVersion () const |
|
const Widgets::WidgetFactory * | getWidgetFactory (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 |
|
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()
WorkspacePlugin |
( |
const QString & |
name, |
|
|
const QString & |
displayName, |
|
|
int |
versionMajor, |
|
|
int |
versionMinor, |
|
|
int |
versionRevision, |
|
|
const QString & |
buildDescription = QString::null |
|
) |
| |
- Parameters
-
name | The plugin name, which must be unique across all workspace plugins that an application might load. |
displayName | The plugin display name, which should be unique across across all workspace plugins that an application might load, but it does not have to be. |
versionMajor | The major part of the plugin version in major.minor.revision form. |
versionMinor | The minorpart of the plugin version in major.minor.revision form. |
versionRevision | The revision part of the plugin version in major.minor.revision form. |
buildDescription | Optional 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:
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 |
( |
const QString & |
name, |
|
|
const QString & |
displayName, |
|
|
const QString & |
version, |
|
|
const QString & |
buildDescription = QString::null |
|
) |
| |
- Parameters
-
name | The plugin name, which must be unique across all workspace plugins that an application might load. |
displayName | The plugin display name, which should be unique across across all workspace plugins that an application might load, but it does not have to be. |
version | The 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. |
buildDescription | Optional 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:
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()
- Parameters
-
factory | The type adaptor factory to add. |
replaceExisting | If 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.
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.
const DataFactory * getAliasedDataFactory |
( |
const QString & |
dataType | ) |
const |
|
protectedvirtual |
- Parameters
-
dataType | Name 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.
const OperationFactory * getAliasedOperationFactory |
( |
const QString & |
opType | ) |
const |
|
protectedvirtual |
- Parameters
-
opType | Name 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.
- 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.
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.
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.
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.