Configuring Custom Functionality
Openspace allows you to call your own customized scripts when various events are triggered in Openspace. For example, you may want users to log into a third-party system before automatically logging into Openspace or you may want them to be redirected to a customized URL when logging out of Openspace.
To achieve this, Openspace has provided a script called callouts.js that you can edit to call your customized scripts. The script is located in CONFIG_HOME\tibcohost\adminenvironment-bpmenvironment-adminservername\datan\host\plugins\com.tibco.openspace.login_n\resources\callouts\callouts.js. See Openspace Configuration Overview for more information about the config.properties file.
There are four properties that allow you to configure when the callouts.js script is run. The script is automatically run when one or more of the properties are enabled. The properties are stored in the config.properties file.
- hook.onLoadOpenspace. The script runs when Openspace loads.
- hook.onLoginOpenspace. The script runs when a user logs in to Openspace.
- hook.onLogoutOpenspace. The script runs when a user logs out of Openspace.
- hook.onUnLoadOpenspace. The script runs when Openspace is unloading.
// Copyright© 2005-2013, TIBCO Software Inc function onLoadOpenspace() { if(document.getElementById) { window.alert = function(txt) { // override window.alert() and instead do INFO level log in Openspace openspaceLog(txt); // can also use openspaceLogN(txt,level); where level 4==WARN, 2==ERROR, 1==FATAL, 8==INFO, 16=DEBUG, 32==TRACE etc. } } window.alert("a) javascript onLoadOpenspace"); } function onLoginOpenspace(user) { window.alert("b) javascript onLoginOpenspace " + user); } function onLogoutOpenspace() { window.alert("c) javascript onLogoutOpenspace" ); } function onUnLoadOpenspace(timedOut, sessionInvalidated, urlReload) { window.alert("d) javascript onUnLoadOpenspace timedOut=" + timedOut + " sessionInvalidated=" + sessionInvalidated + " urlReload=" + urlReload ); return urlReload; } function onCollateStrings(locale, a, b, context) { var result = "0"; var ret = a.localeCompare(b); if (ret < 0) { result = "-1"; } else { if( ret > 0) { result = "1"; } } window.alert("e) javascript onCollateStrings (" + context + ") locale=" + locale + " a=" + a + " b=" + b+" result="+result ); return result; }