Spotfire Developer Documentation

The SDK

The SDK from Spotfire Developer provides required Spotfire developer resources: the Spotfire Extension Project Templates, development assemblies, example projects, and the Package Builder console application which is used to wrap the extensions for deployment. Some of the examples are available for deployment of Web Player packages on either Windows or Linux platforms.

The SDK is required when extending the platform. See Downloading Spotfire Developer for information on how to obtain the Developer product and the SDK files.

Unzip the SDK into the recommended folder structure: Spotfire SDK\[version]\SDK

The structure can be placed in any location.

The SDK is a folder structure. The unzipped SDK contains the following folders:



Binaries

This folder contains the .NET assemblies that are referenced when creating solutions using the Spotfire platform on Windows or on Linux. Because the two platforms have different .NET requirements, the Binaries folder contains one set of files for each type. It also contains the related IntelliSense files.

Examples

This folder provides a wide set of solutions that can be used to solve common development scenarios. The SDK is divided into subfolders based on the technical character of the solutions:

COM Automation: Describes inter-application communication using COM.

Extensions: Provides a set of fully functional .NET projects solving specific tasks for Spotfire and Spotfire web clients. These extensions are simple enough to constitute a source of insight as well as code. Refer to the Community for a list of extension types and other options to add analytic capabilities to the platform.

All of the provided example extensions are included in the Visual Studio solutions SpotfireDeveloperExtensions.sln and SpotfireDeveloperExtensionsVS.sln. The solutions provide an easy way to get started with the examples and can be compiled in Debug or Release mode directly. Both the intended platforms windows and linux are built automatically. The difference between the two solutions is that the .sln file that has the suffix VS automatically also builds package files for all the examples.

All C# example extension projects include a .pkdesc file, which can be used to build separate packages using the Package Builder console. These files are automatically invoked when building the solution SpotfireDeveloperExtensionsVS.sln.

Two distribution description.xml files, DistributionDescription-windows.xml and DistributionDescription-linux.xml are included for the C# example extensions. These files list the examples to include in the distribution for each platform.

The two .bat files BuildPackages-windows.bat and BuildPackages-linux.bat contain logic to build all valid Windows and Linux packages, respectively, for the C# example extensions using the Package Builder console. They call the included .pkdesc files for the applicable examples.

The two .bat files BuildDistribution-windows.bat and BuildDistribution-linux.bat use the provided description.xml files to build distribution files containing the example tool packages.

Ten of the existing example projects have currently been adopted for both .NET flavors (for building on Linux as well as on Windows):

  • SpotfireDeveloper.AutomationServicesExample
  • SpotfireDeveloper.CalculationMethodExample
  • SpotfireDeveloper.CustomDataWriterExample
  • SpotfireDeveloper.CustomSampleFilesExample
  • SpotfireDeveloper.CustomToolsExample
  • SpotfireDeveloper.CustomToolsExampleWeb
  • SpotfireDeveloper.CustomVisualsExample
  • SpotfireDeveloper.FileDataSourceExample
  • SpotfireDeveloper.HtmlPrintToolExample
  • SpotfireDeveloper.HtmlPrintToolExampleWeb

Most examples contain two csproj files; one for just compiling for the two flavors of .NET, and another one that integrates with PackageBuilder-Console to also automatically build the package files.

In addition to extension projects, this folder contains the SpotfireDeveloper.ApiExamples project, which provides source code illustrating how to automate common tasks, like configuring visualizations, handling filtering, and periodically refreshing data.

Integration: Provides an example on how to call REST/SOAP methods in the Spotfire Server.

JavaScript: Provides mashup solutions using the JavaScript API of the web clients.

Package Builder

The Spotfire Package Builder console provides a framework for signing mods, and packaging extensions to Spotfire. It is a necessary tool used to create .spk files that can be deployed to a Spotfire Server, adding custom capabilities to the Spotfire platform.

Templates

The Spotfire Extension Project Template is used in Visual Studio to create new Spotfire extension projects. It handles implementation details and enables you to focus on adding new functionality. There are two versions of the template available, depending on how you want to work during development (using Visual Studio only or if you want to manually invoke the Package Builder console).

A project file to be run on Linux must be a so called "SDK-style project", see https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview .

However, it is possible to use SDK-style for building Windows projects as well. Therefore, the template projects are set up to build both flavors of .NET automatically by using the property <TargetFrameworks>net48;net8.0</TargetFrameworks> in the csproj file.

To automatically refer to the correct version of the Spotfire binaries, the MSBuild property TargetFramework is used to construct the reference path in the csproj file. For example:
<Reference Include="Spotfire.Dxp.Application">
<HintPath>../../../Binaries/$(TargetFramework)/Spotfire.Dxp.Application.dll</HintPath>
<Private>false</Private>
</Reference>

VisualStudioMacros

The SDK contains a Visual Studio macro simplifying development of document nodes. It injects boiler plate code based on the private fields defining a custom Spotfire document node.