Javascript 从不同的spotfire服务器动态加载不同的spotfire报告

Javascript 从不同的spotfire服务器动态加载不同的spotfire报告,javascript,spotfire,tibco,Javascript,Spotfire,Tibco,在我们的web应用程序中,我们使用“TIBCO spotfire JavascriptAPI”集成spotfire报告 我们需要显示来自多个spotfire服务器的报告。例如,我们在“spotfire.cloud.tibco.com”中有一个可视化报告,另一个报告在“spotfire next.cloud.tibco.com”中 为了从这两台服务器加载报告,我需要包括两台SF服务器,如下所示 <script src="https://spotfire-next.cloud.tibco.co

在我们的web应用程序中,我们使用“TIBCO spotfire JavascriptAPI”集成spotfire报告

我们需要显示来自多个spotfire服务器的报告。例如,我们在“spotfire.cloud.tibco.com”中有一个可视化报告,另一个报告在“spotfire next.cloud.tibco.com”中

为了从这两台服务器加载报告,我需要包括两台SF服务器,如下所示

<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>
为了从两个不同的Spotfire服务器加载报告,我如何才能做到这一点

所以,如果我使用spotfire实例实例化报告,比如 “spotfire.webPlayer”哪个spotfire服务器将被触发

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");
Spotfire 7.6及更高版本使用Spotfire服务器作为安装为节点的Web播放器的负载平衡。因此,根据Spotfire服务器请求,将转到该服务器管理的Webplayer节点

如果要在特定服务器/Webplayer实例上运行报告,请执行以下步骤:

  • 创建2个名为“Dashboard”和“Dashboard1”的资源池
  • 将一些Webplayer实例从“服务器1”分配到“仪表板”池
  • 将一些Webplayer实例从“服务器2”分配到“仪表板1”池
  • 现在,您可以将报告分配到适当的资源池

我不知道它是否有效,但如果您错开脚本该怎么办

<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>

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(“容器”);
var serverUrl2=”https://spotfire.cloud.tibco.com/spotfire/wp/";
var analysisPath2=“/Samples/Expense Analyzer Dashboard2”;
var customizationInfo2=newspotfire.webPlayer.Customization();
var app2=newspotfire.webPlayer.Application(serverUrl2、customizationInfo2、analysisPath2);
var doc2=app2.openDocument(“container2”);
您是否可以下载一个loader.js并手动添加前缀,然后将其加载到您的站点并引用它

如果不是过于复杂的页面,您可以在单独的页面中构建它们,然后将它们拉入iFrame


这肯定是一个问题,因为JavaScript会用最后一个函数覆盖相同的命名函数。

对于第一个问题,您是否可以创建并托管HTML页面,并使用DOM资源管理器查看正在进行的调用/触发的是什么?还有,我不使用它,但是Spotfire.cloud不是贬值了吗?如果是的话,你的报告现在不是在同一个地方吗?