Extension artifacts
Extensions are compiled and packaged into Spotfire packages, .spk files, containing the dlls for the extension code and other resources as well as a module.xml file describing the metadata of the extension.
Packages and add-ins
An Extension is typically implemented in a Visual Studio solution
containing one or more projects of which at least one contains an add-in, that
is, a class deriving from
AddIn
. There must also be a
module.xml file that describes the metadata of the
extension and points out the
AddIn
classes. The Spotfire Package Builder
application that is part of the SDK helps with creating and updating the
module.xml file and creating the
.spk file for the Spotfire package.
When Spotfire loads a deployed package (sometimes also referred to as
a module), it will instantiate all its
AddIns
and let them register their extensions. It is
possible for an
AddIn
to register more than one extension. It can, for
instance, register tools, custom data methods, and both models and views for
custom visuals.
Intended clients
Each Spotfire Package has an intended client attribute in its metadata that describes whether it shall be downloaded by the installed client, the web client or both. In most cases, all extensions provided can be run on both clients. If so, when creating the Spotfire Package Builder project, set the Intended client project option to Spotfire Any Client.
The preferred way of implementing a view for a custom visual is to
derive from
CustomVisualView
. This
allows you to write an HTML and JavaScript-based view that can run on both
clients and thus be shipped together in the same Spotfire package.
Client specific extension parts
In cases where you need different view implementations for the installed client and the web client, the extension should be split into two or three packages, targeting the different clients.
Model add-insImplement the model parts using the core Spotfire APIs and define the add-in in a Visual Studio project. When creating the Spotfire Package Builder project, set the Intended client project option to Spotfire Any Client.
View add-ins
Extension views are also set up as Visual Studio projects. They
define their own add-ins, registering the view by overriding the
RegisterViews
method. They must also define
dependencies to the project implementing the model that is used by the view.
For views that target either Spotfire Analyst or Spotfire Business Author and
Spotfire Consumer, the
Intended client for the Package Builder project
corresponding to the view is either set to
Spotfire Installed Client or
Spotfire Web Client.
The following figure illustrates an extension with one model component and two views, one for Spotfire Analyst and one for Spotfire web clients:
Some extension types, for example Custom Visualization or Custom Panel, use the same HTML/JavaScript-based view for all clients and no Forms-based view is needed in this case.