Product: TIBCO Spotfire®
How to run a simple JavaScript API example in Spotfire 7.5 Web Player.
Starting with version 7.5, the Spotfire Web Player is run as a Java process. (Spotfire Web Player 7.0 and earlier use Microsoft IIS.) Because of this, the steps to run the Mashup example differ slightly from prior versions. In 7.0 and earlier, JavaScript API code could be placed in the Web Player installation itself. Starting with 7.5, the procedure is different. This article lists the steps required to run JavaScript code in Spotfire Web Player 7.5.
Steps to run JavaScript code in 7.5:
1). Copy the JavaScript code to open a library file on the Web Player from the following link, and save it in a file (in this example, we will use the filename "Mashup.html"):
http://stn.spotfire.com/stn/Tutorials/WebPlayerOpenFile.aspx
2). Edit this "Mashup.html" file, and configure the following:
Find the following tag:
Update the src element in this tag to read as follows:
"http://{ServerName}:{ServerPort}/spotfire/wp/GetJavaScriptApi.ashx?Version=6.0"
Find the following item:
var app = new spotfire.webPlayer.Application("../SpotfireWeb/", customization);
In this item, replace "../SpotfireWeb/" with the following:
"http://{ServerName}:{ServerPort}/spotfire/wp"
(replacing {ServerName} and {ServerPort} with custom values appropriate for your environment).
Specify the Spotfire library path of the report to be loaded in the app.open method as the first argument, and configuration block (if any) as the third argument. If there is no configuration block, the third argument can be set using this example:
app.open("/analysisfiles/myreport","webplayerdiv","ApplyBookmark(bookmarkName = "All");")
3). On the server that hosts the Spotfire Server instance, create a new folder named JavaScriptApiTest in C:\tibco\tss and place the edited "Mashup.html" file into the JavaScriptApiTest folder.
4). Open C:\tibco\tss\7.5.0\tomcat\conf\server.xml and add the following element to the /Server/Service/Engine/Host
5). Restart the Spotfire Server service.
6). To test the code, use a web browser to browse to http://:/javascriptapitest/Mashup.html
Comments
0 comments
Article is closed for comments.