How to automate Spotfire Template Opening
Purpose
The purpose of this feature is to bind Spotfire templates to specific LiveReports. Based on the rules below, when opening the Discngine Spotfire Gadget, the user will either directly see a specific template, or have the ability to chose from a selected list of template.
Configuration
In Spotfire preferences, you can specify a root directory in the Spotfire Library using the DefaultLibraryPath. All LiveDesign related Spotfire templates will be extracted from the (sub)folders in the root.
By default, the root will be the root of the library.
The Library Structure convention
The structure of the library should follow the same logic than that used in LiveDesign. Namely:
- Root
- Project 0
- LiveReport 11
- LiveReport 22
- Project 1
- LiveReport 33
- LiveReport 44
- Project 0
Project 0
has a special meaning and corresponds to the Global ProjectThe automatic opening of templates is based on the following conventions (by order of precedence):
-
If only one template exists under
Project N/LiveReport Y/template
, it will be open -
If multiple templates exist under
Project N/LiveReport Y
, the user will have to select the template to open. e.g. if we haveProject N/LiveReport Y/template 1
andProject N/LiveReport Y/template 2
, the user will see a prompt with "template 1" and "template 2" -
If the project folder exists but contains no folder for the current LiveReport:
3.1. If only one template exists under
Project N/template
, it will be open3.2. If multiple templates exist under
Project N
, the user will have to select the template to open (similar to rule 2) -
If the project folder does not exist, but a folder named
Project 0
exists4.1. If only one template exists under
Project 0/template
, it will be open4.2. If multiple templates exist under
Project 0
, the user will have to select the template to open (similar to rule 2 and 3.2) -
If none of the previous pattern is found, the user will simply see the full Spotfire Library tree and will be able to open any Document they can access.
If you want to specify a default page in a document for it to be opened automatically in Spotfire with light interface, the document has to contain a page named "[ Default]" if the DefaultPageTitle preference is null or not defined, and if defined, the name specified
Example
If you want for the LiveReport with id 323 of the project with id 1 to open automatically a document :
- in the default library path, create a folder named "Project 1" if it does not exist
- in this project folder, create a folder named "LiveReport 323" if it does not exist
- in this LiveReport folder, put the Spotfire template you want to use (and only this one)
If you put multiple Spotfire template in the folder, the gadget will prompt the user to select the template they want to open: