How to identify which analysis file is the source of script trust (data functions, IronPython scripts, JavaScripts, or custom queries)

How to identify which analysis file is the source of script trust (data functions, IronPython scripts, JavaScripts, or custom queries)

book

Article ID: KB0078289

calendar_today

Updated On:

Products Versions
Spotfire Analyst 10.3 and higher

Description

Whenever data functions, IronPython scripts, JavaScripts, or custom queries are trusted in an analysis file, the file gets a "TrustedScripts" property assigned. But the same scripts and data functions can be present in multiple analysis files. A script or data function may be trusted in one analysis file explicitly, and if the exact same script or data function is not explicitly trusted in another analysis file, they are still considered to be trusted in the library since the script hash matches the trust hash generated for the file where the script of data function is trusted.

Sometimes the script or data function trust is lost for such .dxp copies and users get script ordata function untrusted warnings when:
  1. The script in the original file (where the script was trusted) changes
  2. The original file is deleted
  3. The user no longer has access to the original file (where the script was trusted, and where the script trust property is found). For example, if library permissions for the folder where the original file is saved are changed or the original file is moved to other location where users do not have access.
In such cases, there is a need to identify such dependent analysis and their scripts and data functions need to be trusted by an authorized user in order to generate the trustedscripts property for those analysis files.

Issue/Introduction

How to identify which analysis file is the source of script trust (data functions, IronPython scripts, JavaScripts, or custom queries)

Resolution

The find-analysis-scripts config command can be used to generate a .csv report analyzing the trusted hash for analyses in library. See the find-analysis-scripts reference for more details.

Note: Depending on the size of the environment, the following example command should be run during off-hours since it will analyze all the files in the library by default and may impact server performance. See the the find-analysis-scripts reference and Script and Data function trust in Spotfire 10.3 and later Wiki article for options on how to limit the scope of what is analyzed.
  1. To run, execute the following command: 
    <install directory>\10.3.0\tomcat\spotfire-bin>config find-analysis-scripts -i
  2. This will generate a report_<date>.csv file in the newly created \find-analysis-scripts\ sub-folder
  3. Open this .csv file TIBCO Spotfire installed client
  4. Create a calculated column named "Source":
    Data > Add calculated column...
        Column name: Source
        Expression: case  when Find([Library file ID],[Source of trust])=0 then "Dependent" else "Original" end
  5. Filter on the "Source" column to only "Source"="Dependent"
This will give you the list of all analysis files whose trust is dependent on another analysis file. The "Source of trust" column in the report contains a set of library IDs corresponding to the analysis files where the script or data function is trusted. If the script or data function is used in many analysis files, then this is a list of all analysis files where the script or data function is trusted.

Additional Information

Wiki: Script and Data function trust in Spotfire 10.3 and later Wiki: Guidelines on improved trust mechanism Wiki: Data function trust FAQ Doc: find-analysis-scripts