function SL4B_RttpProviderFactory() { } SL4B_RttpProviderFactory.prototype.createRttpProvider = SL_T; function SL_T(SL_Al) { var SL_Jm = SL4B_Accessor.getConfiguration(); var SL_Jn = null; if (SL_Jm.getRttpProvider() == SL4B_ScriptLoader.const_APPLET_RTTP_PROVIDER) { SL_Jn = new SL4B_AppletRttpProvider(SL_Al); } else if (SL_Jm.getRttpProvider() == SL4B_ScriptLoader.const_OBJECT_RTTP_PROVIDER) { alert("Object RTTP Provider support is not available in this version of SL4B"); } else if (SL_Jm.getRttpProvider() == SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER) { SL_Jn = new SL4B_JavaScriptRttpProvider(SL_Al); } else if (SL_Jm.getRttpProvider() == SL4B_ScriptLoader.const_TEST_RTTP_PROVIDER) { SL_Jn = new SL4B_TestRttpProvider(); } return SL_Jn; } SL4B_Accessor = new function() { this.SL_LN = null; this.SL_LO = null; this.SL_La = null; this.SL_LQ = null; this.SL_fw = null; this.SL_LS = null; this.SL_Ln = new SL4B_RttpProviderFactory(); this.setExceptionHandler = function(SL_Am) { this.SL_LN = SL_Am; }; this.getExceptionHandler = function() { return this.SL_LN; }; this.getConfiguration = function() { return this.SL_LO; }; this.setConfiguration = function(SL_Jm) { if(this.SL_LO != null) { throw new SL4B_Exception("The SL4B_Configuration has already been set and cannot be changed.") } else { this.SL_LO = SL_Jm; } }; this.getBrowserAdapter = function() { if (this.SL_La == null) { throw new SL4B_Exception("BrowserAdapter has not been set"); } return this.SL_La; }; this.setBrowserAdapter = function(SL_Ap) { this.SL_La = SL_Ap; }; this.getCredentialsProvider = function() { if (this.SL_LQ == null) { throw new SL4B_Exception("CredentialsProvider has not been set"); } return this.SL_LQ; }; this.setCredentialsProvider = function(SL_Aq) { this.SL_LQ = SL_Aq; }; this.getRttpProvider = function() { if (this.SL_fw == null) { throw new SL4B_Exception("RttpProvider has not been set"); } return this.SL_fw; }; this.getUnderlyingRttpProvider = function() { if (this.SL_LS == null) { throw new SL4B_Exception("UnderlyingRttpProvider has not been set"); } return this.SL_LS; }; this.setRttpProvider = function(SL_Ar) { this.SL_fw = SL_Ar; SL_Ar.internalInitialise(); }; this.setUnderlyingRttpProvider = function(SL_Ar) { this.SL_LS = SL_Ar; }; this.getLogger = function() { return SL4B_Logger; }; this.getRttpProviderFactory = function() { return this.SL_Ln; }; this.setRttpProviderFactory = function(SL_At) { this.SL_Ln = SL_At; }; }; SL4B_DebugLevel = new function() { this.CRITICAL = "critical"; this.ERROR = "error"; this.NOTIFY = "notify"; this.WARN = "warn"; this.INFO = "info"; this.DEBUG = "debug"; this.RTTP_FINE = "rttp-fine"; this.RTTP_FINER = "rttp-finer"; this.RTTP_FINEST = "rttp-finest"; this.const_CRITICAL_INT = 0; this.const_ERROR_INT = 1; this.const_NOTIFY_INT = 2; this.const_WARN_INT = 3; this.const_INFO_INT = 4; this.const_DEBUG_INT = 5; this.const_RTTP_FINE_INT = 6; this.const_RTTP_FINER_INT = 7; this.const_RTTP_FINEST_INT = 8; this.SL_Lp = new Object(); this.SL_Lq = new Object(); this.addDebugLevel = function(SL_Au, SL_Df) { this.SL_Lp[SL_Au] = SL_Df; this.SL_Lq[SL_Df] = SL_Au; }; this.getNumericDebugLevel = function(SL_BC) { var SL_Jp; if (typeof SL_BC == "number") { SL_Jp = SL_BC; } else if (!isNaN(SL_BC)) { SL_Jp = parseInt(SL_BC); } else if (typeof SL_BC != "string" || typeof this.SL_Lq[SL_BC.toLowerCase()] == "undefined") { throw new SL4B_Exception("Illegal debug level \"" + SL_BC + "\" specified"); } else { SL_Jp = this.SL_Lq[SL_BC.toLowerCase()]; } return SL_Jp; }; this.getDebugLevelName = function(SL_BC) { var SL_Jq; if (typeof SL_BC == "string") { SL_Jq = SL_BC; } else if (typeof SL_BC == "number") { SL_Jq = this.SL_Lp[SL_BC]; } return SL_Jq; }; this.addDebugLevel(this.const_CRITICAL_INT, this.CRITICAL); this.addDebugLevel(this.const_ERROR_INT, this.ERROR); this.addDebugLevel(this.const_NOTIFY_INT, this.NOTIFY); this.addDebugLevel(this.const_WARN_INT, this.WARN); this.addDebugLevel(this.const_INFO_INT, this.INFO); this.addDebugLevel(this.const_DEBUG_INT, this.DEBUG); this.addDebugLevel(this.const_RTTP_FINE_INT, this.RTTP_FINE); this.addDebugLevel(this.const_RTTP_FINER_INT, this.RTTP_FINER); this.addDebugLevel(this.const_RTTP_FINEST_INT, this.RTTP_FINEST); }; SL4B_Logger = new function() { this.const_HTML = "html"; this.const_ABOUT_BLANK = "about:blank"; this.SL_Mr = null; this.SL_Mb = false; this.SL_MV = false; this.SL_Ma = false; this.SL_MQ = new Array(); this.SL_MN = new Array(); this.SL_MM = false; this.SL_Mp = -1; this.SL_La = null; this.SL_MG = new Array(/\{0\}/g, /\{1\}/g, /\{2\}/g, /\{3\}/g, /\{4\}/g, /\{5\}/g, /\{6\}/g, /\{7\}/g); this.replaceMessageParameters = function(SL_EE, SL_BA, SL_BB) { var SL_Jr = SL_BA.length; for (var SL_Js = SL_BB; SL_Js < SL_Jr; ++SL_Js) { SL_EE = SL_EE.replace(this.SL_MG[(SL_Js - SL_BB)], SL_BA[SL_Js]); } return SL_EE; }; this.log = function(SL_BC, SL_EE) { if (typeof(SL_BC) == "number" && this.SL_Mp != -1) { if (this.SL_Mp >= SL_BC) { this.printMessage(SL4B_DebugLevel.getDebugLevelName(SL_BC) + ": " + this.replaceMessageParameters(SL_EE, this.log.arguments, 2)); } } else { try { if (this.mustDebug(SL_BC)) { this.printMessage(SL4B_DebugLevel.getDebugLevelName(SL_BC) + ": " + this.replaceMessageParameters(SL_EE, this.log.arguments, 2)); } } catch(e) { SL4B_Accessor.getExceptionHandler().processException(e); } } }; this.alert = function(SL_EE) { var SL_Jt = this.replaceMessageParameters(SL_EE, this.alert.arguments, 1); this.printMessage(SL_Jt); try { if (this.mustDebug(SL4B_DebugLevel.NOTIFY)) { this.synchronizedAlert(SL_Jt); } } catch(e) { SL4B_Accessor.getExceptionHandler().processException(e); } }; this.synchronizedAlert = function(SL_EE) { this.SL_MN.push(SL_EE); if (!this.SL_MM) { this.SL_MM = true; while (this.SL_MN.length > 0) { alert(this.SL_MN.shift()); } this.SL_MM = false; } }; this.printMessage = function(SL_EE) { var SL_Jt = LF_DateStamp.createDateStamp() + " - " + this.replaceMessageParameters(SL_EE, this.printMessage.arguments, 1); this.SL_MQ.push(SL_Jt); if (this.SL_La == null) { this.SL_La= SL4B_Accessor.getBrowserAdapter(); } if (this.SL_La != null) { this.SL_La.dump(SL_Jt + "\n"); } try { if (this.SL_MV) { this.printMessagesToDebugConsole(); } } catch(e) { SL4B_Accessor.getExceptionHandler().processException(e); } }; this.printMessagesToDebugConsole = function() { while (this.SL_MQ.length > 0) { var SL_Jv = this.SL_MQ.shift(); this.printMessageToDebugConsole(SL_Jv); } }; this.printMessageToDebugConsole = function(SL_EE) { try { this.SL_Mr.SL_AJC(SL_EE); } catch(e) { } }; this.useHtmlDebugWindow = function() { return (SL4B_Accessor.getConfiguration().getDebugWindowType() == this.const_HTML); }; this.openDebugConsoleOnStartUp = function(SL_BI) { if ((SL_BI && this.useHtmlDebugWindow()) || (!SL_BI && !this.useHtmlDebugWindow())) { if (this.mustDebug(SL4B_DebugLevel.WARN)) { this.openDebugConsole(); } } }; this.getDebugWindowName = function() { return "_sl4b_debug_" + SL4B_Accessor.getConfiguration().getFrameId(); }; this.openDebugConsole = function() { if (!this.SL_Mb && !this.SL_Ma) { this.SL_Mb = true; var SL_AJA = SL4B_Accessor.getConfiguration().getCommonDomain(); var SL_Jx = this.getDebugWindowName(); var SL_Jy = "height=400,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes"; if (this.useHtmlDebugWindow()) { var SL_KA = SL4B_ScriptLoader.getRootUrl() + "sl4b/logger/log-window.html?level=" + SL4B_Accessor.getConfiguration().getDebugLevel() + ((SL_AJA != null)?"&domain=" + SL_AJA:""); this.SL_Mr = window.open(SL_KA, SL_Jx, SL_Jy); } else { this.SL_Mr = window.open("", SL_Jx, SL_Jy); var SL_KB = "