Created
August 10, 2015 17:38
-
-
Save manduks/668b025aa7479579407d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configureSpotfire : function (props, url) { | |
var me = this, | |
baseUrl = TopBox.Util.globalURL + '/analytics/', | |
customization, | |
onError, | |
onOpened; | |
customization = new spotfire.webPlayer.Customization(); | |
customization.showTopHeader = false; | |
customization.showToolBar = false; | |
customization.showExportFile = false; | |
customization.showExportVisualization = false; | |
customization.showCustomizableHeader = false; | |
customization.showPageNavigation = false; | |
customization.showStatusBar = false; | |
customization.showDodPanel = false; | |
customization.showFilterPanel = false; | |
onError = function (errorCode, description) { | |
console && console.log(errorCode + ": " + description); | |
if (description.indexOf('401 Unauthorized') >= 0) { //catch session timeout error | |
alert('spotfire session logout'); | |
return TopBox.Util.logoutApp(); | |
} | |
}; | |
onOpened = function (analysisDocument) { | |
Ext.iterate(props, function (key, value) { | |
me.spotfire.analysisDocument.setDocumentProperty(key, value); | |
}); | |
}; | |
onClosed = function (analysisPath) { | |
return TopBox.Util.logoutApp(); | |
}; | |
me.spotfire = new spotfire.webPlayer.Application(baseUrl, customization); | |
var configuration = 'SetPage(pageTitle="Arrival Patterns");MyProperties.engagementId={' + TopBox.State.getCurrentClientEngagement() + '};'; | |
me.spotfire.onError(onError); | |
me.spotfire.onOpened(onOpened); | |
me.spotfire._onClosedCallback(onClosed); | |
console.log(me.spotfire); | |
me.spotfire.open('/Development/Analysis Files/Target Calls - RC4', me.id +'-content', configuration); | |
me.sfLoaded = true; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment