0
votes

In our web application, we are integrating spotfire reports using "TIBCO Spotfire JavascriptAPI"

We need to display reports from multiple spotfire servers. for example we have one visualization report in "spotfire.cloud.tibco.com" and another report is in "spotfire-next.cloud.tibco.com"

In order to load report from these two servers, i need to include two SF servers like below

<script src="https://spotfire-next.cloud.tibco.com/spotfire/js-api/loader.js"></script>
<script src="https://spotfire.cloud.tibco.com/spotfire/wp/GetJavaScriptApi.ashx"></script>

so if i instantiate report using spotfire instance like "spotfire.webPlayer" which spotfire server will get trigger ?

var serverUrl = "https://spotfire-next.cloud.tibco.com/spotfire/wp/";
var analysisPath = "/Samples/Expense Analyzer Dashboard";
var customizationInfo = new spotfire.webPlayer.Customization();    
var app = new spotfire.webPlayer.Application(serverUrl, customizationInfo,analysisPath);
var doc=app.openDocument("container");

var serverUrl2 = "https://spotfire.cloud.tibco.com/spotfire/wp/";
var analysisPath2 = "/Samples/Expense Analyzer Dashboard2";
var customizationInfo2  = new spotfire.webPlayer.Customization();
var app2 = new spotfire.webPlayer.Application(serverUrl2, customizationInfo2, analysisPath2);
var doc2=app2.openDocument("container2");

In order to load report from two different Spotfire server how can i achive this?

2
For your first question, can you create and host the HTML page, and use the DOM explorer to see the call that is going out/what is being triggered? Also, and I don't use it, but isnt Spotfire.cloud depreciated? community.tibco.com/wiki/spotfire-cloud-migration-faq If so, arent your reports in the same place now? - Mark P.

2 Answers

1
votes

so if i instantiate report using spotfire instance like "spotfire.webPlayer" which spotfire server will get trigger ?

Spotfire 7.6 and above uses Spotfire Server as a Load balance for Webplayers installed as Nodes. So based on Spotfire server request will go to Webplayer nodes managed by that server.

If you want to run your reports on specific Server/Webplayer Instances follow these steps:

  • create 2 resource pool Named: "Dashboard" and "Dashboard1"
  • assign some Webplayer instances from "server 1" to "Dashboard" pool
  • assign some Webplayer instances from "server 2" to "Dashboard1" pool
  • now you can assign reports to appropriate resource pool
0
votes

I don't know if it would work but what if you staggered the scripts.

<script src="https://spotfire-next.cloud.tibco.com/spotfire/js-api/loader.js"></script>

<script> 
var serverUrl = "https://spotfire-next.cloud.tibco.com/spotfire/wp/";
var analysisPath = "/Samples/Expense Analyzer Dashboard";
var customizationInfo = new spotfire.webPlayer.Customization();    
var app = new spotfire.webPlayer.Application(serverUrl, customizationInfo,analysisPath);
var doc=app.openDocument("container");

</script>
<script src="https://spotfire.cloud.tibco.com/spotfire/wp/GetJavaScriptApi.ashx"></script>
<script>

var serverUrl2 = "https://spotfire.cloud.tibco.com/spotfire/wp/";
var analysisPath2 = "/Samples/Expense Analyzer Dashboard2";
var customizationInfo2  = new spotfire.webPlayer.Customization();
var app2 = new spotfire.webPlayer.Application(serverUrl2, customizationInfo2, analysisPath2);
var doc2=app2.openDocument("container2");
</script>

Could you download one of the loader.js and append a prefix manually and load that to your site and reference it.

You could build them in separate pages and then pull them in iframes if not overly complicated pages.

It's definitely a problem as JavaScript overrides same named functions with the last one.