Extensions
A Spotfire extension is the smallest functional unit that can be added to the platform, with the exception of mods. An extension is developed in Visual Studio® and is included in a Spotfire add-in, enabling versioning, licensing, deployment and loading. This topic describes the key concepts needed when you develop extensions adding custom capabilities to the Spotfire platform.
For information about Spotfire mods, see the Spotfire mods website.
Extensions are bundled for loading into Spotfire in units called add-ins. Spotfire handles versioning, deploys and loads functionality as add-ins registering extensions. For detailed information on how to create extensions to Spotfire, see the Community.
A Spotfire add-in is implemented as a C# project in Visual Studio®. The design guidelines for Spotfire extensions prescribes that every add-in contains one class derived from the AddIn class. An add-in is basically defined by information provided when creating the project from the SDK template. The add-in project contains one or more extensions. Additional extensions can easily be added to the project at a later point in time, to build a new version.
Each extension is implemented in a set of classes, typically overriding
a base class defining a specific extension type. The add-in registrations are
made declaratively by overriding an extension type specific method,
Register[ExtensionType](). Each such method is passed a
registrar that allows the add-in to register the extension in the appropriate
registry in Spotfire. For instance, to register a new tool, the
RegisterTools(ToolRegistrar) is overridden. A similar
procedure is used when licensing extensions.
An add-in can also register services that can be used by other add-ins. This provides a simple way for add-ins to provide extension points of their own.
A module is defined as qualified for loading in Spotfire if it has a
valid module definition file. It declares the add-in to the application by
defining the fully qualified type name for the
AddIn class and the assembly name. It also declares a
unique project GUID and a strong name for the assembly. Combinations of these
uniquely identifies the project and the add-in. Extension assemblies must
therefore be signed with a strong name key using a strong name key file (.snk).
The extension project template contains a default key. You can replace this key
file with your own, but if you do, make sure to alter the property
<AssemblyOriginatorKeyFile> in the
.csproj file.
- Creating extensions to the Spotfire platform
Use the following procedure to extend Spotfire with custom capabilities. This procedure is an overview of all of the tasks required to create, build, debug, and deploy a Spotfire extension. - Installing the Spotfire extension project templates
The Spotfire extension project templates are used in Visual Studio to create new Spotfire extension projects. They handle implementation details and enable you to focus on adding new functionality. - Creating a Spotfire extension in Visual Studio
This task demonstrates creating a Microsoft Visual Studio project that is based on the Spotfire extension project using the Spotfire Extension.zip or the Spotfire Extension VS.zip template. - Develop and debug extensions
You can easily develop and debug your extension for the installed Spotfire client, and also deploy packages to a server to test your new functionality in a web client. - Loading multiple versions of an assembly
In some use cases, you might need to load multiple versions of an assembly with the same simple name, or load a version of an assembly which differs from one shipped by Spotfire. For instance, you might want to ship an older or newer version of an assembly used by Spotfire, such as Newtonsoft or OpenXml. In .NET framework, this use case is supported out-of-the-box by allowing assemblies with different strong names to be loaded at the same time. However, the latest version of .NET used when running Spotfire on Linux, does not support this use case via strong names. - Signing the code for the Spotfire extension
Spotfire extensions must be signed with a strong name key to be eligible for deployment on a Spotfire® Server. The Spotfire Extension Project Template contains a default key that is used by default to sign the extension during debugging; however, you should change this key before you build a Release version of your extension and deploy it to Spotfire Server. - 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.