SL_BB = function(){this.REMOVAL_LIMIT=1000;this.m_bBrowserMapsLeakMemory=(navigator.userAgent.match(/MSIE/)!=undefined);}; SL_BB.prototype.createMap = function(){if(this.m_bBrowserMapsLeakMemory){var fClass=new Function(); fClass.deleteCount=0;return new fClass(); }else {return {}; }}; SL_BB.prototype.removeItem = function(B,A){delete B[A];if(this.m_bBrowserMapsLeakMemory){if(B.constructor.deleteCount++>=this.REMOVAL_LIMIT){var mNewMap=this.createMap(); for(sItem in B){mNewMap[sItem]=B[sItem];}B=mNewMap;}}return B; }; SL_BB=new SL_BB();var SL4B_RttpProviderFactory=function(){}; if(false){function SL4B_RttpProviderFactory(){} }SL4B_RttpProviderFactory = function(){this.m_oLastProvider=null;}; SL4B_RttpProviderFactory.prototype.createRttpProvider = SL_LR;function SL_LR(A){var l_oConfiguration=SL4B_Accessor.getConfiguration(); var l_oProvider=null; if(l_oConfiguration.getRttpProvider()==SL4B_ScriptLoader.const_APPLET_RTTP_PROVIDER){l_oProvider=new SL4B_AppletRttpProvider(A);}else if(l_oConfiguration.getRttpProvider()==SL4B_ScriptLoader.const_OBJECT_RTTP_PROVIDER){alert("Object RTTP Provider support is not available in this version of SL4B");}else if(l_oConfiguration.getRttpProvider()==SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER){l_oProvider=SL4B_JavaScriptRttpProvider.createProvider(A,this.m_oLastProvider);}else if(l_oConfiguration.getRttpProvider()==SL4B_ScriptLoader.const_TEST_RTTP_PROVIDER){l_oProvider=new SL4B_TestRttpProvider();}if(this.m_oLastProvider!==null){SL4B_WindowEventHandler.removeListener(this.m_oLastProvider);}this.m_oLastProvider=l_oProvider;return l_oProvider; } var SL4B_Accessor=function(){}; if(false){function SL4B_Accessor(){} }SL4B_Accessor = new function(){this.m_oExceptionHandler=null;this.m_oConfiguration=null;this.m_oBrowserAdapter=null;this.m_oCredentialsProvider=null;this.m_oRttpProvider=null;this.m_oUnderlyingRttpProvider=null;this.m_oStatistics=null;this.m_oRttpProviderFactory=new SL4B_RttpProviderFactory();this.setExceptionHandler = function(A){this.m_oExceptionHandler=A;}; this.getExceptionHandler = function(){return this.m_oExceptionHandler; }; this.getConfiguration = function(){return this.m_oConfiguration; }; this.setConfiguration = function(A){if(this.m_oConfiguration!=null){throw new SL4B_Exception("The SL4B_Configuration has already been set and cannot be changed."); }else {this.m_oConfiguration=A;}}; this.getBrowserAdapter = function(){if(this.m_oBrowserAdapter==null){throw new SL4B_Exception("BrowserAdapter has not been set"); }return this.m_oBrowserAdapter; }; this.setBrowserAdapter = function(A){this.m_oBrowserAdapter=A;}; this.getCredentialsProvider = function(){if(this.m_oCredentialsProvider==null){throw new SL4B_Exception("CredentialsProvider has not been set"); }return this.m_oCredentialsProvider; }; this.setCredentialsProvider = function(A){this.m_oCredentialsProvider=A;}; this.getRttpProvider = function(){if(this.m_oRttpProvider==null){throw new SL4B_Exception("RttpProvider has not been set"); }return this.m_oRttpProvider; }; this.getUnderlyingRttpProvider = function(){if(this.m_oUnderlyingRttpProvider==null){throw new SL4B_Exception("UnderlyingRttpProvider has not been set"); }return this.m_oUnderlyingRttpProvider; }; this.setRttpProvider = function(A){this.m_oRttpProvider=A;A.internalInitialise();}; this.setUnderlyingRttpProvider = function(A){this.m_oUnderlyingRttpProvider=A;}; this.getLogger = function(){return SL4B_Logger; }; this.getRttpProviderFactory = function(){return this.m_oRttpProviderFactory; }; this.setRttpProviderFactory = function(A){this.m_oRttpProviderFactory=A;}; this.setStatistics = function(A){this.m_oStatistics=A;}; this.getStatistics = function(){if(this.m_oStatistics==null){throw new SL4B_Exception("Statistics has not been set"); }return this.m_oStatistics; }; this.setCapabilities = function(A){this.m_oCapabilities=A;}; this.getCapabilities = function(){if(this.m_oCapabilities==null){throw new SL4B_Exception("Capabilities has not been set"); }return this.m_oCapabilities; }; this.resetConfig = function(A){this.m_oConfiguration=null;this.setConfiguration(A);}; this.resetRttpProvider = function(A){this.m_oRttpProvider=A;this.m_oUnderlyingRttpProvider=A;}; }; var SL4B_WindowEventHandler=function(){}; if(false){function SL4B_WindowEventHandler(){} }SL4B_WindowEventHandler = new function(){this.m_pRegisteredListeners=new Array();this.addListener = function(A){if(typeof A.onLoad=="function"||typeof A.onUnload=="function"){this.m_pRegisteredListeners.push(A);}else {throw new SL4B_Exception("addListener: listener object must implement either the onLoad or onUnload methods"); }}; this.removeListener = function(A){for(var i=0,l_nLength=this.m_pRegisteredListeners.length;i&"]/g;this.m_mDecodedToEncodedValueMap={"<":"<", ">":">", "&":"&", "\"":"""};}; if(false){function SL4B_StringEncoder(){} }SL4B_StringEncoder.prototype.encodeValue = function(A){if(this.m_oCharactersToEncodeRegExp.test(A)){return A.replace(this.m_oCharactersToEncodeRegExp,this._encodeCharacter); }return A; }; SL4B_StringEncoder.prototype._encodeCharacter = function(A){return SL4B_StringEncoder.m_mDecodedToEncodedValueMap[A]; }; SL4B_StringEncoder=new SL4B_StringEncoder();var SL4B_DebugLevel=function(){}; if(false){function SL4B_DebugLevel(){} }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.m_pDebugLevelNames=new Object();this.m_pNumericDebugLevels=new Object();this.addDebugLevel = function(B,A){this.m_pDebugLevelNames[B]=A;this.m_pNumericDebugLevels[A]=B;}; this.getNumericDebugLevel = function(A){var l_nNumericDebugLevel; if(typeof A=="number"){l_nNumericDebugLevel=A;}else if(!isNaN(A)){l_nNumericDebugLevel=parseInt(A);}else if(typeof A!="string"||typeof this.m_pNumericDebugLevels[A.toLowerCase()]=="undefined"){throw new SL4B_Exception("Illegal debug level \""+A+"\" specified"); }else {l_nNumericDebugLevel=this.m_pNumericDebugLevels[A.toLowerCase()];}return l_nNumericDebugLevel; }; this.getDebugLevelName = function(A){var l_sDebugLevelName; if(typeof A=="string"){l_sDebugLevelName=A;}else if(typeof A=="number"){l_sDebugLevelName=this.m_pDebugLevelNames[A];}return l_sDebugLevelName; }; 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);}; var SL4B_Logger=function(){}; if(false){function SL4B_Logger(){} }SL4B_Logger = new function(){this.const_HTML="html";this.const_ABOUT_BLANK="about:blank";this.m_hDebugConsole=null;this.m_bDebugConsoleOpening=false;this.m_bDebugConsoleOpened=false;this.m_bClosing=false;this.m_pMessageQueue=new Array();this.m_pAlertMessageQueue=new Array();this.m_bAlertDisplayed=false;this.m_nConfiguredDebugLevel=-1;this.m_oBrowserAdapter=null;this.m_pMessageListeners=new Array();this.m_pParameterRegularExpressions=new Array(/\{0\}/g,/\{1\}/g,/\{2\}/g,/\{3\}/g,/\{4\}/g,/\{5\}/g,/\{6\}/g,/\{7\}/g);this.replaceMessageParameters = function(C,A,B){var l_nNumberOfParameters=A.length; for(var l_nParam=B;l_nParam=B){this.printMessage(this.replaceMessageParameters(A,this.log.arguments,2),B);}}else { try {if(this.mustDebug(B)){this.printMessage(this.replaceMessageParameters(A,this.log.arguments,2),B);}}catch(e){SL4B_Accessor.getExceptionHandler().processException(e);} }}; this.logConnectionMessage = function(A){arguments[0]=(A ? SL4B_DebugLevel.const_NOTIFY_INT : SL4B_DebugLevel.const_INFO_INT);arguments[1]="[CONNECTION] "+arguments[1];this.log.apply(this,arguments);}; this.alert = function(A){var l_sFormattedMessage=this.replaceMessageParameters(A,this.alert.arguments,1); this.printMessage(l_sFormattedMessage); try {if(this.mustDebug(SL4B_DebugLevel.NOTIFY)){this.synchronizedAlert(l_sFormattedMessage);}}catch(e){SL4B_Accessor.getExceptionHandler().processException(e);} }; this.synchronizedAlert = function(A){this.m_pAlertMessageQueue.push(A);if(!this.m_bAlertDisplayed){this.m_bAlertDisplayed=true;while(this.m_pAlertMessageQueue.length>0){alert(this.m_pAlertMessageQueue.shift());}this.m_bAlertDisplayed=false;}}; this.printMessage = function(B,A){A=(A===undefined ? SL4B_DebugLevel.INFO : A);var l_sFormattedMessage=SL_HK.createDateStamp()+" - "+SL4B_DebugLevel.getDebugLevelName(A)+": "+B; this.m_pMessageQueue.push(l_sFormattedMessage);if(this.m_oBrowserAdapter==null){this.m_oBrowserAdapter=SL4B_Accessor.getBrowserAdapter();}if(this.m_oBrowserAdapter!=null){this.m_oBrowserAdapter.dump(l_sFormattedMessage+"\n");}for(var l_nListener=0,l_nLength=this.m_pMessageListeners.length;l_nListener0){var l_sNextMessage=this.m_pMessageQueue.shift(); this.printMessageToDebugConsole(l_sNextMessage);}}; this.printMessageToDebugConsole = function(A){if(this.m_hDebugConsole!=null){ try {this.m_hDebugConsole.GF_LogMessage(A);}catch(e){} }}; this.useHtmlDebugWindow = function(){return (SL4B_Accessor.getConfiguration().getDebugWindowType()==this.const_HTML); }; this.openDebugConsoleOnStartUp = function(A){if((A&&this.useHtmlDebugWindow())||(!A&&!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.m_bDebugConsoleOpening&&!this.m_bClosing){this.m_bDebugConsoleOpening=true;var l_sDomain=SL4B_Accessor.getConfiguration().getCommonDomain(); var l_sDebugWindowName=this.getDebugWindowName(); var l_sDebugWindowParameters="height=400,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes"; if(this.useHtmlDebugWindow()){var l_sUrl=SL4B_ScriptLoader.getRootUrl()+"sl4b/logger/log-window.html?level="+SL4B_Accessor.getConfiguration().getDebugLevel()+((l_sDomain!=null) ? "&domain="+l_sDomain : ""); this.m_hDebugConsole=window.open(l_sUrl,l_sDebugWindowName,l_sDebugWindowParameters);}else {this.m_hDebugConsole=window.open("",l_sDebugWindowName,l_sDebugWindowParameters);var l_sHtml="SL4B Debug Log [Debug level "+SL4B_StringEncoder.encodeValue(SL4B_Accessor.getConfiguration().getDebugLevel())+"]"; l_sHtml+="";l_sHtml+="
";l_sHtml+="";l_sHtml+=""; try {var l_oDocument=this.m_hDebugConsole.document; l_oDocument.open();l_oDocument.write(l_sHtml);l_oDocument.close();}catch(e){SL4B_Logger.alert("Your browser appears to have a popup blocker enabled which is preventing the SL4B debug console window from opening.\nPlease disable the popup blocker for this web site to view the console.");} }}}; this.closeDebugConsole = function(){if(this.m_hDebugConsole!=null){this.m_bClosing=true;this.m_hDebugConsole.close();}}; this.debugConsoleOpened = function(){this.m_bDebugConsoleOpened=true;this.printMessageToDebugConsole("Debug Console for frame \""+SL4B_Accessor.getConfiguration().getFrameId()+"\"");this.printMessagesToDebugConsole();SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"Logger.debugConsoleOpened: Adding logger as listener for close event."); try {SL4B_WindowEventHandler.addListener(this);}catch(e){SL4B_Accessor.getExceptionHandler().processException(e);} }; this.debugConsoleClosed = function(){this.m_bDebugConsoleOpened=false;this.m_hDebugConsole=null;}; this.mustDebug = function(A){return (this.getConfiguredDebugLevel()>=SL4B_DebugLevel.getNumericDebugLevel(A)); }; this.getConfiguredDebugLevel = function(){if(this.m_nConfiguredDebugLevel==-1){ try {this.m_nConfiguredDebugLevel=SL4B_DebugLevel.getNumericDebugLevel(SL4B_Accessor.getConfiguration().getDebugLevel());}catch(e){this.m_nConfiguredDebugLevel=SL4B_DebugLevel.getNumericDebugLevel(SL4B_DebugLevel.ERROR);} }return this.m_nConfiguredDebugLevel; }; this.onUnload = function(A){if(A!=null&&typeof A!="undefined"&&!(A.ctrlKey&&A.altKey)){ try {if(this.m_hDebugConsole){this.m_hDebugConsole.close();}}catch(e){} }}; }; SL_HK = new function(){this.m_pMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this.m_pZeroPadding=new Array("","0","00","000");this.createDateStamp = function(){var l_oNow=new Date(); var l_nTimezoneOffset=l_oNow.getTimezoneOffset(); var l_nAbsoluteTimezoneOffset=Math.abs(l_nTimezoneOffset); var l_sOffsetSign=(l_nTimezoneOffset<=0) ? "+" : "-"; var l_sOffsetHours=this.padZeros(Math.floor(Math.abs(l_nAbsoluteTimezoneOffset)/60),2); var l_sOffsetMinutes=this.padZeros(l_nAbsoluteTimezoneOffset%60,2); return this.m_pMonths[l_oNow.getMonth()]+" "+this.padZeros(l_oNow.getDate(),2)+" "+this.padZeros(l_oNow.getHours(),2)+":"+this.padZeros(l_oNow.getMinutes(),2)+":"+this.padZeros(l_oNow.getSeconds(),2)+"."+this.padZeros(l_oNow.getMilliseconds(),3)+" "+l_sOffsetSign+l_sOffsetHours+l_sOffsetMinutes; }; this.padZeros = function(B,A){var l_nValueLength=(B+"").length; var l_nDifference=A-l_nValueLength; return this.m_pZeroPadding[l_nDifference]+B; }; }; var SL4B_LogMessageListener=function(){}; if(false){function SL4B_LogMessageListener(){} }SL4B_LogMessageListener = function(){}; SL4B_LogMessageListener.prototype.logMessage = function(A){}; var SL4B_ConnectionMethod=function(){}; if(false){function SL4B_ConnectionMethod(){} }SL4B_ConnectionMethod = function(D,C,A,B){this.m_sName=D;this.m_sConnectionClass=A;this.m_nRTTPType=C;this.m_bIsPolling=B;}; SL4B_ConnectionMethod.AllMethods={};SL4B_ConnectionMethod.prototype.createConnection = function(B,A){var oClass=window[this.m_sConnectionClass]; var oInstance=new oClass(B,A); return oInstance; }; SL4B_ConnectionMethod.prototype.isStreaming = function(){return !this.m_bIsPolling; }; SL4B_ConnectionMethod.prototype.isPolling = function(){return this.m_bIsPolling; }; SL4B_ConnectionMethod.prototype.getRTTPType = function(){return this.m_nRTTPType; }; SL4B_ConnectionMethod.prototype.toString = function(){return this.m_sName; }; SL4B_ConnectionMethod.XHR_STREAMING=new SL4B_ConnectionMethod("XHR Streaming",2,"SL4B_Type2Connection",false);SL4B_ConnectionMethod.POLLING=new SL4B_ConnectionMethod("Polling",3,"SL4B_Type3Connection",true);SL4B_ConnectionMethod.MULTIPART_REPLACE=new SL4B_ConnectionMethod("XHR Multipart",4,"SL4B_Type4Connection",false);SL4B_ConnectionMethod.FOREVER_FRAME=new SL4B_ConnectionMethod("Forever Frame",5,"SL4B_Type5Connection",false);SL4B_ConnectionMethod.HTML_FILE=new SL4B_ConnectionMethod("HTML File",5,"SL4B_Type6Connection",false);SL4B_ConnectionMethod.AllMethods[2]=SL4B_ConnectionMethod.XHR_STREAMING;SL4B_ConnectionMethod.AllMethods[3]=SL4B_ConnectionMethod.POLLING;SL4B_ConnectionMethod.AllMethods[4]=SL4B_ConnectionMethod.MULTIPART_REPLACE;SL4B_ConnectionMethod.AllMethods[5]=SL4B_ConnectionMethod.FOREVER_FRAME;SL4B_ConnectionMethod.AllMethods[6]=SL4B_ConnectionMethod.HTML_FILE;SL4B_Browser={};SL4B_Browser.UNKNOWN="UNKNOWN";SL4B_Browser.MSIE="MSIE";SL4B_Browser.SAFARI="Safari";SL4B_Browser.FIREFOX="Firefox";SL4B_Browser.CHROME="Chrome";SL4B_Browser.AllBrowsers=[];SL4B_Browser.AllBrowsers.push(SL4B_Browser.MSIE);SL4B_Browser.AllBrowsers.push(SL4B_Browser.SAFARI);SL4B_Browser.AllBrowsers.push(SL4B_Browser.FIREFOX);SL4B_Browser.AllBrowsers.push(SL4B_Browser.CHROME);SL4B_Browser.isKnownBrowser = function(A){for(var i=0,len=SL4B_Browser.AllBrowsers.length;i=this.m_pFieldNameAndValues.length||A<0){throw new SL4B_Exception("getField: specified field index \""+A+"\" is out of bounds"); }return this.m_pFieldNameAndValues[A]; }; SL4B_ContributionFieldData.prototype.toString = function(){return this.m_pFieldNameAndValues.join(" "); }; function GF_Field(B,A){this.m_sName=B;this.m_sValue=A;} GF_Field.prototype.toString = function(){return "["+this.m_sName+"="+this.m_sValue+"]"; }; function SL_DW(){this.showStatus = function(A){window.status=A;}; } SL_DW.prototype = new SL4B_ConnectionListener;SL_DW.prototype.connectionWarning = function(A){this.showStatus("Connection Warning: "+A);}; SL_DW.prototype.connectionInfo = function(A){this.showStatus("Connection Information: "+A);}; SL_DW.prototype.connectionOk = function(C,A,B){this.showStatus("Connection OK: "+C+", "+A+", "+B);}; SL_DW.prototype.reconnectionOk = function(C,A,B){this.showStatus("Reconnection OK");}; SL_DW.prototype.fileDownloadError = function(B,A){this.showStatus("File Download Error: "+B+", "+A);}; SL_DW.prototype.loginError = function(A){this.showStatus("Login Error: "+A);}; SL_DW.prototype.loginOk = function(){this.showStatus("Login Ok");}; SL_DW.prototype.message = function(A,B){this.showStatus("Message :"+A+", "+B);}; SL_DW.prototype.connectionError = function(){this.showStatus("Connection Error: connection lost");}; SL_DW.prototype.serviceMessage = function(A,D,B,C){}; SL_DW.prototype.sessionEjected = function(A,B){this.showStatus("Session Ejected: "+A+", "+B);}; SL_DW.prototype.sourceMessage = function(A,C,D,B){}; SL_DW.prototype.statistics = function(A,D,E,B,C){}; function SL4B_LogConnectionListener(A){this.m_oLogger=A;this.m_mSourceRttpCodeToDescriptionMap={511.0:"is up", 512.0:"is down"};this.m_mServiceRttpCodeToDescriptionMap={515.0:"up, all DataSources are up", 516.0:"down, one or more required DataSources are down", 517.0:"limited, one or more non-required DataSources are down"};} SL4B_LogConnectionListener.prototype = new SL4B_ConnectionListener;SL4B_LogConnectionListener.prototype.connectionAttempt = function(A,B){this.m_oLogger.logConnectionMessage(true,"Attempting a type {0} connection to Liberator {1}",B,A);}; SL4B_LogConnectionListener.prototype.connectionInfo = function(A){this.m_oLogger.logConnectionMessage(false,"Connection information \"{0}\"",A);}; SL4B_LogConnectionListener.prototype.connectionWarning = function(B,D,A,C){var sLogDescription; if(D===SL4B_ConnectionWarningReason.CONNECTION_FAILED){sLogDescription="Failed to establish type {0} connection to Liberator {1} - {2}";}else if(D===SL4B_ConnectionWarningReason.CONNECTION_LOST){sLogDescription="Lost type {0} connection to Liberator {1} - {2}";}else {sLogDescription="Unknown connection issue with type {0} connection to Liberator {1} - {2}";}this.m_oLogger.logConnectionMessage(true,sLogDescription,C,A,B);}; SL4B_LogConnectionListener.prototype.connectionError = function(A){this.m_oLogger.logConnectionMessage(true,"Connection error: {0}",A);}; SL4B_LogConnectionListener.prototype.connectionOk = function(A,B,C){this.m_oLogger.logConnectionMessage(true,"Successfully established type {0} connection to {1}",B,A);}; SL4B_LogConnectionListener.prototype.credentialsRetrieved = function(A){this.m_oLogger.logConnectionMessage(true,"Credentials retrieved for user {0}",A);}; SL4B_LogConnectionListener.prototype.loginOk = function(){this.m_oLogger.logConnectionMessage(true,"Log in successful");}; SL4B_LogConnectionListener.prototype.reconnectionOk = function(){this.m_oLogger.logConnectionMessage(true,"Log in has successfully reconnected to the previous session");}; SL4B_LogConnectionListener.prototype.loginError = function(A){this.m_oLogger.logConnectionMessage(true,"Log in failed - {0}",A);}; SL4B_LogConnectionListener.prototype.sessionEjected = function(B,A){this.m_oLogger.logConnectionMessage(true,"User session ejected by the server - {0}",A);}; SL4B_LogConnectionListener.prototype.message = function(B,A){this.m_oLogger.logConnectionMessage(false,"Generic message \"{0}\" received from Liberator - {1}",B,A);}; SL4B_LogConnectionListener.prototype.serviceMessage = function(B,D,C,A){this.m_oLogger.logConnectionMessage(false,"Data service \"{0}\" is {1}",D,this.m_mServiceRttpCodeToDescriptionMap[B]);}; SL4B_LogConnectionListener.prototype.sourceMessage = function(D,C,B,A){this.m_oLogger.logConnectionMessage(false,"DataSource \"{0}\" {1}",B,this.m_mSourceRttpCodeToDescriptionMap[D]||A);}; SL4B_LogConnectionListener.prototype.fileDownloadError = function(A,B){this.m_oLogger.logConnectionMessage(false,"Failed to load file {0}",B);}; SL4B_LogConnectionListener.prototype.statistics = function(C,D,E,A,B){}; var SL4B_ContainerKey=function(){this.m_nId=SL4B_ContainerKey.g_nNextId++;this.getId = function(){return this.m_nId; }; this.toString = function(){return this.m_nId+""; }; }; SL4B_ContainerKey.g_nNextId=0;var SL4B_ContainerRequestData=function(A,E,B,D,F,C){this.m_sSubscriberId=A;this.m_sContainerId=E;this.m_sContainerName=B;this.m_sFieldList=D;this.m_nWindowStart=F;this.m_nWindowEnd=C;}; SL4B_ContainerRequestData.prototype.getSubscriberId = function(){return this.m_sSubscriberId; }; SL4B_ContainerRequestData.prototype.getContainerId = function(){return this.m_sContainerId; }; SL4B_ContainerRequestData.prototype.getContainerName = function(){return this.m_sContainerName; }; SL4B_ContainerRequestData.prototype.getFieldList = function(){return this.m_sFieldList; }; SL4B_ContainerRequestData.prototype.getWindowStart = function(){return this.m_nWindowStart; }; SL4B_ContainerRequestData.prototype.getWindowEnd = function(){return this.m_nWindowEnd; }; SL4B_ContainerRequestData.prototype.setWindowStart = function(A){this.m_nWindowStart=A;}; SL4B_ContainerRequestData.prototype.setWindowEnd = function(A){this.m_nWindowEnd=A;}; SL4B_ContainerRequestData.prototype.toString = function(){return "{ContainerRequestData "+this.m_sSubscriberId+" "+this.m_sContainerId+" "+this.m_sContainerName+" "+this.m_sFieldList+" "+this.m_nWindowStart+","+this.m_nWindowEnd+" }"; }; SL4B_ContainerRequestData.prototype.clone = function(){return new SL4B_ContainerRequestData(this.m_sSubscriberId,this.m_sContainerId,this.m_sContainerName,this.m_sFieldList,this.m_nWindowStart,this.m_nWindowEnd); }; var SL4B_AbstractSubscriber=function(){}; if(false){function SL4B_AbstractSubscriber(){} }SL4B_AbstractSubscriber = function(){}; SL4B_AbstractSubscriber.prototype.m_sListenerId = null;SL4B_AbstractSubscriber.prototype.m_pMultiUpdateQueue = null;SL4B_AbstractSubscriber.prototype.initialise = SL_AU;SL4B_AbstractSubscriber.prototype.getIdentifier = function(){return SL4B_SubscriptionManager.getListenerPrefix()+this.m_sListenerId; }; SL4B_AbstractSubscriber.prototype.getLocalIdentifier = function(){return SL4B_SubscriptionManager.getLocalListenerPrefix()+this.m_sListenerId; }; SL4B_AbstractSubscriber.prototype.ready = function(){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"AbstractSubscriber.ready invoked but not overridden");}; SL4B_AbstractSubscriber.prototype.WTChat = SL_JD;SL4B_AbstractSubscriber.prototype.WTContribOk = SL_FQ;SL4B_AbstractSubscriber.prototype.WTContribFailed = SL_KL;SL4B_AbstractSubscriber.prototype.WTDirUpdated = SL_HN;SL4B_AbstractSubscriber.prototype.WTFieldDeleted = SL_CS;SL4B_AbstractSubscriber.prototype.WTType2Clear = SL_RM;SL4B_AbstractSubscriber.prototype.WTType3Clear = SL_BQ;SL4B_AbstractSubscriber.prototype.WTNewsUpdated = SL_NI;SL4B_AbstractSubscriber.prototype.WTObjectDeleted = SL_IJ;SL4B_AbstractSubscriber.prototype.WTObjectInfo = SL_EJ;SL4B_AbstractSubscriber.prototype.WTObjectNotFound = SL_GZ;SL4B_AbstractSubscriber.prototype.WTObjectNotStale = SL_AL;SL4B_AbstractSubscriber.prototype.WTObjectReadDenied = SL_JV;SL4B_AbstractSubscriber.prototype.WTObjectStale = SL_QM;SL4B_AbstractSubscriber.prototype.WTObjectStatus = SL_AQ;SL4B_AbstractSubscriber.prototype.WTObjectType = SL_OZ;SL4B_AbstractSubscriber.prototype.WTObjectUnavailable = SL_AG;SL4B_AbstractSubscriber.prototype.WTObjectUpdated = SL_KQ;SL4B_AbstractSubscriber.prototype.WTObjectWriteDenied = SL_IV;SL4B_AbstractSubscriber.prototype.WTPageUpdated = SL_CN;SL4B_AbstractSubscriber.prototype.WTRecordMultiUpdated = SL_HW;SL4B_AbstractSubscriber.prototype.WTRecordUpdated = SL_DN;SL4B_AbstractSubscriber.prototype.WTStoryReset = SL_NA;SL4B_AbstractSubscriber.prototype.WTStoryUpdated = SL_MQ;SL4B_AbstractSubscriber.prototype.WTStructureChange = SL_CM;SL4B_AbstractSubscriber.prototype.WTStructureMultiChange = SL_BK;SL4B_AbstractSubscriber.prototype.WTPermissionUpdated = SL_DT;SL4B_AbstractSubscriber.prototype.WTPermissionDeleted = SL_KX;SL4B_AbstractSubscriber.prototype.dequeueNextMultiUpdate = SL_PH;SL4B_AbstractSubscriber.prototype.chat = function(C,B,D,A,E){this.methodNotImplemented("chat");}; SL4B_AbstractSubscriber.prototype.contribOk = function(A){this.methodNotImplemented("contribOk");}; SL4B_AbstractSubscriber.prototype.contribFailed = function(A,C,B){this.methodNotImplemented("contribFailed");}; SL4B_AbstractSubscriber.prototype.directoryUpdated = function(D,C,A,B){this.methodNotImplemented("directoryUpdated");}; SL4B_AbstractSubscriber.prototype.directoryMultiUpdated = function(A,B){this.methodNotImplemented("recordMultiUpdated");}; SL4B_AbstractSubscriber.prototype.fieldDeleted = function(A,C,B){this.methodNotImplemented("fieldDeleted");}; SL4B_AbstractSubscriber.prototype.type2Clear = function(A){this.methodNotImplemented("type2Clear");}; SL4B_AbstractSubscriber.prototype.type3Clear = function(A){this.methodNotImplemented("type3Clear");}; SL4B_AbstractSubscriber.prototype.newsUpdated = function(A,D,C,B){this.methodNotImplemented("newsUpdated");}; SL4B_AbstractSubscriber.prototype.objectDeleted = function(A){this.methodNotImplemented("objectDeleted");}; SL4B_AbstractSubscriber.prototype.objectInfo = function(C,B,D,A){this.methodNotImplemented("objectInfo");}; SL4B_AbstractSubscriber.prototype.objectNotFound = function(A){this.methodNotImplemented("objectNotFound");}; SL4B_AbstractSubscriber.prototype.objectNotStale = function(A,B){this.methodNotImplemented("objectNotStale");}; SL4B_AbstractSubscriber.prototype.objectReadDenied = function(A,B){this.methodNotImplemented("objectReadDenied");}; SL4B_AbstractSubscriber.prototype.objectStale = function(A,B){this.methodNotImplemented("objectStale");}; SL4B_AbstractSubscriber.prototype.objectStatus = function(D,B,A,C){this.methodNotImplemented("objectStatus");}; SL4B_AbstractSubscriber.prototype.objectType = function(C,B,A){this.methodNotImplemented("objectType");}; SL4B_AbstractSubscriber.prototype.objectUnavailable = function(A){this.methodNotImplemented("objectUnavailable");}; SL4B_AbstractSubscriber.prototype.objectUpdated = function(A){this.methodNotImplemented("objectUpdated");}; SL4B_AbstractSubscriber.prototype.objectWriteDenied = function(A,B){this.methodNotImplemented("objectWriteDenied");}; SL4B_AbstractSubscriber.prototype.pageUpdated = function(E,D,B,A,C){this.methodNotImplemented("pageUpdated");}; SL4B_AbstractSubscriber.prototype.recordMultiUpdated = function(A,B,C){for(var l_nCount=0,l_nSize=B.size();l_nCount=0&&l_nArrayIndex0){this.m_nMaximumCallbacksInBatch=l_oConfiguration.getMaximumCallbackBatchSize();setTimeout("C_CallbackQueue.processCallbackBatch();",this.m_nCallbackBatchFrequency);}}; this.addCallback = function(A){if(this.m_nCallbackBatchFrequency>0){this.m_pQueue.push(A);}else {this.invokeCallback(A);}}; this.processCallbackBatch = function(){var l_nBatchStartTime=(new Date()).valueOf(); var l_nNumberOfUpdatesProcessed=0; while(this.m_pQueue.length>0&&l_nNumberOfUpdatesProcessed=0&&l_nLiberatorIndex>=0;--l_nWebPageIndex, --l_nLiberatorIndex){if(l_pWebPageDomainParts[l_nWebPageIndex]==l_pLiberatorDomainParts[l_nLiberatorIndex]){++l_nMatchingParts;}else {break; }}if(l_nMatchingParts<2){SL4B_Logger.logConnectionMessage(true,"CommonDomainExtractor.determineCommonDomain: Web page and Liberator do not share the common domain (web page domain = {0}, liberator domain = {1})",A,l_oLiberatorDomainMatch[1]);throw new SL4B_Exception("determineCommonDomain [2]: web page and Liberator do not share a common domain, connection to Liberator cannot be established"); }var l_pCommonDomain=l_pWebPageDomainParts.splice(l_pWebPageDomainParts.length-l_nMatchingParts,l_nMatchingParts); var l_sCommonDomain=l_pCommonDomain.join("."); SL4B_Logger.logConnectionMessage(true,"CommonDomainExtractor.determineCommonDomain: document.domain will be set to {0}",l_sCommonDomain);return l_sCommonDomain; } function SL_QN(A){SL4B_Logger.logConnectionMessage(true,"CommonDomainExtractor.getCommonDomainForDifferentPorts: web page and Liberator share the same domain ({0}), but their ports differ and domain needs to be changed.",A);var l_sCommonDomain=A.substring(A.indexOf(".")+1); SL4B_Logger.logConnectionMessage(true,"CommonDomainExtractor.getCommonDomainForDifferentPorts: document.domain will be set to {0}.",l_sCommonDomain);return l_sCommonDomain; } function SL_IF(){return document.domain; } var SL4B_Capabilities=function(){}; if(false){function SL4B_Capabilities(){} }SL4B_Capabilities = function(){this.m_nRttpVersion=2;this.m_oCapabilities={};this.m_oCapabilities["HttpBodyLength"]=65536;this.m_oCapabilities["HttpRequestLineLength"]=128;}; SL4B_Capabilities.prototype.getRttpVersion = function(){return this.m_nRttpVersion; }; SL4B_Capabilities.prototype.setRttpVersion = function(A){this.m_nRttpVersion=A;}; SL4B_Capabilities.prototype.getHttpBodyLength = function(){return this.m_oCapabilities["HttpBodyLength"]; }; SL4B_Capabilities.prototype.getHttpRequestLineLength = function(){var sMaxGetLength=SL4B_Accessor.getConfiguration().getMaxGetLength(); if(sMaxGetLength===null){return this.m_oCapabilities["HttpRequestLineLength"]+""; }else {return Math.min(this.m_oCapabilities["HttpRequestLineLength"],sMaxGetLength)+""; }}; SL4B_Capabilities.prototype.toString = function(){var s=""; for(key in this.m_oCapabilities){s+=key+"="+this.m_oCapabilities[key]+", ";}return s; }; SL4B_Capabilities.prototype.add = function(A,B){this.m_oCapabilities[A]=B;return B; }; function SL4B_Capabilities_scriptLoaded(){SL4B_Accessor.setCapabilities(new SL4B_Capabilities());} SL4B_Capabilities_scriptLoaded();var SL4B_Configuration=function(){}; if(false){function SL4B_Configuration(){} }SL4B_Configuration = function(){this.m_oIndexScript=SL4B_ScriptLoader.getIndexScript();this.m_bUsingFile=false;this.m_bFileAttributeSet=false;this.m_DEFAULT_JAVA_CONNECTION_METHODS=new Array(SL4B_ConnectionMethod.JAVAHTTP,SL4B_ConnectionMethod.JAVAPOLLING);this.m_pBrowserStreamingConnectionMethodOverrides={};this.m_pBrowserPollingConnectionMethodOverrides={};this.m_pDefaultAttributes=new Object();this._getDefaultServerUrl = function(B,A){var l_sDefaultServerUrl; var l_oMatch=B.match(/(^https?:\/\/[^\/]+\/)/); if(l_oMatch){l_sDefaultServerUrl=l_oMatch[0];}else {l_sDefaultServerUrl="/";}return l_sDefaultServerUrl; }; this.m_pDefaultAttributes["appletjar"]="applet.jar";this.m_pDefaultAttributes["user"]="demouser";this.m_pDefaultAttributes["password"]="demopass";this.m_pDefaultAttributes["credentialsprovider"]=SL4B_ScriptLoader.const_STANDARD_CREDENTIALS_PROVIDER;this.m_pDefaultAttributes["rttpprovider"]=SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER;this.m_pDefaultAttributes["appletchecktimeout"]=15000;this.m_pDefaultAttributes["rttpapplettimeout"]=120000;this.m_pDefaultAttributes["debug"]=SL4B_DebugLevel.ERROR;this.m_pDefaultAttributes["suppressexceptions"]="true";this.m_pDefaultAttributes["rttpdebuglevel"]=SL4B_DebugLevel.CRITICAL;this.m_pDefaultAttributes["debugwindowtype"]=SL4B_Logger.const_HTML;this.m_pDefaultAttributes["applicationid"]=null;this.m_pDefaultAttributes["discarddelay"]=10;this.m_pDefaultAttributes["jvmfileurl"]="http://www.caplin.com/products/jvm-list.js";this.m_pDefaultAttributes["jvmfiledownloadtimeout"]=10;this.m_pDefaultAttributes["logoutdelay"]=1;this.m_pDefaultAttributes["objectnamedelimiter"]=" ";this.m_pDefaultAttributes["statsinterval"]=5;this.m_pDefaultAttributes["statsreset"]=5000;this.m_pDefaultAttributes["statstimeout"]=30000;this.m_pDefaultAttributes["useconfig"]="server_config.js";this.m_pDefaultAttributes["updatebatchfreq"]=250;this.m_pDefaultAttributes["maxupdatebatchsize"]=5000;this.m_pDefaultAttributes["gcfreq"]=200;this.m_pDefaultAttributes["jscontainerpath"]="sl4b/javascript-rttp-provider";this.m_pDefaultAttributes["appletpath"]="applet";this.m_pDefaultAttributes["type3pollperiod"]=1000;this.m_pDefaultAttributes["type5reconnectcount"]=10000;this.m_pDefaultAttributes["type5padlength"]=1024*4;this.m_pDefaultAttributes["maxgetlength"]=null;this.m_pDefaultAttributes["connectiontimeout"]=15000;this.m_pDefaultAttributes["noopinterval"]=5000;this.m_pDefaultAttributes["nooptimeout"]=5000;this.m_pDefaultAttributes["logintimeout"]=10000;this.m_pDefaultAttributes["service"]=null;this.m_pDefaultAttributes["keymasterurl"]=null;this.m_pDefaultAttributes["keymasterattempts"]=3;this.m_pDefaultAttributes["keymasterconnectiontimeout"]=10000;this.m_pDefaultAttributes["keymasterkeepaliveinterval"]=30000;this.m_pDefaultAttributes["keymasterxhrurl"]=null;this.m_pDefaultAttributes["commondomain"]=null;this.m_pDefaultAttributes["enableautoloading"]=true;this.m_pDefaultAttributes["enablelatency"]=false;this.m_pDefaultAttributes["clocksyncbatchsize"]=5;this.m_pDefaultAttributes["clocksyncspacing"]=1000;this.m_pDefaultAttributes["clocksyncperiod"]=60000;this.m_pDefaultAttributes["timestampfield"]="INITIAL_TIMESTAMP";this.m_pDefaultAttributes["disablepolling"]=false;this.m_pDefaultAttributes["disablestreaming"]=false;this.m_pDefaultAttributes["flashtime"]=1000;this.m_pDefaultAttributes["bg"]=null;this.m_pDefaultAttributes["bgchange"]='rel';this.m_pDefaultAttributes["bgdn"]='red';this.m_pDefaultAttributes["bgeq"]='green';this.m_pDefaultAttributes["bgup"]='blue';this.m_pDefaultAttributes["fg"]=null;this.m_pDefaultAttributes["fgchange"]=null;this.m_pDefaultAttributes["fgdn"]='red';this.m_pDefaultAttributes["fgeq"]='black';this.m_pDefaultAttributes["fgflash"]='white';this.m_pDefaultAttributes["fgup"]='blue';this.m_pDefaultAttributes["plus"]=null;this.m_pDefaultAttributes["fractionhandling"]=null;this.m_pDefaultAttributes["gfxup"]=null;this.m_pDefaultAttributes["gfxdn"]=null;this.m_pDefaultAttributes["gfxeq"]=null;this.m_pDefaultAttributes["isencoded"]=0;this.m_pDefaultAttributes["todp"]=0;this.m_pDefaultAttributes["round"]='default';this.m_pDefaultAttributes["addcommas"]=0;this.m_pDefaultAttributes["tosf"]=null;this.m_pDefaultAttributes["serverurl"]=this._getDefaultServerUrl(this.m_oIndexScript.src,window.location.href);}; SL4B_Configuration.prototype.getScriptTagAttribute = SL_AC;SL4B_Configuration.prototype.getIntegerScriptTagAttribute = SL_DK;SL4B_Configuration.prototype.getPositiveIntegerScriptTagAttribute = SL_OX;SL4B_Configuration.prototype.getIntegerScriptTagAttributeInMilliseconds = SL_KY;SL4B_Configuration.prototype.unaryScriptTagAttributeExists = function(A){return (this.getScriptTagAttribute(A)!=null); }; SL4B_Configuration.prototype.setAttribute = function(B,A){this.m_bFileAttributeSet=true;this.m_pDefaultAttributes[B.toLowerCase()]=A;}; SL4B_Configuration.prototype.getAttribute = function(A){A=A.toLowerCase();return ((typeof this.m_pDefaultAttributes[A]=="undefined") ? null : this.m_pDefaultAttributes[A]); }; SL4B_Configuration.prototype.getAppletPath = function(){var l_sValue=this.m_oIndexScript.getAttribute("appletpath"); if(l_sValue==null){l_sValue=this.getAttribute("appletpath");}return l_sValue.replace(/(^\/)/,"").replace(/\/$/,""); }; SL4B_Configuration.prototype.getAppletUrl = function(){var l_sValue=this.m_oIndexScript.getAttribute("appleturl"); if(l_sValue==null){l_sValue=this.getAttribute("appleturl");}return ((l_sValue==null) ? null : l_sValue.replace(/\/$/,"")); }; SL4B_Configuration.prototype.getJsContainerPath = function(){var l_sValue=this.m_oIndexScript.getAttribute("jscontainerpath"); if(l_sValue==null){l_sValue=this.getAttribute("jscontainerpath");}return l_sValue.replace(/(^\/)/,"").replace(/\/$/,""); }; SL4B_Configuration.prototype.getJsContainerUrl = function(){var l_sValue=this.m_oIndexScript.getAttribute("jscontainerurl"); if(l_sValue==null){l_sValue=this.getAttribute("jscontainerurl");}return ((l_sValue==null) ? null : l_sValue.replace(/\/$/,"")); }; SL4B_Configuration.prototype.getServerUrl = function(){var l_sServerUrl=this.getScriptTagAttribute("serverurl"); if(l_sServerUrl.match(/\/$/)==null){l_sServerUrl+="/";}return l_sServerUrl; }; SL4B_Configuration.prototype.getAppletJarName = function(){return this.getScriptTagAttribute("appletjar"); }; SL4B_Configuration.prototype.getUsername = function(){return this.getScriptTagAttribute("user"); }; SL4B_Configuration.prototype.getPassword = function(){return this.getScriptTagAttribute("password"); }; SL4B_Configuration.prototype.includeRtsl = function(){return this.unaryScriptTagAttributeExists("includertsl"); }; SL4B_Configuration.prototype.includeRtml = function(){return this.unaryScriptTagAttributeExists("includertml"); }; SL4B_Configuration.prototype.isMasterFrame = function(){return !this.unaryScriptTagAttributeExists("usemasterframe"); }; SL4B_Configuration.prototype.isMultiSource = function(){return this.unaryScriptTagAttributeExists("multisource"); }; SL4B_Configuration.prototype.getService = function(){return this.getScriptTagAttribute("service"); }; SL4B_Configuration.prototype.getKeyMasterConnectionTimeout = function(){return this.getScriptTagAttribute("keymasterconnectiontimeout"); }; SL4B_Configuration.prototype.getKeyMasterKeepAliveInterval = function(){return this.getScriptTagAttribute("keymasterkeepaliveinterval"); }; SL4B_Configuration.prototype.isEnableLatency = function(){return this.getScriptTagAttribute("enablelatency"); }; SL4B_Configuration.prototype.isPollingDisabled = function(){return this.getScriptTagAttribute("disablepolling"); }; SL4B_Configuration.prototype.isStreamingDisabled = function(){return this.getScriptTagAttribute("disablestreaming"); }; SL4B_Configuration.prototype.getClocksyncBatchSize = function(){return this.getScriptTagAttribute("clocksyncbatchsize"); }; SL4B_Configuration.prototype.getClocksyncSpacing = function(){return this.getScriptTagAttribute("clocksyncspacing"); }; SL4B_Configuration.prototype.getClocksyncPeriod = function(){return this.getScriptTagAttribute("clocksyncperiod"); }; SL4B_Configuration.prototype.getTimestampField = function(){return this.getScriptTagAttribute("timestampfield"); }; SL4B_Configuration.prototype.getFrameId = function(){var l_sId; if(this.isMasterFrame()){l_sId="master";}else {l_sId=this.getScriptTagAttribute("frameid");if(l_sId==null){l_sId=this.getFrameLocation();if(l_sId==null){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"Configuration.getFrameId: The slave frame did not have a id defined on it. This identifier is required for the master/slave functionality to work.");}}}return l_sId; }; SL4B_Configuration.prototype.getFrameLocation = function(){return this.getScriptTagAttribute("thisframe"); }; SL4B_Configuration.prototype.getMasterFrameLocation = function(){return this.getScriptTagAttribute("usemasterframe"); }; SL4B_Configuration.prototype.getCredentialsProvider = function(){if(this.getKeyMasterUrl()==null||this.getKeyMasterUrl()==""){return this.getScriptTagAttribute("credentialsprovider"); }else {return SL4B_ScriptLoader.const_KEYMASTER_CREDENTIALS_PROVIDER; }}; SL4B_Configuration.prototype.getParameterFromQueryString = function(A){var l_sDebugLevel=null; try {var l_oNextWindow; do{l_oNextWindow=(l_oNextWindow) ? l_oNextWindow.parent : window;l_sDebugLevel=this.getParameterFromProvidedQueryString(l_oNextWindow.location.href,A);}while((!l_sDebugLevel)&&(l_oNextWindow.parent!=l_oNextWindow));}catch(e){} return l_sDebugLevel; }; SL4B_Configuration.prototype.getParameterFromProvidedQueryString = function(B,A){var l_oMatches=B.match(new RegExp("[?&]"+A+"=([^&#]+)")); return (l_oMatches) ? l_oMatches[1] : null; }; SL4B_Configuration.prototype.getDebugLevel = function(){var l_sDebugLevel=this.getParameterFromQueryString("debug"); return (l_sDebugLevel) ? l_sDebugLevel : this.getScriptTagAttribute("debug"); }; SL4B_Configuration.prototype.isSuppressExceptions = function(){var l_sSuppressExceptions=this.getParameterFromQueryString("suppressexceptions"); return (((l_sSuppressExceptions) ? l_sSuppressExceptions : this.getScriptTagAttribute("suppressexceptions"))==="true"); }; SL4B_Configuration.prototype.getRttpDebugLevel = function(){var l_sDebugLevel=this.getParameterFromQueryString("rttpdebuglevel"); return (l_sDebugLevel) ? l_sDebugLevel : this.getScriptTagAttribute("rttpdebuglevel"); }; SL4B_Configuration.prototype.getAppletCheckTimeout = function(){return this.getIntegerScriptTagAttribute("appletchecktimeout"); }; SL4B_Configuration.prototype.getRttpAppletTimeout = function(){return this.getIntegerScriptTagAttribute("rttpapplettimeout"); }; SL4B_Configuration.prototype.includeFlash = SL_JT;SL4B_Configuration.prototype.getRttpProvider = SL_NG;SL4B_Configuration.prototype.getDebugWindowType = SL_CY;SL4B_Configuration.prototype.isAutoLoadingEnabled = SL_NL;SL4B_Configuration.prototype.getCommonDomain = SL_PM;SL4B_Configuration.prototype.loadConfigurationFile = SL_AX;SL4B_Configuration.prototype.loaded = SL_QQ;SL4B_Configuration.prototype.getConnectionMethods = SL_PD;SL4B_Configuration.prototype.setPollingConnectionMethods = SL_OR;SL4B_Configuration.prototype.setStreamingConnectionMethods = SL_GG;SL4B_Configuration.prototype.getPollingConnectionMethods = SL_CL;SL4B_Configuration.prototype.getStreamingConnectionMethods = SL_QV;SL4B_Configuration.prototype.getType3PollPeriod = SL_PP;SL4B_Configuration.prototype.getType5ReconnectCount = SL_GQ;SL4B_Configuration.prototype.getType5PadLength = SL_FC;SL4B_Configuration.prototype.getConnectionTimeout = SL_HX;SL4B_Configuration.prototype.getNOOPInterval = SL_HQ;SL4B_Configuration.prototype.getNOOPTimeout = SL_EW;SL4B_Configuration.prototype.getLoginTimeout = SL_LZ;SL4B_Configuration.prototype.getMaxGetLength = SL_PU;SL4B_Configuration.prototype.getApplicationId = function(){var l_sClientApplicationId=this.getScriptTagAttribute("applicationid"); return "SL4B"+((l_sClientApplicationId==null||l_sClientApplicationId=="") ? "" : ":"+l_sClientApplicationId); }; SL4B_Configuration.prototype.getDiscardDelay = function(){return this.getIntegerScriptTagAttribute("discarddelay"); }; SL4B_Configuration.prototype.getJvmFileUrl = function(){return this.getScriptTagAttribute("jvmfileurl"); }; SL4B_Configuration.prototype.getJvmFileDownloadTimeout = function(){return this.getIntegerScriptTagAttribute("jvmfiledownloadtimeout"); }; SL4B_Configuration.prototype.getLogoutDelay = function(){return this.getIntegerScriptTagAttribute("logoutdelay"); }; SL4B_Configuration.prototype.getObjectNameDelimiter = function(){return this.getScriptTagAttribute("objectnamedelimiter"); }; SL4B_Configuration.prototype.getStatsInterval = function(){return this.getIntegerScriptTagAttributeInMilliseconds("statsinterval"); }; SL4B_Configuration.prototype.getStatsReset = function(){return this.getIntegerScriptTagAttributeInMilliseconds("statsreset"); }; SL4B_Configuration.prototype.getStatsTimeout = function(){return this.getIntegerScriptTagAttributeInMilliseconds("statstimeout"); }; SL4B_Configuration.prototype.getKeyMasterUrl = function(){return this.getScriptTagAttribute("keymasterurl"); }; SL4B_Configuration.prototype.getKeyMasterAttempts = function(){return this.getIntegerScriptTagAttribute("keymasterattempts"); }; SL4B_Configuration.prototype.getKeyMasterXHRUrl = function(){return this.getScriptTagAttribute("keymasterxhrurl"); }; SL4B_Configuration.prototype.getUseConfig = function(){return this.getScriptTagAttribute("useconfig"); }; SL4B_Configuration.prototype.getGarbageCollectionFrequency = function(){return this.getPositiveIntegerScriptTagAttribute("gcfreq"); }; SL4B_Configuration.prototype.getMicrosoftGarbageCollectionFrequency = function(){return this.getPositiveIntegerScriptTagAttribute("gcfreqms"); }; SL4B_Configuration.prototype.getSunGarbageCollectionFrequency = function(){return this.getPositiveIntegerScriptTagAttribute("gcfreqsun"); }; SL4B_Configuration.prototype.getCallbackBatchFrequency = function(){return ((this.getRttpProvider()==SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER) ? 0 : this.getIntegerScriptTagAttribute("updatebatchfreq")); }; SL4B_Configuration.prototype.getMaximumCallbackBatchSize = function(){return this.getPositiveIntegerScriptTagAttribute("maxupdatebatchsize"); }; SL4B_Configuration.prototype.isNoStaleNotify = function(){return this.unaryScriptTagAttributeExists("nostalenotify"); }; SL4B_Configuration.prototype.isNoBrowserStatus = function(){return this.unaryScriptTagAttributeExists("nobrowserstatus"); }; SL4B_Configuration.prototype.isNoStats = function(){return this.unaryScriptTagAttributeExists("nostats"); }; SL4B_Configuration.prototype.isPortlet = function(){return this.unaryScriptTagAttributeExists("portlet"); }; SL4B_Configuration.prototype.isDisableJvmDownload = function(){return this.unaryScriptTagAttributeExists("disablejvmdownload"); }; SL4B_Configuration.prototype.isMultiUpdates = function(){return this.unaryScriptTagAttributeExists("multiupdates"); }; SL4B_Configuration.prototype.isUseStaticHtmlFailoverContainers = function(){return this.unaryScriptTagAttributeExists("usestatichtmlfailovercontainers"); }; SL4B_Configuration.prototype.isDirectEnable = function(){return this.unaryScriptTagAttributeExists("directEnable"); }; SL4B_Configuration.prototype.isHttpEnable = function(){return this.unaryScriptTagAttributeExists("httpEnable"); }; SL4B_Configuration.prototype.isRefreshEnable = function(){return this.unaryScriptTagAttributeExists("refreshEnable"); }; SL4B_Configuration.prototype.getContainerFrameLocation = function(){var l_sCommonContainerFrame=this.getScriptTagAttribute("containerframelocation"); if(l_sCommonContainerFrame==null){var l_sMasterFrameLocation=this.getMasterFrameLocation(); if(l_sMasterFrameLocation!=null&&l_sMasterFrameLocation!=""){var l_oMatch=l_sMasterFrameLocation.match(/(((window)|(self)|(parent)|(top)|(opener))(\.|$))*/); if(l_oMatch!=null&&l_oMatch[0]!=""){l_sCommonContainerFrame=l_oMatch[0].replace(/\.$/,"");}else {l_sCommonContainerFrame="top";}}else {l_sCommonContainerFrame="top";}}return l_sCommonContainerFrame; }; function SL_AC(A){A=A.toLowerCase();var l_sValue=this.m_oIndexScript.getAttribute(A); if(l_sValue==null){l_sValue=this.getAttribute(A);}return l_sValue; } function SL_DK(A){A=A.toLowerCase();var l_nIntegerValue=this.getAttribute(A); var l_sValue=this.m_oIndexScript.getAttribute(A); if(this.checkInteger(l_sValue)==true){l_nIntegerValue=parseInt(l_sValue);}return l_nIntegerValue; } SL4B_Configuration.prototype.checkInteger = function(A){var isValid=false; if(A!==null&&!isNaN(A)){var l_nTestValue=parseInt(A,10); if(l_nTestValue>=0){isValid=true;}}return isValid; }; function SL_OX(A){A=A.toLowerCase();var l_nPositiveIntegerValue=this.getAttribute(A); var l_sValue=this.m_oIndexScript.getAttribute(A); if(this.checkPositiveInteger(l_sValue)==true){l_nPositiveIntegerValue=parseInt(l_sValue);}return l_nPositiveIntegerValue; } SL4B_Configuration.prototype.checkPositiveInteger = function(A){var isValid=false; if(this.checkInteger(A)==true&&parseInt(A)>0){isValid=true;}return isValid; }; function SL_KY(A){A=A.toLowerCase();var l_nAttributeValue=this.getIntegerScriptTagAttribute(A); if(l_nAttributeValue==null){l_nAttributeValue=this.getAttribute(A);}else if(l_nAttributeValue<500){l_nAttributeValue=l_nAttributeValue*1000;}return l_nAttributeValue; } function SL_JT(){return (this.includeRtml()||this.unaryScriptTagAttributeExists("enableflash")); } function SL_OR(A,B){if(!SL4B_Browser.isKnownBrowser(A)){throw new SL4B_Error("Configuration method setPollingConnectionMethods called with invalid SL4B_Browser parameter: "+A); }if(B==null){delete this.m_pBrowserPollingConnectionMethodOverrides[A];}else {var l_pConnectionMethods=this.m_pBrowserPollingConnectionMethodOverrides[A]; if(l_pConnectionMethods==null){l_pConnectionMethods=[];this.m_pBrowserPollingConnectionMethodOverrides[A.toString()]=l_pConnectionMethods;}for(var i=0;i");var l_oIFrameIdentifierToElementMap=new Object(); var l_oIFrameIdentifierToTimeoutMap=new Object(); this.loadIFrame = function(C,D,B,A){if(typeof B.scriptLoadTimeout!="function"){throw new SL4B_Exception("C_DynamicIFrameLoader.loadIFrame: l_oErrorCallback parameter must implement scriptLoadTimeout() "); }D+=((D.indexOf("?")==-1) ? "?" : "&")+"time="+(new Date()).valueOf();var l_sCommonDomain=SL4B_Accessor.getConfiguration().getCommonDomain(); if(l_sCommonDomain!=null){D+="&"+SL4B_JavaScriptRttpProviderConstants.const_DOMAIN_PARAMETER+"="+l_sCommonDomain;}var l_oIFrameElement=l_oIFrameIdentifierToElementMap[C]; if(typeof l_oIFrameElement!="undefined"){document.getElementById("iframeloader").removeChild(l_oIFrameElement);}SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Creating IFRAME for {0} at URL {1} with a timeout of {2}ms",C,D,A);l_oIFrameElement=document.createElement('iframe');l_oIFrameElement.src=D;l_oIFrameElement.style.display="none";l_oIFrameIdentifierToElementMap[C]=l_oIFrameElement;document.getElementById("iframeloader").appendChild(l_oIFrameElement);var self=this; var l_nTimeout=setTimeout(function(){self.checkLoaded(C,B);},A); l_oIFrameIdentifierToTimeoutMap[C]=l_nTimeout;}; this.checkLoaded = function(B,A){var l_nTimeout=l_oIFrameIdentifierToTimeoutMap[B]; if(typeof l_nTimeout!="undefined"){this.clearIFrame(B);A.scriptLoadTimeout(B);}}; this.iframeLoaded = function(A){var l_nTimeout=l_oIFrameIdentifierToTimeoutMap[A]; if(typeof l_nTimeout!="undefined"){clearTimeout(l_nTimeout);this.clearIFrame(A);}}; this.clearIFrame = function(A){var l_oIFrameElement=l_oIFrameIdentifierToElementMap[A]; if(typeof l_oIFrameElement!="undefined"){document.getElementById("iframeloader").removeChild(l_oIFrameElement);}delete (l_oIFrameIdentifierToElementMap[A]);delete (l_oIFrameIdentifierToTimeoutMap[A]);}; }; var SL4B_KeymasterIFrameManager=function(){}; if(false){function SL4B_KeymasterIFrameManager(){} }SL4B_KeymasterIFrameManager = function(A,B){this.m_sKeyMasterUrl=B;this.m_sLastLoadedUrl="";this.m_oListener=A;this.nKeepAliveTimer=null;SL4B_Logger.logConnectionMessage(true,"Using deprecated iframe loading method to access keymaster. Use XHRKeymaster instead of StandardKeyMaster : {0}",this.m_sKeyMasterUrl);}; SL4B_KeymasterIFrameManager.prototype.getCredentials = function(A){SL4B_Logger.logConnectionMessage(true,"KeyMasterCredentialsProvider.getCredentials: Requesting credentials");var sUserName=SL4B_KeymasterIFrameManager.escapeParameter(SL4B_Accessor.getConfiguration().getUsername()); var nConnectionTimeout=SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout(); var l_sSeparator=((this.m_sKeyMasterUrl.indexOf("?")!=-1) ? "&" : "?"); this.m_sLastLoadedUrl=this.m_sKeyMasterUrl+l_sSeparator+"type=html&sourceid="+SL4B_KeymasterIFrameManager.escapeParameter(A)+"&username="+sUserName;SL4B_Logger.logConnectionMessage(true,"SL4B_KeyMaster.requestToken: Credentials being requested from {0}",this.m_sLastLoadedUrl);C_DynamicIFrameLoader.loadIFrame("keymaster",this.m_sLastLoadedUrl,this,nConnectionTimeout);}; SL4B_KeymasterIFrameManager.prototype.startKeepAlive = function(C,A,B){if(this.nKeepAliveTimer==null){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"KeyMaster: Starting keep-alive polling");var oThis=this; this.nKeepAliveTimer=setInterval(function(){oThis.sendKeepAlive();},A);}}; SL4B_KeymasterIFrameManager.prototype.stopKeepAlive = function(){if(this.nKeepAliveTimer!=null){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"KeyMaster: Stopping keep-alive polling");clearInterval(this.nKeepAliveTimer);this.nKeepAliveTimer=null;}}; SL4B_KeymasterIFrameManager.prototype.sendKeepAlive = function(){var l_sUrl=""; var l_oMatch=this.m_sKeyMasterUrl.match(/((^|\/)servlet\/)/); if(l_oMatch!=null){l_sUrl=this.m_sKeyMasterUrl.replace(/((^|\/)servlet\/.*)/,l_oMatch[2]+"poll.jsp");}else {l_sUrl=this.m_sKeyMasterUrl.replace(/[^\/]+$/,"poll.jsp");}SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"KeyMaster: Sending session keep-alive at URL {0}",l_sUrl);C_DynamicIFrameLoader.loadIFrame("keymaster-poll",l_sUrl,this,SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout());}; SL4B_KeymasterIFrameManager.prototype.scriptLoadTimeout = function(A){if(A=="keymaster"){this.m_oListener.failed("Could not load keymaster script",this.m_sLastLoadedUrl,null,0);}else if(A=="keymaster-poll"){var l_sUrl=""; var l_oMatch=this.m_sKeyMasterUrl.match(/((^|\/)servlet\/)/); if(l_oMatch!=null){l_sUrl=this.m_sKeyMasterUrl.replace(/((^|\/)servlet\/.*)/,l_oMatch[2]+"poll.jsp");}else {l_sUrl=this.m_sKeyMasterUrl.replace(/[^\/]+$/,"poll.jsp");}this.m_oListener.keepAliveFailure("Keep-alive polling timed out.",l_sUrl,null,0);}}; SL4B_KeymasterIFrameManager.escapeParameter = function(A){return escape(A).replace(/[.]/g,"%2E").replace(/@/g,"%40"); }; function SigGen_Signature(B,A,C){ try {C_DynamicIFrameLoader.iframeLoaded("keymaster");SL4B_Accessor.getCredentialsProvider().success(A,C);}catch(e){SL4B_Logger.logConnectionMessage(true,"SigGen_Signature: failed to retrieve SL4B_CredentialsProvider "+e.message);SL4B_Accessor.getExceptionHandler().processException(e);} } function SigGen_AuthenticationFailed(B,A){ try {C_DynamicIFrameLoader.iframeLoaded("keymaster");SL4B_Accessor.getCredentialsProvider().failed(A,SL4B_Accessor.getCredentialsProvider().m_oRequestManager.m_sLastLoadedUrl,null,200);}catch(e){SL4B_Logger.logConnectionMessage(true,"SigGen_AuthenticationFailed: failed to retrieve SL4B_CredentialsProvider "+e.message);SL4B_Accessor.getExceptionHandler().processException(e);} } function SigGen_KeepAliveLoaded(){C_DynamicIFrameLoader.iframeLoaded("keymaster-poll");SL4B_Accessor.getCredentialsProvider().keepAliveSuccess();} var SL4B_KeymasterXHRManager=function(){}; if(false){function SL4B_KeymasterXHRManager(A,B){} }SL4B_KeymasterXHRManager = function(A,B){this.m_sKeyMasterUrl=B;var sCommonDomain=SL4B_Accessor.getConfiguration().getCommonDomain(); if(sCommonDomain!=null){this.m_sKeyMasterUrl=SL4B_KeymasterXHRManager.appendParameter(this.m_sKeyMasterUrl,"domain",sCommonDomain);}this.m_oListener=A;this.storedRequests=[];this.iFrameLoaded=false;var oThis=this; this._iframeLoadedFunction = function(){oThis.xhrIframeLoaded();}; var keymasterIframe=document.createElement("div"); keymasterIframe.id='keymaster';document.body.appendChild(keymasterIframe);}; SL4B_KeymasterXHRManager.prototype.getCredentials = function(A){var oListener=this.m_oListener; var oThis=this; var loadCredentials=function(){var sUserName=SL4B_KeymasterIFrameManager.escapeParameter(SL4B_Accessor.getConfiguration().getUsername()); var nConnectionTimeout=SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout(); SL4B_Logger.logConnectionMessage(true,"KeyMasterCredentialsProvider.getCredentials: Requesting credentials");oThis.m_oEmbeddedKeyMaster.requestToken(oListener,A,sUserName,nConnectionTimeout);}; this.removeFunctionFromQueue("load credentials");this.withIFrameLoaded(loadCredentials,"load credentials");}; SL4B_KeymasterXHRManager.prototype.startKeepAlive = function(C,A,B){var oThis=this; this.withIFrameLoaded(function(){oThis.m_oEmbeddedKeyMaster.startKeepAlive(C,A,B);},"start keep alive");}; SL4B_KeymasterXHRManager.prototype.stopKeepAlive = function(){var oThis=this; this.withIFrameLoaded(function(){oThis.m_oEmbeddedKeyMaster.stopKeepAlive();},"stop keep alive");}; SL4B_KeymasterXHRManager.prototype.withIFrameLoaded = function(B,A){if(this.m_oEmbeddedKeyMaster!=null){B();}else {SL4B_Logger.logConnectionMessage(true,"KeyMasterCredentialsProvider.getCredentials: {0} waiting for iframe to load.",A);B.tag=A;this.storedRequests.push(B);}if(this.iFrameLoaded==false){this.iFrameLoaded=true;this.loadXhrIframe();}}; SL4B_KeymasterXHRManager.prototype.loadXhrIframe = function(){var oThis=this; this.m_nIFrameLoadingTimeout=null;this.m_oIFrameContainer=document.getElementById('keymaster');this.m_oIFrame=document.createElement('iframe');this.m_oIFrame.src=this.m_sKeyMasterUrl;this.m_oIFrame.style.display="none";if(this.m_oIFrame.addEventListener!=null){this.m_oIFrame.addEventListener("load",this._iframeLoadedFunction,false);}else {this.m_oIFrame.attachEvent("onload",this._iframeLoadedFunction);}this.m_nIFrameLoadingTimeout=setTimeout(function(){oThis.xhrIframeLoadingTimedOut();},SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout());SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"SL4B_KeyMasterCredentialsProvider: Loading initial KeyMaster page");this.m_oIFrameContainer.appendChild(this.m_oIFrame);}; SL4B_KeymasterXHRManager.prototype.processStoredRequests = function(){for(var i=0;i=0;--i){if(this.storedRequests[i].tag==A){this.storedRequests.splice(i,1);}}}; SL4B_KeymasterXHRManager.prototype.xhrIframeLoaded = function(){if(this.m_nIFrameLoadingTimeout!=null){clearTimeout(this.m_nIFrameLoadingTimeout);} try {this.m_oEmbeddedKeyMaster=this.m_oIFrame.contentWindow.KeyMaster;if(this.m_oEmbeddedKeyMaster==null||this.m_oIFrame.contentWindow.KeyMasterListener==null){var iframeDoc=this.m_oIFrame.contentWindow.document; var contentType=null; if(iframeDoc.contentType==null){contentType=iframeDoc.mimeType;}else {contentType=iframeDoc.contentType;}var sContents=iframeDoc.documentElement.innerHTML; SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"SL4B_KeyMasterCredentialsProvider: *** Bad Keymaster page");this._reset();this.m_oListener.failed("Unexpected initial KeyMaster page. Type='"+contentType+"'",this.m_sKeyMasterUrl,sContents,200);return; }}catch(e){this._reset();var errMsg="Error accessing initial KeyMaster page: "+e.message+" The page probably did not set document.domain"; this.m_oListener.failed(errMsg,this.m_sKeyMasterUrl,null,200);return; } SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"SL4B_KeyMasterCredentialsProvider: Initial KeyMaster page loaded");this.processStoredRequests();}; SL4B_KeymasterXHRManager.prototype._reset = function(){if(this.m_oIFrame){this._deleteIframe();}this.m_oEmbeddedKeyMaster=undefined;this.iFrameLoaded=false;this.storedRequests=[];}; SL4B_KeymasterXHRManager.prototype._deleteIframe = function(){if(this.m_oIFrame.removeEventListener!=null){this.m_oIFrame.removeEventListener("load",this._iframeLoadedFunction,false);}else if(this.m_oIFrame.detachEvent!=null){this.m_oIFrame.detachEvent("onload",this._iframeLoadedFunction);}this.m_oIFrameContainer.removeChild(this.m_oIFrame);}; SL4B_KeymasterXHRManager.prototype.xhrIframeLoadingTimedOut = function(){this._reset();SL4B_Logger.logConnectionMessage(true,"SL4B_KeyMasterCredentialsProvider: Could not load initial KeyMaster page: Timeout");this.m_oListener.failed("Could not load initial KeyMaster page: Timeout after "+SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout()+"ms",this.m_sKeyMasterUrl,null,0);}; SL4B_KeymasterXHRManager.appendParameter = function(A,C,B){if(A==null||C==null){return A; }if(B==null){B="";}var sAppendChar="?"; if(A.indexOf("?")==A.length-1){sAppendChar="";}else if(A.indexOf("?")>=0){sAppendChar="&";}A+=sAppendChar+C+"="+B;return A; }; var SL4B_KeyMasterCredentialsProvider=function(){}; if(false){function SL4B_KeyMasterCredentialsProvider(){} }SL4B_KeyMasterCredentialsProvider = function(){this.m_sSourceId="default";this.m_oRequestManager=null;this.m_sUserName="";this.m_oRttpProvider=null;this.reconnectAttempt=0;this.doneBackwardsCompatibleCheck=false;this.storedRequests=[];this.m_sKeyMasterToken=null;this.iFrameLoaded=false;if(SL4B_Accessor.getConfiguration().getKeyMasterUrl()==null){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"SL4B_KeyMasterCredentialsProvider: KeyMaster URL has not been defined");}}; SL4B_KeyMasterCredentialsProvider.prototype = new SL4B_AbstractCredentialsProvider;SL4B_KeyMasterCredentialsProvider.prototype.getCredentials = SL_RH;SL4B_KeyMasterCredentialsProvider.prototype.getKeyMasterToken = SL_IB;SL4B_KeyMasterCredentialsProvider.prototype.getUsername = SL_GN;SL4B_KeyMasterCredentialsProvider.prototype.stopKeepAlive = function(){if(this.m_oRequestManager==null){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"SL4B_KeyMasterCredentialsProvider.stopKeepAlive: KeyMaster URL was not been defined. Unable to stop keepalive.");return; }this.m_oRequestManager.stopKeepAlive();}; SL4B_KeyMasterCredentialsProvider.prototype.startKeepAlive = function(){if(this.m_oRequestManager==null){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"SL4B_KeyMasterCredentialsProvider.startKeepAlive: KeyMaster URL was not been defined. Unable to start keepalive.");return; }var l_nKeepAliveInterval=SL4B_Accessor.getConfiguration().getKeyMasterKeepAliveInterval(); if(l_nKeepAliveInterval>0){var oThis=this; this.m_oRequestManager.startKeepAlive({success:function(){oThis.keepAliveSuccess();}, failed:function(B,A,C,D){oThis.keepAliveFailure(B,A,C,D);}, timedOut:function(A,B){oThis.keepAliveTimedOut(A,B);}},l_nKeepAliveInterval,SL4B_Accessor.getConfiguration().getKeyMasterConnectionTimeout());}}; SL4B_KeyMasterCredentialsProvider.prototype._internalGetCredentials = function(){var sKeyMasterUrl=SL4B_Accessor.getConfiguration().getKeyMasterUrl(); var sXhrKeymaster=SL4B_Accessor.getConfiguration().getKeyMasterXHRUrl(); if(this.doneBackwardsCompatibleCheck==false){this.doneBackwardsCompatibleCheck=true;if(sXhrKeymaster==null){if(sKeyMasterUrl!=null){this.m_oRequestManager=new SL4B_KeymasterIFrameManager(this,sKeyMasterUrl);}else {}}else if(this.usingFirefoxAndForeverFrame()==true){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"SL4B_KeyMasterCredentialsProvider: Firefox and Forever Frame detected");if(sKeyMasterUrl!=null){this.m_oRequestManager=new SL4B_KeymasterIFrameManager(this,sKeyMasterUrl);}else {}}else {this.m_oRequestManager=new SL4B_KeymasterXHRManager(this,sXhrKeymaster);}}if(this.m_oRequestManager==null){this.logConnectionError("KeyMaster error - KeyMaster URL has not been defined.");return; }this.m_sUserName="";this.stopKeepAlive();this.m_oRequestManager.getCredentials(this.m_sSourceId);}; function SL_RH(A){this.m_oRttpProvider=A;this.reconnectAttempt=0;this._internalGetCredentials();} function SL_IB(){return this.m_sKeyMasterToken; } function SL_GN(){return this.m_sUserName; } SL4B_KeyMasterCredentialsProvider.prototype.logConnectionError = function(A){C_CallbackQueue.addCallback(new Array(this.m_oRttpProvider,"notifyConnectionListeners",this.m_oRttpProvider.const_LOGIN_ERROR_CONNECTION_EVENT,A));}; SL4B_KeyMasterCredentialsProvider.prototype.usingFirefoxAndForeverFrame = function(){var result=false; if(SL4B_Accessor.getBrowserAdapter().isFirefox()){var connections=this.m_oRttpProvider.getLiberatorConfiguration().getAllConnectionData(); for(var i=0;i0){message+=" response="+B;}SL4B_Logger.logConnectionMessage(true,"KeyMasterCredentialsProvider.failed: {0}",message);var maximumRetries=SL4B_Accessor.getConfiguration().getKeyMasterAttempts(); var bRetry=++this.reconnectAttempt=500; if(bRetry&&bRetriable){SL4B_Logger.logConnectionMessage(true,"KeyMasterCredentialsProvider: Retrying Keymaster");this._internalGetCredentials();}else {this.logConnectionError(message);}}; SL4B_KeyMasterCredentialsProvider.prototype.timedOut = function(A,B){this.failed("Timed out after "+B+"ms",A,"",0);}; SL4B_KeyMasterCredentialsProvider.prototype.keepAliveSuccess = function(){SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"Keymaster server session alive");}; SL4B_KeyMasterCredentialsProvider.prototype.keepAliveFailure = function(B,A,C,D){C_CallbackQueue.addCallback(new Array(this.m_oRttpProvider,"notifyConnectionListeners",this.m_oRttpProvider.const_CREDENTIALS_PROVIDER_SESSION_ERROR_CONNECTION_EVENT,"Keymaster polling failed: "+B,A,C,D));SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"Keymaster polling failed to access {0}: {1} code={2} {3}",A,B,D,C);}; SL4B_KeyMasterCredentialsProvider.prototype.keepAliveTimedOut = function(A,B){C_CallbackQueue.addCallback(new Array(this.m_oRttpProvider,"notifyConnectionListeners",this.m_oRttpProvider.const_CREDENTIALS_PROVIDER_SESSION_ERROR_CONNECTION_EVENT,"Keymaster polling timed out after "+B+"ms",A,null,null));SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"Keymaster polling timed out after {0} contacting {1}",B,A);}; function SL_CT(){SL4B_Accessor.setCredentialsProvider(new SL4B_KeyMasterCredentialsProvider());} var SL4B_LiberatorConfiguration=function(){}; if(false){function SL4B_LiberatorConfiguration(){} }SL4B_LiberatorConfiguration = function(){this.m_nCurrentConnection=-1;this.m_nSuccessfulConnection=-1;this.m_nIgnoreConnection=-1;this.m_pConnectionDatas=new Array();}; SL4B_LiberatorConfiguration.prototype.initialise = function(){this.m_nCurrentConnection=-1;this.m_nSuccessfulConnection=-1;this.m_nIgnoreConnection=-1;this.m_pConnectionDatas=new Array();}; SL4B_LiberatorConfiguration.prototype.addConnection = function(A){this.m_pConnectionDatas.push(A);}; SL4B_LiberatorConfiguration.prototype.getNextConnection = function(){var l_oConfigurationData=null; if(this.m_nSuccessfulConnection!=-1){l_oConfigurationData=this.m_pConnectionDatas[this.m_nSuccessfulConnection];this.m_nIgnoreConnection=this.m_nSuccessfulConnection;this.m_nSuccessfulConnection=-1;this.m_nCurrentConnection=-1;}else {++this.m_nCurrentConnection;if(this.m_nCurrentConnection==this.m_nIgnoreConnection){++this.m_nCurrentConnection;}if(this.m_nCurrentConnectionA; } function SL_GU(A,B){this.m_nCommandType=A;this.m_pArguments=B;} SL_EX = new function(){this.const_GET_OBJECT=1;this.const_GET_OBJECTS=2;this.const_REMOVE_OBJECT=3;this.const_REMOVE_OBJECTS=4;this.const_GET_OBJECT_TYPE=5;this.const_SET_THROTTLE_OBJECT=6;this.const_SET_THROTTLE_OBJECTS=7;this.const_SET_GLOBAL_THROTTLE=8;this.const_DISABLE_WTSTATS_TIMEOUT=9;this.const_CLEAR_OBJECT_LISTENERS=10;this.const_BLOCK_OBJECT_LISTENERS=11;this.const_UNBLOCK_OBJECT_LISTENERS=12;this.const_CREATE_OBJECT=13;this.const_CONTRIB_OBJECT=14;this.const_DELETE_OBJECT=15;this.const_GET_FIELD_NAMES=16;this.const_LOGOUT=17;this.const_DEBUG=18;this.const_SET_DEBUG_LEVEL=19;this.const_GET_VERSION=20;this.const_GET_VERSION_INFO=21;this.const_ADD_CONNECTION_LISTENER=22;this.const_REMOVE_CONNECTION_LISTENER=23;this.const_GET_CONTAINER=24;this.const_REMOVE_CONTAINER=25;this.const_REMOVE_SUBSCRIBER=26;this.const_SET_CONTAINER_WINDOW=27;this.const_CLEAR_CONTAINER_WINDOW=28;this.const_SET_CONTAINER_WINDOW=29;this.const_CLEAR_CONTAINER=30;this.const_GET_AUTO_DIRECTORY=31;this.const_REMOVE_AUTO_DIRECTORY=32;}; var SL4B_SlaveFrameRttpProvider=function(){}; if(false){function SL4B_SlaveFrameRttpProvider(){} }SL4B_SlaveFrameRttpProvider = function(){SL4B_AbstractRttpProvider.apply(this);this.m_oMasterFrameRttpProvider=null;this.m_oRttpCommandQueue=new GF_RttpCommandQueue();this.m_bMasterRefresh=false;}; SL4B_SlaveFrameRttpProvider.prototype = new SL4B_AbstractRttpProvider;SL4B_SlaveFrameRttpProvider.prototype.register = SL_PA;SL4B_SlaveFrameRttpProvider.prototype.masterRegistered = SL_KG;SL4B_SlaveFrameRttpProvider.prototype.masterClosing = SL_HB;SL4B_SlaveFrameRttpProvider.prototype.connect = function(){}; SL4B_SlaveFrameRttpProvider.prototype.login = function(A,B){}; SL4B_SlaveFrameRttpProvider.prototype.reconnect = function(){}; SL4B_SlaveFrameRttpProvider.prototype.getObject = SL_DZ;SL4B_SlaveFrameRttpProvider.prototype.getObjects = SL_OH;SL4B_SlaveFrameRttpProvider.prototype.removeObject = SL_NP;SL4B_SlaveFrameRttpProvider.prototype.removeObjects = SL_EQ;SL4B_SlaveFrameRttpProvider.prototype.removeSubscriber = SL_GC;SL4B_SlaveFrameRttpProvider.prototype.getObjectType = SL_PX;SL4B_SlaveFrameRttpProvider.prototype.setThrottleObject = SL_IW;SL4B_SlaveFrameRttpProvider.prototype.setThrottleObjects = SL_PV;SL4B_SlaveFrameRttpProvider.prototype.setGlobalThrottle = SL_QY;SL4B_SlaveFrameRttpProvider.prototype.createObject = SL_GK;SL4B_SlaveFrameRttpProvider.prototype.contribObject = SL_CI;SL4B_SlaveFrameRttpProvider.prototype.deleteObject = SL_DP;SL4B_SlaveFrameRttpProvider.prototype.getFieldNames = SL_HG;SL4B_SlaveFrameRttpProvider.prototype.logout = function(){}; SL4B_SlaveFrameRttpProvider.prototype.initialise = function(){}; SL4B_SlaveFrameRttpProvider.prototype.stop = SL_DJ;SL4B_SlaveFrameRttpProvider.prototype.disableWTStatsTimeout = function(A){this.m_oMasterFrameRttpProvider.disableWTStatsTimeout(A);}; SL4B_SlaveFrameRttpProvider.prototype.clearObjectListeners = function(B,A){this.m_oMasterFrameRttpProvider.clearObjectListeners(B,A);}; SL4B_SlaveFrameRttpProvider.prototype.blockObjectListeners = function(B,A){this.m_oMasterFrameRttpProvider.blockObjectListeners(B,A);}; SL4B_SlaveFrameRttpProvider.prototype.unblockObjectListeners = function(B,A){this.m_oMasterFrameRttpProvider.unblockObjectListeners(B,A);}; SL4B_SlaveFrameRttpProvider.prototype.debug = function(B,A){this.m_oMasterFrameRttpProvider.debug(B,A);}; SL4B_SlaveFrameRttpProvider.prototype.setDebugLevel = function(A){return this.m_oMasterFrameRttpProvider.setDebugLevel(A); }; SL4B_SlaveFrameRttpProvider.prototype.getVersion = function(){return this.m_oMasterFrameRttpProvider.getVersion()+"-"+this.m_oMasterFrameRttpProvider.getBuildVersion(); }; SL4B_SlaveFrameRttpProvider.prototype.getVersionInfo = function(){return this.m_oMasterFrameRttpProvider.getVersionInfo(); }; function SL_DZ(C,B,A){if(this.m_oMasterFrameRttpProvider!=null){this.m_oMasterFrameRttpProvider.getObject(C,B,A);}else {this.m_oRttpCommandQueue.getObject(C,B,A);}} function SL_OH(C,A,B){this.m_oMasterFrameRttpProvider.getObjects(C,A,B);} function SL_NP(C,B,A){this.m_oMasterFrameRttpProvider.removeObject(C,B,A);} function SL_EQ(C,A,B){this.m_oMasterFrameRttpProvider.removeObjects(C,A,B);} function SL_GC(A){if(this.m_oMasterFrameRttpProvider!=null){this.m_oMasterFrameRttpProvider.removeSubscriber(A);}} function SL_PX(B,A){this.m_oMasterFrameRttpProvider.getObjectType(B,A);} function SL_IW(A,B){this.m_oMasterFrameRttpProvider.setThrottleObject(A,B);} function SL_PV(A,B){this.m_oMasterFrameRttpProvider.setThrottleObject(A,B);} function SL_QY(A){this.m_oMasterFrameRttpProvider.setGlobalThrottle(A);} function SL_GK(A,B){return this.m_oMasterFrameRttpProvider.createObject(A,B); } function SL_CI(C,A,B){this.m_oMasterFrameRttpProvider.contribObject(C,A,B);} function SL_DP(A){return this.m_oMasterFrameRttpProvider.deleteObject(A); } function SL_HG(){return this.m_oMasterFrameRttpProvider.getFieldNames(); } function SL_PA(){setTimeout("SL4B_FrameRegistrarAccessor.registerSlaveFrame(SL4B_Accessor.getConfiguration().getFrameId(), SL4B_Accessor.getRttpProvider())",0);} function SL_DJ(){SL4B_FrameRegistrarAccessor.deregisterSlaveFrame(SL4B_Accessor.getConfiguration().getFrameId());if(this.m_oMasterFrameRttpProvider!=null){this.m_oMasterFrameRttpProvider.deregisterSlave(SL4B_Accessor.getConfiguration().getFrameId(),this,SL4B_SubscriptionManager);}for(var i=0;i0&&B[0]===undefined){B=[];}this.m_pConnectionListeners[l_nListener][A].apply(this.m_pConnectionListeners[l_nListener],B);}}; SL_MF.prototype.connectionAttempt = function(B,A){this.notifyConnectionListeners("connectionAttempt",[B,A]);}; SL_MF.prototype.connectionWarning = function(C,D,B,A){this.notifyConnectionListeners("connectionWarning",[C,D,B,A]);}; SL_MF.prototype.connectionError = function(A){if(this.m_oFailoverProvider.m_bAttemptReconnections){var l_bIsAnotherServerAvailable=this.m_oFailoverProvider.nextRttpProvider(); if(!l_bIsAnotherServerAvailable){this.m_oFailoverProvider.m_bConnectionLost=true;this.notifyConnectionListeners("connectionError",[A]);}this.m_oFailoverProvider.onLoad(null);}}; SL_MF.prototype.connectionInfo = function(A){this.notifyConnectionListeners("connectionInfo",[A]);}; SL_MF.prototype.connectionOk = function(C,A,B){this.notifyConnectionListeners("connectionOk",[C,A,B]);}; SL_MF.prototype.reconnectionOk = function(C,A,B){this.notifyConnectionListeners("reconnectionOk",[C,A,B]);}; SL_MF.prototype.fileDownloadError = function(B,A){this.notifyConnectionListeners("fileDownloadError",[B,A]);}; SL_MF.prototype.credentialsRetrieved = function(A){this.notifyConnectionListeners("credentialsRetrieved",[A]);}; SL_MF.prototype.loginError = function(A){this.notifyConnectionListeners("loginError",[A]);}; SL_MF.prototype.credentialsProviderSessionError = function(A,D,C,B){this.notifyConnectionListeners("credentialsProviderSessionError",[A,D,C,B]);}; SL_MF.prototype.loginOk = function(){this.notifyConnectionListeners("loginOk",[]);setTimeout("SL4B_Accessor.getRttpProvider().processQueuedCommands()",0);}; SL_MF.prototype.message = function(A,B){this.notifyConnectionListeners("message",[A,B]);}; SL_MF.prototype.serviceMessage = function(A,D,B,C){this.notifyConnectionListeners("serviceMessage",[A,D,B,C]);}; SL_MF.prototype.sessionEjected = function(A,B){this.notifyConnectionListeners("sessionEjected",[A,B]);}; SL_MF.prototype.sourceMessage = function(A,C,D,B){this.notifyConnectionListeners("sourceMessage",[A,C,D,B]);}; SL_MF.prototype.statistics = function(A,D,E,B,C){this.notifyConnectionListeners("statistics",[A,D,E,B,C]);}; SL4B_FailoverRttpProvider.prototype = new SL4B_AbstractRttpProvider;SL4B_FailoverRttpProvider.prototype.super_internalInitialise = SL4B_AbstractRttpProvider.prototype.internalInitialise;SL4B_FailoverRttpProvider.prototype.super_register = SL4B_AbstractRttpProvider.prototype.register;SL4B_FailoverRttpProvider.prototype.internalInitialise = function(){if(this.m_oBaseRttpProvider==null){this.super_internalInitialise();this.nextRttpProvider();}else {this.m_oBaseRttpProvider.internalInitialise();}}; SL4B_FailoverRttpProvider.prototype.initialise = function(){if(!this.m_bConnectionListenerAdded){this.m_bConnectionListenerAdded=true;SL4B_AbstractRttpProvider.prototype.addConnectionListener.apply(this,[this.m_oConnectionListener]);}if(this.m_oBaseRttpProvider!=null){this.m_oBaseRttpProvider.initialise();}}; SL4B_FailoverRttpProvider.prototype.onLoad = function(A){if(this.m_oBaseRttpProvider!=null&&this.m_bAttemptReconnections){this.m_bConnectionLost=false;this.m_oBaseRttpProvider.onLoad(A);}}; SL4B_FailoverRttpProvider.prototype.internalStop = function(){this.m_oBaseRttpProvider.internalStop();}; SL4B_FailoverRttpProvider.prototype.stop = function(){this.m_bAttemptReconnections=false;this.m_oBaseRttpProvider.stop();if(this.m_bConnectionLost===false){this.m_bConnectionLost=true;this.m_oConnectionListener.notifyConnectionListeners("connectionError",["Connection stopped"]);}}; SL4B_FailoverRttpProvider.prototype.addConnectionListener = function(A){this.m_oConnectionListener.addConnectionListener(A);}; SL4B_FailoverRttpProvider.prototype.removeConnectionListener = function(A){return this.m_oConnectionListener.removeConnectionListener(A); }; SL4B_FailoverRttpProvider.prototype.loggedIn = function(){this.m_oBaseRttpProvider.loggedIn();}; SL4B_FailoverRttpProvider.prototype.register = function(){if(this.m_oBaseRttpProvider==null){this.super_register();}else {this.m_oBaseRttpProvider.register();}}; SL4B_FailoverRttpProvider.prototype.registerSlave = function(B,A,C){this.m_oBaseRttpProvider.registerSlave(B,A,C);}; SL4B_FailoverRttpProvider.prototype.deregisterSlave = function(B,A,C){this.m_oBaseRttpProvider.deregisterSlave(B,A,C);}; SL4B_FailoverRttpProvider.prototype.connect = function(){this.m_oBaseRttpProvider.connect();}; SL4B_FailoverRttpProvider.prototype.reconnect = function(){this.m_bAttemptReconnections=true;this.m_oBaseRttpProvider.reconnect();}; SL4B_FailoverRttpProvider.prototype.connected = function(){this.m_oBaseRttpProvider.connected();}; SL4B_FailoverRttpProvider.prototype.login = function(A,B){this.m_oBaseRttpProvider.login(A,B);}; SL4B_FailoverRttpProvider.prototype.loggedIn = function(){this.m_oBaseRttpProvider.loggedIn();}; SL4B_FailoverRttpProvider.prototype.getObject = function(C,B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getObject(C,B,A);}else {this.m_oRttpCommandQueue.getObject(C,B,A);}}; SL4B_FailoverRttpProvider.prototype.getObjects = function(C,A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getObjects(C,A,B);}else {this.m_oRttpCommandQueue.getObjects(C,A,B);}}; SL4B_FailoverRttpProvider.prototype.removeObject = function(C,B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.removeObject(C,B,A);}else {this.m_oRttpCommandQueue.removeObject(C,B,A);}}; SL4B_FailoverRttpProvider.prototype.removeObjects = function(C,A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.removeObjects(C,A,B);}else {this.m_oRttpCommandQueue.removeObjects(C,A,B);}}; SL4B_FailoverRttpProvider.prototype.getContainer = function(E,A,C,D,B){if(this.m_bProviderReady){return this.m_oBaseRttpProvider.getContainer(E,A,C,D,B); }else {var l_oProxyContainerKey=new SL4B_ContainerKey(); this.m_oProxyKeyArray.push(l_oProxyContainerKey);this.m_oRttpCommandQueue.getContainer(E,A,C,D,B);return l_oProxyContainerKey; }}; SL4B_FailoverRttpProvider.prototype.setContainerWindow = function(B,C,A){if(this.m_bProviderReady){if(this.m_oContainerKeyMap[B]!=null){B=this.m_oContainerKeyMap[B];}this.m_oBaseRttpProvider.setContainerWindow(B,C,A);}else {this.m_oRttpCommandQueue.setContainerWindow(B,C,A);}}; SL4B_FailoverRttpProvider.prototype.clearContainerWindow = function(A){if(this.m_bProviderReady){if(this.m_oContainerKeyMap[A]!=null){A=this.m_oContainerKeyMap[A];}this.m_oBaseRttpProvider.clearContainerWindow(A);}else {this.m_oRttpCommandQueue.clearContainerWindow(A);}}; SL4B_FailoverRttpProvider.prototype.removeContainer = function(B,A){if(this.m_bProviderReady){if(this.m_oContainerKeyMap[A]!=null){A=this.m_oContainerKeyMap[A];}this.m_oBaseRttpProvider.removeContainer(B,A);}else {this.m_oRttpCommandQueue.removeContainer(B,A);}}; SL4B_FailoverRttpProvider.prototype.getAutoDirectory = function(E,D,A,B,C){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getAutoDirectory(E,D,A,B,C);}else {this.m_oRttpCommandQueue.getAutoDirectory(E,D,A,B,C);}}; SL4B_FailoverRttpProvider.prototype.removeAutoDirectory = function(E,D,A,B,C){if(this.m_bProviderReady){this.m_oBaseRttpProvider.removeAutoDirectory(E,D,A,B,C);}else {this.m_oRttpCommandQueue.removeAutoDirectory(E,D,A,B,C);}}; SL4B_FailoverRttpProvider.prototype.getObjectType = function(B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getObjectType(B,A);}else {this.m_oRttpCommandQueue.getObjectType(B,A);}}; SL4B_FailoverRttpProvider.prototype.setThrottleObject = function(A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.setThrottleObject(A,B);}else {this.m_oRttpCommandQueue.setThrottleObject(A,B);}}; SL4B_FailoverRttpProvider.prototype.setThrottleObjects = function(A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.setThrottleObjects(A,B);}else {this.m_oRttpCommandQueue.setThrottleObjects(A,B);}}; SL4B_FailoverRttpProvider.prototype.setGlobalThrottle = function(A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.setGlobalThrottle(A);}else {this.m_oRttpCommandQueue.setGlobalThrottle(A);}}; SL4B_FailoverRttpProvider.prototype.disableWTStatsTimeout = function(A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.disableWTStatsTimeout(A);}else {this.m_oRttpCommandQueue.disableWTStatsTimeout(A);}}; SL4B_FailoverRttpProvider.prototype.clearObjectListeners = function(B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.clearObjectListeners(B,A);}else {this.m_oRttpCommandQueue.clearObjectListeners(B,A);}}; SL4B_FailoverRttpProvider.prototype.blockObjectListeners = function(B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.blockObjectListeners(B,A);}else {this.m_oRttpCommandQueue.blockObjectListeners(B,A);}}; SL4B_FailoverRttpProvider.prototype.unblockObjectListeners = function(B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.unblockObjectListeners(B,A);}else {this.m_oRttpCommandQueue.unblockObjectListeners(B,A);}}; SL4B_FailoverRttpProvider.prototype.createObject = function(A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.createObject(A,B);}else {this.m_oRttpCommandQueue.createObject(A,B);}}; SL4B_FailoverRttpProvider.prototype.contribObject = function(C,A,B){if(this.m_bProviderReady){this.m_oBaseRttpProvider.contribObject(C,A,B);}else {this.m_oRttpCommandQueue.contribObject(C,A,B);}}; SL4B_FailoverRttpProvider.prototype.deleteObject = function(A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.deleteObject(A);}else {this.m_oRttpCommandQueue.deleteObject(A);}}; SL4B_FailoverRttpProvider.prototype.removeSubscriber = function(A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.removeSubscriber(A);}else {this.m_oRttpCommandQueue.removeSubscriber(A);}}; SL4B_FailoverRttpProvider.prototype.getFieldNames = function(){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getFieldNames();}else {this.m_oRttpCommandQueue.getFieldNames();}}; SL4B_FailoverRttpProvider.prototype.logout = function(){if(this.m_bProviderReady){this.m_oBaseRttpProvider.logout();}else {this.m_oRttpCommandQueue.logout();}}; SL4B_FailoverRttpProvider.prototype.debug = function(B,A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.debug(B,A);}else {this.m_oRttpCommandQueue.debug(B,A);}}; SL4B_FailoverRttpProvider.prototype.setDebugLevel = function(A){if(this.m_bProviderReady){this.m_oBaseRttpProvider.setDebugLevel(A);}else {this.m_oRttpCommandQueue.setDebugLevel(A);}}; SL4B_FailoverRttpProvider.prototype.getVersion = function(){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getVersion();}else {this.m_oRttpCommandQueue.getVersion();}}; SL4B_FailoverRttpProvider.prototype.getVersionInfo = function(){if(this.m_bProviderReady){this.m_oBaseRttpProvider.getVersionInfo();}else {this.m_oRttpCommandQueue.getVersionInfo();}}; SL4B_FailoverRttpProvider.prototype.onUnload = function(){this.m_oBaseRttpProvider.onUnload();}; var bURLValid=false; var SL4B_AbstractJavaRttpProvider=function(){}; if(false){function SL4B_AbstractJavaRttpProvider(){} }SL4B_AbstractJavaRttpProvider = function(){SL4B_AbstractRttpProvider.apply(this);this.m_sAppletDirectoryUrl=null;}; SL4B_AbstractJavaRttpProvider.prototype = new SL4B_AbstractRttpProvider;SL4B_AbstractJavaRttpProvider.prototype.connect = SL_FS;SL4B_AbstractJavaRttpProvider.prototype.login = SL_FI;SL4B_AbstractJavaRttpProvider.prototype.reconnect = SL_DV;SL4B_AbstractJavaRttpProvider.prototype.getObject = function(C,B,A){this.m_oRttpApplet.getObject(this.getListener(C),B,this.validateFieldList(A));}; SL4B_AbstractJavaRttpProvider.prototype.getObjects = function(C,A,B){this.m_oRttpApplet.getObjects(this.getListener(C),A,this.validateFieldList(B));}; SL4B_AbstractJavaRttpProvider.prototype.removeObject = function(C,B,A){this.m_oRttpApplet.removeObject(this.getListener(C),B,this.validateFieldList(A));}; SL4B_AbstractJavaRttpProvider.prototype.removeObjects = function(C,A,B){this.m_oRttpApplet.removeObjects(this.getListener(C),A,this.validateFieldList(B));}; SL4B_AbstractJavaRttpProvider.prototype.getObjectType = function(B,A){this.m_oRttpApplet.getObjectType(this.getListener(B),A);}; SL4B_AbstractJavaRttpProvider.prototype.setThrottleObject = function(A,B){this.m_oRttpApplet.setThrottleObject(A,B);}; SL4B_AbstractJavaRttpProvider.prototype.setThrottleObjects = function(A,B){this.m_oRttpApplet.setThrottleObjects(A,B);}; SL4B_AbstractJavaRttpProvider.prototype.setGlobalThrottle = function(A){this.m_oRttpApplet.setGlobalThrottle(A);}; SL4B_AbstractJavaRttpProvider.prototype.disableWTStatsTimeout = function(A){this.m_oRttpApplet.disableWTStatsTimeout(A);}; SL4B_AbstractJavaRttpProvider.prototype.clearObjectListeners = SL_MN;SL4B_AbstractJavaRttpProvider.prototype.blockObjectListeners = SL_DC;SL4B_AbstractJavaRttpProvider.prototype.unblockObjectListeners = SL_CZ;SL4B_AbstractJavaRttpProvider.prototype.createObject = function(A,B){return this.m_oRttpApplet.createObject(A,B); }; SL4B_AbstractJavaRttpProvider.prototype.contribObject = SL_EU;SL4B_AbstractJavaRttpProvider.prototype.deleteObject = function(A){return this.m_oRttpApplet.deleteObject(A); }; SL4B_AbstractJavaRttpProvider.prototype.getFieldNames = function(){return this.m_oRttpApplet.getFieldNames(); }; SL4B_AbstractJavaRttpProvider.prototype.logout = function(){this.m_oRttpApplet.logout();}; SL4B_AbstractJavaRttpProvider.prototype.setDebugLevel = function(A){return this.m_oRttpApplet.setDebugLevel(A); }; SL4B_AbstractJavaRttpProvider.prototype.getVersion = function(){return this.m_oRttpApplet.getVersion()+"-"+this.m_oRttpApplet.getBuildVersion(); }; SL4B_AbstractJavaRttpProvider.prototype.getVersionInfo = function(){return this.m_oRttpApplet.getVersionInfo(); }; SL4B_AbstractJavaRttpProvider.prototype.debug = function(B,A){if(typeof A=="undefined"){this.m_oRttpApplet.debug(B);}else {this.m_oRttpApplet.debug(B,A);}}; SL4B_AbstractJavaRttpProvider.prototype.m_oRttpApplet = null;SL4B_AbstractJavaRttpProvider.prototype.m_nAppletCheckTimeoutHandle = null;SL4B_AbstractJavaRttpProvider.prototype.m_nRttpAppletTimeoutHandle = null;SL4B_AbstractJavaRttpProvider.prototype.m_pUpdateQueue = new Array();SL4B_AbstractJavaRttpProvider.prototype.m_bConnectionEstablished = false;SL4B_AbstractJavaRttpProvider.prototype.const_ALL_FIELDS = 0;SL4B_AbstractJavaRttpProvider.prototype.getRttpAppletId = function(){return "appRttpApplet"; }; SL4B_AbstractJavaRttpProvider.prototype.createParameterHtml = function(B,A){return ""; }; SL4B_AbstractJavaRttpProvider.prototype.validateFieldList = function(A){return ((A==null||typeof A=="undefined") ? this.const_ALL_FIELDS : A); }; SL4B_AbstractJavaRttpProvider.prototype.setRttpApplet = SL_FU;SL4B_AbstractJavaRttpProvider.prototype.getAppletParameterHtml = SL_GJ;SL4B_AbstractJavaRttpProvider.prototype.writeAppletToDocument = SL_MT;SL4B_AbstractJavaRttpProvider.prototype.startAppletCheckTimeout = SL_JZ;SL4B_AbstractJavaRttpProvider.prototype.startRttpAppletTimeout = SL_IA;SL4B_AbstractJavaRttpProvider.prototype.appletCheckDownloadComplete = SL_NK;SL4B_AbstractJavaRttpProvider.prototype.rttpAppletDownloadComplete = SL_JI;SL4B_AbstractJavaRttpProvider.prototype.urlCheckDownloadFailed = SL_DF;SL4B_AbstractJavaRttpProvider.prototype.appletCheckDownloadFailed = SL_RC;SL4B_AbstractJavaRttpProvider.prototype.rttpAppletDownloadFailed = SL_KR;SL4B_AbstractJavaRttpProvider.prototype.queueUpdates = SL_GD;SL4B_AbstractJavaRttpProvider.prototype.dequeueUpdates = SL_OY;SL4B_AbstractJavaRttpProvider.prototype.WTConnectionError = SL_FO;SL4B_AbstractJavaRttpProvider.prototype.WTConnectionInfo = SL_AA;SL4B_AbstractJavaRttpProvider.prototype.WTConnectionOk = SL_BU;SL4B_AbstractJavaRttpProvider.prototype.WTMessage = SL_FY;SL4B_AbstractJavaRttpProvider.prototype.WTReconnect = SL_JC;SL4B_AbstractJavaRttpProvider.prototype.WTServiceMessage = SL_GY;SL4B_AbstractJavaRttpProvider.prototype.WTSessionEjected = SL_GF;SL4B_AbstractJavaRttpProvider.prototype.WTSourceMessage = SL_KI;SL4B_AbstractJavaRttpProvider.prototype.WTStats = SL_AT;function SL_FS(){this.m_oRttpApplet.addStatsListener('SL4B_Accessor.getRttpProvider()');this.m_oRttpApplet.addConnectionListener("SL4B_Accessor.getRttpProvider()");this.m_oRttpApplet.addReconnectListener('SL4B_Accessor.getRttpProvider()');this.m_oRttpApplet.addMessagesListener('SL4B_Accessor.getRttpProvider()');this.m_oRttpApplet.connect(false);} function SL_DV(){this.m_oRttpApplet.reconnect(false);} function SL_FI(A,B){this.credentialsRetrieved();var l_sLoginResponse=this.m_oRttpApplet.login(A,B); if(typeof l_sLoginResponse!="undefined"&&l_sLoginResponse!=null&&l_sLoginResponse!=""){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_LOGIN_ERROR_CONNECTION_EVENT,l_sLoginResponse));}else {this.loggedIn();}} function SL_MN(B,A){if(typeof A=="undefined"){this.m_oRttpApplet.clearObjectListeners(this.getListener(B));}else {this.m_oRttpApplet.clearObjectListeners(this.getListener(B),A);}} function SL_DC(B,A){if(typeof A=="undefined"){this.m_oRttpApplet.blockObjectListeners(this.getListener(B));}else {this.m_oRttpApplet.blockObjectListeners(this.getListener(B),A);}} function SL_CZ(B,A){if(typeof A=="undefined"){this.m_oRttpApplet.unblockObjectListeners(this.getListener(B));}else {this.m_oRttpApplet.unblockObjectListeners(this.getListener(B),A);}} function SL_EU(C,A,B){for(var l_nFieldIndex=0,l_nLength=B.size();l_nFieldIndex"; l_sHtmlToWrite+=A;l_sHtmlToWrite+="";document.write(l_sHtmlToWrite);} function SL_JZ(){this.m_nAppletCheckTimeoutHandle=setTimeout("SL4B_Accessor.getRttpProvider().appletCheckDownloadFailed()",SL4B_Accessor.getConfiguration().getAppletCheckTimeout());} function SL_IA(){this.m_nRttpAppletTimeoutHandle=setTimeout("SL4B_Accessor.getRttpProvider().rttpAppletDownloadFailed()",SL4B_Accessor.getConfiguration().getRttpAppletTimeout());} function SL_NK(){if(this.m_nAppletCheckTimeoutHandle!==null){clearTimeout(this.m_nAppletCheckTimeoutHandle);this.m_nAppletCheckTimeoutHandle=null;}} function SL_JI(){if(this.m_nRttpAppletTimeoutHandle!==null){clearTimeout(this.m_nRttpAppletTimeoutHandle);this.m_nRttpAppletTimeoutHandle=null;}var l_oApplet=SL4B_Accessor.getBrowserAdapter().getElementById(this.getRttpAppletId()); this.setRttpApplet(l_oApplet);} function SL_DF(){this.notifyConnectionListeners(this.const_FILE_DOWNLOAD_ERROR_CONNECTION_EVENT,SL4B_FileType.URL_CHECK,this.m_sAppletDirectoryUrl+"/urlcheck.js");} function SL_RC(){if(this.m_nAppletCheckTimeoutHandle!==null){this.m_nAppletCheckTimeoutHandle=null;this.notifyConnectionListeners(this.const_FILE_DOWNLOAD_ERROR_CONNECTION_EVENT,SL4B_FileType.APPLET_CHECK,this.m_sAppletDirectoryUrl+"/AppletCheck.class");}} function SL_KR(){if(this.m_nRttpAppletTimeoutHandle!==null){this.m_nRttpAppletTimeoutHandle=null;var l_oConfiguration=SL4B_Accessor.getConfiguration(); this.notifyConnectionListeners(this.const_FILE_DOWNLOAD_ERROR_CONNECTION_EVENT,SL4B_FileType.RTTP_APPLET,this.m_sAppletDirectoryUrl+l_oConfiguration.getAppletJarName());}} function SL_GD(A){this.m_pUpdateQueue.push(A);setTimeout("SL4B_Accessor.getRttpProvider().dequeueUpdates()",0);} function SL_OY(){var l_oQueue=this.m_pUpdateQueue.shift(); l_oQueue.doAllUpdates();} function SL_FO(A){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_WARNING_CONNECTION_EVENT,A));} function SL_AA(A){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_INFO_CONNECTION_EVENT,A));} function SL_BU(C,A,B){if(!this.m_bConnectionEstablished){this.m_bConnectionEstablished=true;setTimeout("SL4B_Accessor.getRttpProvider().connected();",0);}C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_OK_CONNECTION_EVENT,C,A,B));} function SL_FY(A,B){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_MESSAGE_CONNECTION_EVENT,A,B));} function SL_JC(){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_ERROR_CONNECTION_EVENT));} function SL_GY(A,D,B,C){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SERVICE_MESSAGE_CONNECTION_EVENT,A,D,B,C));} function SL_GF(A,B){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SESSION_EJECTED_CONNECTION_EVENT,A,B));} function SL_KI(A,C,D,B){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SOURCE_MESSAGE_CONNECTION_EVENT,A,C,D,B));} function SL_AT(A,D,E,B,C){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_STATISTICS_CONNECTION_EVENT,A,D,E,B,C));} function WTAppletLoaded(){setTimeout("SL4B_Accessor.getRttpProvider().rttpAppletDownloadComplete()",0);} function WTWrapper(){eval(arguments[0]+"."+arguments[1]+"(arguments[2], arguments[3])");} function WTQueue(A){SL4B_Accessor.getRttpProvider().queueUpdates(A);} function AppletCheckLoaded(){setTimeout("SL4B_Accessor.getRttpProvider().appletCheckDownloadComplete()",0);} var SL4B_AppletRttpProvider=function(){}; if(false){function SL4B_AppletRttpProvider(){} }SL4B_AppletRttpProvider = function(A){this.m_oLiberatorConfiguration=A;var l_sAppletUrl=SL4B_Accessor.getConfiguration().getAppletUrl(); if(l_sAppletUrl==null){var l_oConnectionData=this.m_oLiberatorConfiguration.peekAtNextConnection(); l_sAppletUrl=((l_oConnectionData==null) ? "" : l_oConnectionData.getServerUrl())+"/"+SL4B_Accessor.getConfiguration().getAppletPath();}this.m_sAppletDirectoryUrl=l_sAppletUrl;}; SL4B_AppletRttpProvider.prototype = new SL4B_AbstractJavaRttpProvider;SL4B_AppletRttpProvider.prototype.initialise = SL_KC;SL4B_AppletRttpProvider.prototype.loadUrlCheck = SL_GT;SL4B_AppletRttpProvider.prototype.loadAppletCheck = SL_OC;SL4B_AppletRttpProvider.prototype.loadRttpApplet = SL_KP;function SL_KC(){this.loadUrlCheck();this.loadAppletCheck();this.loadRttpApplet();} function SL_GT(){SL4B_ScriptLoader.loadScript(this.m_sAppletDirectoryUrl+"/urlcheck.js?"+(new Date()).valueOf());SL4B_ScriptLoader.loadSl4bScript("applet-rttp-provider/js-check-file-loaded.js");} function SL_OC(){var l_sHtml="";this.startRttpAppletTimeout();this.writeAppletToDocument(l_sHtml);} var SL4B_AbstractObjectRttpProvider=function(){}; if(false){function SL4B_AbstractObjectRttpProvider(){} }SL4B_AbstractObjectRttpProvider = function(A){SL4B_AbstractRttpProvider.apply(this);this.m_oLiberatorConfiguration=A;}; function SL_GI(){SL4B_AbstractObjectRttpProvider.prototype = new SL4B_AbstractRttpProvider;} var SL4B_JavaScriptRttpProviderConstants = new function(){this.const_TYPE_PARAMETER="type";this.const_DOMAIN_PARAMETER="domain";this.const_URL_PARAMETER="url";this.const_UNIQUEID_PARAMETER="uniqueid";this.const_MAX_GET_LENGTH_PARAMETER="maxget";this.const_INIT_PARAMETER="init";this.const_TYPE4_PARAMETER="type4";this.const_REQUEST_TYPE="request";this.const_RESPONSE_TYPE="response";}; var SL4B_RttpCodes = new function(){this.const_REQUEST_ACK=0;this.const_CONNECT_OK=1;this.const_FIELD_MAP=50;this.const_SESSION_EJECTED=90;this.const_LOGIN_OK=101;this.const_RECON_OK=111;this.const_RESP_UNKNOWN=200;this.const_DIRECTORY_RESP=220;this.const_PAGE_RESP=221;this.const_RECORD_RESP=222;this.const_NEWS_RESP=223;this.const_STORY_RESP=224;this.const_CHAT_RESP=227;this.const_CONT_RESP=228;this.const_AUTODIR_RESP=229;this.const_PERM_RESP=230;this.const_CONTRIB_OK=301;this.const_DISCARD_OK=302;this.const_CREATE_OK=303;this.const_DELETE_OK=304;this.const_NOOP_OK=305;this.const_LOGOUT_OK=306;this.const_THROTTLE_OK=307;this.const_SYNC_OK=309;this.const_CONTRIB_WAIT=311;this.const_CONTRIB_OK_DELAY=351;this.const_OBJECT_UPDATES=400;this.const_STATUS_OK=415;this.const_STATUS_STALE=416;this.const_STATUS_LIMITED=417;this.const_STATUS_REMOVED=418;this.const_STATUS_INFO=419;this.const_DIR_UPD=420;this.const_PAGE_UPD=421;this.const_REC1_UPD=422;this.const_NEWS_UPD=423;this.const_STORY_UPD=424;this.const_REC2_UPD=425;this.const_REC3_UPD=426;this.const_CHAT_UPD=427;this.const_CONT_UPD=428;this.const_AUTODIR_UPD=429;this.const_PERM_UPD=430;this.const_PERM_IMG=450;this.const_PERM_CLR=470;this.const_REC1_IMG=472;this.const_NEWS_IMG=473;this.const_STORY_IMG=474;this.const_REC2_IMG=475;this.const_REC3_IMG=476;this.const_CONT_IMG=478;this.const_AUTODIR_IMG=479;this.const_REC1_CLR=482;this.const_NEWS_CLR=463;this.const_REC2_CLR=485;this.const_REC3_CLR=486;this.const_PERM_DEL=490;this.const_REC1_DEL=492;this.const_REC2_DEL=495;this.const_REC3_DEL=496;this.const_MISC_HEARTBEAT=501;this.const_INIT_HEARTBEAT=502;this.const_SOURCE_UP=511;this.const_SOURCE_DOWN=512;this.const_SOURCE_WARN=513;this.const_SERVICE_OK=515;this.const_SERVICE_DOWN=516;this.const_SERVICE_LIMITED=517;this.const_STATUS_MSG=520;this.const_WARNING_MSG=530;this.const_ERROR_MSG=540;this.const_NOT_FOUND_DELAY=550;this.const_READ_DENY_DELAY=560;this.const_WRITE_DENY_DELAY=570;this.const_UNAVAILABLE_DELAY=580;this.const_INVALID_PARAMETERS=581;this.const_DELETED_DELAY=590;this.const_NOT_FOUND=600;this.const_READ_DENY=610;this.const_WRITE_DENY=620;this.const_UNAVAILABLE=630;this.const_INVALID_PARAMETERS_DELAY=631;this.const_CONTRIB_FAILED=650;this.const_THROTTLE_FAILED=660;this.const_THROTTLE_UP_FAILED=661;this.const_THROTTLE_DOWN_FAILED=662;this.const_THROTTLE_MIN_FAILED=663;this.const_THROTTLE_MAX_FAILED=664;this.const_THROTTLE_STOP_FAILED=665;this.const_THROTTLE_START_FAILED=666;this.const_THROTTLE_DEF_FAILED=667;this.const_THROTTLE_NL_FAILED=668;this.const_LOGIN_FAILURES=700;this.const_INVALID_USER=701;this.const_INVALID_PASS=702;this.const_INVALID_IP=703;this.const_ACCT_EXPIRED=704;this.const_ALREADY_LOGGED_IN=705;this.const_LICENSE_SITE=711;this.const_LICENSE_USER=712;this.const_GOTO_URL=721;this.const_AUTH_ERROR_STR=731;this.const_NOT_LOGGED_IN=800;this.const_REQUEST_ERROR=810;this.const_INVALID_REQUEST=811;this.const_SERVER_ERROR=820;this.const_INVALID_SESSION_ID=832;this.const_MULTI_RESPONSE=900;this.isResponseCode = function(A){return ((A>=this.const_LOGIN_OK&&A=this.const_NOT_FOUND&&A=this.const_NOT_LOGGED_IN&&A=this.const_DIRECTORY_RESP&&A=this.const_REC1_IMG&&A<=this.const_AUTODIR_IMG)||(A>=this.const_PERM_IMG&&A=this.const_CONTRIB_OK_DELAY&&A=this.const_NOT_FOUND_DELAY&&A=this.const_CONTRIB_OK_DELAY&&A=this.const_NOT_FOUND_DELAY&&A1){this.mParameters[pKeyval[0]]=pKeyval[1];}else {this.pFields.push(pKeyval[0]);}}}}; SL4B_RequestRecord.prototype.getObjectName = function(){return this.sObjectName; }; SL4B_RequestRecord.prototype.getParameters = function(){return this.mParameters; }; SL4B_RequestRecord.prototype.getFields = function(){return this.pFields; }; SL4B_RequestRecord.prototype.getFilterContent = function(A){var result={}; if(A!==null&&A!==undefined&&A.length>0){var filterStart=A.indexOf(';'); if(filterStart>=0){var filterMsg=A.substring(filterStart+1); while(filterMsg!=""){filterMsg=this.getNextNameValuePair(filterMsg,result);}}}return result; }; SL4B_RequestRecord.prototype.getMessage = function(){return this.sMessage; }; SL4B_RequestRecord.prototype.getOriginalMessage = function(){return this.oOriginalMessage; }; SL4B_RequestRecord.prototype.getListener = function(){return this.oListener; }; SL4B_RequestRecord.prototype.isHighPriority = function(){return this.bHighPriority; }; SL4B_RequestRecord.prototype.getContext = function(){return this.oContext; }; SL4B_RequestRecord.prototype.toString = function(){return "{RequestRecord: "+this.sMessage+" "+this.oOriginalMessage+" "+this.oListener+" "+this.bHighPriority+" "+this.oContext+"}"; }; var SL4B_ManagedConnection=function(){}; if(false){function SL4B_ManagedConnection(){} }SL4B_ManagedConnection = function(){this.CLASS_NAME="SL4B_ManagedConnection";this.m_pRequestQueue=new Array();this.m_pPriorityRequestQueue=new Array();this.m_pResponseQueue=new Array();this.m_mObjectNumberToRequestRecord=new Object();this.m_pMessagingListeners=new Array();this.m_oSystemEventReceiverRecord=null;this.m_oObjectNumberMap=new SL4B_ObjectNumberMap(this);this.m_oConnectionManager=null;this.m_sSessionId=null;}; SL4B_ManagedConnection.MESSAGES={REQUEST_CONFLICT:"{0}: Conflict between message listeners for object number {1}. Two different listeners have been registered to process the message.", UNEXPECTED_RESPONSE:"{0}: Received response when none were expected. message={1}", UNKNOWN_OBJECT_NUMBER:"{0}: Received update for an unknown object number. message={1}", IGNORING_RESPONSE_QUEUE:"{0}: ignoring expected response queue queue for message={1}", RESPONSE_QUEUED:"{0}: queued expected response for message={1}", RESPONSE_DEQUEUED:"{0}: dequeued reponse for message={1}, response={2}", ADDED_OBJECT_NUMBER_EVENT_LISTENER:"{0}: Added event listener for object number {1}", REMOVED_OBJECT_NUMBER_EVENT_LISTENER:"{0}: Removed event listener for object number {1}", CLEARING_STATE:"{0}: Clearing state.", INCOMING_MESSAGES_EXPECTED_AFTER_LOGIN:"{0}: The expected incoming should be empty immediately after receiving a login, but instead has {1} messages. First message is '{2}'", QUEUED_HIGH_PRIORITY_MESSAGE:"{0}: Queued high priority message {1}", QUEUED_MESSAGE:"{0}: Queued message {1}", SESSION_ID_NULL_FOR_HIGH_PRIORITY_MESSAGE:"{0}: Session id is null, cannot send high priority message {1} at the moment", SESSION_ID_NULL_FOR_MESSAGE:"{0}: Session id is null, cannot send message {1} at the moment", DONT_SEND_NEXT_MESSAGE:"{0}: Didn't send next message - {1}"};SL4B_ManagedConnection.prototype._$setConnectionManager = function(A){this.m_oConnectionManager=A;}; SL4B_ManagedConnection.prototype.sendMessage = function(A,B,C){this._sendPriorityMessage(A,B,false,C);}; SL4B_ManagedConnection.prototype.setSystemEventReceiver = function(A){this.m_oSystemEventReceiverRecord=new SL4B_RequestRecord(null,null,A,false,null);}; SL4B_ManagedConnection.prototype._setSessionId = function(A){this.m_sSessionId=A;SL4B_Logger.logConnectionMessage(true,"Session Id: {0}",this.m_sSessionId);}; SL4B_ManagedConnection.prototype._getSessionId = function(){return this.m_sSessionId; }; SL4B_ManagedConnection.prototype._hasSessionId = function(){return this.m_sSessionId!==null; }; SL4B_ManagedConnection.prototype.notifyMessagingListenersSent = function(){for(var i=0;i0){oMsgRecord=this.m_pResponseQueue.shift();this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.RESPONSE_DEQUEUED,"_getNextResponseListener",oMsgRecord,A.toString());oListener=oMsgRecord.getListener();if(nObjectNumber!==null){this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.ADDED_OBJECT_NUMBER_EVENT_LISTENER,"_getNextResponseListener",nObjectNumber);var oOrigRecord=this.m_mObjectNumberToRequestRecord[nObjectNumber]; if(oOrigRecord!==undefined&&oOrigRecord.getListener()!==oMsgRecord.getListener()){this._log(SL4B_DebugLevel.const_WARN_INT,SL4B_ManagedConnection.MESSAGES.REQUEST_CONFLICT,"_getNextResponseListener",nObjectNumber);}else {this.m_mObjectNumberToRequestRecord[nObjectNumber]=oMsgRecord;}}}else {this._log(SL4B_DebugLevel.const_ERROR_INT,SL4B_ManagedConnection.MESSAGES.UNEXPECTED_RESPONSE,"_getNextResponseListener",A);this._triggerReconnect("Received response when none was expected",true);return null; }return oMsgRecord; }; SL4B_ManagedConnection.prototype._triggerReconnect = function(A,B){SL4B_Accessor.getUnderlyingRttpProvider().createConnectionLost(A,B);}; SL4B_ManagedConnection.prototype._$isFullReconnectRequired = function(){var bFullReconnect=false; for(var i=0,nLength=this.m_pResponseQueue.length;i0){this._log(SL4B_DebugLevel.const_WARN_INT,SL4B_ManagedConnection.MESSAGES.INCOMING_MESSAGES_EXPECTED_AFTER_LOGIN,"clear",this.m_pResponseQueue.length,this.m_pResponseQueue[0]);}this.m_pResponseQueue=new Array();this.m_mObjectNumberToRequestRecord=new Object();}; SL4B_ManagedConnection.prototype._sendPriorityMessage = function(A,B,D,C){if(B==null){throw new SL4B_Exception("SL4B_ManagedConnection._sendPriorityMessage: Listener may not be null or undefined."); }if(B.receiveMessage==null){throw new SL4B_Exception("SL4B_ManagedConnection._sendPriorityMessage: Listener must implement receiveMessage."); }var oMsgRecord=new SL4B_RequestRecord(A,null,B,D,C); if(D){this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.QUEUED_HIGH_PRIORITY_MESSAGE,"_sendPriorityMessage",A);this.m_pPriorityRequestQueue.push(oMsgRecord);}else {this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.QUEUED_MESSAGE,"_sendPriorityMessage",A);this.m_pRequestQueue.push(oMsgRecord);}this._sendNextRttpMessage();}; SL4B_ManagedConnection.prototype._sendNextRttpMessage = function(){if(this.m_oConnectionManager.readyToRequest()&&this._hasMessages()){if(this.m_sSessionId!==null){var oMsgRecord=this._dequeueMessage(); if(oMsgRecord===null){this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.DONT_SEND_NEXT_MESSAGE,"_sendNextRttpMessage","not logged in");return; }this.m_oConnectionManager.makingRequest();if(oMsgRecord.getListener()!==SL4B_ManagedConnection.NO_RESPONSE_EXPECTED_MESSAGE_RECEIVER){this._addResponses(oMsgRecord);}else {this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.IGNORING_RESPONSE_QUEUE,"_sendNextRttpMessage",oMsgRecord);}var sMsg=oMsgRecord.getMessage(); if(sMsg=="SYNC"){sMsg=this.m_oConnectionManager.getConnectionProxy().getNextSyncMessage();}this._sendRttpMessage(sMsg);}else {if(this.m_pPriorityRequestQueue.length>0){this._log(SL4B_DebugLevel.const_ERROR_INT,SL4B_ManagedConnection.MESSAGES.SESSION_ID_NULL_FOR_HIGH_PRIORITY_MESSAGE,"_sendNextRttpMessage",this.m_pPriorityRequestQueue[0]);}else {this._log(SL4B_DebugLevel.const_ERROR_INT,SL4B_ManagedConnection.MESSAGES.SESSION_ID_NULL_FOR_MESSAGE,"_sendNextRttpMessage",this.m_pRequestQueue[0]);}}}else {var sMessage; if(!this._hasMessages()){sMessage="no messages remaining in queue";}else {sMessage="an acknowledgement for the last message has not been received";}this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.DONT_SEND_NEXT_MESSAGE,"_sendNextRttpMessage",sMessage);}}; SL4B_ManagedConnection.prototype._sendRttpMessage = function(A){var l_sFullRttpMessage=this.m_sSessionId+((A=="") ? "" : (" "+A)); SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"> {0}",l_sFullRttpMessage);this.m_oConnectionManager.getConnectionProxy().send(GF_RequestEncoder.encodeUrl(l_sFullRttpMessage));this.notifyMessagingListenersSent();}; SL4B_ManagedConnection.prototype._addResponse = function(A){this._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.RESPONSE_QUEUED,"_addResponse",A);this.m_pResponseQueue.push(A);}; SL4B_ManagedConnection.prototype._addResponses = function(A){var sMsg=A.getMessage(); var nEndOfCommand=sMsg.indexOf(" "); if(nEndOfCommand>0){var sCommand=sMsg.substring(0,nEndOfCommand); if(this._mayHaveMultipleObjects(sCommand)){var pObjects=sMsg.substring(nEndOfCommand+1).split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); var start=0; if(pObjects[0].substr(0,1)==";"){start=1;}for(var i=start,len=pObjects.length;i0){oMsgRecord=this.m_pPriorityRequestQueue.shift();}else if(this.m_oConnectionManager.isLoggedIn()){oMsgRecord=this.m_pRequestQueue.shift();}return oMsgRecord; }; SL4B_ManagedConnection.prototype._hasMessages = function(){return this.m_pPriorityRequestQueue.length>0||this.m_pRequestQueue.length>0; }; SL4B_ManagedConnection.prototype._log = function(B,A){arguments[1]="SL4B_ManagedConnection."+arguments[1];SL4B_Logger.log.apply(SL4B_Logger,arguments);}; SL4B_ManagedConnection.NULL_MESSAGE_RECEIVER = function(){}; SL4B_ManagedConnection.NULL_MESSAGE_RECEIVER = new function(){this.receiveMessage = function(){}; }; SL4B_ManagedConnection.NO_RESPONSE_EXPECTED_MESSAGE_RECEIVER = function(){}; SL4B_ManagedConnection.NO_RESPONSE_EXPECTED_MESSAGE_RECEIVER = new function(){this.receiveMessage = function(){}; }; function SL4B_ObjectNumberMap(A){this.m_oManagedConnection=A;this.m_oMsgRecord=null;} SL4B_ObjectNumberMap.prototype._setMsgRecord = function(A){this.m_oMsgRecord=A;}; SL4B_ObjectNumberMap.prototype.addObjectNumber = function(A){this.m_oManagedConnection._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.ADDED_OBJECT_NUMBER_EVENT_LISTENER,"SL4B_ObjectNumberMap.addObjectNumber",A);this.m_oManagedConnection.m_mObjectNumberToRequestRecord[A]=this.m_oMsgRecord;}; SL4B_ObjectNumberMap.prototype.removeObjectNumber = function(A){this.m_oManagedConnection._log(SL4B_DebugLevel.const_RTTP_FINEST_INT,SL4B_ManagedConnection.MESSAGES.REMOVED_OBJECT_NUMBER_EVENT_LISTENER,"SL4B_ObjectNumberMap.removeObjectNumber",A);delete this.m_oManagedConnection.m_mObjectNumberToRequestRecord[A];}; var SL4B_AbstractConnection=function(){}; if(false){function SL4B_AbstractConnection(){} }SL4B_AbstractConnection = function(){this.CLASS_NAME="SL4B_AbstractConnection";this.m_oRttpProvider=null;this.m_sUrlPrefix="";this.m_oResponseHttpRequest=null;this.m_sResponseUniqueId=null;this.m_sRequestUniqueId=null;this.m_oRequestHttpRequest=null;this.m_oMessageReceiver=null;this.m_sLastSequenceNumber="";this.m_oRttpMessage=null;this.m_bConnectionStopped=false;}; SL4B_AbstractConnection.prototype.initialise = function(A,B){this.m_oRttpProvider=A;this.m_sUrlPrefix=B;this.m_oResponseHttpRequest=null;this.m_oRequestHttpRequest=null;this.m_oRttpMessage=new SL4B_RttpMessage();this.m_oMessageReceiver=null;}; SL4B_AbstractConnection.prototype.toString = function(){return "AbstractConnection(url = "+this.m_sUrlPrefix+")"; }; SL4B_AbstractConnection.prototype.connect = function(){throw new SL4B_Error("connect method not implemented"); }; SL4B_AbstractConnection.prototype.send = SL_IS;SL4B_AbstractConnection.prototype.setRequestHttpRequest = SL_JF;SL4B_AbstractConnection.prototype.setResponseHttpRequest = SL_MB;SL4B_AbstractConnection.prototype.getLastSequenceNumber = function(){return this.m_sLastSequenceNumber; }; SL4B_AbstractConnection.prototype.start = function(){throw new SL4B_Error("start method not implemented"); }; SL4B_AbstractConnection.prototype.stop = function(){this.m_bConnectionStopped=true;}; SL4B_AbstractConnection.prototype.setMessageReceiver = SL_QE;SL4B_AbstractConnection.prototype.parseRttpMessage = SL_OM;SL4B_AbstractConnection.prototype.createChannel = SL_PR;SL4B_AbstractConnection.prototype.createStandardRequestChannel = SL_LB;SL4B_AbstractConnection.prototype.createStandardResponseChannel = SL_HY;SL4B_AbstractConnection.prototype.getResponseUniqueId = SL_PY;SL4B_AbstractConnection.prototype.getRequestUniqueId = SL_OO;function SL_PY(){return this.m_sResponseUniqueId; } function SL_OO(){return this.m_sRequestUniqueId; } function SL_IS(A){if(!this.m_bConnectionStopped){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"AbstractConnection.send({0}?{1})",this.m_sUrlPrefix,A); try {this.m_oRequestHttpRequest.send(this.m_sUrlPrefix+"?"+A);}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"AbstractConnection.send: failed to send \"{0}\" due to exception {1}",A,e);} }} function SL_MB(A){this.m_oResponseHttpRequest=A;} function SL_JF(A){this.m_oRequestHttpRequest=A;} function SL_QE(A){if(A!==null&&typeof A.receiveMessage!="function"){throw new SL4B_Exception("Specified listener does not define the receiveMessage method"); }this.m_oMessageReceiver=A;} function SL_OM(A){if(A.rttpcode){l_oJsonMessage=A;SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"< {0}",l_oJsonMessage.origmsg);if(this.m_oMessageReceiver!==null){SL4B_MethodInvocationProxy.invoke(this.m_oMessageReceiver,"receiveMessage",[l_oJsonMessage]);}if(l_oJsonMessage.seqnum!=null){this.m_sLastSequenceNumber=l_oJsonMessage.seqnum;}return; }if(!this.m_bConnectionStopped){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"AbstractConnection.parseRttpMessage({0})",A);if(A.charAt(0)=="<"&&A.match(/\s*\s*\n*\s*404 Not Found<\/TITLE>/i)){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"AbstractConnection.parseRttpMessage: 404 response received from Liberator - user session has probably timed out");this.m_oRttpProvider.createConnectionLost("404 response received-probable Session Timeout",false);}else {var l_pMessageLines=A.split("\n"); for(var l_nLine=0,l_nSize=l_pMessageLines.length;l_nLine<l_nSize;++l_nLine){if(l_pMessageLines[l_nLine]!=""){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"< {0}",l_pMessageLines[l_nLine]);if(l_pMessageLines[l_nLine].substr(0,2)=="4r"){ try {SL4B_ConnectionProxy.getInstance().receiveSync(A);}catch(e){SL4B_Accessor.getExceptionHandler().processException(e);} }else {var l_bMessageSet=false; try {l_nLine=this.m_oRttpMessage.setMessage(l_pMessageLines,l_nLine);l_bMessageSet=true;}catch(e){SL4B_Accessor.getExceptionHandler().processException(e);} if(this.m_oRttpMessage.isMessageComplete()&&l_bMessageSet){if(this.m_oMessageReceiver!==null){SL4B_MethodInvocationProxy.invoke(this.m_oMessageReceiver,"receiveMessage",[this.m_oRttpMessage]);}if(this.m_oRttpMessage.m_sSequenceNumber!=null){this.m_sLastSequenceNumber=this.m_oRttpMessage.m_sSequenceNumber;}}}}}}}} function SL_PR(B,A){C_CallbackQueue.addCallback(new Array(SL4B_Accessor.getUnderlyingRttpProvider(),"notifyConnectionListeners",this.m_oRttpProvider.const_INFO_CONNECTION_EVENT,"Establishing "+B.replace(/^frm/,"").toLowerCase()+" channel (URL: "+A+")"));var l_sUniqueId=(new Date()).valueOf(); var l_sCommonDomain=SL4B_Accessor.getConfiguration().getCommonDomain(); if(l_sCommonDomain!=null){A+="&"+SL4B_JavaScriptRttpProviderConstants.const_DOMAIN_PARAMETER+"="+l_sCommonDomain;}A+="&"+SL4B_JavaScriptRttpProviderConstants.const_UNIQUEID_PARAMETER+"="+l_sUniqueId;A+="&"+SL4B_JavaScriptRttpProviderConstants.const_MAX_GET_LENGTH_PARAMETER+"="+SL4B_Accessor.getConfiguration().getMaxGetLength();C_LiberatorUrlCheck.getLiberatorUrlCheck(B).loadUrl(A,this.m_oRttpProvider.getJsContainerUrl());return l_sUniqueId; } function SL_LB(){var l_sUrlPrefix=this.m_oRttpProvider.getJsContainerUrl()+"/"; var l_sRequestFrameUrl=l_sUrlPrefix+SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_URL; l_sRequestFrameUrl+="&"+SL4B_JavaScriptRttpProviderConstants.const_INIT_PARAMETER+"=true";this.m_sRequestUniqueId=this.createChannel(SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_ID,l_sRequestFrameUrl);} function SL_HY(){var l_sUrlPrefix=this.m_oRttpProvider.getJsContainerUrl()+"/"; var l_sResponseFrameUrl=l_sUrlPrefix+SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_URL; l_sResponseFrameUrl+="&"+SL4B_JavaScriptRttpProviderConstants.const_INIT_PARAMETER+"=true";this.m_sResponseUniqueId=this.createChannel(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID,l_sResponseFrameUrl);} function C_LiberatorUrlCheck(A){this.m_sFrameId=A;this.m_sImageId="imgLiberatorCheck_"+A;this.m_nCurrentLiberatorUrlId=null;this.m_oImgRef=null;this.m_mLiberatorIdToLiberatorUrl={};this.createImage();} C_LiberatorUrlCheck.m_nLiberatorUrlUniqueId=0;C_LiberatorUrlCheck.m_pFrameIdToLiberatorUrlCheckMap=new Object();C_LiberatorUrlCheck.createLiberatorUrlCheck = function(A){C_LiberatorUrlCheck.m_pFrameIdToLiberatorUrlCheckMap[A]=new C_LiberatorUrlCheck(A);}; C_LiberatorUrlCheck.getLiberatorUrlCheck = function(A){return C_LiberatorUrlCheck.m_pFrameIdToLiberatorUrlCheckMap[A]; }; C_LiberatorUrlCheck.prototype.createImage = function(){var l_sHtml="<img id=\""+this.m_sImageId+"\" src=\""+SL4B_ScriptLoader.getRootUrl().replace(/\/$/,"")+"/sl4b/javascript-rttp-provider/url-check.gif\" "; l_sHtml+="height=\"1\" width=\"1\" style=\"display: none;\" />";document.write(l_sHtml);this.m_oImgRef=document.getElementById(this.m_sImageId);}; C_LiberatorUrlCheck.prototype.loadUrl = function(B,A){var l_oLiberatorUrl=new SL_OK(B,A); var l_nNextId=C_LiberatorUrlCheck.m_nLiberatorUrlUniqueId++; this.m_nCurrentLiberatorUrlId=l_nNextId;this.m_mLiberatorIdToLiberatorUrl[l_nNextId]=l_oLiberatorUrl;var l_sTestImageUrl=l_oLiberatorUrl.m_sJsContainerUrl+"/url-check.gif?"+((new Date()).valueOf()); SL4B_Logger.logConnectionMessage(true,"LiberatorUrlCheck.testLiberatorIsAvailable [{0}]: Checking Liberator availability: {1}",this.m_sFrameId,l_sTestImageUrl);this.m_oImgRef.onload=C_LiberatorUrlCheck.getLiberatorUrlCheck(this.m_sFrameId).getOnLoadFunction(l_nNextId);this.m_oImgRef.onerror=C_LiberatorUrlCheck.getLiberatorUrlCheck(this.m_sFrameId).getOnErrorFunction(l_nNextId);this.m_oImgRef.src=l_sTestImageUrl;}; C_LiberatorUrlCheck.prototype.getOnLoadFunction = function(A){var oSelf=this; return function(){var l_oLiberatorUrl=oSelf.m_mLiberatorIdToLiberatorUrl[A]; if(A===oSelf.m_nCurrentLiberatorUrlId){SL4B_Logger.logConnectionMessage(true,"LiberatorUrlCheck.onLoad[{0}]: Liberator available, loading: {1}",oSelf.m_sFrameId,l_oLiberatorUrl.m_sUrl);var l_oFrameWindow=SL4B_Accessor.getBrowserAdapter().getFrameWindow(oSelf.m_sFrameId); l_oFrameWindow.location.replace(l_oLiberatorUrl.m_sUrl);}else {SL4B_Logger.logConnectionMessage(true,"LiberatorUrlCheck.onLoad[{0}]: Received unexpected onload event, {1}, {2}",oSelf.m_sFrameId,l_oLiberatorUrl.m_sUrl,A);}}; }; C_LiberatorUrlCheck.prototype.getOnErrorFunction = function(A){var oSelf=this; return function(){if(A===oSelf.m_nCurrentLiberatorUrlId){SL4B_Logger.logConnectionMessage(true,"LiberatorUrlCheck.onError[{0}]: Liberator unavailable",oSelf.m_sFrameId);}else {SL4B_Logger.logConnectionMessage(true,"LiberatorUrlCheck.onError[{0}]: Received unexpected onerror event, {1}",oSelf.m_sFrameId,A);}}; }; function SL_OK(B,A){this.m_sUrl=B;this.m_sJsContainerUrl=A;} var SL4B_CacheEntry=function(){}; if(false){function SL4B_CacheEntry(){} }SL4B_CacheEntry = function(){this.m_pFieldList=new Object();this.m_bAllFields=false;this.m_oObjectStatus=GF_CachedObjectStatus.const_SUBSCRIBING;}; SL4B_CacheEntry.prototype.addFields = SL4B_CacheEntry_AddFields;function SL4B_CacheEntry_AddFields(A){var l_sFieldsToRequest=null; if(!this.m_bAllFields){if(A==""||A==null||typeof A=="undefined"){this.m_bAllFields=true;l_sFieldsToRequest="";}else {var l_pFields=A.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){if(typeof this.m_pFieldList[l_pFields[l_nField]]=="undefined"){this.m_pFieldList[l_pFields[l_nField]]=true;if(l_sFieldsToRequest==null){l_sFieldsToRequest=l_pFields[l_nField];}else {l_sFieldsToRequest+=SL4B_ObjectCache.const_FIELD_NAME_DELIMITER+l_pFields[l_nField];}}}}}return l_sFieldsToRequest; } SL4B_CacheEntry.prototype.setObjectStatus = function(B,A,C){this.m_oObjectStatus=new GF_CachedObjectStatus(B,A,C);}; SL4B_CacheEntry.prototype.getObjectStatus = function(){return this.m_oObjectStatus; }; SL4B_CacheEntry.prototype.sendCurrentObjectStatus = function(C,A,B){C.objectStatusForListener(A,this.m_oObjectStatus.m_nType,this.m_oObjectStatus.m_nCode,this.m_oObjectStatus.m_sMessage,B);}; var SL4B_ConnectionProxy=function(){this.CLASS_NAME="SL4B_ConnectionProxy";this.m_sConnectionState=SL4B_ConnectionProxy.const_CONNECTION_STATE_INITIALISING;this.m_oConnection=null;this.m_oMessageReceiver=null;this.m_nSyncTimeoutId=-1;this.m_nT1=0;this.m_nBestRoundTrip=9999999;this.m_nClockOffset=null;this.m_nBestClockOffset=null;this.m_nBatchCount=0;this.m_nLastMessageReceivedTime=0;this.m_nLatency=0;this.m_nLatencySum=0;this.m_nLatencyCount=0;this.m_nLatencyAverage=-1;}; SL4B_ConnectionProxy.prototype = new SL4B_AbstractConnection;SL4B_ConnectionProxy.prototype.sendSync = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionProxy.sendSync({0})",A);if(A){this.m_nBatchCount=0;this.m_nBestRoundTrip=9999999;if(this.m_nLatencyCount>0){this.m_nLatencyAverage=Math.round(this.m_nLatencySum/this.m_nLatencyCount);SL4B_Accessor.getStatistics().setAverageLatency(this.m_nLatencyAverage);}this.m_nLatencySum=0;this.m_nLatencyCount=0;SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ClockOffset = {0}, Average Latency = {1}",this.m_nClockOffset,this.m_nLatencyAverage);}if(this.m_oConnection!=null){this.m_oConnection.m_oRttpProvider.getManagedConnection().sendMessage("SYNC",SL4B_ManagedConnection.NO_RESPONSE_EXPECTED_MESSAGE_RECEIVER);}}; SL4B_ConnectionProxy.prototype.getNextSyncMessage = function(){this.m_nBatchCount++;var self=this; if(this.m_nBatchCount<SL4B_Accessor.getConfiguration().getClocksyncBatchSize()){this.m_nSyncTimeoutId=setTimeout(function(){return self.sendSync(false); },SL4B_Accessor.getConfiguration().getClocksyncSpacing());}else {this.m_nSyncTimeoutId=setTimeout(function(){return self.sendSync(true); },SL4B_Accessor.getConfiguration().getClocksyncPeriod());}this.m_nT1=this._getTime();var l_nClockOffset=this.m_nClockOffset; if(l_nClockOffset===null){l_nClockOffset=0;}var l_sMessage="SYNC "+this.m_nT1+" "+l_nClockOffset+" "+this.m_nLatencyAverage; return l_sMessage; }; SL4B_ConnectionProxy.prototype.receiveSync = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionProxy.receiveSync({0})",A);var l_nT4=this._getTime(); var l_nRoundtrip=l_nT4-this.m_nT1; if(l_nRoundtrip<this.m_nBestRoundTrip){this.m_nBestRoundTrip=l_nRoundtrip;var l_pTokens=A.split(" "); if(l_pTokens.length==4){var l_nT3=parseInt(l_pTokens[2],10); var l_nT2MinusT1=parseInt(l_pTokens[3],10); this.m_nBestClockOffset=(l_nT2MinusT1-(l_nT4-l_nT3))/2;}}if(this.m_nBatchCount==SL4B_Accessor.getConfiguration().getClocksyncBatchSize()){this.m_nClockOffset=this.m_nBestClockOffset;SL4B_Accessor.getStatistics().setClockOffset(this.m_nClockOffset);}}; SL4B_ConnectionProxy.prototype._getTime = function(){return new Date().getTime(); }; SL4B_ConnectionProxy.prototype.recordLatency = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionProxy.recordLatency({0})",A);var l_nTimeStampServer=parseInt(A,10); if(this.m_nClockOffset!==null&&l_nTimeStampServer!=0){this.m_nLatency=Math.max(0,(this.m_nLastMessageReceivedTime-l_nTimeStampServer+this.m_nClockOffset));this.m_nLatencySum+=this.m_nLatency;this.m_nLatencyCount++;SL4B_Accessor.getStatistics().setLatency(this.m_nLatency);SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Latency: {0}",this.m_nLatency);}}; SL4B_ConnectionProxy.const_CONNECTION_STATE_INITIALISING="initialising";SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTING="connecting";SL4B_ConnectionProxy.const_CONNECTION_STATE_RECONNECTING="reconnecting";SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTED="connected";SL4B_ConnectionProxy.const_CONNECTION_STATE_DISCONNECTED="disconnected";SL4B_ConnectionProxy.m_oInstance=new SL4B_ConnectionProxy();SL4B_ConnectionProxy.getInstance = function(){return SL4B_ConnectionProxy.m_oInstance; }; SL4B_ConnectionProxy.prototype.initialise = function(){}; SL4B_ConnectionProxy.prototype.verifyConnection = function(){if(this.m_oConnection==null){throw new SL4B_Exception("A connection has not been set"); }}; SL4B_ConnectionProxy.prototype.getConnection = function(){return this.m_oConnection; }; SL4B_ConnectionProxy.prototype.isDisconnected = function(){return (this.m_sConnectionState==SL4B_ConnectionProxy.const_CONNECTION_STATE_INITIALISING||this.m_sConnectionState==SL4B_ConnectionProxy.const_CONNECTION_STATE_DISCONNECTED); }; SL4B_ConnectionProxy.prototype.connect = SL_BF;SL4B_ConnectionProxy.prototype.send = SL_EO;SL4B_ConnectionProxy.prototype.setRequestHttpRequest = SL_OQ;SL4B_ConnectionProxy.prototype.setResponseHttpRequest = SL_LI;SL4B_ConnectionProxy.prototype.start = SL_OT;SL4B_ConnectionProxy.prototype.stop = SL_CJ;SL4B_ConnectionProxy.prototype.setMessageReceiver = SL_DI;SL4B_ConnectionProxy.prototype.setConnection = SL_MI;SL4B_ConnectionProxy.prototype.parseRttpMessage = SL_DB;SL4B_ConnectionProxy.prototype.getResponseUniqueId = SL_HP;SL4B_ConnectionProxy.prototype.getRequestUniqueId = SL_KE;function SL_HP(){this.verifyConnection();return this.m_oConnection.getResponseUniqueId(); } function SL_KE(){this.verifyConnection();return this.m_oConnection.getRequestUniqueId(); } SL4B_ConnectionProxy.prototype.getConnectionState = function(){return this.m_sConnectionState; }; SL4B_ConnectionProxy.prototype.setConnectionState = function(A){this.m_sConnectionState=A;}; function SL_BF(){SL4B_Logger.logConnectionMessage(false,"ConnectionProxy.connect()");this.verifyConnection();this.m_oConnection.connect();} function SL_EO(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionProxy.send({0})",A);this.verifyConnection();this.m_oConnection.send(A);} function SL_OQ(B,A){ try {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionProxy.setRequestHttpRequest({0}) - {1}",A,this.getRequestUniqueId());if(A==this.getRequestUniqueId()){this.verifyConnection();this.m_oConnection.setRequestHttpRequest(B);this.m_oConnection.m_oRttpProvider.requestHttpRequestReady();}}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionProxy.setRequestHttpRequest: exception caught: {0}",e);} } function SL_LI(B,A){ try {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionProxy.setResponseHttpRequest({0}) - {1}",A,this.getResponseUniqueId());if(A==this.getResponseUniqueId()){this.verifyConnection();this.m_oConnection.setResponseHttpRequest(B);this.m_oConnection.m_oRttpProvider.responseHttpRequestReady();}}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionProxy.setResponseHttpRequest: exception caught: {0}",e);} } function SL_OT(){SL4B_Logger.logConnectionMessage(false,"ConnectionProxy.start()");this.verifyConnection();this.m_oConnection.start();} function SL_CJ(){this.verifyConnection();this.setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_DISCONNECTED);this.m_oConnection.stop();if(this.m_nSyncTimeoutId!=-1){clearTimeout(this.m_nSyncTimeoutId);this.m_nSyncTimeoutId=-1;}} function SL_DI(A){if(A!==null&&typeof A.receiveMessage!="function"){throw new SL4B_Exception("Specified listener does not define the receiveMessage method"); }this.m_oMessageReceiver=A;if(this.m_oConnection!=null){this.m_oConnection.setMessageReceiver(A);}} function SL_MI(A){if(this.m_oConnection!=null){this.m_oConnection.stop();if(this.m_nSyncTimeoutId!=-1){clearTimeout(this.m_nSyncTimeoutId);this.m_nSyncTimeoutId=-1;}}SL4B_Logger.logConnectionMessage(false,"ConnectionProxy.setConnection: {0}",A);this.m_oConnection=A;this.m_oConnection.setMessageReceiver(this.m_oMessageReceiver);} function SL_DB(A){if(this.m_oConnection!=null){this.m_nLastMessageReceivedTime=this._getTime();this.m_oConnection.parseRttpMessage(A);}else {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionProxy.parseRttpMessage: RTTP message \"{0}\" received, but underlying connection is null",A);}} var SL4B_ObjectCache=function(){}; if(false){function SL4B_ObjectCache(){} }SL4B_ObjectCache = function(B,A){this.CLASS_NAME="SL4B_ObjectCache";this.m_oRttpProvider=B;this.m_oSubscriptionManager=A;A.setObjectCache(this);this.m_pObjects=new Object();this.m_pObjectDataCache=new Object();this.m_pObjectDataCacheType2=new Object();this.m_pObjectDataCacheType3=new Object();this.m_pObjectNumberToObjectKeyMap=new Object();this.m_pDirectoryCache=new Object();this.m_pStoryCache=new Object();this.m_mChatCache=new Object();this.m_bIsFireFox1_0=SL4B_Accessor.getBrowserAdapter().isFirefox()&&SL4B_Accessor.getBrowserAdapter().getBrowserVersion().indexOf("1.0")==0;this.m_nMaxRequestDiscardLength=800;this.m_pContainerCache=new Object();this.m_pNewsHeadlineCache=new Object();this.m_pPermissionCache=new Object();}; SL4B_ObjectCache.const_FIELD_NAME_DELIMITER=",";SL4B_ObjectCache.const_OBJECT_NAME_AND_FIELD_LIST_DELIMITER=";";SL4B_ObjectCache.const_BLANK_STRING="";SL4B_ObjectCache.prototype.receiveMessage = SL_QB;SL4B_ObjectCache.prototype.processRttpMessage = SL4B_ObjectCache.prototype.receiveMessage;SL4B_ObjectCache.prototype.requestObject = SL_EB;SL4B_ObjectCache.prototype.sendCachedFields = SL_DR;SL4B_ObjectCache.prototype.requestObjects = SL_EI;SL4B_ObjectCache.prototype.discardObject = SL_HJ;SL4B_ObjectCache.prototype.discardObjects = SL_OA;SL4B_ObjectCache.prototype.cacheObject = SL_JA;SL4B_ObjectCache.prototype.cacheType1Record = SL_DL;SL4B_ObjectCache.prototype.cacheType2Record = SL_OL;SL4B_ObjectCache.prototype.cacheType3Record = SL_PE;SL4B_ObjectCache.prototype.deleteType2RecordLevel = SL_RJ;SL4B_ObjectCache.prototype.type2Clear = SL_EV;SL4B_ObjectCache.prototype.type3Clear = SL_PK;SL4B_ObjectCache.prototype.notFound = SL_DY;SL4B_ObjectCache.prototype.cacheDirectory = SL_AP;SL4B_ObjectCache.prototype.statusUpdated = SL_PZ;SL4B_ObjectCache.prototype.sendObjectAction = SL_PN;SL4B_ObjectCache.prototype.createObjectArray = SL_EC;SL4B_ObjectCache.prototype.cacheContainer = SL_RI;SL4B_ObjectCache.prototype.cacheNewsHeadline = SL_DM;SL4B_ObjectCache.prototype.cacheNewsStory = SL_QI;SL4B_ObjectCache.prototype.cachePermission = SL_OG;SL4B_ObjectCache.prototype.clearPermission = SL_LO;SL4B_ObjectCache.prototype.deletePermissionEntry = SL_CB;SL4B_ObjectCache.prototype.parseOrderChanges = SL_IZ;SL4B_ObjectCache.prototype.isActive = SL_DQ;SL4B_ObjectCache.prototype.clear = function(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.clear()");this.m_pObjects=new Object();this.m_pObjectDataCache=new Object();this.m_pObjectDataCacheType2=new Object();this.m_pObjectDataCacheType3=new Object();this.m_pObjectNumberToObjectKeyMap=new Object();this.m_pDirectoryCache=new Object();this.m_pStoryCache=new Object();this.m_pNewsHeadlineCache=new Object();this.m_pContainerCache=new Object();this.m_pPermissionCache=new Object();this.m_mChatCache=new Object();}; function SL_QB(C,A,B){if(C.rttpcode){var l_oJsonMessage=C; this.cacheObject(l_oJsonMessage,A,B);return; }var l_nRttpCode=C.getRttpCode(); switch(l_nRttpCode){ case SL4B_RttpCodes.const_RECORD_RESP:case SL4B_RttpCodes.const_RESP_UNKNOWN:case SL4B_RttpCodes.const_REC1_UPD:case SL4B_RttpCodes.const_REC1_IMG:case SL4B_RttpCodes.const_REC2_UPD:case SL4B_RttpCodes.const_REC2_IMG:case SL4B_RttpCodes.const_REC2_CLR:case SL4B_RttpCodes.const_REC2_DEL:case SL4B_RttpCodes.const_REC3_UPD:case SL4B_RttpCodes.const_REC3_IMG:case SL4B_RttpCodes.const_REC3_CLR:case SL4B_RttpCodes.const_REC3_DEL:case SL4B_RttpCodes.const_DIRECTORY_RESP:case SL4B_RttpCodes.const_DIR_UPD:case SL4B_RttpCodes.const_CONT_RESP:case SL4B_RttpCodes.const_AUTODIR_RESP:case SL4B_RttpCodes.const_CONT_UPD:case SL4B_RttpCodes.const_AUTODIR_UPD:case SL4B_RttpCodes.const_CONT_IMG:case SL4B_RttpCodes.const_AUTODIR_IMG:case SL4B_RttpCodes.const_NEWS_RESP:case SL4B_RttpCodes.const_NEWS_IMG:case SL4B_RttpCodes.const_NEWS_UPD:case SL4B_RttpCodes.const_STORY_RESP:case SL4B_RttpCodes.const_STORY_UPD:case SL4B_RttpCodes.const_STORY_IMG:case SL4B_RttpCodes.const_PERM_RESP:case SL4B_RttpCodes.const_PERM_IMG:case SL4B_RttpCodes.const_PERM_UPD:case SL4B_RttpCodes.const_PERM_CLR:case SL4B_RttpCodes.const_PERM_DEL:case SL4B_RttpCodes.const_CHAT_RESP:case SL4B_RttpCodes.const_CHAT_UPD:{this.cacheObject(C,A,B);break; }case SL4B_RttpCodes.const_STATUS_OK:case SL4B_RttpCodes.const_STATUS_STALE:case SL4B_RttpCodes.const_STATUS_LIMITED:case SL4B_RttpCodes.const_STATUS_REMOVED:case SL4B_RttpCodes.const_STATUS_INFO:{this.statusUpdated(C);break; }case SL4B_RttpCodes.const_NEWS_CLR:{var sObjKey=this.m_pObjectNumberToObjectKeyMap[C.getObjectNumber()]; delete this.m_pNewsHeadlineCache[sObjKey];break; }case SL4B_RttpCodes.const_DISCARD_OK:{this._discarded(C,A,B);break; }default :this.notFound(C,A);}} SL4B_ObjectCache.prototype._discarded = function(B,A,C){this.m_oSubscriptionManager._discarded();}; SL4B_ObjectCache.prototype.sendSubscriptionMessage = function(A,B){this.m_oRttpProvider.getManagedConnection().sendMessage(A,this,B);}; SL4B_ObjectCache.prototype._createObjectKey = function(A,B){return A+B; }; SL4B_ObjectCache.prototype._extractObjectKeyFromSentMessage = function(A){if(A===null||A.getContext()==null){throw new SL4B_Exception("SL4B_ObjectCache._extractObjectKeyFromSentMessage: context could not be extracted from the specified request ("+oRequest+")"); }var sEncodedObjectName=A.getMessage().match(/^[A-Z]+ ([^;]+)/)[1]; return GF_ResponseDecoder.decodeRttpData(sEncodedObjectName)+A.getContext().filter; }; function SL_EB(C,B,A,D){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.requestObject({0}, {1}, {2})",C,B,A);var l_sObjectKey=this._createObjectKey(C,B); if(this.m_pObjects[l_sObjectKey]===undefined||this.m_pObjects[l_sObjectKey]==null){this.m_pObjects[l_sObjectKey]=new SL4B_CacheEntry();}var l_sFieldsToRequest=this.m_pObjects[l_sObjectKey].addFields(A); if(l_sFieldsToRequest!=null){var l_sFieldMessage=SL4B_ObjectCache.createFilterAndFieldList(B,A); this.sendObjectAction("REQUEST",this.createObjectArray(GF_RequestEncoder.encodeRttpData(C),l_sFieldMessage),[C],B);}else {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"\tnothing to request, send cached update");this.sendCachedFields(C,B,A,D);}} SL4B_ObjectCache.buildRTTPRequestMessage = function(C,B,A){var l_sObjectRequestMessage="REQUEST "+GF_RequestEncoder.encodeRttpData(C); l_sObjectRequestMessage+=SL4B_ObjectCache.createFilterAndFieldList(B,A);return l_sObjectRequestMessage; }; SL4B_ObjectCache.createFilterAndFieldList = function(B,A){var l_sFilterAndFieldList=""; var l_bFilterSet=false; if(typeof B=="string"&&B!=""){l_sFilterAndFieldList+=SL4B_ObjectCache.const_OBJECT_NAME_AND_FIELD_LIST_DELIMITER;l_sFilterAndFieldList+=GF_RequestEncoder.encodeFieldList(B,SL4B_ObjectCache.const_FIELD_NAME_DELIMITER);l_bFilterSet=true;}if(typeof A=="string"&&A!=""){if(l_bFilterSet){l_sFilterAndFieldList+=SL4B_ObjectCache.const_FIELD_NAME_DELIMITER;}else {l_sFilterAndFieldList+=SL4B_ObjectCache.const_OBJECT_NAME_AND_FIELD_LIST_DELIMITER;}l_sFilterAndFieldList+=GF_RequestEncoder.encodeFieldList(A,SL4B_ObjectCache.const_FIELD_NAME_DELIMITER);}return l_sFilterAndFieldList; }; function SL_DR(D,A,C,B){var l_sObjectKey=this._createObjectKey(D,A); var l_oCacheEntry=this.m_pObjects[l_sObjectKey]; if(l_oCacheEntry!==undefined&&l_oCacheEntry!=null){var l_pCacheFieldList=l_oCacheEntry.m_pFieldList; var l_bCacheAllFields=l_oCacheEntry.m_bAllFields; var l_bAllFields=false; if(C==""||C==null||C===undefined){l_bAllFields=true;}if(this.m_pObjectDataCache[l_sObjectKey]!==undefined){var l_oType1RecordCache=this.m_pObjectDataCache[l_sObjectKey]; var l_oRecordFieldData=new SL4B_RecordFieldData(); if(l_bAllFields){for(l_sField in l_oType1RecordCache.m_pFieldCache){var l_sValue=l_oType1RecordCache.m_pFieldCache[l_sField]; l_oRecordFieldData.add(l_sField,l_sValue);}}else {var l_pFields=C.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_sField=l_pFields[l_nField]; if(l_bCacheAllFields||l_pCacheFieldList[l_sField]!==undefined){var l_sValue=l_oType1RecordCache.m_pFieldCache[l_sField]; if(l_sValue){l_oRecordFieldData.add(l_sField,l_sValue);}}}}if(l_oRecordFieldData.size()>0){this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,true,B);}}if(this.m_pObjectDataCacheType2[l_sObjectKey]!==undefined){var l_oType2RecordCache=this.m_pObjectDataCacheType2[l_sObjectKey]; var l_sLevelField=l_oType2RecordCache.m_sIndexFieldName; for(l_sLevel in l_oType2RecordCache.m_pLevelCache){var l_oRecordFieldData=new SL4B_RecordFieldData(); var l_pNameValues=l_oType2RecordCache.m_pLevelCache[l_sLevel]; var l_sLevelValue=l_sLevel; l_oRecordFieldData.add(l_sLevelField,l_sLevelValue);if(l_bAllFields){for(l_sField in l_pNameValues){var l_sValue=l_pNameValues[l_sField]; l_oRecordFieldData.add(l_sField,l_sValue);}}else {var l_pFields=C.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_sField=l_pFields[l_nField]; if(l_bCacheAllFields||l_pNameValues[l_sField]!==undefined){var l_sValue=l_pNameValues[l_sField]; l_oRecordFieldData.add(l_sField,l_sValue);}}}if(l_oRecordFieldData.size()>0){this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,true,B);}}}if(this.m_pObjectDataCacheType3[l_sObjectKey]!==undefined){var l_oType3RecordCache=this.m_pObjectDataCacheType3[l_sObjectKey]; for(var l_nLevel=0;l_nLevel<l_oType3RecordCache.m_pLevelCache.length;l_nLevel++){var l_oRecordFieldData=new SL4B_RecordFieldData(); var l_pNameValues=l_oType3RecordCache.m_pLevelCache[l_nLevel]; if(l_bAllFields){for(l_sField in l_pNameValues){var l_sValue=l_pNameValues[l_sField]; l_oRecordFieldData.add(l_sField,l_sValue);}}else {var l_pFields=C.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_sField=l_pFields[l_nField]; if(l_bCacheAllFields||l_pNameValues[l_sField]!==undefined){var l_sValue=l_pNameValues[l_sField]; l_oRecordFieldData.add(l_sField,l_sValue);}}}if(l_oRecordFieldData.size()>0){this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,true,B);}}}if(this.m_pDirectoryCache[l_sObjectKey]!==undefined){var l_oDirCache=this.m_pDirectoryCache[l_sObjectKey]; var l_pListing=l_oDirCache.m_pListing; for(l_sName in l_pListing){var l_sType=l_pListing[l_sName]; this.m_oSubscriptionManager.dirUpdated(l_sObjectKey,l_sName,l_sType,true,B);}}if(this.m_pContainerCache[l_sObjectKey]!==undefined){var l_oContCache=this.m_pContainerCache[l_sObjectKey]; var l_oObjectNameToObjectTypeMap=l_oContCache.getObjectNameToObjectTypeMap(); var l_pStructureChanges=new Array(); for(l_sName in l_oObjectNameToObjectTypeMap){this.m_oSubscriptionManager.structureChange(l_sObjectKey,l_sName,l_oObjectNameToObjectTypeMap[l_sName],true,B);l_pStructureChanges.push(new SL4B_ContainerStructureChange(l_sName,l_oObjectNameToObjectTypeMap[l_sName],true));}var l_pOrderChanges=new Array(); var l_oOrdering=l_oContCache.m_oOrdering; for(l_sSubscriptionId in l_oOrdering){l_pOrderChanges.push(new SL4B_ContainerOrderChange(this.m_pObjectNumberToObjectKeyMap[l_sSubscriptionId],l_sSubscriptionId,l_oOrdering[l_sSubscriptionId]));}if(!l_oContCache.isDirectory()){this.m_oSubscriptionManager.structureMultiChange(l_sObjectKey,l_pStructureChanges,l_pOrderChanges,l_pStructureChanges.length);}var l_sProxyListenerId=this.m_oSubscriptionManager.getProxySubscriber(B,l_sObjectKey,""); if(l_sProxyListenerId!=null){for(l_sName in l_oObjectNameToObjectTypeMap){this.sendCachedFields(l_sName,"","",l_sProxyListenerId);}}}if(this.m_pNewsHeadlineCache[l_sObjectKey]!==undefined){var l_oNewsHeadlineCache=this.m_pNewsHeadlineCache[l_sObjectKey]; var l_nNumberOfHeadlines=l_oNewsHeadlineCache.getSize(); this.m_oSubscriptionManager.objectInfo(l_sObjectKey,SL4B_ObjectType.NEWS_HEADLINE,SL4B_NewsHeadlineCache.const_SIZE_FIELD,l_oNewsHeadlineCache.getSize()+"");for(var l_nHeadline=0;l_nHeadline<l_nNumberOfHeadlines;++l_nHeadline){var l_oHeadline=l_oNewsHeadlineCache.getHeadline(l_nHeadline); this.m_oSubscriptionManager.newsUpdated(l_sObjectKey,l_oHeadline.m_sStoryCode,l_oHeadline.m_sHeadline,l_oHeadline.m_sDate);}}if(this.m_pStoryCache[l_sObjectKey]!==undefined){var l_oNewsStoryCache=this.m_pStoryCache[l_sObjectKey]; var l_aStoryText=l_oNewsStoryCache.getTextLines(); this.m_oSubscriptionManager.storyUpdated(l_sObjectKey,l_aStoryText);}if(this.m_pPermissionCache[l_sObjectKey]!==undefined){var l_oPermissionCache=this.m_pPermissionCache[l_sObjectKey]; for(l_sKey in l_oPermissionCache.m_pLevelCache){var l_oFieldData=new SL4B_RecordFieldData(); if(l_bAllFields){for(l_sField in l_pNameValues){var l_sValue=l_pNameValues[l_sField]; l_oFieldData.add(l_sField,l_sValue);}}else {var l_pFields=C.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_sField=l_pFields[l_nField]; if(l_bCacheAllFields||l_pNameValues[l_sField]!==undefined){var l_sValue=l_pNameValues[l_sField]; l_oFieldData.add(l_sField,l_sValue);}}}if(l_oFieldData.size()>0){this.m_oSubscriptionManager.permissionUpdated(l_sObjectKey,l_sKey,l_oFieldData,B);}}}if(this.m_mChatCache[l_sObjectKey]!==undefined){this.m_mChatCache[l_sObjectKey].sendCachedData(this,B);}if(B!=null){this.m_pObjects[l_sObjectKey].sendCurrentObjectStatus(this.m_oSubscriptionManager,l_sObjectKey,B);}}} function SL_EC(A,B){var l_pObjectsToReturn=new Array(); if(A!=undefined&&A.length>0){var l_pObjects=A.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); if(SL4B_Accessor.getCapabilities().getRttpVersion()>=2.1){if(l_pObjects.length==1){l_pObjectsToReturn.push(l_pObjects[0]+B);}else {if(B!=undefined&&B.length>0){l_pObjectsToReturn.push(B);}for(var l_nObject=0,l_nLength=l_pObjects.length;l_nObject<l_nLength;l_nObject++){l_pObjectsToReturn.push(l_pObjects[l_nObject]);}}}else {for(var l_nObject=0,l_nLength=l_pObjects.length;l_nObject<l_nLength;l_nObject++){l_pObjectsToReturn.push(l_pObjects[l_nObject]+B);}}}return l_pObjectsToReturn; } function SL_PN(C,B,A,D){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.sendObjectAction({0}, {1})",C,B);if(B.length==0){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ObjectCache.sendObjectAction. Not performing {0} action as there are no subjects to send to Liberator, not sending any messages.",C);return; }var l_sObjectRequestMessage=C+" "+B.join(" "); this.sendSubscriptionMessage(l_sObjectRequestMessage,{filter:D});} function SL_EI(C,A,D,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.requestObjects({0}, {1}, {2})",C,A,D);var l_pObjects=C.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); var l_pObjectsToRequest=new Array(); var l_sObjectRequestList=""; for(var l_nObject=0,l_nLength=l_pObjects.length;l_nObject<l_nLength;++l_nObject){var l_sObjectName=l_pObjects[l_nObject]; var l_sObjectKey=this._createObjectKey(l_sObjectName,A); if(this.m_pObjects[l_sObjectKey]==undefined){this.m_pObjects[l_sObjectKey]=new SL4B_CacheEntry();}if(this.m_pObjects[l_sObjectKey].addFields(D)!=null){l_pObjectsToRequest.push(l_sObjectName);l_sObjectRequestList+=((l_sObjectRequestList=="") ? "" : SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER)+GF_RequestEncoder.encodeRttpData(l_sObjectName);}else {this.sendCachedFields(l_sObjectName,A,D,B);}}if(l_pObjectsToRequest.length>0){var l_sFieldMessage=SL4B_ObjectCache.createFilterAndFieldList(A,D); this.sendObjectAction("REQUEST",this.createObjectArray(l_sObjectRequestList,l_sFieldMessage),l_pObjectsToRequest,A);}} function SL_HJ(B,A){var l_sSendFilter=A; if(l_sSendFilter!=""){l_sSendFilter=SL4B_ObjectCache.const_OBJECT_NAME_AND_FIELD_LIST_DELIMITER+GF_RequestEncoder.encodeFieldList(l_sSendFilter,SL4B_ObjectCache.const_FIELD_NAME_DELIMITER);}this.sendObjectAction("DISCARD",this.createObjectArray(GF_RequestEncoder.encodeRttpData(B),l_sSendFilter),[B],A);var l_sObjectKey=this._createObjectKey(B,A); this.clearCacheForObjectKey(l_sObjectKey);} function SL_OA(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.discardObjects({0}, {1})",A,B);var l_sSendFilter=B; if(l_sSendFilter!=""){l_sSendFilter=SL4B_ObjectCache.const_OBJECT_NAME_AND_FIELD_LIST_DELIMITER+GF_RequestEncoder.encodeFieldList(l_sSendFilter,SL4B_ObjectCache.const_FIELD_NAME_DELIMITER);}var l_pObjects=A.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); this.sendObjectAction("DISCARD",this.createObjectArray(A,l_sSendFilter),l_pObjects,B);for(var l_nObject=0,l_nLength=l_pObjects.length;l_nObject<l_nLength;++l_nObject){var l_sObjectName=l_pObjects[l_nObject]; var l_sObjectKey=this._createObjectKey(l_sObjectName,B); this.clearCacheForObjectKey(l_sObjectKey);}} function SL_DY(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.notFound: {0}",A);var l_sObjectKey=null; var l_sObjectNumber=A.getObjectNumber(); if(l_sObjectNumber!==null){l_sObjectKey=(l_sObjectNumber ? this.m_pObjectNumberToObjectKeyMap[l_sObjectNumber] : A.getMessageContent().split(" ")[0]);}if(B!==null&&l_sObjectKey==null){l_sObjectKey=this._extractObjectKeyFromSentMessage(B);}this.clearCacheForObjectKey(l_sObjectKey);this.m_oSubscriptionManager.clearAllSubscriptions(l_sObjectKey,A.getRttpCode());} SL4B_ObjectCache.prototype.clearCacheForObjectKey = function(A){if(A!==undefined){if(this.m_pObjects[A]!==undefined){delete this.m_pObjects[A];}if(this.m_pObjectDataCache[A]!==undefined){delete this.m_pObjectDataCache[A];}if(this.m_pObjectDataCacheType2[A]!==undefined){delete this.m_pObjectDataCacheType2[A];}if(this.m_pObjectDataCacheType3[A]!==undefined){delete this.m_pObjectDataCacheType3[A];}if(this.m_pDirectoryCache[A]!==undefined){delete this.m_pDirectoryCache[A];}if(this.m_pContainerCache[A]!==undefined){delete this.m_pContainerCache[A];}if(this.m_pNewsHeadlineCache[A]!==undefined){delete this.m_pNewsHeadlineCache[A];}if(this.m_pStoryCache[A]!==undefined){delete this.m_pStoryCache[A];}if(this.m_pPermissionCache[A]!==undefined){delete this.m_pPermissionCache[A];}if(this.m_mChatCache[A]!==undefined){delete this.m_mChatCache[A];}}}; SL4B_ObjectCache.prototype.validateResponseMatchesExpectation = function(A,B){if(SL4B_RttpCodes.isResponseCode(A.getRttpCode())){var sReceivedObjectName=A.getMessageContent().match(/([^ ]+)/)[1]; var sSentObjectName=B.getMessage().match(/ ([^;]+)/)[1]; if(sReceivedObjectName!==sSentObjectName&&GF_ResponseDecoder.decodeRttpData(sReceivedObjectName)!==GF_ResponseDecoder.decodeRttpData(sSentObjectName)){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"ObjectCache.validateResponseMatchesExpectation: Received a message for {0} when a message for {1} was expected.",sReceivedObjectName,sSentObjectName);return false; }}return true; }; function SL_DQ(A,B,C){switch(A){ case SL4B_RttpCodes.const_RESP_UNKNOWN:case SL4B_RttpCodes.const_DIRECTORY_RESP:case SL4B_RttpCodes.const_CONT_UPD:case SL4B_RttpCodes.const_CONT_IMG:case SL4B_RttpCodes.const_CONT_RESP:case SL4B_RttpCodes.const_AUTODIR_RESP:case SL4B_RttpCodes.const_AUTODIR_UPD:case SL4B_RttpCodes.const_AUTODIR_IMG:{return true; }default :{if(C!=null){var mParameters=C.getParameters(); if(mParameters.ctrid!==undefined){oUserRequestData=this.m_oSubscriptionManager.getContainerRequestData(mParameters.ctrid);if(oUserRequestData!==undefined&&(mParameters.ctrstart!=oUserRequestData.getWindowStart()||mParameters.ctrend!=oUserRequestData.getWindowEnd())){var oContainerRequest=C; if(C.getOriginalMessage()){oContainerRequest=C.getOriginalMessage();}var l_sContainerObjectKey=this._extractObjectKeyFromSentMessage(oContainerRequest); if(B&&l_sContainerObjectKey&&this.m_pContainerCache[l_sContainerObjectKey]){var l_nObjPosition=this.m_pContainerCache[l_sContainerObjectKey].getOrdering(B); if(l_nObjPosition>=oUserRequestData.getWindowStart()&&l_nObjPosition<=oUserRequestData.getWindowEnd()){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"ObjectCache.cacheObject: Item {0} is from an old request, but it is inside the current window {1} - {2}: processing updates",l_nObjPosition,oUserRequestData.getWindowStart(),oUserRequestData.getWindowEnd());}else {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"ObjectCache.cacheObject: Item {0} is outside the current window {1} - {2}: will not process non container updates",l_nObjPosition,oUserRequestData.getWindowStart(),oUserRequestData.getWindowEnd());return false; }}else {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"ObjectCache.cacheObject: windows don't match - not processing non container updates: expected window start = {0} end = {1} this update for window start = {2}, end = {3}",oUserRequestData.getWindowStart(),oUserRequestData.getWindowEnd(),mParameters.ctrstart,mParameters.ctrend);return false; }}}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheObject: no request record stored for message {0}",B);}}}return true; } function SL_JA(B,A,C){var oNormalisedRttpMessage=B; if(B.rttpcode){oNormalisedRttpMessage=SL4B_RttpMessage.getJsonMessageAdapter(B);}if(this.validateResponseMatchesExpectation(oNormalisedRttpMessage,A)==false){this.m_oRttpProvider.getManagedConnection()._triggerReconnect();return; }var oUserRequestData; var l_nRttpCode=oNormalisedRttpMessage.getRttpCode(); var l_sObjectNumber=oNormalisedRttpMessage.getObjectNumber(); var bProcessUpdates=this.isActive(l_nRttpCode,l_sObjectNumber,A); if(B.rttpcode){var l_oJsonMessage=B; switch(l_oJsonMessage.rttpcode){ case "3U":case "38":{var l_sObjectNumber=l_oJsonMessage.objnum; var l_sObjectKey=this._extractObjectKeyFromSentMessage(A); this.m_pObjectNumberToObjectKeyMap[l_sObjectNumber]=l_sObjectKey;break; }}if(bProcessUpdates){switch(B.rttpcode){ case "38":this.cacheType1Record(l_oJsonMessage.objnum,l_oJsonMessage.msg,true,false);break; case "3U":case "6c":case "7O":this.cacheType1Record(l_oJsonMessage.objnum,l_oJsonMessage.msg,false,(B.rttpcode!="6c"));break; }}return; }if(bProcessUpdates==false){return; }switch(l_nRttpCode){ case SL4B_RttpCodes.const_RECORD_RESP:case SL4B_RttpCodes.const_RESP_UNKNOWN:case SL4B_RttpCodes.const_DIRECTORY_RESP:case SL4B_RttpCodes.const_CONT_RESP:case SL4B_RttpCodes.const_AUTODIR_RESP:case SL4B_RttpCodes.const_NEWS_RESP:case SL4B_RttpCodes.const_STORY_RESP:case SL4B_RttpCodes.const_PERM_RESP:case SL4B_RttpCodes.const_CHAT_RESP:{var l_sObjectKey=this._extractObjectKeyFromSentMessage(A); this.m_pObjectNumberToObjectKeyMap[l_sObjectNumber]=l_sObjectKey;break; }}switch(l_nRttpCode){ case SL4B_RttpCodes.const_RECORD_RESP:case SL4B_RttpCodes.const_RESP_UNKNOWN:{var l_nIndex=B.getMessageContent().indexOf(" "); this.cacheType1Record(B.getObjectNumber(),B.getMessageContent().substr(l_nIndex+1),(l_nRttpCode==SL4B_RttpCodes.const_RESP_UNKNOWN),SL4B_RttpCodes.isImageCode(l_nRttpCode));break; }case SL4B_RttpCodes.const_REC1_UPD:case SL4B_RttpCodes.const_REC1_IMG:{this.cacheType1Record(B.getObjectNumber(),B.getMessageContent(),false,SL4B_RttpCodes.isImageCode(l_nRttpCode));break; }case SL4B_RttpCodes.const_REC2_UPD:case SL4B_RttpCodes.const_REC2_IMG:{this.cacheType2Record(B.getObjectNumber(),B.getMessageContent(),SL4B_RttpCodes.isImageCode(l_nRttpCode));break; }case SL4B_RttpCodes.const_REC2_CLR:{this.type2Clear(B.getObjectNumber());break; }case SL4B_RttpCodes.const_REC2_DEL:{this.deleteType2RecordLevel(B.getObjectNumber(),B.getMessageContent());break; }case SL4B_RttpCodes.const_REC3_UPD:case SL4B_RttpCodes.const_REC3_IMG:{this.cacheType3Record(B.getObjectNumber(),B.getMessageContent(),SL4B_RttpCodes.isImageCode(l_nRttpCode));break; }case SL4B_RttpCodes.const_REC3_CLR:{this.type3Clear(B.getObjectNumber());break; }case SL4B_RttpCodes.const_DIRECTORY_RESP:case SL4B_RttpCodes.const_DIR_UPD:{this.cacheDirectory(B.getObjectNumber(),B.getMessageContent(),l_nRttpCode);break; }case SL4B_RttpCodes.const_CONT_RESP:case SL4B_RttpCodes.const_CONT_UPD:case SL4B_RttpCodes.const_CONT_IMG:case SL4B_RttpCodes.const_AUTODIR_RESP:case SL4B_RttpCodes.const_AUTODIR_UPD:case SL4B_RttpCodes.const_AUTODIR_IMG:{this.cacheContainer(B.getObjectNumber(),B.getMessageContent(),l_nRttpCode,C,A);break; }case SL4B_RttpCodes.const_NEWS_IMG:case SL4B_RttpCodes.const_NEWS_UPD:{this.cacheNewsHeadline(B.getObjectNumber(),B.getMessageContent());break; }case SL4B_RttpCodes.const_STORY_UPD:case SL4B_RttpCodes.const_STORY_RESP:case SL4B_RttpCodes.const_STORY_IMG:{this.cacheNewsStory(B.getObjectNumber(),B.getMultipleLineContents(),B.getMessageContent());break; }case SL4B_RttpCodes.const_PERM_IMG:case SL4B_RttpCodes.const_PERM_UPD:{this.cachePermission(B.getObjectNumber(),B.getMessageContent());break; }case SL4B_RttpCodes.const_PERM_CLR:{this.clearPermission(B.getObjectNumber());break; }case SL4B_RttpCodes.const_PERM_DEL:{this.deletePermissionEntry(B.getObjectNumber(),B.getMessageContent());break; }case SL4B_RttpCodes.const_CHAT_RESP:case SL4B_RttpCodes.const_CHAT_UPD:{this.cacheChat(B.getObjectNumber(),B.getMessageContent(),(l_nRttpCode===SL4B_RttpCodes.const_CHAT_RESP));break; }}} var g_rePlus=new RegExp("\\+","g"); function SL_DL(A,B,C,D){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.cacheType1Record({0}, {1}, {2}, {3})",A,B,C,D);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){var l_oType1Cache=this.m_pObjectDataCache[l_sObjectKey]; if(l_oType1Cache===undefined){l_oType1Cache=new SL4B_Type1RecordCache();this.m_pObjectDataCache[l_sObjectKey]=l_oType1Cache;}if(!C){var l_oRecordFieldData; if(B.constructor!=String){l_oRecordFieldData=this.getFieldDataFromJson(l_oType1Cache,B);}else {l_oRecordFieldData=this.getFieldDataFromString(l_oType1Cache,B);}this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,D);}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheType1Record: No object name is "+"available that corresponds to the object number {0}",A);}} SL4B_ObjectCache.prototype.getFieldDataFromJson = function(B,A){var l_oRecordFieldData=new SL4B_RecordFieldData(); for(l_sRawFieldName in A){var l_sRawFieldValue=A[l_sRawFieldName]; this.addType1FieldData(B,l_oRecordFieldData,l_sRawFieldName,l_sRawFieldValue);}return l_oRecordFieldData; }; SL4B_ObjectCache.prototype.getFieldDataFromString = function(B,A){var l_pFields=A.split(" "); var l_oRecordFieldData=new SL4B_RecordFieldData(); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_nIndex=l_pFields[l_nField].indexOf("="); var l_sRawFieldName=l_pFields[l_nField].substring(0,l_nIndex); var l_sRawFieldValue=l_pFields[l_nField].substring(l_nIndex+1); this.addType1FieldData(B,l_oRecordFieldData,l_sRawFieldName,l_sRawFieldValue);}return l_oRecordFieldData; }; SL4B_ObjectCache.prototype.addType1FieldData = function(A,D,C,B){var l_sFieldName=this.m_oRttpProvider.getFieldName(C); var l_sFieldValue=unescape(B.replace(g_rePlus," ")); A.addField(l_sFieldName,l_sFieldValue);D.add(l_sFieldName,l_sFieldValue);if(SL4B_Accessor.getConfiguration().isEnableLatency()&&l_sFieldName==SL4B_Accessor.getConfiguration().getTimestampField()){SL4B_ConnectionProxy.getInstance().recordLatency(l_sFieldValue);}}; function SL_OL(A,C,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.cacheType2Record({0}, {1}, {2})",A,C,B);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){var l_pFields=C.split(" "); var l_nIndex=l_pFields[0].indexOf("="); var l_sLevelFieldName=this.m_oRttpProvider.getFieldName(l_pFields[0].substring(0,l_nIndex)); var l_sLevelFieldValue=l_pFields[0].substring(l_nIndex+1); l_sLevelFieldValue=GF_ResponseDecoder.decodeRttpData(l_sLevelFieldValue);if(this.m_pObjectDataCacheType2[l_sObjectKey]===undefined){this.m_pObjectDataCacheType2[l_sObjectKey]=new SL4B_Type2RecordCache();this.m_pObjectDataCacheType2[l_sObjectKey].m_sIndexFieldName=l_sLevelFieldName;}var l_oRecordFieldData=new SL4B_RecordFieldData(); l_oRecordFieldData.add(l_sLevelFieldName,l_sLevelFieldValue);for(var l_nField=1,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){l_nIndex=l_pFields[l_nField].indexOf("=");var l_sFieldName=this.m_oRttpProvider.getFieldName(l_pFields[l_nField].substring(0,l_nIndex)); var l_sFieldValue=l_pFields[l_nField].substring(l_nIndex+1); if(l_sFieldName!==undefined){var l_sFieldValue=GF_ResponseDecoder.decodeRttpData(l_sFieldValue); this.m_pObjectDataCacheType2[l_sObjectKey].addField(l_sLevelFieldValue,l_sFieldName,l_sFieldValue);l_oRecordFieldData.add(l_sFieldName,l_sFieldValue);if(SL4B_Accessor.getConfiguration().isEnableLatency()&&l_sFieldName==SL4B_Accessor.getConfiguration().getTimestampField()){SL4B_ConnectionProxy.getInstance().recordLatency(l_sFieldValue);}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheType2Record: No field is "+"available that corresponds to the field {0}",l_pFields[l_nField].substring(0,l_nIndex));}}this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,B);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheType2Record: No object name is "+"available that corresponds to the object number {0}",A);}} function SL_EV(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.type2Clear: {0}",A);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pObjectDataCacheType2[l_sObjectKey]!==undefined){delete this.m_pObjectDataCacheType2[l_sObjectKey];this.m_oSubscriptionManager.type2Clear(l_sObjectKey);}}} function SL_PE(A,C,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.cacheType3Record: {0}, {1}, {2}",A,C,B);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pObjectDataCacheType3[l_sObjectKey]===undefined){this.m_pObjectDataCacheType3[l_sObjectKey]=new SL_NM();}var l_pFields=C.split(" "); var l_oRecordFieldData=new SL4B_RecordFieldData(); var l_pNameValuePairs=new Array(); this.m_pObjectDataCacheType3[l_sObjectKey].m_pLevelCache.push(l_pNameValuePairs);for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){l_nIndex=l_pFields[l_nField].indexOf("=");var l_sFieldName=this.m_oRttpProvider.getFieldName(l_pFields[l_nField].substring(0,l_nIndex)); var l_sFieldValue=l_pFields[l_nField].substring(l_nIndex+1); if(l_sFieldName!==undefined){var l_sFieldValue=GF_ResponseDecoder.decodeRttpData(l_sFieldValue); l_pNameValuePairs[l_sFieldName]=l_sFieldValue;l_oRecordFieldData.add(l_sFieldName,l_sFieldValue);if(SL4B_Accessor.getConfiguration().isEnableLatency()&&l_sFieldName==SL4B_Accessor.getConfiguration().getTimestampField()){SL4B_ConnectionProxy.getInstance().recordLatency(l_sFieldValue);}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheType3Record: No field is "+"available that corresponds to the field {0}",l_pFields[l_nField].substring(0,l_nIndex));}}this.m_oSubscriptionManager.recordMultiUpdated(l_sObjectKey,l_oRecordFieldData,B);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheType3Record: No object name is "+"available that corresponds to the object number {0}",A);}} function SL_PK(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.type3Clear({0})",A);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pObjectDataCacheType3[l_sObjectKey]!==undefined){delete this.m_pObjectDataCacheType3[l_sObjectKey];this.m_oSubscriptionManager.type3Clear(l_sObjectKey);}}} function SL_RJ(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.deleteType2RecordLevel: {0}; {1}",A,B);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pObjectDataCacheType2[l_sObjectKey]!==undefined){var l_pFields=B.split(" "); var l_nIndex=l_pFields[0].indexOf("="); var l_sLevelFieldName=this.m_oRttpProvider.getFieldName(l_pFields[0].substring(0,l_nIndex)); var l_sLevelFieldValue=l_pFields[0].substring(l_nIndex+1); l_sLevelFieldValue=GF_ResponseDecoder.decodeRttpData(l_sLevelFieldValue);this.m_pObjectDataCacheType2[l_sObjectKey].deleteLevel(l_sLevelFieldValue);this.m_oSubscriptionManager.deleteType2Level(l_sObjectKey,l_sLevelFieldName,l_sLevelFieldValue);}}} function SL_AP(B,C,A){var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[B]; if(l_sObjectKey!==undefined){var l_oCache=this.m_pDirectoryCache[l_sObjectKey]; if(l_oCache===undefined){l_oCache=new SL4B_DirectoryCache();this.m_pDirectoryCache[l_sObjectKey]=l_oCache;}var l_pDirs=C.split(" "); var l_nDir=1; if(A==SL4B_RttpCodes.const_DIR_UPD){l_nDir=0;}for(var l_nLength=l_pDirs.length;l_nDir<l_nLength;++l_nDir){var l_sDirAndType=l_pDirs[l_nDir]; var l_pDirAndType=l_sDirAndType.split(";"); if(l_pDirAndType[1]==0){delete l_oCache.m_pListing[l_pDirAndType[0]];}else {l_oCache.m_pListing[l_pDirAndType[0]]=l_pDirAndType[1];}this.m_oSubscriptionManager.dirUpdated(l_sObjectKey,GF_ResponseDecoder.decodeRttpData(l_pDirAndType[0]),l_pDirAndType[1],(l_pDirAndType[1]!=0));}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheDirectory: No object name is "+"available that corresponds to the object number {0}",B);}} function SL_RI(A,E,C,B,D){var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey===undefined){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheContainer: No object name is "+"available that corresponds to the object number {0}",A);return; }var l_oCache=this.m_pContainerCache[l_sObjectKey]; if(l_oCache===undefined){l_oCache=new SL4B_ContainerCache();this.m_pContainerCache[l_sObjectKey]=l_oCache;}if(C==SL4B_RttpCodes.const_AUTODIR_RESP||C==SL4B_RttpCodes.const_AUTODIR_IMG){l_oCache.setDirectory(true);}var l_pWords=E.split(" "); var l_pStructureChanges=new Array(); var l_pOrderChanges=new Array(); var l_nPos=0; var l_bParseOrderFromElements=false; if(C==SL4B_RttpCodes.const_CONT_RESP||C==SL4B_RttpCodes.const_AUTODIR_RESP||C==SL4B_RttpCodes.const_CONT_IMG||C==SL4B_RttpCodes.const_AUTODIR_IMG){l_bParseOrderFromElements=true;if(C==SL4B_RttpCodes.const_CONT_RESP||C==SL4B_RttpCodes.const_AUTODIR_RESP){l_nPos=2;}var l_oObjectNameToObjectTypeMap=l_oCache.getObjectNameToObjectTypeMap(); for(l_sName in l_oObjectNameToObjectTypeMap){this.m_oSubscriptionManager.structureChange(l_sObjectKey,l_sName,l_oObjectNameToObjectTypeMap[l_sName],false);l_pStructureChanges.push(new SL4B_ContainerStructureChange(l_sName,l_oObjectNameToObjectTypeMap[l_sName],false));B.removeObjectNumber(l_oCache.m_mObjectNameToNumberMap[l_sName]);l_oCache.removeEntry(l_sName);l_oCache.removeOrdering(l_oCache.m_oObjectNameToIdMap[l_sName]);l_oCache.removeFromNameIdMap(l_sName);}}var l_nElementPosition=0; if(C==SL4B_RttpCodes.const_CONT_RESP||C==SL4B_RttpCodes.const_CONT_IMG){var l_nWindowStart; if(D!==undefined){l_nWindowStart=parseInt(D.getParameters()['ctrstart']);if(l_nWindowStart!==undefined){l_nElementPosition=l_nWindowStart;}}}if(l_nElementPosition>=2147483647){return; }var l_sOrderingString=""; for(var l_nLength=l_pWords.length;l_nPos<l_nLength;++l_nPos){var l_sWord=l_pWords[l_nPos]; if(l_sWord.match(/^size=/)!=null){var l_pItems=l_sWord.split("="); l_oCache.setSize(parseInt(l_pItems[1]));}else if(l_sWord.match(/^order=/)!=null){var l_pItems=l_sWord.split("="); l_sOrderingString=l_pItems[1];}else if(l_sWord.match(/^.+;.+;.+/)!=null){var l_pItems=l_sWord.split(";"); var l_sName=l_pItems[0]; l_sName=GF_ResponseDecoder.decodeRttpData(l_sName);var l_bAdded=(l_pItems[1]!=0); var l_sSubscriptionId=l_pItems[l_pItems.length-1]; if(!l_bAdded){l_oCache.removeEntry(l_sName);l_oCache.removeOrdering(l_oCache.m_oObjectNameToIdMap[l_sName]);l_oCache.removeFromNameIdMap(l_sName);B.removeObjectNumber(l_sSubscriptionId);}else {if(this.m_pObjects[l_sName]===undefined){this.m_pObjects[l_sName]=new SL4B_CacheEntry();}this.m_pObjectNumberToObjectKeyMap[l_sSubscriptionId]=l_sName;l_oCache.addEntry(l_sName,l_pItems[1],l_sSubscriptionId);B.addObjectNumber(l_sSubscriptionId);}this.m_oSubscriptionManager.structureChange(l_sObjectKey,l_sName,l_pItems[1],l_bAdded);l_pStructureChanges.push(new SL4B_ContainerStructureChange(l_sName,l_pItems[1],l_bAdded));if(l_bParseOrderFromElements){l_pOrderChanges.push(new SL4B_ContainerOrderChange(l_sName,l_sSubscriptionId,l_nElementPosition));l_oCache.addToNameIdMap(l_sName,l_sSubscriptionId);l_oCache.addOrdering(l_sSubscriptionId,l_nElementPosition);}l_nElementPosition++;}}if(l_sOrderingString!=""){l_pOrderChanges=this.parseOrderChanges(l_sOrderingString,l_oCache);}if(C==SL4B_RttpCodes.const_CONT_RESP||C==SL4B_RttpCodes.const_CONT_IMG||C==SL4B_RttpCodes.const_CONT_UPD){this.m_oSubscriptionManager.structureMultiChange(l_sObjectKey,l_pStructureChanges,l_pOrderChanges,l_oCache.getSize());}} function SL_IZ(A,B){var l_sParsedItems=new Array(); if(typeof A!="string"||A==null||A.length==0){return l_sParsedItems; }var l_pOrderItems=A.split(","); for(var i=0;i<l_pOrderItems.length;i++){var l_pOrderMessage=l_pOrderItems[i].split(":"); if(l_pOrderMessage.length!=2){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.parseOrderChanges: Unable to parse order message: \"{0}\" from \"{1}\"",l_pOrderItems[i],A);break; }var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[l_pOrderMessage[0]]; if(l_sObjectKey===undefined){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.parseOrderChanges: Unable to parse order message: \"{0}\" from \"{1}\" could not find subscriptionId",l_pOrderItems[i],A);break; }var order=parseInt(l_pOrderMessage[1]); l_sParsedItems.push(new SL4B_ContainerOrderChange(l_sObjectKey,l_pOrderMessage[0],order));B.addToNameIdMap(l_sObjectKey,l_pOrderMessage[0]);B.addOrdering(l_pOrderMessage[0],order);}return l_sParsedItems; } function SL_DM(A,B){var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){var l_oCache=this.m_pNewsHeadlineCache[l_sObjectKey]; if(l_oCache===undefined||typeof l_oCache.addField=="function"){l_oCache=new SL4B_NewsHeadlineCache();this.m_pNewsHeadlineCache[l_sObjectKey]=l_oCache;}var l_pFields=B.split(" "); if(l_pFields.length==1){var l_nIndex=l_pFields[0].indexOf("="); l_sFieldName=l_pFields[0].substring(0,l_nIndex);l_sFieldValue=l_pFields[0].substring(l_nIndex+1);if(l_sFieldName==SL4B_NewsHeadlineCache.const_SIZE_FIELD){this.m_oSubscriptionManager.objectInfo(l_sObjectKey,SL4B_ObjectType.NEWS_HEADLINE,l_sFieldName,l_sFieldValue);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheNewsHeadline: update did not contain the \"size\" field: {0} - {1}",A,B);}}else if(l_pFields.length==3){var l_sHeadline; var l_sCode; var l_sDate; var l_bError=false; for(var l_nField=0;l_nField<3;++l_nField){var l_nIndex=l_pFields[l_nField].indexOf("="); l_sFieldName=this.m_oRttpProvider.getFieldName(l_pFields[l_nField].substring(0,l_nIndex));l_sFieldValue=l_pFields[l_nField].substring(l_nIndex+1);l_sFieldValue=GF_ResponseDecoder.decodeRttpData(l_sFieldValue);switch(l_sFieldName){ case "headline":l_sHeadline=l_sFieldValue;break; case "code":l_sCode=l_sFieldValue;break; case "date":l_sDate=l_sFieldValue;break; default :l_bError=true;break; }}if(!l_bError){l_oCache.addHeadline(l_sCode,l_sHeadline,l_sDate);this.m_oSubscriptionManager.newsUpdated(l_sObjectKey,l_sCode,l_sHeadline,l_sDate);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheNewsHeadline: news headline message did not contain the expected fields: {0} - {1}",A,B);}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheNewsHeadline: unexpected news headline message received: {0} - {1}",A,B);}}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheNewsHeadline: No object name is available that corresponds to the object number {0}",A);}} function SL_QI(A,B,C){var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){var l_oStoryCache=this.m_pStoryCache[l_sObjectKey]||this.m_pObjectDataCache[l_sObjectKey]; if(l_oStoryCache===undefined||!l_oStoryCache.isNewsStory){if(l_oStoryCache!==undefined){delete this.m_pObjectDataCache[l_sObjectKey];}l_oStoryCache=new SL4B_NewsStoryCache();this.m_pStoryCache[l_sObjectKey]=l_oStoryCache;}if(C.match(/reset/)){l_oStoryCache.addTextLines(B);}else {l_oStoryCache.setTextLines(B);}}var l_aTextLines=l_oStoryCache.getTextLines(); this.m_oSubscriptionManager.storyUpdated(l_sObjectKey,B);} function SL_OG(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.cachePermission({0}, {1})",A,B);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){var l_oCache=this.m_pPermissionCache[l_sObjectKey]; var l_pFields=null; if(B==null){l_pFields=new Array();}else {l_pFields=B.split(" ");var l_nIndex=l_pFields[0].indexOf("="); var l_sKeyFieldName=this.m_oRttpProvider.getFieldName(l_pFields[0].substring(0,l_nIndex)); var l_sKeyFieldValue=GF_ResponseDecoder.decodeRttpData(l_pFields[0].substring(l_nIndex+1)); if(l_oCache===undefined){l_oCache=new SL4B_Type2RecordCache();l_oCache.m_sIndexFieldName=l_sKeyFieldValue;this.m_pPermissionCache[l_sObjectKey]=l_oCache;}}var l_oFieldData=new SL4B_RecordFieldData(); for(var l_nField=1,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){l_nIndex=l_pFields[l_nField].indexOf("=");var l_sFieldName=this.m_oRttpProvider.getFieldName(l_pFields[l_nField].substring(0,l_nIndex)); var l_sFieldValue=GF_ResponseDecoder.decodeRttpData(l_pFields[l_nField].substring(l_nIndex+1)); this.m_pPermissionCache[l_sObjectKey].addField(l_sKeyFieldValue,l_sFieldName,l_sFieldValue);l_oFieldData.add(l_sFieldName,l_sFieldValue);}this.m_oSubscriptionManager.permissionUpdated(l_sObjectKey,l_sKeyFieldValue,l_oFieldData);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cachePermission: No object name is available that corresponds to the object number {0}",A);}} function SL_LO(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.clearPermission: {0}",A);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pPermissionCache[l_sObjectKey]!==undefined){delete this.m_pPermissionCache[l_sObjectKey];this.m_oSubscriptionManager.deleteAllPermissionEntries(l_sObjectKey);}}} function SL_CB(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.deletePermissionEntry: {0}; {1}",A,B);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[A]; if(l_sObjectKey!==undefined){if(this.m_pPermissionCache[l_sObjectKey]!==undefined){var l_pFields=B.split(" "); var l_nIndex=l_pFields[0].indexOf("="); var l_sKeyFieldName=this.m_oRttpProvider.getFieldName(l_pFields[0].substring(0,l_nIndex)); var l_sKeyFieldValue=GF_ResponseDecoder.decodeRttpData(l_pFields[0].substring(l_nIndex+1)); this.m_pPermissionCache[l_sObjectKey].deleteLevel(l_sKeyFieldValue);this.m_oSubscriptionManager.deletePermissionEntry(l_sObjectKey,l_sKeyFieldValue);}}} SL4B_ObjectCache.prototype.cacheChat = function(B,C,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.cacheChat: {0}; {1}",B,C);var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[B]; if(l_sObjectKey!==undefined){var mFields=this._extractFieldsAsMap(C,A); var oCache=this.m_mChatCache[l_sObjectKey]; if(oCache===undefined){oCache=new GF_ChatCache(l_sObjectKey);this.m_mChatCache[l_sObjectKey]=oCache;}oCache.addToCache(mFields);this._$sendChat(l_sObjectKey,mFields);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.cacheChat: No object name is available that corresponds to the object number {0}",B);}}; SL4B_ObjectCache.prototype._$sendChat = function(A,C,B){this.m_oSubscriptionManager.chat(A,C[GF_ChatFields.TIME]||SL4B_ObjectCache.const_BLANK_STRING,C[GF_ChatFields.USER]||SL4B_ObjectCache.const_BLANK_STRING,C[GF_ChatFields.MESSAGE]||SL4B_ObjectCache.const_BLANK_STRING,parseInt(C[GF_ChatFields.STATUS]||0),B);}; SL4B_ObjectCache.prototype._extractFieldsAsArray = function(B,A){return this._extractFields(B,A,this._addFieldToArray,[]); }; SL4B_ObjectCache.prototype._addFieldToArray = function(B,A,C){B.push({name:A, value:C});}; SL4B_ObjectCache.prototype._extractFieldsAsMap = function(B,A){return this._extractFields(B,A,this._addFieldToMap,{}); }; SL4B_ObjectCache.prototype._addFieldToMap = function(C,A,B){C[A]=B;}; SL4B_ObjectCache.prototype._extractFields = function(C,A,B,D){var pFieldPairs=C.split(" "); for(var nField=(A ? 1 : 0),nLength=pFieldPairs.length;nField<nLength;++nField){var nIndex=pFieldPairs[nField].indexOf("="); if(nIndex>=0){var sFieldName=this.m_oRttpProvider.getFieldName(pFieldPairs[nField].substring(0,nIndex)); var sFieldValue=pFieldPairs[nField].substring(nIndex+1); B(D,sFieldName,GF_ResponseDecoder.decodeRttpData(sFieldValue));}else {this._logParsingError("Illegal field definition found for \""+pFieldPairs[nField]+"\" whilst parsing message body \""+C+"\"");}}return D; }; SL4B_ObjectCache.prototype._logParsingError = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,A);}; function SL_PZ(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectCache.statusUpdated: {0}",A);var l_sObjectNumber=A.getObjectNumber(); var l_sObjectKey=this.m_pObjectNumberToObjectKeyMap[l_sObjectNumber]; var l_pFields=A.getMessageContent().split(" "); var l_nCode=0; var l_sMessage=""; for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_nIndex=l_pFields[l_nField].indexOf("="); var l_sFieldName=this.m_oRttpProvider.getFieldName(l_pFields[l_nField].substring(0,l_nIndex)); var l_sFieldValue=GF_ResponseDecoder.decodeRttpData(l_pFields[l_nField].substring(l_nIndex+1)); switch(l_sFieldName){ case "code":l_nCode=parseInt(l_sFieldValue,10);break; case "status":l_sMessage=l_sFieldValue;break; }} try {this.m_oSubscriptionManager.objectStatus(l_sObjectKey,SL4B_ObjectStatus.getObjectStatusFromRttpCode(A.getRttpCode()),l_nCode,l_sMessage);this.m_pObjects[l_sObjectKey].setObjectStatus(SL4B_ObjectStatus.getObjectStatusFromRttpCode(A.getRttpCode()),l_nCode,l_sMessage);}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectCache.statusUpdated: Unable to get status code from SL4B_ObjectStatus.getObjectStatusFromRttpCode for the update: {0}.",A);} } SL4B_ObjectCache.prototype.getObjectStatus = function(A){return ((this.m_pObjects[A]!==undefined) ? this.m_pObjects[A].getObjectStatus() : null); }; GF_ChatFields = new function(){this.STATUS="status";this.USER="user";this.MESSAGE="msg";this.TIME="time";}; var SL4B_ObjectSubscriptionManager=function(){}; if(false){function SL4B_ObjectSubscriptionManager(){} }SL4B_ObjectSubscriptionManager = function(){this.CLASS_NAME="SL4B_ObjectSubscriptionManager";this.m_pObjectSubscriptions=new Object();this.m_oObjectCache=null;this.m_oContainerProxySubscribers=new Object();this.m_oContainerObjects=new Object();this.m_oContainerIdToRequestDataMap=new Object();}; SL4B_ObjectSubscriptionManager.prototype.isValidObject = function(A){return ((typeof A=="string")&&A!=""); }; SL4B_ObjectSubscriptionManager.prototype.isSubscribed = function(A){return this.m_pObjectSubscriptions[A]!=null; }; SL4B_ObjectSubscriptionManager.prototype.requestObject = SL_BP;SL4B_ObjectSubscriptionManager.prototype.requestObjects = SL_NZ;SL4B_ObjectSubscriptionManager.prototype.reRequestObjects = SL_BO;SL4B_ObjectSubscriptionManager.prototype.discardObject = SL_DH;SL4B_ObjectSubscriptionManager.prototype.discardObjects = SL_LL;SL4B_ObjectSubscriptionManager.prototype.addObject = SL_LH;SL4B_ObjectSubscriptionManager.prototype.removeObject = SL_QG;SL4B_ObjectSubscriptionManager.prototype.removeSubscriber = SL_CK;SL4B_ObjectSubscriptionManager.prototype.setObjectCache = SL_AK;SL4B_ObjectSubscriptionManager.prototype.recordMultiUpdated = SL_GB;SL4B_ObjectSubscriptionManager.prototype.recordMultiUpdated2 = SL_II;SL4B_ObjectSubscriptionManager.prototype.deleteType2Level = SL_DA;SL4B_ObjectSubscriptionManager.prototype.type2Clear = SL_GE;SL4B_ObjectSubscriptionManager.prototype.type3Clear = SL_DO;SL4B_ObjectSubscriptionManager.prototype.clearAllSubscriptions = SL_JK;SL4B_ObjectSubscriptionManager.prototype.dirUpdated = SL_EY;SL4B_ObjectSubscriptionManager.prototype.dirMultiUpdated = SL_NY;SL4B_ObjectSubscriptionManager.prototype.newsUpdated = SL_PF;SL4B_ObjectSubscriptionManager.prototype.objectInfo = SL_IC;SL4B_ObjectSubscriptionManager.prototype.storyUpdated = SL_BJ;SL4B_ObjectSubscriptionManager.prototype.permissionUpdated = SL_MV;SL4B_ObjectSubscriptionManager.prototype.deleteAllPermissionEntries = SL_FK;SL4B_ObjectSubscriptionManager.prototype.deletePermissionEntry = SL_DU;SL4B_ObjectSubscriptionManager.prototype.objectStatus = SL_MJ;SL4B_ObjectSubscriptionManager.prototype.splitFilter = SL_KM;SL4B_ObjectSubscriptionManager.prototype.sendStaleToAll = SL_JR;SL4B_ObjectSubscriptionManager.prototype.sendCurrentObjectStatusToAll = SL_QF;SL4B_ObjectSubscriptionManager.prototype.sendObjectStatusToAll = SL_MA;SL4B_ObjectSubscriptionManager.prototype.structureChange = SL_LT;SL4B_ObjectSubscriptionManager.prototype.structureChange2 = SL_PT;SL4B_ObjectSubscriptionManager.prototype.structureMultiChange = SL_PG;SL4B_ObjectSubscriptionManager.prototype.structureMultiChange2 = SL_BY;SL4B_ObjectSubscriptionManager.prototype.registerProxySubscriber = SL_QX;SL4B_ObjectSubscriptionManager.prototype.getProxySubscriber = SL_HZ;SL4B_ObjectSubscriptionManager.prototype.addContainerRequestData = SL_RE;SL4B_ObjectSubscriptionManager.prototype.getContainerRequestData = SL_DD;SL4B_ObjectSubscriptionManager.prototype.getContainer = function(A,B,D,E,C){SL4B_JavaScriptRttpProvider.checkWindowRange(E,C);var l_oListener=SL4B_AbstractRttpProvider.prototype.getListener(A); var l_oProxyListener=SL4B_AbstractRttpProvider.prototype.getListener(new SL4B_ProxySubscriber(A)); var l_oContainerKey=new SL4B_ContainerKey(); this.addContainerRequestData(l_oListener,l_oContainerKey,B,D,E,C);var l_sCombinedFieldList=SL4B_AbstractRttpProvider.prototype.createFieldListForContainer(l_oContainerKey.getId(),D,E,C); this.registerProxySubscriber(l_oListener,l_oProxyListener,B,l_sCombinedFieldList);this.requestObject(l_oListener,B,l_sCombinedFieldList);return l_oContainerKey; }; SL4B_ObjectSubscriptionManager.prototype.setContainerWindow = function(A,C,B){SL4B_JavaScriptRttpProvider.checkWindowRange(C,B);var l_oRequestData=this.getContainerRequestData(A.getId()); var l_sOldCombinedFieldList=SL4B_AbstractRttpProvider.prototype.createFieldListForContainer(A.getId(),l_oRequestData.getFieldList(),l_oRequestData.getWindowStart(),l_oRequestData.getWindowEnd()); var l_oOldFilterAndFieldList=this.splitFilter(l_sOldCombinedFieldList); this.removeObject(l_oRequestData.getSubscriberId(),l_oRequestData.getContainerName(),l_oOldFilterAndFieldList.m_sFilter,l_oOldFilterAndFieldList.m_sFieldList);l_oRequestData.setWindowStart(C);l_oRequestData.setWindowEnd(B);var l_sCombinedFieldList=SL4B_AbstractRttpProvider.prototype.createFieldListForContainer(A.getId(),l_oRequestData.getFieldList(),C,B); var l_oFilterAndFieldList=this.splitFilter(l_sCombinedFieldList); var l_sObjectKey=l_oRequestData.getContainerName()+l_oFilterAndFieldList.m_sFilter; this.addObject(l_oRequestData.getSubscriberId(),l_oRequestData.getContainerName(),l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList);var l_sObjectRequestMessage=SL4B_ObjectCache.buildRTTPRequestMessage(l_oRequestData.getContainerName(),l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList); this.m_oObjectCache.sendSubscriptionMessage(l_sObjectRequestMessage,{filter:l_oFilterAndFieldList.m_sFilter});}; function SL_RE(F,D,A,C,E,B){var l_oContainerRequestData=new SL4B_ContainerRequestData(F,D.getId(),A,C,E,B); this.m_oContainerIdToRequestDataMap[D.getId()]=l_oContainerRequestData;} function SL_DD(A){return this.m_oContainerIdToRequestDataMap[A]; } function SL_QX(D,C,A,B){var l_oFilterAndFieldList=this.splitFilter(B); var l_sObjectKey=A+l_oFilterAndFieldList.m_sFilter; if(this.m_oContainerProxySubscribers[l_sObjectKey]==null){this.m_oContainerProxySubscribers[l_sObjectKey]=new Object();}this.m_oContainerProxySubscribers[l_sObjectKey][D]=C;} function SL_HZ(C,A,B){var l_oFilterAndFieldList=this.splitFilter(B); var l_sObjectKey=A+l_oFilterAndFieldList.m_sFilter; if(this.m_oContainerProxySubscribers[l_sObjectKey]!=null){return this.m_oContainerProxySubscribers[l_sObjectKey][C]; }return null; } function SL_LT(A,C,D,B,E){if(typeof (E)!="undefined"){this.structureChange2(A,C,D,B,E);}else {for(l_sListenerId in this.m_pObjectSubscriptions[A]){this.structureChange2(A,C,D,B,l_sListenerId);}}} function SL_PT(A,C,D,B,E){if(this.m_oContainerProxySubscribers[A]!=null){var l_sProxyListenerId=this.m_oContainerProxySubscribers[A][E]; if(l_sProxyListenerId!=null){if(B){this.addObject(l_sProxyListenerId,C,"","");if(this.m_oContainerObjects[A]==null){this.m_oContainerObjects[A]=new Object();}this.m_oContainerObjects[A][C]=C;}else {this.removeObject(l_sProxyListenerId,C,"","");if(this.m_oContainerObjects[A]!=null){delete this.m_oContainerObjects[A][C];}}}var l_oSubscription=this.m_pObjectSubscriptions[A][E]; l_oSubscription.m_oSubscriber.WTStructureChange(l_oSubscription.m_sObjectName,C,D,B);}} function SL_PG(B,A,D,C,E){if(typeof (E)!="undefined"){this.structureMultiChange2(B,A,D,C,E);}else {for(l_sListenerId in this.m_pObjectSubscriptions[B]){this.structureMultiChange2(B,A,D,C,l_sListenerId);}}} function SL_BY(B,A,D,C,E){if(this.m_oContainerProxySubscribers[B]!=null){var l_oSubscription=this.m_pObjectSubscriptions[B][E]; l_oSubscription.m_oSubscriber.WTStructureMultiChange(l_oSubscription.m_sObjectName,A,D,C);}} function SL_BO(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ObjectSubscriptionManager.reRequestObjects()");for(l_sObjectKey in this.m_pObjectSubscriptions){var l_pListenerMap=this.m_pObjectSubscriptions[l_sObjectKey]; for(l_oListenerId in l_pListenerMap){var l_oObjectSubscription=l_pListenerMap[l_oListenerId]; if(!l_oObjectSubscription.m_oSubscriber.m_bIsProxySubscriber){if(l_oObjectSubscription.isSubscribedToAllFields()){this.m_oObjectCache.requestObject(l_oObjectSubscription.m_sObjectName,l_oObjectSubscription.m_sFilter,"");}else {for(var l_nFieldList=0,l_nLength=l_oObjectSubscription.m_pFieldLists.length;l_nFieldList<l_nLength;++l_nFieldList){var l_sFieldList=l_oObjectSubscription.m_pFieldLists[l_nFieldList]; this.m_oObjectCache.requestObject(l_oObjectSubscription.m_sObjectName,l_oObjectSubscription.m_sFilter,l_sFieldList.replace(/^,/,"").replace(/,$/,""));}}}}}} function SL_JR(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ObjectSubscriptionManager.sendStaleToAll()");this.sendObjectStatusToAll(GF_CachedObjectStatus.const_CONNECTION_LOST);} function SL_QF(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ObjectSubscriptionManager.sendCurrentObjectStatusToAll()");this.sendObjectStatusToAll(null);} function SL_MA(A){for(l_sObjectKey in this.m_pObjectSubscriptions){var l_pListenerMap=this.m_pObjectSubscriptions[l_sObjectKey]; for(l_oListenerId in l_pListenerMap){var l_oObjectSubscription=l_pListenerMap[l_oListenerId]; var l_oObjectStatus=((A===null) ? this.m_oObjectCache.getObjectStatus(l_sObjectKey) : A); l_oObjectSubscription.m_oSubscriber.WTObjectStatus(l_oObjectSubscription.m_sObjectName,l_oObjectStatus.m_nType,l_oObjectStatus.m_nCode,l_oObjectStatus.m_sMessage);}}} function SL_GL(){this.m_sFilter="";this.m_sFieldList="";} function SL_KM(A){var l_oReturn=new SL_GL(); var l_pFilter=new Array(); var l_sFilter=""; var l_sNewFieldList=A; if(A!=null){var l_pNames=["imagefilter=","filter=","auto=","monitor=","ctrid="]; for(l_nName in l_pNames){var l_nFilterPos=l_sNewFieldList.indexOf(l_pNames[l_nName]); if(l_nFilterPos!=-1){var l_nEndFilterPos=l_sNewFieldList.indexOf(",",l_nFilterPos); if(l_nEndFilterPos!=-1){l_pFilter.push(l_sNewFieldList.substring(l_nFilterPos,l_nEndFilterPos));}else {l_pFilter.push(l_sNewFieldList.substring(l_nFilterPos));}var l_sOldFieldList=l_sNewFieldList; l_sNewFieldList="";if(l_nFilterPos>0){l_sNewFieldList+=l_sOldFieldList.substring(0,l_nFilterPos);}if(l_nEndFilterPos!=-1&&l_nEndFilterPos<l_sOldFieldList.length){l_sNewFieldList+=l_sOldFieldList.substring(l_nEndFilterPos+1);}if(l_sNewFieldList.substring(l_sNewFieldList.length-1,l_sNewFieldList.length)==","){l_sNewFieldList=l_sNewFieldList.substring(0,l_sNewFieldList.length-1);}}}l_sFilter=l_pFilter.join(",");}else {l_sNewFieldList="";}l_oReturn.m_sFieldList=l_sNewFieldList;l_oReturn.m_sFilter=l_sFilter;return l_oReturn; } function SL_BP(C,B,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.requestObject: {0}, {1}, {2}",C,B,A);var l_oFilterAndFieldList=this.splitFilter(A); var l_bIsValidObject=this.addObject(C,B,l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList); if(l_bIsValidObject){this.m_oObjectCache.requestObject(B,l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList,C);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectSubscriptionManager.requestObject: attempt to request illegal object \"{0}\" ignored",B);}} function SL_NZ(C,A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.requestObjects: {0}, {1}, {2}",C,A,B);var l_oFilterAndFieldList=this.splitFilter(B); var l_sValidatedObjectList=""; var l_pObjectNames=A.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); for(var l_nObject=0,l_nSize=l_pObjectNames.length;l_nObject<l_nSize;++l_nObject){var l_bIsValidObject=this.addObject(C,l_pObjectNames[l_nObject],l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList); if(l_bIsValidObject){l_sValidatedObjectList+=((l_sValidatedObjectList=="") ? "" : SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER)+l_pObjectNames[l_nObject];}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectSubscriptionManager.requestObjects: attempt to request illegal object \"{0}\" ignored",l_pObjectNames[l_nObject]);}}if(l_sValidatedObjectList!=""){this.m_oObjectCache.requestObjects(l_sValidatedObjectList,l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList,C);}} function SL_DH(C,B,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.discardObject: {0}, {1}, {2}",C,B,A);var l_oFilterAndFieldList=this.splitFilter(A); var l_sObjectKey=B+l_oFilterAndFieldList.m_sFilter; var l_oContainedObjects=this.m_oContainerObjects[l_sObjectKey]; if(l_oContainedObjects!=null){var nCtridloc=A.indexOf("ctrid="); if(nCtridloc>=0){var sCtrid=A.substring(nCtridloc+6); if(sCtrid.indexOf(",")){sCtrid=sCtrid.substring(0,sCtrid.indexOf(","));}SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINER_INT,"ObjectSubscriptionManager.discardObject: ctrid={0}",sCtrid);delete this.m_oContainerIdToRequestDataMap[sCtrid];}var l_sProxyListenerId=this.m_oContainerProxySubscribers[l_sObjectKey][C]; if(l_sProxyListenerId!=null){for(l_sContainedObjectName in l_oContainedObjects){this.removeObject(l_sProxyListenerId,l_sContainedObjectName,"");}}delete this.m_oContainerProxySubscribers[l_sObjectKey][C];}var l_bDiscardFromServer=this.removeObject(C,B,l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList); if(l_bDiscardFromServer==true){this.m_oObjectCache.discardObject(B,l_oFilterAndFieldList.m_sFilter);delete this.m_oContainerObjects[l_sObjectKey];delete this.m_oContainerProxySubscribers[B];}} SL4B_ObjectSubscriptionManager.prototype._discarded = function(){}; function SL_LL(A,B,C){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.discardObjects: {0}, {1}, {2}",A,B,C);var l_oFilterAndFieldList=this.splitFilter(C); var l_sValidatedObjectList=""; var l_pObjectNames=B.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); for(var l_nObject=0,l_nSize=l_pObjectNames.length;l_nObject<l_nSize;++l_nObject){var l_sObjectName=l_pObjectNames[l_nObject]; var l_sObjectKey=l_sObjectName+l_oFilterAndFieldList.m_sFilter; var l_oContainedObjects=this.m_oContainerObjects[l_sObjectKey]; if(l_oContainedObjects!=null){var l_sProxyListenerId=this.m_oContainerProxySubscribers[l_sObjectKey][A]; if(l_sProxyListenerId!=null){for(l_sContainedObjectName in l_oContainedObjects){this.removeObject(l_sProxyListenerId,l_sContainedObjectName,"");}}delete this.m_oContainerProxySubscribers[l_sObjectKey][A];}var l_bDiscardFromServer=this.removeObject(A,l_sObjectName,l_oFilterAndFieldList.m_sFilter,l_oFilterAndFieldList.m_sFieldList); if(l_bDiscardFromServer==true){l_sValidatedObjectList+=((l_sValidatedObjectList=="") ? "" : SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER)+l_pObjectNames[l_nObject];delete this.m_oContainerObjects[l_sObjectKey];delete this.m_oContainerProxySubscribers[l_sObjectName];}}if(l_sValidatedObjectList!=""){this.m_oObjectCache.discardObjects(l_sValidatedObjectList,l_oFilterAndFieldList.m_sFilter);}} function SL_LH(D,C,B,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.addObject: {0}, {1}, {2}, {3}",D,C,B,A);var l_bIsValidObject=this.isValidObject(C); if(l_bIsValidObject){var l_sObjectKey=C+B; if(this.m_pObjectSubscriptions[l_sObjectKey]===undefined){this.m_pObjectSubscriptions[l_sObjectKey]=new Object();}if(this.m_pObjectSubscriptions[l_sObjectKey][D]===undefined){this.m_pObjectSubscriptions[l_sObjectKey][D]=new SL4B_ObjectSubscription(D,C,B);}this.m_pObjectSubscriptions[l_sObjectKey][D].addFields(A);}return l_bIsValidObject; } function SL_CK(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.removeSubscriber: {0}",A);for(l_sObject in this.m_pObjectSubscriptions){for(l_sCurrListenerId in this.m_pObjectSubscriptions[l_sObject]){if(l_sCurrListenerId==A){this.discardObject(A,l_sObject,SL4B_ObjectSubscription.const_ALL_FIELDS);}}}} function SL_QG(D,C,B,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.removeObject: {0}, {1}, {2}",D,C,A);var l_bSendDiscard=this.isValidObject(C); if(l_bSendDiscard){var l_sObjectKey=C+B; var l_bCheckForDiscard=false; if(this.m_pObjectSubscriptions[l_sObjectKey]===undefined){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectSubscriptionManager.removeObject: attempt to remove an object ({0}) that is not currently subscribed to",C);}else if(this.m_pObjectSubscriptions[l_sObjectKey][D]===undefined){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ObjectSubscriptionManager.removeObject: attempt to remove an object ({0}) that is not currently subscribed to by the specified listener ({1})",C,D);}else {var l_oObjectSubscription=this.m_pObjectSubscriptions[l_sObjectKey][D]; var l_bRemaining=l_oObjectSubscription.removeFields(A); if(l_bRemaining==false){l_bCheckForDiscard=!l_oObjectSubscription.m_oSubscriber.m_bIsProxySubscriber;delete this.m_pObjectSubscriptions[l_sObjectKey][D];}}if(l_bCheckForDiscard){if(this.m_pObjectSubscriptions[l_sObjectKey]){for(l_oListenerId in this.m_pObjectSubscriptions[l_sObjectKey]){var l_oSubscriber=this.m_pObjectSubscriptions[l_sObjectKey][l_oListenerId].m_oSubscriber; if(!l_oSubscriber.m_bIsProxySubscriber){l_bSendDiscard=false;break; }}}}else {l_bSendDiscard=false;}}return l_bSendDiscard; } function SL_AK(A){this.m_oObjectCache=A;} function SL_GB(A,C,D,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.recordMultiUpdated: {0}, {1}, {2}",A,C,D);if(typeof (B)!="undefined"){this.recordMultiUpdated2(A,C,D,B);}else {for(l_sListenerId in this.m_pObjectSubscriptions[A]){this.recordMultiUpdated2(A,C,D,l_sListenerId);}}} function SL_II(D,A,C,B){var l_oSubscription=this.m_pObjectSubscriptions[D][B]; var l_bAllFields=l_oSubscription.isSubscribedToAllFields(); var l_oRecordFieldData=null; if(l_bAllFields){l_oRecordFieldData=A;}else {l_oRecordFieldData=new SL4B_RecordFieldData();for(var l_nCount=0,l_nSize=A.size();l_nCount<l_nSize;l_nCount++){var l_sFieldName=A.getFieldName(l_nCount); if(l_oSubscription.isSubscribedToField(l_sFieldName)){var l_sFieldValue=A.getFieldValue(l_nCount); l_oRecordFieldData.add(l_sFieldName,l_sFieldValue);}}}if(l_oRecordFieldData.size()!=0){SL4B_MethodInvocationProxy.invoke(l_oSubscription.m_oSubscriber,"recordMultiUpdated",[l_oSubscription.m_sObjectName,l_oRecordFieldData,C]);}else {SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.recordMultiUpdated2: didn't invoke record multiupdated, as there were no updated fields {0}",l_oSubscription.m_sObjectName);}} function SL_DA(B,A,C){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.deleteType2Level: {0}, {1}, {2}",B,A,C);for(l_sListenerId in this.m_pObjectSubscriptions[B]){var l_oSubscription=this.m_pObjectSubscriptions[B][l_sListenerId]; l_oSubscription.m_oSubscriber.WTFieldDeleted(l_oSubscription.m_sObjectName,A,C);}} function SL_GE(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.type2Clear: {0}",A);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTType2Clear(l_oSubscription.m_sObjectName);}} function SL_DO(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.type3Clear: {0}",A);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTType3Clear(l_oSubscription.m_sObjectName);}} function SL_JK(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.clearAllSubscriptions: {0}",A);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; if(B==SL4B_RttpCodes.const_NOT_FOUND_DELAY||B==SL4B_RttpCodes.const_NOT_FOUND){l_oSubscription.m_oSubscriber.WTObjectNotFound(l_oSubscription.m_sObjectName);}else if(B==SL4B_RttpCodes.const_READ_DENY_DELAY||B==SL4B_RttpCodes.const_READ_DENY){l_oSubscription.m_oSubscriber.WTObjectReadDenied(l_oSubscription.m_sObjectName);}else if((B>SL4B_RttpCodes.const_READ_DENY_DELAY&&B<SL4B_RttpCodes.const_WRITE_DENY_DELAY)||(B>SL4B_RttpCodes.const_READ_DENY&&B<SL4B_RttpCodes.const_WRITE_DENY)){l_oSubscription.m_oSubscriber.WTObjectReadDenied(l_oSubscription.m_sObjectName,(B%10));}else if(B==SL4B_RttpCodes.const_WRITE_DENY_DELAY||B==SL4B_RttpCodes.const_WRITE_DENY){l_oSubscription.m_oSubscriber.WTObjectWriteDenied(l_oSubscription.m_sObjectName);}else if((B>SL4B_RttpCodes.const_WRITE_DENY_DELAY&&B<SL4B_RttpCodes.const_UNAVAILABLE_DELAY)||(B>SL4B_RttpCodes.const_WRITE_DENY&&B<SL4B_RttpCodes.const_UNAVAILABLE)){l_oSubscription.m_oSubscriber.WTObjectWriteDenied(l_oSubscription.m_sObjectName,(B%10));}else if(B==SL4B_RttpCodes.const_UNAVAILABLE_DELAY||B==SL4B_RttpCodes.const_UNAVAILABLE){l_oSubscription.m_oSubscriber.WTObjectUnavailable(l_oSubscription.m_sObjectName);}}} function SL_EY(C,D,A,B,E){if(typeof (E)!="undefined"){var l_oSubscription=this.m_pObjectSubscriptions[C][E]; l_oSubscription.m_oSubscriber.WTDirUpdated(l_oSubscription.m_sObjectName,D,A,B);}else {for(l_sListenerId in this.m_pObjectSubscriptions[C]){var l_oSubscription=this.m_pObjectSubscriptions[C][l_sListenerId]; l_oSubscription.m_oSubscriber.WTDirUpdated(l_oSubscription.m_sObjectName,D,A,B);}}} function SL_NY(A,B){for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTDirMultiUpdated(l_oSubscription.m_sObjectName,B);}} function SL_PF(A,D,C,B){for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTNewsUpdated(l_oSubscription.m_sObjectName,D,C,B);}} function SL_IC(B,C,D,A){for(l_sListenerId in this.m_pObjectSubscriptions[B]){var l_oSubscription=this.m_pObjectSubscriptions[B][l_sListenerId]; l_oSubscription.m_oSubscriber.WTObjectInfo(l_oSubscription.m_sObjectName,C,D,A);}} function SL_BJ(B,A){for(l_sListenerId in this.m_pObjectSubscriptions[B]){var l_oSubscription=this.m_pObjectSubscriptions[B][l_sListenerId]; for(var i=0;i<A.length;i++){if(i||A[i]){l_oSubscription.m_oSubscriber.WTStoryUpdated(B,A[i]||"\\n");}}}} function SL_MV(A,B,C){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.permissionUpdated: {0}, {1}, {2}",A,B,C);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; var l_bAllFields=l_oSubscription.isSubscribedToAllFields(); var l_oSubscribedFieldData=null; if(l_bAllFields){l_oSubscribedFieldData=C;}else {l_oSubscribedFieldData=new SL4B_RecordFieldData();for(var l_nCount=0,l_nSize=C.size();l_nCount<l_nSize;l_nCount++){var l_sFieldName=C.getFieldName(l_nCount); var l_sFieldValue=C.getFieldValue(l_nCount); if(l_oSubscription.isSubscribedToField(l_sFieldName)){l_oSubscribedFieldData.add(l_sFieldName,l_sFieldValue);}}}if(l_oSubscribedFieldData.size()!=0){l_oSubscription.m_oSubscriber.WTPermissionUpdated(l_oSubscription.m_sObjectName,B,l_oSubscribedFieldData);}}} function SL_FK(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.deleteAllPermissionEntries: {0}",A);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTPermissionDeleted(l_oSubscription.m_sObjectName,null);}} function SL_DU(A,B){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscriptionManager.deleteAllPermissionEntries: {0}, {1}",A,B);for(l_sListenerId in this.m_pObjectSubscriptions[A]){var l_oSubscription=this.m_pObjectSubscriptions[A][l_sListenerId]; l_oSubscription.m_oSubscriber.WTPermissionDeleted(l_oSubscription.m_sObjectName,B);}} function SL_MJ(B,C,A,D){for(l_sListenerId in this.m_pObjectSubscriptions[B]){this.objectStatusForListener(B,C,A,D,l_sListenerId);}} SL4B_ObjectSubscriptionManager.prototype.objectStatusForListener = function(B,C,A,D,E){var l_oSubscription=this.m_pObjectSubscriptions[B][E]; l_oSubscription.m_oSubscriber.WTObjectStatus(l_oSubscription.m_sObjectName,C,A,D);}; SL4B_ObjectSubscriptionManager.prototype.chat = function(A,C,D,B,E,F){if(F===undefined){for(l_sStoredListenerId in this.m_pObjectSubscriptions[A]){this.chat(A,C,D,B,E,l_sStoredListenerId);}}else {var l_oSubscription=this.m_pObjectSubscriptions[A][F]; l_oSubscription.m_oSubscriber.WTChat(l_oSubscription.m_sObjectName,C,D,B,E);}}; function GF_ActionSubscriptionManager(){this.CLASS_NAME="GF_ActionSubscriptionManager";} SL4B_ActionSubscriptionManager=GF_ActionSubscriptionManager;GF_ActionSubscriptionManager.prototype.sendActionMessage = SL_KK;GF_ActionSubscriptionManager.prototype.contribObject = SL_RF;GF_ActionSubscriptionManager.prototype.createObject = SL_KV;GF_ActionSubscriptionManager.prototype.deleteObject = SL_QW;GF_ActionSubscriptionManager.prototype.throttleObjects = SL_LV;GF_ActionSubscriptionManager.prototype.throttleGlobal = SL_KB;function SL_KK(A,B){SL4B_Accessor.getUnderlyingRttpProvider().getManagedConnection().sendMessage(B,A);} function SL_RF(C,A,B){var l_nLength=B.size(); var pContribMessage=new Array(2+l_nLength); pContribMessage[0]="CONTRIB ";pContribMessage[1]=GF_RequestEncoder.encodeRttpData(A);for(var l_nField=0;l_nField<l_nLength;++l_nField){var l_oField=B.getField(l_nField); pContribMessage[2+l_nField]=" "+GF_RequestEncoder.encodeRttpData(l_oField.m_sName)+"="+GF_RequestEncoder.encodeRttpData(l_oField.m_sValue);}var l_oActionSubscription=new SL_BV(C,A,B); this.sendActionMessage(l_oActionSubscription,pContribMessage.join(""));} function SL_KV(A,B){var l_sCreationMessage="CREATE "+GF_RequestEncoder.encodeRttpData(A)+";"+B; this.sendActionMessage(new SL_MD(A,B),l_sCreationMessage);} function SL_LV(A,B){if(SL4B_ThrottleLevel.isValid(B)===false){throw new SL4B_Exception("'"+B+"' is not a valid throttle level."); }var l_pObjectNames=A.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); for(var i=0;i<l_pObjectNames.length;i++){l_pObjectNames[i]=GF_RequestEncoder.encodeRttpData(l_pObjectNames[i]);}var l_sThrottleMessage="THROTTLE "+l_pObjectNames.join(";"+B+" ")+";"+B; this.sendActionMessage(new SL_CX(B,false),l_sThrottleMessage);} function SL_KB(A){if(SL4B_ThrottleLevel.isValid(A)===false){throw new SL4B_Exception("'"+A+"' is not a valid throttle level."); }this.sendActionMessage(new SL_CX(A,true),"GLOBAL_THROTTLE "+A);} function SL_QW(A){var l_sDeletionMessage="DELETE "+GF_RequestEncoder.encodeRttpData(A); this.sendActionMessage(new SL_JU(A),l_sDeletionMessage);} function SL_MX(){} SL_MX.prototype.receiveMessage = function(A,B){throw new SL4B_Error("AbstractActionSubscription.receiveMessage: method not implemented"); }; function SL_BV(C,A,B){this.m_oSubscriber=eval(C);this.m_sObjectName=A;this.m_oFieldData=B;} SL_BV.prototype = new SL_MX;SL_BV.prototype.receiveMessage = function(B,A){var l_nRttpCode=B.getRttpCode(); switch(l_nRttpCode){ case SL4B_RttpCodes.const_CONTRIB_OK:case SL4B_RttpCodes.const_CONTRIB_OK_DELAY:this.m_oSubscriber.WTContribOk(this.m_sObjectName);break; case SL4B_RttpCodes.const_CONTRIB_WAIT:break; default :var nAuthCode=this.getAuthCode(l_nRttpCode); if(nAuthCode===undefined){this.m_oSubscriber.WTContribFailed(this.m_sObjectName,this.getFailureDescription(l_nRttpCode));}else {this.m_oSubscriber.WTContribFailed(this.m_sObjectName,this.getFailureDescription(l_nRttpCode),nAuthCode);}break; }}; SL_BV.prototype.getFailureDescription = function(A){var l_sDescription; switch(A){ case SL4B_RttpCodes.const_NOT_FOUND:case SL4B_RttpCodes.const_NOT_FOUND_DELAY:l_sDescription="Object not found";break; case SL4B_RttpCodes.const_UNAVAILABLE:case SL4B_RttpCodes.const_UNAVAILABLE_DELAY:l_sDescription="Object unavailable";break; case SL4B_RttpCodes.const_DELETED_DELAY:case SL4B_RttpCodes.const_CONTRIB_FAILED:default :if((A>=SL4B_RttpCodes.const_READ_DENY_DELAY&&A<SL4B_RttpCodes.const_WRITE_DENY_DELAY)||(A>=SL4B_RttpCodes.const_READ_DENY&&A<SL4B_RttpCodes.const_WRITE_DENY)){l_sDescription="Read denied";}else if((A>=SL4B_RttpCodes.const_WRITE_DENY_DELAY&&A<SL4B_RttpCodes.const_UNAVAILABLE_DELAY)||(A>=SL4B_RttpCodes.const_WRITE_DENY&&A<SL4B_RttpCodes.const_UNAVAILABLE)){l_sDescription="Write denied";}else {l_sDescription="Unknown failure code ("+A+")";}}return l_sDescription; }; SL_BV.prototype.getAuthCode = function(A){var l_nAuthCode; if((A>SL4B_RttpCodes.const_READ_DENY_DELAY&&A<SL4B_RttpCodes.const_WRITE_DENY_DELAY)||(A>SL4B_RttpCodes.const_READ_DENY&&A<SL4B_RttpCodes.const_WRITE_DENY)||(A>SL4B_RttpCodes.const_WRITE_DENY_DELAY&&A<SL4B_RttpCodes.const_UNAVAILABLE_DELAY)||(A>SL4B_RttpCodes.const_WRITE_DENY&&A<SL4B_RttpCodes.const_UNAVAILABLE)){l_nAuthCode=A%10;}return l_nAuthCode; }; function SL_MD(A,B){this.m_sObjectName=A;this.m_sRttpType=B;} SL_MD.prototype = new SL_MX;SL_MD.prototype.receiveMessage = function(B,A){var l_nRttpCode=B.getRttpCode(); switch(l_nRttpCode){ case SL4B_RttpCodes.const_CREATE_OK:break; default :break; }}; function SL_CX(A,B){this.m_sThrottleStatus=A;this.m_bIsGlobal=B;} SL_CX.prototype = new SL_MX;SL_CX.prototype.receiveMessage = function(B,A){var l_nRttpCode=B.getRttpCode(); switch(l_nRttpCode){ case SL4B_RttpCodes.const_THROTTLE_OK:break; default :break; }}; function SL_JU(A){this.m_sObjectName=A;} SL_JU.prototype = new SL_MX;SL_JU.prototype.receiveMessage = function(B,A){var l_nRttpCode=B.getRttpCode(); switch(l_nRttpCode){ case SL4B_RttpCodes.const_DELETE_OK:break; default :break; }}; var SL4B_ObjectSubscription=function(){}; if(false){function SL4B_ObjectSubscription(){} }SL4B_ObjectSubscription = function(B,E,D,C){this.m_sSubscriptionId=B;this.m_oSubscriber=eval(B);this.m_sObjectName=E;this.m_sFilter=D;this.m_pFieldLists=new Array();this.m_bAllFields=false;this.normaliseFieldList = function(A){var l_sReturnList=A; if(typeof (A)!="undefined"&&A!=null&&A!=SL4B_ObjectSubscription.const_ALL_FIELDS){if(A.charAt(0)!=","){l_sReturnList=","+l_sReturnList;}if(A.charAt(A.length-1)!=","){l_sReturnList+=",";}}return l_sReturnList; }; if(typeof (C)!="undefined"){this.addFields(C);}}; SL4B_ObjectSubscription.const_ALL_FIELDS="";SL4B_ObjectSubscription.isAllFields = function(A){return (typeof A=="undefined"||A==null||A==SL4B_ObjectSubscription.const_ALL_FIELDS); }; SL4B_ObjectSubscription.prototype.addFields = SL_AN;SL4B_ObjectSubscription.prototype.removeFields = SL_BH;SL4B_ObjectSubscription.prototype.isSubscribedToField = SL_LY;SL4B_ObjectSubscription.prototype.isSubscribedToAllFields = SL_CE;function SL_AN(A){A=this.normaliseFieldList(A);SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscription.addFields: {0}",A);if(A==null||typeof A=="undefined"){A=SL4B_ObjectSubscription.const_ALL_FIELDS;}if(A==SL4B_ObjectSubscription.const_ALL_FIELDS){this.m_bAllFields=true;}var l_bFound=false; for(var l_nFieldList=0,l_nLength=this.m_pFieldLists.length;l_nFieldList<l_nLength;++l_nFieldList){if(this.m_pFieldLists[l_nFieldList]==A){l_bFound=true;break; }}if(!l_bFound){this.m_pFieldLists.push(A);}} function SL_BH(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ObjectSubscription.removeFields: {0}",A);A=this.normaliseFieldList(A);if(A==null||typeof A=="undefined"){A=SL4B_ObjectSubscription.const_ALL_FIELDS;}var l_bFound=false; if(A==SL4B_ObjectSubscription.const_ALL_FIELDS){this.m_bAllFields=false;this.m_pFieldLists=new Array();}else {var l_nFieldList=0; while(l_nFieldList<this.m_pFieldLists.length){if(this.m_pFieldLists[l_nFieldList]==A){this.m_pFieldLists.splice(l_nFieldList,1);}else {l_bFound=true;l_nFieldList++;}}}return l_bFound; } function SL_LY(A){var l_bIsSubscribed=false; var l_sTestFieldName=","+A+","; for(var l_nFieldList=0,l_nLength=this.m_pFieldLists.length;l_nFieldList<l_nLength;++l_nFieldList){if(this.m_pFieldLists[l_nFieldList]==SL4B_ObjectSubscription.const_ALL_FIELDS||this.m_pFieldLists[l_nFieldList].indexOf(l_sTestFieldName)!=-1){l_bIsSubscribed=true;break; }}return l_bIsSubscribed; } function SL_CE(){return this.m_bAllFields; } function GF_CachedObjectStatus(E,D,F){this.m_nType=E;this.m_nCode=D;this.m_sMessage=F;this.updateStatus = function(B,A,C){this.m_nType=B;this.m_nCode=A;this.m_sMessage=C;}; } GF_CachedObjectStatus.const_CONNECTION_LOST=new GF_CachedObjectStatus(SL4B_ObjectStatus.STALE,0,"Liberator connection lost");GF_CachedObjectStatus.const_SUBSCRIBING=new GF_CachedObjectStatus(SL4B_ObjectStatus.STALE,0,"Subscribing to object");var SL4B_RttpMessage=function(){}; if(false){function SL4B_RttpMessage(){} }SL4B_RttpMessage = function(){this.m_nRttpCode=null;this.m_sSequenceNumber=null;this.m_sObjectNumber=null;this.m_sMessageContent=null;this.m_pMultipleLineContents=null;this.m_bIsMessageComplete=true;}; SL4B_RttpMessage.const_RTTP_CODE_SIZE=2;SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE=2;SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE=4;SL4B_RttpMessage.const_MAXIMUM_MESSAGE_CODE_SIZE=SL4B_RttpMessage.const_RTTP_CODE_SIZE+SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE+SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE;SL4B_RttpMessage.const_MESSAGE_CODE_END=" ";SL4B_RttpMessage.const_NO_MESSAGE_CONTENT="";SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START="-";SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_END=".";SL4B_RttpMessage.JSON_MESSAGE_ADAPTOR=new SL_EE();SL4B_RttpMessage.createBase64Decoder=SL_JO;SL4B_RttpMessage.m_pBase64Decoder=SL4B_RttpMessage.createBase64Decoder();SL4B_RttpMessage.prototype.setMessage = SL_CC;SL4B_RttpMessage.prototype.internalConstructor = SL_MS;SL4B_RttpMessage.prototype.decodeRttpCode = SL_IL;SL4B_RttpMessage.prototype.isMessageComplete = function(){return this.m_bIsMessageComplete; }; SL4B_RttpMessage.prototype.getRttpCode = function(){return this.m_nRttpCode; }; SL4B_RttpMessage.prototype.getSequenceNumber = function(){return this.m_sSequenceNumber; }; SL4B_RttpMessage.prototype.getObjectNumber = function(){return this.m_sObjectNumber; }; SL4B_RttpMessage.prototype.getMessageContent = function(){return this.m_sMessageContent; }; SL4B_RttpMessage.prototype.isMultipleLineMessage = function(){return (this.m_pMultipleLineContents!=null); }; SL4B_RttpMessage.prototype.getMultipleLineContents = function(){return this.m_pMultipleLineContents; }; SL4B_RttpMessage.prototype.toString = function(){return this.m_nRttpCode+((this.m_sSequenceNumber==null) ? "" : " {"+this.m_sSequenceNumber+"}")+((this.m_sObjectNumber==null) ? "" : " ["+this.m_sObjectNumber+"]")+": "+this.m_sMessageContent; }; function SL_JO(){var l_sBase64Encoding="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; var l_pDecoder=new Object(); for(var l_nDecodedValue=0,l_nLength=l_sBase64Encoding.length;l_nDecodedValue<l_nLength;++l_nDecodedValue){l_pDecoder[l_sBase64Encoding.charAt(l_nDecodedValue)]=l_nDecodedValue;}return l_pDecoder; } function SL_CC(B,A){if(this.m_bIsMessageComplete){this.m_nRttpCode=null;this.m_sSequenceNumber=null;this.m_sObjectNumber=null;this.m_sMessageContent=SL4B_RttpMessage.const_NO_MESSAGE_CONTENT;this.m_pMultipleLineContents=null;}return this.internalConstructor(B,A); } function SL_MS(B,A){if(A>=B.length){throw new SL4B_Exception("An illegal message index ("+A+") was received"); }var l_sRttpMessage=B[A]; if(l_sRttpMessage==null){throw new SL4B_Exception("A null RTTP message was received"); }var l_bIsMultipleLineMessage=false; if(!this.m_bIsMessageComplete){l_bIsMultipleLineMessage=true;}else {var l_nMessageCodeEnd=l_sRttpMessage.indexOf(SL4B_RttpMessage.const_MESSAGE_CODE_END); if(l_nMessageCodeEnd==-1){var l_nMessageLength=l_sRttpMessage.length; if(l_sRttpMessage.charAt(l_nMessageLength-1)==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START&&l_nMessageLength!=2&&l_nMessageLength!=4&&l_nMessageLength!=6&&l_nMessageLength!=8){l_bIsMultipleLineMessage=true;l_nMessageCodeEnd=l_sRttpMessage.length-1;}else {l_nMessageCodeEnd=l_sRttpMessage.length;}}if(l_nMessageCodeEnd>SL4B_RttpMessage.const_MAXIMUM_MESSAGE_CODE_SIZE){if(l_sRttpMessage.charAt(SL4B_RttpMessage.const_MAXIMUM_MESSAGE_CODE_SIZE)==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START){l_nMessageCodeEnd=SL4B_RttpMessage.const_MAXIMUM_MESSAGE_CODE_SIZE;l_bIsMultipleLineMessage=true;}else if(l_sRttpMessage.charAt(6)==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START){l_nMessageCodeEnd=6;l_bIsMultipleLineMessage=true;}else if(l_sRttpMessage.charAt(4)==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START){l_nMessageCodeEnd=4;l_bIsMultipleLineMessage=true;}else if(l_sRttpMessage.charAt(2)==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_START){l_nMessageCodeEnd=2;l_bIsMultipleLineMessage=true;}}var l_nPosition=SL4B_RttpMessage.const_RTTP_CODE_SIZE; switch(l_nMessageCodeEnd){ case 2:break; case 4:this.m_sSequenceNumber=l_sRttpMessage.substr(l_nPosition,SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE);l_nPosition+=SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE;break; case 6:this.m_sObjectNumber=l_sRttpMessage.substr(l_nPosition,SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE);l_nPosition+=SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE;break; case 8:this.m_sSequenceNumber=l_sRttpMessage.substr(l_nPosition,SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE);l_nPosition+=SL4B_RttpMessage.const_SEQUENCE_NUMBER_SIZE;this.m_sObjectNumber=l_sRttpMessage.substr(l_nPosition,SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE);l_nPosition+=SL4B_RttpMessage.const_OBJECT_NUMBER_SIZE;break; default :throw new SL4B_Exception("Unknown RTTP message received '"+l_sRttpMessage+"'"); }this.m_nRttpCode=this.decodeRttpCode(l_sRttpMessage.substr(0,SL4B_RttpMessage.const_RTTP_CODE_SIZE));if(l_sRttpMessage.length>=l_nPosition+1){this.m_sMessageContent=l_sRttpMessage.substr(l_nPosition+1);}}if(l_bIsMultipleLineMessage){if(this.m_bIsMessageComplete){this.m_pMultipleLineContents=new Array();}var l_nStartPos=((this.m_bIsMessageComplete) ? A+1 : A); this.m_bIsMessageComplete=false;for(var l_nLine=l_nStartPos,l_nLength=B.length;l_nLine<l_nLength;++l_nLine){if(l_nLine>A){++A;}if(B[l_nLine]==SL4B_RttpMessage.const_MULTIPLE_LINE_MESSAGE_END){this.m_bIsMessageComplete=true;break; }else {this.m_pMultipleLineContents.push(B[l_nLine]);}}}else {this.m_bIsMessageComplete=true;}return A; } function SL_IL(A){var l_n64s=SL4B_RttpMessage.m_pBase64Decoder[A.charAt(0)]; var l_nUnits=SL4B_RttpMessage.m_pBase64Decoder[A.charAt(1)]; if(typeof l_n64s=="undefined"||typeof l_nUnits=="undefined"){throw new SL4B_Exception("Illegal RTTP code received '"+A+"'"); }return (l_n64s*64)+l_nUnits; } SL4B_RttpMessage.getJsonMessageAdapter = function(A){SL4B_RttpMessage.JSON_MESSAGE_ADAPTOR.setUnderlyingMessage(A);return SL4B_RttpMessage.JSON_MESSAGE_ADAPTOR; }; function SL_EE(){this.m_oJsonMessage=null;this.m_nRttpCode=null;} SL_EE.prototype.setUnderlyingMessage = function(A){this.m_oJsonMessage=A;this.m_nRttpCode=this.decodeRttpCode(this.m_oJsonMessage.rttpcode);}; SL_EE.prototype.getRttpCode = function(){return this.m_nRttpCode; }; SL_EE.prototype.decodeRttpCode = SL_IL;SL_EE.prototype.getObjectNumber = function(){return this.m_oJsonMessage.objnum; }; SL_EE.prototype.getSequenceNumber = function(){return this.m_oJsonMessage.seqnum; }; SL_EE.prototype.getMessageContent = function(){return this.m_oJsonMessage.origmsg.substr(this.m_oJsonMessage.origmsg.indexOf(" ")); }; SL_EE.prototype.toString = function(){var sOutput="rttp_json{ "; for(sName in this.m_oJsonMessage){sOutput+=sName+": \""+this.m_oJsonMessage[sName]+"\", ";}sOutput=sOutput.replace(/, $/,"")+" }";return sOutput; }; var SL4B_Type1RecordCache=function(){}; if(false){function SL4B_Type1RecordCache(){} }SL4B_Type1RecordCache = function(){this.m_pFieldCache=new Object();}; SL4B_Type1RecordCache.prototype.addField = SL4B_Type1RecordCache_AddField;SL4B_Type1RecordCache.prototype.getField = SL4B_Type1RecordCache_GetField;function SL4B_Type1RecordCache_AddField(B,A){this.m_pFieldCache[B]=A;} function SL4B_Type1RecordCache_GetField(A){return this.m_pFieldCache[A]; } var SL4B_Type2RecordCache=function(){}; if(false){function SL4B_Type2RecordCache(){} }SL4B_Type2RecordCache = function(){this.m_sIndexFieldName=null;this.m_pLevelCache=new Object();}; SL4B_Type2RecordCache.prototype.addField = SL_MP;SL4B_Type2RecordCache.prototype.getField = SL_LJ;SL4B_Type2RecordCache.prototype.deleteLevel = SL_HA;SL4B_Type2RecordCache.prototype.dump = SL_JL;function SL_MP(B,C,A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Type2RecordCache.addField: {0}, {1}, {2}",B,C,A);if(typeof this.m_pLevelCache[B]=="undefined"){this.m_pLevelCache[B]=new Object();}this.m_pLevelCache[B][C]=A;} function SL_HA(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Type2RecordCache.deleteLevel: {0}",A);if(typeof this.m_pLevelCache[A]!="undefined"){delete this.m_pLevelCache[A];}} function SL_JL(){for(l_sLevel in this.m_pLevelCache){var l_oFields=this.m_pLevelCache[l_sLevel]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Level: {0}",l_sLevel);for(l_sFieldName in l_oFields){var l_sValue=l_oFields[l_sFieldName]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"\t{0}={1}",l_sFieldName,l_sValue);}}} function SL_LJ(A,B){var l_oFieldCache=this.m_pLevelCache[A]; var l_sValue=null; if(typeof l_oFieldCache=="undefined"){l_sValue=null;}else {l_sValue=l_oFieldCache[B];if(typeof l_sValue=="undefined"){l_sValue=null;}}return l_sValue; } function SL_NM(){this.m_pLevelCache=new Array();} SL_NM.prototype.getField = SL_HU;SL_NM.prototype.dump = SL_BL;function SL_HU(A,B){var l_oFieldCache=this.m_pLevelCache[A]; var l_sValue=null; if(typeof l_oFieldCache=="undefined"){l_sValue=null;}else {l_sValue=l_oFieldCache[B];if(typeof l_sValue=="undefined"){l_sValue=null;}}return l_sValue; } function SL_BL(){for(l_sLevel in this.m_pLevelCache){var l_oFields=this.m_pLevelCache[l_sLevel]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Level: {0}",l_sLevel);for(l_sFieldName in l_oFields){var l_sValue=l_oFields[l_sFieldName]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"\t{0}={1}",l_sFieldName,l_sValue);}}} var SL4B_NewsStoryCache=function(){}; if(false){function SL4B_NewsStoryCache(){} }SL4B_NewsStoryCache = function(){this.m_pTextLines=new Array();}; SL4B_NewsStoryCache.prototype.isNewsStory = true;SL4B_NewsStoryCache.prototype.setTextLines = SL4B_NewsStoryCache_SetTextLines;SL4B_NewsStoryCache.prototype.addTextLines = SL4B_NewsStoryCache_AddTextLines;SL4B_NewsStoryCache.prototype.getTextLines = SL4B_NewsStoryCache_GetTextLines;function SL4B_NewsStoryCache_SetTextLines(A){if(!A||typeof A!="object"||typeof A.length=="undefined"){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"SL4B_NewsStoryCache.setTextLines: attempt to set invalid value for l_pTextLines");}else {this.m_pTextLines=new Array();for(var l_nLine=0,l_nLength=A.length;l_nLine<l_nLength;++l_nLine){this.m_pTextLines[l_nLine]=GF_ResponseDecoder.decodeRttpData(A[l_nLine]);}}} function SL4B_NewsStoryCache_GetTextLines(){return this.m_pTextLines; } function SL4B_NewsStoryCache_AddTextLines(A){for(var i=0;i<A.length;i++){if(A[i]==""){if(this.m_pTextLines.length){this.m_pTextLines.push("\\n");}}else {this.m_pTextLines.push(GF_ResponseDecoder.decodeRttpData(A[i]));}}} var SL4B_DirectoryCache=function(){}; if(false){function SL4B_DirectoryCache(){} }SL4B_DirectoryCache = function(){this.m_pListing=new Object();}; SL4B_DirectoryCache.prototype.dump = SL_GW;function SL_GW(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"DirectoryCache.dump()");for(l_sObject in this.m_pListing){var l_sType=this.m_pListing[l_sObject]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"\t{0} ({1})",l_sObject,l_sType);}} var SL4B_ContainerCache=function(){}; if(false){function SL4B_ContainerCache(){} }SL4B_ContainerCache = function(){this.m_bisDirectory=false;this.m_oListing=new Object();this.m_mObjectNameToNumberMap=new Object();this.m_oOrdering=new Object();this.m_oObjectNameToIdMap=new Object();this.m_nSize=0;}; SL4B_ContainerCache.prototype.addEntry = function(B,C,A){this.m_oListing[B]=C;this.m_mObjectNameToNumberMap[B]=A;}; SL4B_ContainerCache.prototype.removeEntry = function(A){delete this.m_oListing[A];delete this.m_mObjectNameToNumberMap[A];}; SL4B_ContainerCache.prototype.addOrdering = function(B,A){this.m_oOrdering[B]=A;}; SL4B_ContainerCache.prototype.getOrdering = function(A){return this.m_oOrdering[A]; }; SL4B_ContainerCache.prototype.removeOrdering = function(A){delete this.m_oOrdering[A];}; SL4B_ContainerCache.prototype.addToNameIdMap = function(A,B){this.m_oObjectNameToIdMap[A]=B;}; SL4B_ContainerCache.prototype.removeFromNameIdMap = function(A){delete this.m_oObjectNameToIdMap[A];}; SL4B_ContainerCache.prototype.getObjectNameToObjectTypeMap = function(){return this.m_oListing; }; SL4B_ContainerCache.prototype.dump = SL_EP;SL4B_ContainerCache.prototype.getSize = function(){return this.m_nSize; }; SL4B_ContainerCache.prototype.setSize = function(A){this.m_nSize=A;}; SL4B_ContainerCache.prototype.setDirectory = function(A){this.m_bIsDirectory=A;}; SL4B_ContainerCache.prototype.isDirectory = function(){return this.m_bIsDirectory; }; function SL_EP(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ContainerCache.dump()");for(l_sObject in this.m_oListing){var l_sType=this.m_oListing[l_sObject]; SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"\t{0} ({1})",l_sObject,l_sType);}} var SL4B_NewsHeadlineCache=function(){}; if(false){function SL4B_NewsHeadlineCache(){} }SL4B_NewsHeadlineCache = function(){this.m_pHeadlines=new Array();}; SL4B_NewsHeadlineCache.m_HEADLINE_CACHE_LIMIT=200;SL4B_NewsHeadlineCache.const_SIZE_FIELD="size";SL4B_NewsHeadlineCache.prototype.addHeadline = function(C,B,A){if(this.m_pHeadlines.length>=SL4B_NewsHeadlineCache.m_HEADLINE_CACHE_LIMIT){this.m_pHeadlines.shift();}this.m_pHeadlines.push(new SL_HD(C,B,A));}; SL4B_NewsHeadlineCache.prototype.getHeadline = function(A){return ((A<this.m_pHeadlines.length) ? this.m_pHeadlines[A] : null); }; SL4B_NewsHeadlineCache.prototype.getSize = function(){return this.m_pHeadlines.length; }; function SL_HD(C,B,A){this.m_sStoryCode=C;this.m_sHeadline=B;this.m_sDate=A;} function GF_ChatCache(A){this.m_sObjectKey=A;this.m_pCachedData=[];} GF_ChatCache.prototype.addToCache = function(A){if(A[GF_ChatFields.STATUS]==SL4B_ChatStatus.SUBSCRIBED){this.m_pCachedData=[];this.m_pCachedData.push(A);}else if(A[GF_ChatFields.STATUS]==SL4B_ChatStatus.USER_SUBSCRIBED){if(this.m_pCachedData.length>0&&this.m_pCachedData[0][GF_ChatFields.USER]===A[GF_ChatFields.USER]){this.m_pCachedData.push(A);}}}; GF_ChatCache.prototype.sendCachedData = function(B,A){for(var i=0,nLength=this.m_pCachedData.length;i<nLength;++i){B._$sendChat(this.m_sObjectKey,this.m_pCachedData[i],A);}}; var SL4B_BaseStreamingConnection=function(){}; if(false){function SL4B_BaseStreamingConnection(){} }SL4B_BaseStreamingConnection = function(D,C,E,B,A){this.CLASS_NAME="SL4B_BaseStreamingConnection";this.m_nConnectedState=0;this.m_nMessageCount=0;this.m_oCurrentConnectionData=C;this.m_nReconnectCount=A;this.m_sResponseFrameUrl=B;this.initialise(D,"/"+E);}; SL4B_BaseStreamingConnection.prototype = new SL4B_AbstractConnection;SL4B_BaseStreamingConnection.prototype.connect = SL_JY;SL4B_BaseStreamingConnection.prototype.getScriptPathUrl = SL_JB;SL4B_BaseStreamingConnection.prototype.reconnect = SL_LG;SL4B_BaseStreamingConnection.prototype.setResponseHttpRequest = SL_KF;SL4B_BaseStreamingConnection.prototype.start = SL_FX;SL4B_BaseStreamingConnection.prototype.super_stop = SL4B_BaseStreamingConnection.prototype.stop;SL4B_BaseStreamingConnection.prototype.stop = SL_FE;SL4B_BaseStreamingConnection.prototype.super_parseRttpMessage = SL4B_BaseStreamingConnection.prototype.parseRttpMessage;SL4B_BaseStreamingConnection.prototype.parseRttpMessage = SL_AH;function SL_JY(){SL4B_Logger.logConnectionMessage(false,"BaseStreamingConnection.connect");this.m_nMessageCount=0;if(this.m_nConnectedState==0&&this.m_oRequestHttpRequest!=null){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT," connecting...");var l_sResponseFrameUrl; var l_oMatch=this.m_oCurrentConnectionData.getServerUrl().match(/(https?:\/\/[^\/]+)/); if(l_oMatch!=null){l_sResponseFrameUrl=l_oMatch[1]+this.m_sResponseFrameUrl;}else {l_sResponseFrameUrl=this.m_sResponseFrameUrl;}l_sResponseFrameUrl+="?X-RTTP-Type5-Pad-Length="+SL4B_Accessor.getConfiguration().getType5PadLength();if(!SL4B_Accessor.getConfiguration().isSuppressExceptions()||SL4B_JsUnit.isUnobfuscated()){l_sResponseFrameUrl+="&suppressexceptions=false";}this.m_sResponseUniqueId=this.createChannel(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID,l_sResponseFrameUrl);this.m_nConnectedState=1;SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"BaseStreamingConnection.connect: Connecting to Liberator {0}",l_sResponseFrameUrl);C_CallbackQueue.addCallback(new Array(SL4B_Accessor.getUnderlyingRttpProvider(),"notifyConnectionListeners",this.m_oRttpProvider.const_INFO_CONNECTION_EVENT,"Establishing streaming connection (URL: "+l_sResponseFrameUrl+")"));}} function SL_JB(A,B){var l_sRootUrl=SL4B_ScriptLoader.getRootUrl(); if(!l_sRootUrl.match(/^https?:\/\/./)){if(l_sRootUrl.charAt(0)=="/"){l_sRootUrl=B.match(/^https?:\/\/[^/]*/)[0]+l_sRootUrl;}else {var l_sPageRoot=B.replace(/\?.*$/,"").replace(/\/[^/]+$/,""); l_sRootUrl=l_sPageRoot.replace(/\/$/,"")+"/"+l_sRootUrl.replace(/(^\/)/,"");}var l_oRegExp=new RegExp("\\/[^/.]+\\/\\.\\."); var l_oMatch; while((l_oMatch=l_sRootUrl.match(l_oRegExp))){l_sRootUrl=l_sRootUrl.replace(l_oRegExp,"");}}return l_sRootUrl+"sl4b/javascript-rttp-provider"; } function SL_AH(A){if(this.m_nConnectedState==2){this.super_parseRttpMessage(A);this.m_nMessageCount++;}} SL4B_BaseStreamingConnection.prototype.messageBlockComplete = function(){if(this.m_nConnectedState==2&&this.m_nMessageCount>this.m_nReconnectCount){this.reconnect();}}; function SL_LG(){SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"BaseStreamingConnection.reconnect()");var oConnectionManager=this.m_oRttpProvider.m_oConnectionManager; if(oConnectionManager.m_oManagedConnection._$isFullReconnectRequired()){SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"BaseStreamingConnection.reconnect: not attempting to reconnect as there are stateful responses outstanding");}else {this.m_nConnectedState=0;oConnectionManager.m_sPreviousSessionId=this.m_oRttpProvider.getSessionId()+"/"+this.getLastSequenceNumber();SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"BaseStreamingConnection.reconnect: {0}",oConnectionManager.m_sPreviousSessionId);oConnectionManager.m_oManagedConnection._setSessionId(null);oConnectionManager.setLoggedIn(false);this.connect();}} function SL_KF(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"BaseStreamingConnection.setResponseHttpRequest");this.m_oResponseHttpRequest=A;if(this.m_nConnectedState==1){this.m_nConnectedState=2;}} function SL_FX(){SL4B_Logger.logConnectionMessage(false,"BaseStreamingConnection.start");this.createStandardRequestChannel();} function SL_FE(){this.super_stop();this.m_nConnectedState=3;var l_oFrameWindow=SL4B_Accessor.getBrowserAdapter().getFrameWindow(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID); try {l_oFrameWindow.stop();}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"Attempt to invoke stop on type 5 streaming frame failed: {0}",e.message);} } if(window.addEventListener){window.addEventListener("keypress",SL_FZ,true);}else {if(document.body){document.body.attachEvent("onkeydown",SL_FZ);}else {window.attachEvent("onload",function(){document.body.attachEvent("onkeydown",SL_FZ);});}}function SL_FZ(A){A=A||window.event;if(A.keyCode==27){var eTarget=A.target||A.srcElement; if(A.preventDefault){A.preventDefault();}else {A.returnValue=false;}if((eTarget.tagName=="INPUT")&&((eTarget.type=="text")||(eTarget.type=="password"))){eTarget.value="";eTarget.blur();eTarget.focus();}else if(eTarget.tagName=="SELECT"){eTarget.blur();eTarget.focus();}}} var SL4B_Type2Connection=function(){}; if(false){function SL4B_Type2Connection(){} }SL4B_Type2Connection = function(B,A){var l_nReconnectCount=10000; SL4B_BaseStreamingConnection.apply(this,[B,A,"RTTP-TYPE2","/sl4b/javascript-rttp-provider/streaming-type2.html",l_nReconnectCount]);this.CLASS_NAME="SL4B_Type2Connection";}; SL4B_Type2Connection.prototype = new SL4B_BaseStreamingConnection;var SL4B_Type3Connection=function(){}; if(false){function SL4B_Type3Connection(){} }SL4B_Type3Connection = function(B,A){this.CLASS_NAME="SL4B_Type3Connection";this.m_nPollTimeout=null;this.m_oCurrentConnectionData=A;this.m_nRefreshPeriod=SL4B_Accessor.getConfiguration().getType3PollPeriod();this.initialise(B,"/RTTP-TYPE3");}; SL4B_Type3Connection.prototype = new SL4B_AbstractConnection;SL4B_Type3Connection.prototype.connect = SL_QU;SL4B_Type3Connection.prototype.super_send = SL4B_Type3Connection.prototype.send;SL4B_Type3Connection.prototype.send = SL_QL;SL4B_Type3Connection.prototype.setRequestHttpRequest = SL_MY;SL4B_Type3Connection.prototype.clearPollTimeout = SL_DS;SL4B_Type3Connection.prototype.pollServer = SL_QO;SL4B_Type3Connection.prototype.start = SL_NH;SL4B_Type3Connection.prototype.super_stop = SL4B_Type3Connection.prototype.stop;SL4B_Type3Connection.prototype.stop = SL_LX;function SL_QU(){SL4B_Logger.logConnectionMessage(false,"Type3Connection.connect");if(this.m_oRequestHttpRequest!=null&&!this.m_bConnectionStopped){this.m_oRequestHttpRequest.send(this.m_sUrlPrefix);var l_oMatch=this.m_oCurrentConnectionData.getServerUrl().match(/(https?:\/\/[^\/]+)/); var l_sFullType3Url=((l_oMatch!=null) ? l_oMatch[1] : "")+this.m_sUrlPrefix; C_CallbackQueue.addCallback(new Array(SL4B_Accessor.getUnderlyingRttpProvider(),"notifyConnectionListeners",this.m_oRttpProvider.const_INFO_CONNECTION_EVENT,"Establishing polling connection (URL: "+l_sFullType3Url+")"));}} function SL_QL(A){this.clearPollTimeout();this.super_send(A);} function SL_MY(A){this.m_oRequestHttpRequest=A;this.clearPollTimeout();this.m_nPollTimeout=setTimeout("SL4B_ConnectionProxy.getInstance().getConnection().pollServer()",this.m_nRefreshPeriod);} function SL_DS(){if(this.m_nPollTimeout!==null){clearTimeout(this.m_nPollTimeout);this.m_nPollTimeout=null;}} function SL_QO(){if(this.m_nPollTimeout!=null&&this.m_oRttpProvider.getSessionId()!=null){this.m_oRttpProvider.getManagedConnection()._sendPriorityMessage("",SL4B_ManagedConnection.NO_RESPONSE_EXPECTED_MESSAGE_RECEIVER,true);}} function SL_NH(){SL4B_Logger.logConnectionMessage(false,"Type3Connection.start");this.createStandardRequestChannel();} function SL_LX(){this.super_stop();this.clearPollTimeout();} var SL4B_Type4Connection=function(){}; if(false){function SL4B_Type4Connection(){} }SL4B_Type4Connection = function(B,A){this.CLASS_NAME="SL4B_Type4Connection";this.m_oCurrentConnectionData=A;var l_sUrlPrefix=B.getJsContainerUrl()+"/"; this.sResponseFrameUrl=l_sUrlPrefix+SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_URL;this.sResponseFrameUrl+="&"+SL4B_JavaScriptRttpProviderConstants.const_INIT_PARAMETER+"=true";this.sResponseFrameUrl+="&"+SL4B_JavaScriptRttpProviderConstants.const_TYPE4_PARAMETER+"=true";this.bNeedToSendPrefix=true;this.initialise(B,"/RTTP-TYPE4");}; SL4B_Type4Connection.prototype = new SL4B_AbstractConnection();SL4B_Type4Connection.prototype.setResponseHttpRequest = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"Type4Connection.setResponseHttpRequest");SL4B_AbstractConnection.prototype.setResponseHttpRequest.call(this,A);if(this.bNeedToSendPrefix&&(this.m_oResponseHttpRequest!=null&&!this.m_bConnectionStopped)){this.bNeedToSendPrefix=false;this.m_oResponseHttpRequest.send(this.m_sUrlPrefix);}}; SL4B_Type4Connection.prototype.connect = function(){SL4B_Logger.logConnectionMessage(false,"Type4Connection.connect");}; SL4B_Type4Connection.prototype.start = function(){SL4B_Logger.logConnectionMessage(false,"Type4Connection.start");this.m_sResponseUniqueId=this.createChannel(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID,this.sResponseFrameUrl);this.createStandardRequestChannel();}; var SL4B_Type5Connection=function(){}; if(false){function SL4B_Type5Connection(){} }SL4B_Type5Connection = function(B,A){var l_nReconnectCount=SL4B_Accessor.getConfiguration().getType5ReconnectCount(); SL4B_BaseStreamingConnection.apply(this,[B,A,"RTTP-TYPE5","/RTTP-TYPE5",l_nReconnectCount]);this.CLASS_NAME="SL4B_Type5Connection";}; SL4B_Type5Connection.prototype = new SL4B_BaseStreamingConnection;var SL4B_Type6Connection=function(){}; if(false){function SL4B_Type6Connection(){} }SL4B_Type6Connection = function(B,A){var l_nReconnectCount=SL4B_Accessor.getConfiguration().getType5ReconnectCount(); SL4B_BaseStreamingConnection.apply(this,[B,A,"RTTP-TYPE5","/sl4b/javascript-rttp-provider/streaming-type6.html",l_nReconnectCount]);this.CLASS_NAME="SL4B_Type6Connection";}; SL4B_Type6Connection.prototype = new SL4B_BaseStreamingConnection;var SL4B_Type7Connection=function(){}; if(false){function SL4B_Type7Connection(){} }SL4B_Type7Connection = function(B,A){var l_nReconnectCount=SL4B_Accessor.getConfiguration().getType5ReconnectCount(); SL4B_BaseStreamingConnection.apply(this,[B,A,"RTTP-TYPE5","/sl4b/javascript-rttp-provider/streaming-type7.html",l_nReconnectCount]);this.CLASS_NAME="SL4B_Type7Connection";}; SL4B_Type7Connection.prototype = new SL4B_BaseStreamingConnection;var LF_Type5RttpMessageParserProxy=function(){this.m_oConnectionProxy=null;this.initialise = function(){this.m_oConnectionProxy=SL4B_ConnectionProxy.getInstance();}; this.parseRttpMessage = function(A){this.m_oConnectionProxy.parseRttpMessage(A);}; this.messageBlockComplete = function(){var oType5Connection=this.m_oConnectionProxy.getConnection(); if(oType5Connection&&oType5Connection.messageBlockComplete!==undefined){oType5Connection.messageBlockComplete();}}; this.initialise();}; try {LF_Type5RttpMessageParserProxy=new LF_Type5RttpMessageParserProxy();}catch(e){} function SL4B_StreamingType5(){this.JSON_MESSAGE_TYPE1=0;this.m_oType1ImageRegExp1=new RegExp("(^|\n)(3U)()([^ ]{4}) ([^ \n]+)( *[^\n]*)","g");this.m_oType1UpdateRegExp1=new RegExp("(^|\n)(6c|7O)(..)([^ ]{4}) ?()( *[^\n]*)","g");this.m_sType1Replace1="\n{\"objnum\":\"$4\",\"seqnum\":\"$3\",\"rttpcode\":\"$2\",\"objname\":\"$5\",\"msg\":{ $6 }},";this.m_oType1RegExp2=new RegExp(" *([^ =]+)=([^ ]*)","g");this.m_sType1Replace2="\"$1\":\"$2\",";this.m_oType1RegExp3=new RegExp(", *}","g");this.m_sType1Replace3="}";this.m_pEmptyArray=new Array();this.reset();} SL4B_StreamingType5.prototype.reset = function(){this.m_nBufferSize=0;this.m_pMessageBuffer=new Array();this.m_pMessageBufferType1=new Array();}; SL4B_StreamingType5.prototype.processMessagesInBuffer = function(){var l_pMessageBuffer=this.m_pMessageBuffer; var l_pMessageBufferType1=this.m_pMessageBufferType1; this.reset();var l_pJsonMessages; if(l_pMessageBufferType1.length>0){l_pJsonMessages=this.convertType1MessagesToJson(l_pMessageBufferType1,l_pMessageBuffer);}var l_nJsonBufferType1Index=0; var l_nCount=0; for(var l_nLength=l_pMessageBuffer.length;l_nCount<l_nLength;++l_nCount){var l_oMessage=l_pMessageBuffer[l_nCount]; if(l_oMessage.constructor==String){LF_Type5RttpMessageParserProxy.parseRttpMessage(l_oMessage);}else {switch(l_oMessage){ case this.JSON_MESSAGE_TYPE1:LF_Type5RttpMessageParserProxy.parseRttpMessage(l_pJsonMessages[l_nJsonBufferType1Index++]);break; default :throw "Unknown JSON message type"; break; }}}}; SL4B_StreamingType5.prototype.processMessageBuffer = function(){if(this.m_nBufferSize>0){var oThis=this; SL4B_MethodInvocationProxy.invoke(this,"processMessagesInBuffer",[],function(A){oThis.processException(A,"Exception occured whilst processing message buffer");});LF_Type5RttpMessageParserProxy.messageBlockComplete();}}; SL4B_StreamingType5.prototype.convertType1MessagesToJson = function(A,B){var l_pJsonMessages; var l_sMessages=A.join("\n")+"\n"; var l_sJson; try {l_sJson="["+l_sMessages.replace(this.m_oType1UpdateRegExp1,this.m_sType1Replace1).replace(this.m_oType1ImageRegExp1,this.m_sType1Replace1).replace(this.m_oType1RegExp2,this.m_sType1Replace2).replace(this.m_oType1RegExp3,this.m_sType1Replace3)+"]";}catch(e){this.processException(e,"JSON regexp exception, original message(s) follows:\n"+l_sMessages);this.revertToStringMessageProcessing(A,B);return this.m_pEmptyArray; } try {l_pJsonMessages=eval(l_sJson);for(var i=0,nLength=l_pJsonMessages.length;i<nLength;++i){if(l_pJsonMessages[i]){l_pJsonMessages[i].origmsg=A[i];}}}catch(e){this.processException(e,"JSON eval exception "+l_sJson+"\nUnderlying exception:\n"+e.message+"\nOriginal message(s):\n"+l_sMessages);this.revertToStringMessageProcessing(A,B);l_pJsonMessages=this.m_pEmptyArray;} l_sJson=null;return l_pJsonMessages; }; SL4B_StreamingType5.prototype.revertToStringMessageProcessing = function(A,B){var l_nType1Pos=0; for(var l_nMessage=0,l_nLength=B.length;l_nMessage<l_nLength;++l_nMessage){if(B[l_nMessage]==this.JSON_MESSAGE_TYPE1){B[l_nMessage]=A[l_nType1Pos++];}}}; SL4B_StreamingType5.prototype.processException = function(B,A){SL4B_Accessor.getLogger().printMessage("critical: SL4B_StreamingType5.processException: message = "+A+", exception = "+B);}; SL4B_StreamingType5=new SL4B_StreamingType5();function a(A){switch(A.substr(0,2)){ case "6c":case "7O":case "3U":SL4B_StreamingType5.m_pMessageBuffer[SL4B_StreamingType5.m_nBufferSize]=SL4B_StreamingType5.JSON_MESSAGE_TYPE1;SL4B_StreamingType5.m_pMessageBufferType1.push(A);break; default :SL4B_StreamingType5.m_pMessageBuffer[SL4B_StreamingType5.m_nBufferSize]=A;break; }++SL4B_StreamingType5.m_nBufferSize;} function z(){SL4B_StreamingType5.processMessageBuffer();} GF_RequestEncoder = new function(){this.const_FIELD_SEPARATOR=",";this.const_NON_ENCODED_CHARACTERS="A-Za-z0-9_\\x2D.*\/:";this.m_oFilterFieldRegExp=new RegExp("(^imagefilter=|^filter=|^auto=|^monitor=|^ctrid=|^ctrstart=|^ctrend=)(.*)");this.m_pFieldSeparatorToRegExpMap=new Object();this.encodeRttpData = function(A){return escape(A).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/%3A/g,":").replace(/@/g,"%40"); }; this.encodeUrl = function(A){return escape(A).replace(/(\/)/g,"%2F").replace(/\+/g,"%2B").replace(/%20/g,"+"); }; this.encodeFieldList = function(A,B){var l_sEncodedFieldList=A; if(A&&A!=""&&A.match(this.getFieldListRegExp(B))!=null){l_sEncodedFieldList="";var l_pFields=A.split(B); for(var l_nField=0,l_nLength=l_pFields.length;l_nField<l_nLength;++l_nField){var l_sField; var l_oMatch=l_pFields[l_nField].match(this.m_oFilterFieldRegExp); if(l_oMatch){l_sField=l_oMatch[1]+GF_RequestEncoder.encodeRttpData(l_oMatch[2]);}else {l_sField=GF_RequestEncoder.encodeRttpData(l_pFields[l_nField]);}l_sEncodedFieldList+=this.const_FIELD_SEPARATOR+l_sField;}l_sEncodedFieldList=l_sEncodedFieldList.substring(1);}return l_sEncodedFieldList; }; this.getFieldListRegExp = function(A){var l_oRegExp=this.m_pFieldSeparatorToRegExpMap[A]; if(!l_oRegExp){if(A==this.const_FIELD_SEPARATOR){l_oRegExp=new RegExp("[^"+this.const_NON_ENCODED_CHARACTERS+this.const_FIELD_SEPARATOR+"]");}else {l_oRegExp=new RegExp("[^"+this.const_NON_ENCODED_CHARACTERS+"]");}this.m_pFieldSeparatorToRegExpMap[A]=l_oRegExp;}return l_oRegExp; }; }; GF_ResponseDecoder = new function(){this.m_fUnescape=window.unescape;this.m_oDecodeRegExp=/\+/g;this.decodeRttpData = function(A){return this.m_fUnescape(A.replace(this.m_oDecodeRegExp," ")); }; }; var g_nConnectionManagerDebugId=0; var SL4B_ConnectionManager=function(){}; if(false){function SL4B_ConnectionManager(){} }SL4B_ConnectionManager = function(B,C,A){this.const_CAPABILITIES="HttpRequestLineLength="+SL4B_Accessor.getConfiguration().getMaxGetLength()+",HttpBodyLength=";this.CLASS_NAME="ConnectionManager (instance: "+(g_nConnectionManagerDebugId++)+")";this.m_fConnectionCreator=B;this.m_oLiberatorConfiguration=C;this.m_oManagedConnection=A;A.addMessagingListener(this);this.m_oConnectionProxy=SL4B_ConnectionProxy.getInstance();this.m_sPreviousSessionId=SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID;this.m_bIsStopped=true;this.m_oCurrentConnectionData=null;this.m_pConnectionListeners=new Array();this.m_pMessagingListeners=new Array();this.m_bRequestWindowReady=false;this.m_bLoggedIn=false;this.m_bLogInMessageProcessing=false;this.m_nConnectionCheckInterval=SL4B_Accessor.getConfiguration().getConnectionTimeout();this.m_nConnectionCheckTimeoutId=0;this.m_nNOOPInterval=SL4B_Accessor.getConfiguration().getNOOPInterval();this.m_nNOOPTimeout=SL4B_Accessor.getConfiguration().getNOOPTimeout();this.m_nLoginTimeout=SL4B_Accessor.getConfiguration().getLoginTimeout();this.m_nNoopSendTimeoutId=null;this.m_nLoginTimeoutId=null;this.m_nNoopReceivedTimeoutId=null;this.m_bConnectionLost=false;this.m_oMessageReceiver=null;this.m_bFieldMapAvailable=false;this.m_pFieldCodeToFieldNameMap=new Object();var l_sAppendText=""; var l_sCommonDomain=GF_CommonDomainExtractor.getCommonDomain(); if(l_sCommonDomain){l_sAppendText="?domain="+l_sCommonDomain;}this.m_sEmptyPageUrl=SL4B_ScriptLoader.getRootUrl()+"sl4b/javascript-rttp-provider/empty.html"+l_sAppendText;}; SL4B_ConnectionManager.prototype.getSessionId = function(){return this.m_oManagedConnection._getSessionId(); }; SL4B_ConnectionManager.prototype.setSessionIdFromMessage = function(A){this.m_oManagedConnection._setSessionId(this.parseSessionId(A));}; SL4B_ConnectionManager.prototype.parseSessionId = function(A){return A.substr(0,A.indexOf(" ")); }; SL4B_ConnectionManager.prototype.getConnectionProxy = function(){return this.m_oConnectionProxy; }; SL4B_ConnectionManager.prototype.connect = function(){this.m_bIsStopped=false;if(this.m_oManagedConnection._hasSessionId()==false&&this.m_oConnectionProxy.isDisconnected()){this.m_oConnectionProxy.setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTING);this.m_oConnectionProxy.connect();}}; SL4B_ConnectionManager.prototype.getCurrentConnectionData = function(){return this.m_oCurrentConnectionData; }; SL4B_ConnectionManager.prototype.addConnectionListener = function(A){this.m_pConnectionListeners.push(A);}; SL4B_ConnectionManager.prototype.removeConnectionListener = function(A){var l_nMatchIndex=-1; for(var l_nListener=0,l_nLength=this.m_pConnectionListeners.length;l_nListener<l_nLength;++l_nListener){if(this.m_pConnectionListeners[l_nListener]==A){l_nMatchIndex=l_nListener;break; }}if(l_nMatchIndex!=-1){this.m_pConnectionListeners.splice(l_nMatchIndex,1);}return (l_nMatchIndex!=-1); }; SL4B_ConnectionManager.prototype.notifyConnectionListeners = function(A){var l_pArguments=arguments; var l_aCopy=this.m_pConnectionListeners.slice(); for(var l_nListener=0,l_nLength=l_aCopy.length;l_nListener<l_nLength;++l_nListener){ try {switch(A){ case SL4B_AbstractRttpProvider.prototype.const_ERROR_CONNECTION_EVENT:l_aCopy[l_nListener].connectionError(l_pArguments[1]);break; case SL4B_AbstractRttpProvider.prototype.const_WARNING_CONNECTION_EVENT:l_aCopy[l_nListener].connectionWarning(l_pArguments[1],l_pArguments[2],l_pArguments[3],l_pArguments[4]);break; case SL4B_AbstractRttpProvider.prototype.const_INFO_CONNECTION_EVENT:l_aCopy[l_nListener].connectionInfo(l_pArguments[1]);break; case SL4B_AbstractRttpProvider.prototype.const_ATTEMPT_CONNECTION_EVENT:l_aCopy[l_nListener].connectionAttempt(l_pArguments[1],l_pArguments[2]);break; case SL4B_AbstractRttpProvider.prototype.const_OK_CONNECTION_EVENT:l_aCopy[l_nListener].connectionOk(l_pArguments[1],l_pArguments[2],l_pArguments[3]);break; case SL4B_AbstractRttpProvider.prototype.const_RECONNECTION_OK_CONNECTION_EVENT:l_aCopy[l_nListener].reconnectionOk();break; case SL4B_AbstractRttpProvider.prototype.const_FILE_DOWNLOAD_ERROR_CONNECTION_EVENT:l_aCopy[l_nListener].fileDownloadError(l_pArguments[1],l_pArguments[2]);break; case SL4B_AbstractRttpProvider.prototype.const_LOGIN_ERROR_CONNECTION_EVENT:l_aCopy[l_nListener].loginError(l_pArguments[1]);break; case SL4B_AbstractRttpProvider.prototype.const_LOGIN_OK_CONNECTION_EVENT:l_aCopy[l_nListener].loginOk();break; case SL4B_AbstractRttpProvider.prototype.const_CREDENTIALS_RETRIEVED_CONNECTION_EVENT:l_aCopy[l_nListener].credentialsRetrieved(l_pArguments[1]);break; case SL4B_AbstractRttpProvider.prototype.const_MESSAGE_CONNECTION_EVENT:l_aCopy[l_nListener].message(l_pArguments[1],l_pArguments[2]);break; case SL4B_AbstractRttpProvider.prototype.const_SERVICE_MESSAGE_CONNECTION_EVENT:l_aCopy[l_nListener].serviceMessage(l_pArguments[1],l_pArguments[2],l_pArguments[3],l_pArguments[4]);break; case SL4B_AbstractRttpProvider.prototype.const_SESSION_EJECTED_CONNECTION_EVENT:l_aCopy[l_nListener].sessionEjected(l_pArguments[1],l_pArguments[2]);break; case SL4B_AbstractRttpProvider.prototype.const_SOURCE_MESSAGE_CONNECTION_EVENT:l_aCopy[l_nListener].sourceMessage(l_pArguments[1],l_pArguments[2],l_pArguments[3],l_pArguments[4]);break; case SL4B_AbstractRttpProvider.prototype.const_STATISTICS_CONNECTION_EVENT:l_aCopy[l_nListener].statistics(l_pArguments[1],l_pArguments[2],l_pArguments[3],l_pArguments[4],l_pArguments[5]);break; case SL4B_AbstractRttpProvider.prototype.const_CREDENTIALS_PROVIDER_SESSION_ERROR_CONNECTION_EVENT:l_aCopy[l_nListener].credentialsProviderSessionError(l_pArguments[1],l_pArguments[2],l_pArguments[3],l_pArguments[4]);break; default :SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ConnectionManager.notifyConnectionListeners: "+"Received an unknown connection event '"+A+"'. Ignoring event.");}}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ConnectionManager.notifyConnectionListeners: Exception thrown by a listener whilst processing a \"{0}\" event; exception was {1}",A,SL4B_Accessor.getBrowserAdapter().convertExceptionToString(e));} }if(A==SL4B_AbstractRttpProvider.prototype.const_RECONNECTION_OK_CONNECTION_EVENT||A==SL4B_AbstractRttpProvider.prototype.const_LOGIN_OK_CONNECTION_EVENT){this.m_oManagedConnection._sendNextRttpMessage();}}; SL4B_ConnectionManager.prototype.createConnection = function(A){SL4B_Logger.logConnectionMessage(false,"ConnectionManager.createConnection({0})",A);this.m_oConnectionProxy.setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_DISCONNECTED);if(!A){var l_oConnectionData=this.m_oLiberatorConfiguration.getNextConnection(); this.m_oCurrentConnectionData=l_oConnectionData;SL4B_Logger.logConnectionMessage(false,"Next connection information: {0}",l_oConnectionData);if(l_oConnectionData==null){this.connectionLost();return false; }}var l_oConnectionData=this.m_oCurrentConnectionData; var l_oConnectionMethod=l_oConnectionData.getMethod(); var l_oConnection=this.m_fConnectionCreator(l_oConnectionData); this.m_oConnectionProxy.setConnection(l_oConnection);this.startRttpMessageListening();if(l_oConnection.constructor==SL4B_Type3Connection){l_oConnectionMethod=SL4B_ConnectionMethod.POLLING;}C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_AbstractRttpProvider.prototype.const_ATTEMPT_CONNECTION_EVENT,l_oConnectionData.getServerUrl(),l_oConnectionMethod));this.m_oConnectionProxy.start();return true; }; SL4B_ConnectionManager.prototype.isLoggedIn = function(){return this.m_bLoggedIn; }; SL4B_ConnectionManager.prototype.setLoggedIn = function(A){if(A==false){this.clearNoopSending();this.clearNoopTimeout();}else {this.m_bLogInMessageProcessing=false;}this.m_bLoggedIn=A;}; SL4B_ConnectionManager.prototype.startConnectionChecking = function(){this.m_nConnectionCheckTimeoutId=setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().checkConnected()",this.m_nConnectionCheckInterval);}; SL4B_ConnectionManager.prototype.clearConnectionCheckTimeout = function(){if(this.m_nConnectionCheckTimeoutId!=0){clearTimeout(this.m_nConnectionCheckTimeoutId);this.m_nConnectionCheckTimeoutId=0;}}; SL4B_ConnectionManager.prototype.messageReceivedEvent = function(){this.clearNoopSending();if((this.getConnectionProxy().getConnectionState()==SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTED)&&this.isLoggedIn()){this.startNoopSending();}}; SL4B_ConnectionManager.prototype.messageSentEvent = function(){}; SL4B_ConnectionManager.prototype.clearNoopSending = function(){if(this.m_nNoopSendTimeoutId!=null){clearTimeout(this.m_nNoopSendTimeoutId);this.m_nNoopSendTimeoutId=null;}}; SL4B_ConnectionManager.prototype.startNoopSending = function(){if(this.m_nNoopSendTimeoutId==null){this.m_nNoopSendTimeoutId=setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().m_oConnectionManager.noop()",this.m_nNOOPInterval);}}; SL4B_ConnectionManager.prototype.clearNoopTimeout = function(){if(this.m_nNoopReceivedTimeoutId!=null){clearTimeout(this.m_nNoopReceivedTimeoutId);this.m_nNoopReceivedTimeoutId=null;}}; SL4B_ConnectionManager.prototype.clearLoginTimeout = function(){if(this.m_nLoginTimeoutId!=null){clearTimeout(this.m_nLoginTimeoutId);this.m_nLoginTimeoutId=null;}}; SL4B_ConnectionManager.prototype.startNoopTimeout = function(){if(this.m_nNoopReceivedTimeoutId!=null){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ConnectionManager.startNoopTimeout while a noop timeout is already set.)");}this.m_nNoopReceivedTimeoutId=setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().createConnectionLost(\"Request Timeout\", false)",this.m_nNOOPTimeout);}; SL4B_ConnectionManager.prototype.reconnectInternal = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionManager.reconnectInternal({0})",A);this.stopConnection();this.m_oConnectionProxy.setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_RECONNECTING);this.m_sPreviousSessionId=A;this.m_bRequestWindowReady=false;this.m_oManagedConnection._setSessionId(null);this.setLoggedIn(false);if(this.createConnection(A!=SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID)){this.clearConnectionCheckTimeout();this.startConnectionChecking();}}; SL4B_ConnectionManager.prototype.connectionLost = function(){this.m_oLiberatorConfiguration.resetConnections();this.m_bConnectionLost=true;this.clearConnectionCheckTimeout();this.stopConnection();SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"JavaScriptRttpProvider.createConnection: failed to reconnect - no more connection types to try");C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_AbstractRttpProvider.prototype.const_ERROR_CONNECTION_EVENT,"Failed to connect"));}; SL4B_ConnectionManager.prototype.setMessageReceiver = function(A){if(A!==null&&typeof A.receiveMessage!="function"){throw new SL4B_Exception("Specified listener does not define the receiveMessage method"); }this.m_oMessageReceiver=A;}; SL4B_ConnectionManager.prototype.receiveMessage = function(A){if(this.m_oMessageReceiver!==null){SL4B_MethodInvocationProxy.invoke(this.m_oMessageReceiver,"receiveMessage",[A]);}}; SL4B_ConnectionManager.prototype.stopRttpMessageListening = function(){this.m_oConnectionProxy.setMessageReceiver(null);}; SL4B_ConnectionManager.prototype.startRttpMessageListening = function(){this.m_oConnectionProxy.setMessageReceiver(this);}; SL4B_ConnectionManager.prototype.reconnect = function(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionManager.reconnect()");if(this.m_bConnectionLost){this.m_bConnectionLost=false;this.startConnectionChecking();}this.m_bFieldMapAvailable=false;this.reconnectInternal(SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID);}; SL4B_ConnectionManager.prototype.createConnectionLost = function(B,A){SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"ConnectionManager.createConnectionLost: Connection lost: "+B);C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_JavaScriptRttpProvider.prototype.const_WARNING_CONNECTION_EVENT,B,SL4B_ConnectionWarningReason.CONNECTION_LOST,this.m_oCurrentConnectionData.getServerUrl(),this.m_oCurrentConnectionData.getMethod()));var sSessionId=SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID; if(!A&&!this.m_oManagedConnection._$isFullReconnectRequired()){sSessionId=this.m_oManagedConnection._getSessionId()+"/"+this.m_oConnectionProxy.getConnection().getLastSequenceNumber();SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"ConnectionManager.createConnectionLost: attempting session reconnect");}else {var sMessage="attempting full reconnect"+(A ? "" : " due to indeterminate client/server state"); SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"ConnectionManager.createConnectionLost: {0}",sMessage);}this.reconnectInternal(sSessionId);}; SL4B_ConnectionManager.prototype.checkConnected = function(){var l_sConnectionState=this.m_oConnectionProxy.getConnectionState(); SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionManager.checkConnected: {0}",l_sConnectionState);this.m_nConnectionCheckTimeoutId=0;if(l_sConnectionState!=SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTED){var l_currentConnectionData=this.m_oCurrentConnectionData; C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_JavaScriptRttpProvider.prototype.const_WARNING_CONNECTION_EVENT,"Connection timed out - "+l_currentConnectionData,SL4B_ConnectionWarningReason.CONNECTION_FAILED,l_currentConnectionData.getServerUrl(),l_currentConnectionData.getMethod()));this.reconnect();}}; SL4B_ConnectionManager.prototype.setFieldCodeMapping = function(A){this.m_bFieldMapAvailable=true;var l_pFieldNameValuePairs=A.split(" "); for(var l_nFieldPair=0,l_nLength=l_pFieldNameValuePairs.length;l_nFieldPair<l_nLength;++l_nFieldPair){var l_nIndex=l_pFieldNameValuePairs[l_nFieldPair].indexOf("="); this.m_pFieldCodeToFieldNameMap[l_pFieldNameValuePairs[l_nFieldPair].substr(0,l_nIndex)]=GF_ResponseDecoder.decodeRttpData(l_pFieldNameValuePairs[l_nFieldPair].substr(l_nIndex+1));}}; SL4B_ConnectionManager.prototype.getFieldName = function(A){var l_sFieldName=this.m_pFieldCodeToFieldNameMap[A]; return ((l_sFieldName===undefined) ? GF_ResponseDecoder.decodeRttpData(A) : l_sFieldName); }; SL4B_ConnectionManager.prototype.responseHttpRequestReady = function(){this.connect();}; SL4B_ConnectionManager.prototype.requestHttpRequestReady = function(){this.m_bRequestWindowReady=true;this.connect();this.m_oManagedConnection._sendNextRttpMessage();}; SL4B_ConnectionManager.prototype.startConnection = function(){setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().m_oConnectionManager.startConnectionInternal();",0);}; SL4B_ConnectionManager.prototype.startConnectionInternal = function(){this.createConnection(false);this.startConnectionChecking();}; SL4B_ConnectionManager.prototype.login = function(A,B){if(this.m_bLogInMessageProcessing===false){SL4B_Logger.logConnectionMessage(true,"ConnectionManager.login: username = {0}; password = {1}",A,B);var l_sLoginSession=this.m_sPreviousSessionId; if(this.m_bFieldMapAvailable==false){l_sLoginSession="0";}var l_nVersion=SL4B_Accessor.getCapabilities().getRttpVersion(); var l_sLoginMessage="LOGIN "+l_sLoginSession+" "+GF_RequestEncoder.encodeRttpData(SL4B_Accessor.getConfiguration().getApplicationId())+"/ RTTP/"+l_nVersion.toFixed(1)+" "+GF_RequestEncoder.encodeRttpData(A)+" "+GF_RequestEncoder.encodeRttpData(B); if(l_nVersion>=2.1){l_sLoginMessage+=" "+this.const_CAPABILITIES;}C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_AbstractRttpProvider.prototype.const_CREDENTIALS_RETRIEVED_CONNECTION_EVENT,SL4B_Accessor.getCredentialsProvider().getUsername()));this.m_oManagedConnection.clearResponseQueue();this.m_bLogInMessageProcessing=true;this.m_oManagedConnection._sendPriorityMessage(l_sLoginMessage,this.m_oManagedConnection.m_oSystemEventReceiverRecord.getListener(),true);}else {SL4B_Logger.logConnectionMessage(true,"ConnectionManager.login: Attempt to login again, even though a login is currently in progress.");}SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Login message sent. Waiting {0}ms for login OK response.",this.m_nLoginTimeout);this.m_nLoginTimeoutId=setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().createConnectionLost(\"Login Timeout\", true)",this.m_nLoginTimeout);}; SL4B_ConnectionManager.prototype.createStreamingFrame = function(A){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"ConnectionManager.createStreamingFrame: frameid = {0}; url = {1}",A,this.m_sEmptyPageUrl);var l_sHtml="<iframe id=\""+A+"\" style=\"display:none;\" src=\""+this.m_sEmptyPageUrl+"\"></iframe>"; document.write(l_sHtml);setTimeout("SL4B_Accessor.getUnderlyingRttpProvider().m_oConnectionManager.replaceStreamingFrame(\""+A+"\", \""+this.m_sEmptyPageUrl+"\")",0);SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionManager.createStreamingFrame: html = {0}",l_sHtml);C_LiberatorUrlCheck.createLiberatorUrlCheck(A);}; SL4B_ConnectionManager.prototype.replaceStreamingFrame = function(B,A){var l_oFrameWindow=SL4B_Accessor.getBrowserAdapter().getFrameWindow(B); if(l_oFrameWindow&&l_oFrameWindow.location){l_oFrameWindow.location.replace(A);}}; SL4B_ConnectionManager.prototype.cleanUpStreamingFrames = function(){this.replaceStreamingFrame(SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_ID,this.m_sEmptyPageUrl);this.replaceStreamingFrame(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID,this.m_sEmptyPageUrl);SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"ConnectionManager.cleanUpStreamingFrames()");}; SL4B_ConnectionManager.prototype.logout = function(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"JavaScriptRttpProvider.logout()");if(this.m_bLoggedIn){this.m_oManagedConnection._sendPriorityMessage("LOGOUT",this.m_oManagedConnection.m_oSystemEventReceiverRecord.getListener(),true);}this.m_sPreviousSessionId=SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID;this.m_bFieldMapAvailable=false;this.clearConnectionCheckTimeout();this.getConnectionProxy().setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_DISCONNECTED);this.cleanUpStreamingFrames();}; SL4B_ConnectionManager.prototype.initialise = function(){ try {if(SL4B_JavaScriptRttpProvider.bFramesCreatedFlag==false){SL4B_JavaScriptRttpProvider.bFramesCreatedFlag=true;this.createStreamingFrame(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID);this.createStreamingFrame(SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_ID);}}catch(e){return false; } return true; }; SL4B_ConnectionManager.prototype.noop = function(){if(this.m_bLoggedIn){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"ConnectionManager.noop: {0}",this.getConnectionProxy().getConnectionState());switch(this.getConnectionProxy().getConnectionState()){ case SL4B_ConnectionProxy.const_CONNECTION_STATE_INITIALISING:break; case SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTED:this.m_oManagedConnection.sendMessage("NOOP",this.m_oManagedConnection.m_oSystemEventReceiverRecord.getListener());this.startNoopTimeout();break; case SL4B_ConnectionProxy.const_CONNECTION_STATE_RECONNECTING:break; case SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTING:break; }}}; SL4B_ConnectionManager.prototype.stop = function(){if(this.m_bIsStopped==false){this.m_bIsStopped=true;SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"AbstractRttpProvider.stop");this.logout(); try {SL4B_FrameRegistrarAccessor.removeMasterFrame();}catch(e){} this.m_pRequestQueue=new Array();this.m_pPriorityRequestQueue=new Array();this.m_bRequestWindowReady=true;this.clearConnectionCheckTimeout();this.stopConnection();if(!this.m_bConnectionLost){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",SL4B_AbstractRttpProvider.prototype.const_ERROR_CONNECTION_EVENT,"Connection stopped"));}}}; SL4B_ConnectionManager.prototype.stopConnection = function(){this.stopRttpMessageListening();this.m_oConnectionProxy.stop();}; SL4B_ConnectionManager.prototype.sendSync = function(A){this.m_oConnectionProxy.sendSync(A);}; SL4B_ConnectionManager.prototype.getJsContainerUrl = function(){var l_sContainerUrl=SL4B_Accessor.getConfiguration().getJsContainerUrl(); if(l_sContainerUrl==null){var l_oConnectionData=this.getCurrentConnectionData(); if(l_oConnectionData==null){l_oConnectionData=this.m_oLiberatorConfiguration.peekAtNextConnection();}l_sContainerUrl=l_oConnectionData.getServerUrl()+"/"+SL4B_Accessor.getConfiguration().getJsContainerPath();}return l_sContainerUrl.replace(/\/$/,""); }; SL4B_ConnectionManager.prototype.readyToRequest = function(){return this.m_bRequestWindowReady; }; SL4B_ConnectionManager.prototype.makingRequest = function(){this.m_bRequestWindowReady=false;}; var SL4B_JavaScriptRttpProvider=function(){}; if(false){function SL4B_JavaScriptRttpProvider(){} }SL4B_JavaScriptRttpProvider = function(B,C){this.CLASS_NAME="SL4B_JavaScriptRttpProvider";SL4B_AbstractRttpProvider.apply(this);this.m_oLiberatorConfiguration=B;var thisProvider=this; var l_fConnectionCreator=function(A){var l_oConnectionMethod=A.getMethod(); if(l_oConnectionMethod!=null){return l_oConnectionMethod.createConnection(thisProvider,A); }SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"JavaScriptRttpProvider.createConnection: invalid connection type ({0}) using type 3",l_oConnectionMethod);return new SL4B_Type3Connection(this); }; this.m_oManagedConnection=new SL4B_ManagedConnection();this.m_oManagedConnection.setSystemEventReceiver(this);this.m_oConnectionManager=new SL4B_ConnectionManager(l_fConnectionCreator,B,this.m_oManagedConnection);this.m_oManagedConnection._$setConnectionManager(this.m_oConnectionManager);this.m_bFatalError=false;if(SL4B_JavaScriptRttpProvider.oObjectSubscriptionManager==null){SL4B_JavaScriptRttpProvider.oObjectSubscriptionManager=new SL4B_ObjectSubscriptionManager();}this.m_oObjectSubscriptionManager=SL4B_JavaScriptRttpProvider.oObjectSubscriptionManager;this.m_oActionSubscriptionManager=C;this.m_oObjectCache=new SL4B_ObjectCache(this,this.m_oObjectSubscriptionManager);}; SL4B_JavaScriptRttpProvider.prototype = new SL4B_AbstractRttpProvider;SL4B_JavaScriptRttpProvider.createProvider = function(B,A){var oProvider=null; if(A==null){oProvider=new SL4B_JavaScriptRttpProvider(B,new GF_ActionSubscriptionManager());}else {oProvider=new SL4B_JavaScriptRttpProvider(B,A.m_oActionSubscriptionManager);}return oProvider; }; SL4B_JavaScriptRttpProvider.prototype.getManagedConnection = function(){return this.m_oManagedConnection; }; SL4B_JavaScriptRttpProvider.const_NEW_SESSION_ID="0";SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_ID="frmRequest";SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID="frmResponse";SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_URL="container.html?"+SL4B_JavaScriptRttpProviderConstants.const_TYPE_PARAMETER+"="+SL4B_JavaScriptRttpProviderConstants.const_REQUEST_TYPE;SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_URL="container.html?"+SL4B_JavaScriptRttpProviderConstants.const_TYPE_PARAMETER+"="+SL4B_JavaScriptRttpProviderConstants.const_RESPONSE_TYPE;SL4B_JavaScriptRttpProvider.bFramesCreatedFlag=false;SL4B_JavaScriptRttpProvider.oObjectSubscriptionManager=null;SL4B_JavaScriptRttpProvider.prototype.getSessionId = function(){return this.m_oConnectionManager.getSessionId(); }; SL4B_JavaScriptRttpProvider.prototype.receiveMessage = SL_ON;SL4B_JavaScriptRttpProvider.prototype.initialise = SL_HL;SL4B_JavaScriptRttpProvider.prototype.onLoad = SL_CQ;SL4B_JavaScriptRttpProvider.prototype.responseHttpRequestReady = SL_CA;SL4B_JavaScriptRttpProvider.prototype.requestHttpRequestReady = SL_AY;SL4B_JavaScriptRttpProvider.prototype.createConnection = SL_GA;SL4B_JavaScriptRttpProvider.prototype.createConnectionLost = SL_EZ;SL4B_JavaScriptRttpProvider.prototype.connect = SL_OJ;SL4B_JavaScriptRttpProvider.prototype.login = SL_NO;SL4B_JavaScriptRttpProvider.prototype.logout = SL_QK;SL4B_JavaScriptRttpProvider.prototype.super_stop = SL4B_JavaScriptRttpProvider.prototype.stop;SL4B_JavaScriptRttpProvider.prototype.stop = SL_AZ;SL4B_JavaScriptRttpProvider.prototype.getVersion = SL_EM;SL4B_JavaScriptRttpProvider.prototype.getVersionInfo = SL_QD;SL4B_JavaScriptRttpProvider.prototype.getObject = SL_LF;SL4B_JavaScriptRttpProvider.prototype.getObjects = SL_KZ;SL4B_JavaScriptRttpProvider.prototype.removeObject = SL_LE;SL4B_JavaScriptRttpProvider.prototype.removeObjects = SL_CO;SL4B_JavaScriptRttpProvider.prototype.removeSubscriber = SL_IX;SL4B_JavaScriptRttpProvider.prototype.contribObject = SL_QP;SL4B_JavaScriptRttpProvider.prototype.createObject = SL_GR;SL4B_JavaScriptRttpProvider.prototype.deleteObject = SL_JW;SL4B_JavaScriptRttpProvider.prototype.reconnect = SL_ML;SL4B_JavaScriptRttpProvider.prototype.checkConnected = SL_FN;SL4B_JavaScriptRttpProvider.prototype.getJsContainerUrl = SL_JG;SL4B_JavaScriptRttpProvider.prototype.getAutoDirectory = SL_NJ;SL4B_JavaScriptRttpProvider.prototype.removeAutoDirectory = SL_FP;SL4B_JavaScriptRttpProvider.prototype.getContainer = SL_EF;SL4B_JavaScriptRttpProvider.prototype.setContainerWindow = SL_DX;SL4B_JavaScriptRttpProvider.prototype.clearContainerWindow = SL_MW;SL4B_JavaScriptRttpProvider.prototype.removeContainer = SL_NW;SL4B_JavaScriptRttpProvider.prototype.getFieldName = SL_BW;SL4B_JavaScriptRttpProvider.prototype.setGlobalThrottle = SL_IH;SL4B_JavaScriptRttpProvider.prototype.setThrottleObject = SL_AW;SL4B_JavaScriptRttpProvider.prototype.setThrottleObjects = SL_AF;SL4B_JavaScriptRttpProvider.prototype.addConnectionListener = function(A){this.m_oConnectionManager.addConnectionListener(A);}; SL4B_JavaScriptRttpProvider.prototype.removeConnectionListener = function(A){this.m_oConnectionManager.removeConnectionListener(A);}; SL4B_JavaScriptRttpProvider.prototype.notifyConnectionListeners = function(){SL4B_MethodInvocationProxy.invoke(this.m_oConnectionManager,"notifyConnectionListeners",arguments);}; SL4B_JavaScriptRttpProvider.prototype.getObjectCache = function(){return this.m_oObjectCache; }; function SL_GA(A){this.m_oConnectionManager.createConnection(A);} function SL_EZ(B,A){this.m_oConnectionManager.createConnectionLost(B,A);this.m_oObjectSubscriptionManager.sendStaleToAll();} function SL_FN(){this.m_oConnectionManager.checkConnected();} function SL_ON(A,C,B){if(SL4B_Accessor.getRttpProvider()!=this&&SL4B_Accessor.getUnderlyingRttpProvider()!=this){return; }if(!A.rttpcode){var l_nRttpCode=A.getRttpCode(); if(l_nRttpCode==SL4B_RttpCodes.const_NOOP_OK){this.m_oConnectionManager.clearNoopTimeout();}else if(l_nRttpCode==SL4B_RttpCodes.const_CONNECT_OK){this.m_oLiberatorConfiguration.connectionOk();this.m_oConnectionManager.setSessionIdFromMessage(A.getMessageContent());setTimeout("SL4B_Accessor.getRttpProvider().connected()",0);var l_sHostName=A.getMessageContent().match(/host=(.*)\sversion=/)[1]; var l_sTime=A.getMessageContent().match(/time=(\d*)/)[1]; var l_sVersion=A.getMessageContent().match(/version=(.*)\s/)[1]; var l_nVersion=parseFloat(l_sVersion); SL4B_Accessor.getCapabilities().setRttpVersion(l_nVersion);this.m_oConnectionManager.getConnectionProxy().setConnectionState(SL4B_ConnectionProxy.const_CONNECTION_STATE_CONNECTED);C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_OK_CONNECTION_EVENT,l_sHostName,this.m_oConnectionManager.getCurrentConnectionData().getMethod(),l_sTime));}else if(l_nRttpCode==SL4B_RttpCodes.const_LOGIN_OK){this.m_oConnectionManager.setLoggedIn(true);this.m_oManagedConnection.clear();this.m_oObjectCache.clear();this.m_oObjectSubscriptionManager.reRequestObjects();var pWords=A.getMessageContent().split(" "); if(pWords.length==2){this.storeCapabilities(pWords[1]);}this.loggedIn();}else if(l_nRttpCode==SL4B_RttpCodes.const_RECON_OK){this.m_oConnectionManager.setLoggedIn(true);C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_RECONNECTION_OK_CONNECTION_EVENT));this.loggedIn();this.m_oObjectSubscriptionManager.sendCurrentObjectStatusToAll();}else if(l_nRttpCode>=SL4B_RttpCodes.const_INVALID_USER&&l_nRttpCode<SL4B_RttpCodes.const_NOT_LOGGED_IN){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_LOGIN_ERROR_CONNECTION_EVENT,A.getMessageContent()));this.m_oConnectionManager.stopConnection();this.m_oConnectionManager.clearConnectionCheckTimeout();}else if(l_nRttpCode==SL4B_RttpCodes.const_FIELD_MAP){this.m_oConnectionManager.setFieldCodeMapping(A.getMessageContent());}else if(l_nRttpCode>=SL4B_RttpCodes.const_SOURCE_UP&&l_nRttpCode<=SL4B_RttpCodes.const_SOURCE_WARN){var l_sWords=A.getMessageContent().split(" "); C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SOURCE_MESSAGE_CONNECTION_EVENT,l_nRttpCode,l_sWords[0],l_sWords[1],l_sWords[2]));}else if(l_nRttpCode==SL4B_RttpCodes.const_SESSION_EJECTED){C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SESSION_EJECTED_CONNECTION_EVENT,A.getMessageContent()));this.m_oConnectionManager.stopConnection();this.m_oConnectionManager.clearConnectionCheckTimeout();}else if(l_nRttpCode>=SL4B_RttpCodes.const_SERVICE_OK&&l_nRttpCode<=SL4B_RttpCodes.const_SERVICE_LIMITED){var l_sWords=A.getMessageContent().split(" "); C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_SERVICE_MESSAGE_CONNECTION_EVENT,l_nRttpCode,l_sWords[0],l_sWords[1],""));}else if(l_nRttpCode>=SL4B_RttpCodes.const_STATUS_MSG&&l_nRttpCode<=SL4B_RttpCodes.const_ERROR_MSG){var l_sWords=A.getMessageContent().split(" "); C_CallbackQueue.addCallback(new Array(this,"notifyConnectionListeners",this.const_MESSAGE_CONNECTION_EVENT,l_nRttpCode,l_sWords[0],l_sWords[1]));}else {}}} SL4B_JavaScriptRttpProvider.prototype.storeCapabilities = function(A){var pCapabilityKVPairs=A.split(","); for(var i=0,nLength=pCapabilityKVPairs.length;i<nLength;++i){var sCapabilityKVPair=pCapabilityKVPairs[i]; var pWords=sCapabilityKVPair.split("="); if(pWords.length==2){SL4B_Accessor.getCapabilities().add(pWords[0],pWords[1]);}}}; SL4B_JavaScriptRttpProvider.prototype.loggedIn = function(){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINEST_INT,"Login successful, starting NOOP messages");this.m_oConnectionManager.clearLoginTimeout();this.m_oConnectionManager.startNoopSending();if(SL4B_Accessor.getConfiguration().isEnableLatency()){this.m_oConnectionManager.sendSync(true);}SL4B_AbstractRttpProvider.prototype.loggedIn.apply(this,[]);}; function SL_HL(){SL4B_Logger.logConnectionMessage(false,"JavaScriptRttpProvider.initialise");this.m_oConnectionManager.setMessageReceiver(this.m_oManagedConnection);this.m_bFatalError=(this.m_oConnectionManager.initialise()==false);} function SL_JG(){return this.m_oConnectionManager.getJsContainerUrl(); } function SL_CA(){this.m_oConnectionManager.responseHttpRequestReady();} function SL_AY(){this.m_oConnectionManager.requestHttpRequestReady();} function SL_CQ(A){SL4B_Logger.logConnectionMessage(false,"JavaScriptRttpProvider.onLoad()");if(!this.m_bFatalError){this.m_oConnectionManager.startConnection();}} SL4B_JavaScriptRttpProvider.prototype.onUnload = function(){this._removeStreamingFrame(SL4B_JavaScriptRttpProvider.const_REQUEST_FRAME_ID);this._removeStreamingFrame(SL4B_JavaScriptRttpProvider.const_RESPONSE_FRAME_ID);}; SL4B_JavaScriptRttpProvider.prototype._removeStreamingFrame = function(A){ try {var eFrameElement=SL4B_Accessor.getBrowserAdapter().getElementById(A); eFrameElement.parentNode.removeChild(eFrameElement);}catch(e){} }; function SL_OJ(){this.m_oConnectionManager.connect();} function SL_ML(){this.m_oConnectionManager.reconnect();} function SL_NO(A,B){this.m_oConnectionManager.login(A,B);} function SL_IH(A){this.m_oActionSubscriptionManager.throttleGlobal(A);} function SL_AF(A,B){this.m_oActionSubscriptionManager.throttleObjects(A,B);} function SL_AW(A,B){this.m_oActionSubscriptionManager.throttleObjects(A,B);} function SL_QK(){this.m_oConnectionManager.logout();} function SL_AZ(){this.m_oConnectionManager.stop();} function SL_EM(){return SL4B_Version.getVersion(); } function SL_QD(){return SL4B_Version.getVersionInfo(); } function SL_LF(C,B,A){this.m_oObjectSubscriptionManager.requestObject(this.getListener(C),B,A);} function SL_KZ(C,A,B){this.m_oObjectSubscriptionManager.requestObjects(this.getListener(C),A,B);} function SL_LE(C,B,A){this.m_oObjectSubscriptionManager.discardObject(this.getListener(C),B,A);} function SL_CO(C,A,B){this.m_oObjectSubscriptionManager.discardObjects(this.getListener(C),A,B);} function SL_IX(A){this.m_oObjectSubscriptionManager.removeSubscriber(this.getListener(A));} function SL_QP(C,A,B){if(B==null||B.size()==0){throw new SL4B_Exception("JavaScriptRttpProvider.contribObject: field data object cannot be null or empty"); }this.m_oActionSubscriptionManager.contribObject(this.getListener(C),A,B);} function SL_GR(A,B){this.m_oActionSubscriptionManager.createObject(A,B);} function SL_JW(A){this.m_oActionSubscriptionManager.deleteObject(A);} function SL_NJ(E,D,A,B,C){var l_sCombinedFieldList=this.createFieldListForAutoDirectory(B,C,A); this.m_oObjectSubscriptionManager.registerProxySubscriber(this.getListener(E),this.getListener(new SL4B_ProxySubscriber(E)),D,l_sCombinedFieldList);this.m_oObjectSubscriptionManager.requestObject(this.getListener(E),D,l_sCombinedFieldList);} function SL_FP(E,D,A,B,C){var l_sCombinedFieldList=this.createFieldListForAutoDirectory(B,C,A); this.m_oObjectSubscriptionManager.discardObject(this.getListener(E),D,l_sCombinedFieldList);} function SL_EF(E,A,C,D,B){return this.m_oObjectSubscriptionManager.getContainer(E,A,C,D,B); } function SL_DX(B,C,A){this.m_oObjectSubscriptionManager.setContainerWindow(B,C,A);} function SL_MW(A){this.setContainerWindow(A);} function SL_NW(B,A){var l_oRequestData=this.m_oObjectSubscriptionManager.getContainerRequestData(A.getId()); var l_sCombinedFieldList=this.createFieldListForContainer(A.getId(),l_oRequestData.getFieldList(),l_oRequestData.getWindowStart(),l_oRequestData.getWindowEnd()); this.m_oObjectSubscriptionManager.discardObject(this.getListener(B),l_oRequestData.getContainerName(),l_sCombinedFieldList);} SL4B_JavaScriptRttpProvider.checkWindowRange = function(B,A){if(typeof (B)!="undefined"){if(typeof (A)=="undefined"){throw new SL4B_Exception("JavaScriptRttpProvider.getContainer: When specifying a window, both start and end must be passed"); }B=parseInt(B);A=parseInt(A);if(isNaN(B)||isNaN(A)){throw new SL4B_Exception("JavaScriptRttpProvider.getContainer: Both window parameters must be an integer"); }if(0>B||B>A){throw new SL4B_Exception("JavaScriptRttpProvider.getContainer: Window start must be non-negative and window end must be more than window start"); }}}; function SL_BW(A){return this.m_oConnectionManager.getFieldName(A); } var SL4B_ProxySubscriber=function(){}; if(false){function SL4B_ProxySubscriber(){} }SL4B_ProxySubscriber = function(A){this.m_oProxy=A;this.m_bIsProxySubscriber=true;this.initialise();}; SL4B_ProxySubscriber.prototype = new SL4B_AbstractSubscriber;SL4B_ProxySubscriber.prototype.ready = function(){}; SL4B_ProxySubscriber.prototype.structureChange = function(A,D,C,B){this.m_oProxy.structureChange(A,D,C,B);}; SL4B_ProxySubscriber.prototype.chat = function(C,B,D,A,E){this.m_oProxy.chat(l_sObjectName,B,D,A,E);}; SL4B_ProxySubscriber.prototype.contribOk = function(A){this.m_oProxy.contribOk(A);}; SL4B_ProxySubscriber.prototype.contribFailed = function(A,B){this.m_oProxy.contribFailed(A,B);}; SL4B_ProxySubscriber.prototype.directoryUpdated = function(D,C,A,B){this.m_oProxy.directoryUpdated(D,C,A,B);}; SL4B_ProxySubscriber.prototype.directoryMultiUpdated = function(A,B){this.m_oProxy.directoryMultiUpdated(A,B);}; SL4B_ProxySubscriber.prototype.fieldDeleted = function(A,C,B){this.m_oProxy.fieldDeleted(A,C,B);}; SL4B_ProxySubscriber.prototype.type2Clear = function(A){this.m_oProxy.type2Clear(A);}; SL4B_ProxySubscriber.prototype.type3Clear = function(A){this.m_oProxy.type3Clear(A);}; SL4B_ProxySubscriber.prototype.newsUpdated = function(A,D,C,B){this.m_oProxy.newsUpdated(A,D,C,B);}; SL4B_ProxySubscriber.prototype.objectDeleted = function(A){this.m_oProxy.objectDeleted(A);}; SL4B_ProxySubscriber.prototype.objectInfo = function(C,B,D,A){this.m_oProxy.objectInfo(C,B,D,A);}; SL4B_ProxySubscriber.prototype.objectNotFound = function(A){this.m_oProxy.objectNotFound(A);}; SL4B_ProxySubscriber.prototype.objectNotStale = function(A,B){this.m_oProxy.objectNotStale(A,B);}; SL4B_ProxySubscriber.prototype.objectReadDenied = function(A){this.m_oProxy.objectReadDenied(A);}; SL4B_ProxySubscriber.prototype.objectStale = function(A,B){this.m_oProxy.objectStale(A,B);}; SL4B_ProxySubscriber.prototype.objectStatus = function(D,B,A,C){this.m_oProxy.objectStatus(D,B,A,C);}; SL4B_ProxySubscriber.prototype.objectType = function(C,B,A){this.m_oProxy.objectType(C,B,A);}; SL4B_ProxySubscriber.prototype.objectUnavailable = function(A){this.m_oProxy.objectUnavailable(A);}; SL4B_ProxySubscriber.prototype.objectUpdated = function(A){this.m_oProxy.objectUpdated(A);}; SL4B_ProxySubscriber.prototype.objectWriteDenied = function(A){this.m_oProxy.objectWriteDenied(A);}; SL4B_ProxySubscriber.prototype.pageUpdated = function(E,D,B,A,C){this.m_oProxy.pageUpdated(E,D,B,A,C);}; SL4B_ProxySubscriber.prototype.recordMultiUpdated = function(A,B){this.m_oProxy.recordMultiUpdated(A,B);}; SL4B_ProxySubscriber.prototype.recordUpdated = function(B,C,A){this.m_oProxy.recordUpdated(B,l_oFieldData);}; SL4B_ProxySubscriber.prototype.storyReset = function(A){this.m_oProxy.storyReset(A);}; SL4B_ProxySubscriber.prototype.storyUpdated = function(A,B){this.m_oProxy.storyUpdated(A,B);}; SL4B_ProxySubscriber.prototype.permissionUpdated = function(A,B,C){this.m_oProxy.permissionUpdated(A,B,C);}; SL4B_ProxySubscriber.prototype.permissionDeleted = function(A,B){this.m_oProxy.permissionDeleted(A,B);}; function SL4B_FieldCheck(){this.m_mFieldSet={};} SL4B_FieldCheck.prototype.addFields = function(A){if(SL4B_ObjectSubscription.isAllFields(A)){this.m_mFieldSet[SL4B_ObjectSubscription.const_ALL_FIELDS]=true;}else {var l_pFields=A.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); for(var i=0,l_nLength=l_pFields.length;i<l_nLength;++i){this.m_mFieldSet[l_pFields[i]]=true;}}}; SL4B_FieldCheck.prototype.contains = function(A){var l_pFields=A.split(SL4B_ObjectCache.const_FIELD_NAME_DELIMITER); var l_bContainsFields=true; if(this.m_mFieldSet[SL4B_ObjectSubscription.const_ALL_FIELDS]!==true){if(SL4B_ObjectSubscription.isAllFields(A)){l_bContainsFields=false;}else {for(var i=0,l_nLength=l_pFields.length;i<l_nLength;++i){if(this.m_mFieldSet[l_pFields[i]]!==true){l_bContainsFields=false;break; }}}}return l_bContainsFields; }; var SL4B_TestRttpProvider=function(){}; if(false){function SL4B_TestRttpProvider(){} }SL4B_TestRttpProvider = function(){SL4B_AbstractRttpProvider.apply(this);this.m_pObjects=new Object();this.m_pFields=new Object();this.m_pSubscriptions=new Object();this.m_nTickCount=1;this.addDecimalField("ASK",1.53,3.23);this.addDecimalField("BID",1.53,3.23);this.addDecimalField("OPEN",1.53,3.23);this.addDecimalField("CLOSE",1.53,3.23);this.addIntegerField("TRDPRC_1",10,23);this.addIntegerField("LAST",1,5);this.addObject("/I/VOD.L",1500,1);this.addObject("/I/BP.L",5000,4);this.addObject("/I/BARC.L",3000,133);this.addObject("/I/GBP=",12500,234);}; SL4B_TestRttpProvider.prototype = new SL4B_AbstractRttpProvider;SL4B_TestRttpProvider.prototype.tick = SL_CP;SL4B_TestRttpProvider.prototype.addDecimalField = SL_CR;SL4B_TestRttpProvider.prototype.addIntegerField = SL_IP;SL4B_TestRttpProvider.prototype.addStringField = SL_BN;SL4B_TestRttpProvider.prototype.addObject = SL_EK;SL4B_TestRttpProvider.prototype.getNextValue = SL_LA;SL4B_TestRttpProvider.prototype.initialise = SL_FT;SL4B_TestRttpProvider.prototype.connect = SL_ES;SL4B_TestRttpProvider.prototype.login = SL_FJ;SL4B_TestRttpProvider.prototype.getObject = SL_DE;SL4B_TestRttpProvider.prototype.getObjects = SL_OS;SL4B_TestRttpProvider.prototype.removeObject = SL_FL;SL4B_TestRttpProvider.prototype.removeObjects = SL_EA;SL4B_TestRttpProvider.prototype.getObjectType = SL_MC;SL4B_TestRttpProvider.prototype.setThrottleObject = SL_LD;SL4B_TestRttpProvider.prototype.setThrottleObjects = SL_QZ;SL4B_TestRttpProvider.prototype.setGlobalThrottle = SL_QC;SL4B_TestRttpProvider.prototype.disableWTStatsTimeout = SL_QS;SL4B_TestRttpProvider.prototype.clearObjectListeners = SL_JP;SL4B_TestRttpProvider.prototype.blockObjectListeners = SL_GV;SL4B_TestRttpProvider.prototype.unblockObjectListeners = SL_LC;SL4B_TestRttpProvider.prototype.createObject = SL_NQ;SL4B_TestRttpProvider.prototype.contribObject = SL_AS;SL4B_TestRttpProvider.prototype.deleteObject = SL_AR;SL4B_TestRttpProvider.prototype.getFieldNames = SL_BM;SL4B_TestRttpProvider.prototype.logout = SL_PQ;SL4B_TestRttpProvider.prototype.debug = SL_IQ;SL4B_TestRttpProvider.prototype.setDebugLevel = SL_NS;SL4B_TestRttpProvider.prototype.getVersion = SL_LU;SL4B_TestRttpProvider.prototype.getVersionInfo = SL_OV;function SL_ES(){setTimeout("SL4B_Accessor.getRttpProvider().connected()",100);} function SL_FT(){this.connect();} function SL_FJ(A,B){this.credentialsRetrieved();this.loggedIn();this.m_hSetInterval=setInterval("SL4B_Accessor.getRttpProvider().tick()",200);} function SL_DE(C,B,A){var l_oObject=this.m_pObjects[B]; if(typeof l_oObject=="undefined"){setTimeout(C.WTObjectNotFound(B),500);return; }var l_oLiberatorSubscription=this.m_pSubscriptions[this.getListener(C)]; if(typeof l_oLiberatorSubscription=="undefined"){l_oLiberatorSubscription=new SL_IO();l_oLiberatorSubscription.m_oSubscriber=C;this.m_pSubscriptions[this.getListener(C)]=l_oLiberatorSubscription;}var l_oSubscriptionObject=l_oLiberatorSubscription.m_pObjects[B]; if(typeof l_oSubscriptionObject=="undefined"){l_oSubscriptionObject=new SL_CH();l_oSubscriptionObject.m_sName=B;l_oLiberatorSubscription.m_pObjects[B]=l_oSubscriptionObject;}l_oSubscriptionObject.add(A.split(","));} function SL_OS(C,A,B){l_pObjects=A.split(" ");for(var l_nCount=0;l_nCount<l_pObjects.length;l_nCount++){var l_sObjectName=l_pObjects[l_nCount]; this.getObject(C,l_sObjectName,B);}} function SL_FL(C,B,A){throw new SL4B_Error("removeObject method not implemented in TestRttpProvider"); } function SL_EA(C,A,B){throw new SL4B_Error("removeObjects method not implemented in TestRttpProvider"); } function SL_MC(B,A){throw new SL4B_Error("getObjectType method not implemented in TestRttpProvider"); } function SL_LD(A,B){var l_oObject=this.m_pObjects[A]; if(typeof l_oObject!="undefined"){}throw new SL4B_Error("setThrottleObject method not implemented in TestRttpProvider"); } function SL_QZ(A,B){throw new SL4B_Error("setThrottleObjects method not implemented in TestRttpProvider"); } function SL_QC(A){throw new SL4B_Error("setGlobalThrottle method not implemented in TestRttpProvider"); } function SL_QS(A){throw new SL4B_Error("disableWTStatsTimeout method not implemented in TestRttpProvider"); } function SL_JP(B,A){if(typeof A=="undefined"){}else {}} function SL_GV(B,A){if(typeof A=="undefined"){}else {}} function SL_LC(B,A){if(typeof A=="undefined"){}else {}} function SL_NQ(A,B){throw new SL4B_Error("createObject method not implemented in TestRttpProvider"); } function SL_AS(C,A,B){for(var l_nFieldIndex=0,l_nLength=B.size();l_nFieldIndex<l_nLength;++l_nFieldIndex){var l_oField=B.getField(l_nFieldIndex); if(l_nFieldIndex==(l_nLength-1)){this.m_oRttpApplet.contribObject(A,l_oField.m_sName,l_oField.m_sValue,this.getListener(C));}else {this.m_oRttpApplet.contribObject(A,l_oField.m_sName,l_oField.m_sValue,null);}}} function SL_AR(A){throw new SL4B_Error("deleteObject method not implemented in TestRttpProvider"); } function SL_BM(){var l_sNames=""; for(var l_nCount=0;l_nCount<l_pFieldNames.length;l_nCount++){if(l_nCount!=0){l_sNames+=",";}l_sNames+=l_pFieldNames[l_nCount];}return l_sNames; } function SL_PQ(){clearInterval(this.m_hSetInterval);} function SL_IQ(B,A){throw new SL4B_Error("debug method not implemented in TestRttpProvider"); } function SL_NS(A){throw new SL4B_Error("setDebugLevel method not implemented in TestRttpProvider"); } function SL_LU(){throw new SL4B_Error("getVersion method not implemented in TestRttpProvider"); } function SL_OV(){throw new SL4B_Error("getVersionInfo method not implemented in TestRttpProvider"); } function SL_JM(){this.m_sName="";this.m_sType="numeric";this.m_sDefaultValue="?";this.m_nMax;this.m_nMin;} function SL_FV(){this.m_sName="";this.m_sDirectory="";this.m_nFreqency=1000;this.m_nLastUpdateTime=0;this.m_nUpdateId=0;this.m_nOffset;this.m_pFields=new Object();} function SL_BX(){this.m_sName="";this.m_sValue="";this.m_nUpdateId=0;} function SL_IO(){this.m_oSubscriber=null;this.m_pObjects=new Object();this.toString = function(){var l_sRtn=""; for(l_sObjectName in this.m_pObjects){l_sRtn+="\t"+this.m_pObjects[l_sObjectName]+"\n";}return l_sRtn; }; } function SL_CH(){this.m_sName=null;this.m_pFields=new Object();this.m_nUpdateId=0;this.toString = function(){var l_sRtn=this.m_sName+": "; for(l_sField in this.m_pFields){l_sRtn+=l_sField+", ";}return l_sRtn; }; this.add = function(A){for(var l_nCount=0;l_nCount<A.length;l_nCount++){var l_sField=A[l_nCount]; if(typeof this.m_pFields[l_sField]=="undefined"){this.m_pFields[l_sField]=l_sField;}}}; } function SL_HT(){this.m_sName=null;this.m_sValue=null;} function SL_GX(){this.m_pData=new Array();} SL_GX.prototype = new SL4B_RecordFieldData;SL_GX.prototype.size = function(){return this.m_pData.length; }; SL_GX.prototype.getFieldName = function(A){this.checkIndex(A);return this.m_pData[A].m_sName; }; SL_GX.prototype.getFieldValue = function(A){this.checkIndex(A);return this.m_pData[A].m_sValue; }; SL_GX.prototype.checkIndex = function(A){if(A<0||A>=this.m_pData.length){throw new SL4B_Exception("Index "+A+" is out of bounds"); }}; function SL_CR(C,B,A){var l_oField=new SL_JM(); l_oField.m_sName=C;l_oField.m_sType="decimal";l_oField.m_nMin=B;l_oField.m_nMax=A;this.m_pFields[C]=l_oField;} function SL_IP(C,B,A){var l_oField=new SL_JM(); l_oField.m_sName=C;l_oField.m_sType="integer";l_oField.m_nMin=B;l_oField.m_nMax=A;this.m_pFields[C]=l_oField;} function SL_BN(B,A){var l_oField=new SL_JM(); l_oField.m_sName=B;l_oField.m_sType="string";l_oField.m_sDefaultValue=A;this.m_pFields[B]=l_oField;} function SL_EK(C,A,B){var l_nNow=(new Date()).valueOf(); l_oObject=new SL_FV();l_oObject.m_sName=C;l_oObject.m_nOffset=B;l_oObject.m_nLastUpdateTime=0;l_oObject.m_nUpdateId=1;l_oObject.m_nFreqency=A;l_oObject.m_sDirectory=C.substring(0,C.lastIndexOf("/")+1);for(l_sFieldName in this.m_pFields){var l_oField=this.m_pFields[l_sFieldName]; var l_oFieldValue=new SL_BX(); l_oFieldValue.m_sName=l_oField.m_sName;l_oFieldValue.m_sValue=this.getNextValue(l_oObject,l_oField);l_oFieldValue.m_nUpdateId=1;l_oObject.m_pFields[l_oFieldValue.m_sName]=l_oFieldValue;}this.m_pObjects[C]=l_oObject;} function SL_LA(B,A){var l_oReturn=""; if(A.m_sType=="decimal"){l_oReturn=(Math.random()*(A.m_nMax-A.m_nMin))+A.m_nMin+B.m_nOffset;l_oReturn=Math.floor(l_oReturn*100)/100;}if(A.m_sType=="integer"){l_oReturn=(Math.random()*(A.m_nMax-A.m_nMin))+A.m_nMin+B.m_nOffset;l_oReturn=Math.floor(l_oReturn);}return l_oReturn; } function SL_CP(){this.m_nTickCount++;var l_nNow=(new Date()).valueOf(); for(l_sObjectName in this.m_pObjects){var l_oObject=this.m_pObjects[l_sObjectName]; if((l_oObject.m_nLastUpdateTime+l_oObject.m_nFreqency)<l_nNow){for(l_sFieldName in this.m_pFields){var l_oField=this.m_pFields[l_sFieldName]; var l_oFieldValue=l_oObject.m_pFields[l_oField.m_sName]; if(l_oField.m_sType=="decimal"||l_oField.m_sType=="integer"){if(Math.random()>0.5){l_oFieldValue.m_sValue=this.getNextValue(l_oObject,l_oField);l_oFieldValue.m_nUpdateId=this.m_nTickCount;l_oObject.m_nUpdateId=this.m_nTickCount;l_oObject.m_nLastUpdateTime=l_nNow;}}}}}for(l_sSubscriber in this.m_pSubscriptions){var l_oLiberatorSubscription=this.m_pSubscriptions[l_sSubscriber]; for(l_sObjectName in l_oLiberatorSubscription.m_pObjects){var l_oLiberatorSubsciptionObject=l_oLiberatorSubscription.m_pObjects[l_sObjectName]; var l_oObject=this.m_pObjects[l_sObjectName]; if(typeof l_oObject!="undefined"&&l_oObject.m_nUpdateId>l_oLiberatorSubsciptionObject.m_nUpdateId){var l_oData=new SL_GX(); for(l_sField in l_oLiberatorSubsciptionObject.m_pFields){var l_oFieldValue=l_oObject.m_pFields[l_sField]; if(typeof l_oFieldValue!="undefined"&&l_oFieldValue.m_nUpdateId>l_oLiberatorSubsciptionObject.m_nUpdateId){var l_oNotificationFieldValue=new SL_HT(); l_oNotificationFieldValue.m_sName=l_sField;l_oNotificationFieldValue.m_sValue=l_oFieldValue.m_sValue;l_oData.m_pData.push(l_oNotificationFieldValue);}}l_oLiberatorSubscription.m_oSubscriber.WTRecordMultiUpdated(l_sObjectName,l_oData);l_oLiberatorSubsciptionObject.m_nUpdateId=l_oObject.m_nUpdateId;}}}} function SL_FA(){SL4B_ScriptLoader.createRttpProvider();} function SL_KS(){this.m_nSliceSize=20;this.m_pRtmlObjectContainers=new Object();this.initialise();} SL_KS.prototype = new SL4B_AbstractSubscriber;SL_KS.prototype.ready = SL_KD;SL_KS.prototype.getRequiredSymbols = SL_LP;SL_KS.prototype.optimiseAndRequestObjects = SL_JS;SL_KS.prototype.recordUpdated = SL_BA;SL_KS.prototype.objectStatus = SL_OI;function SL_KD(){SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"RtmlSubscriber.ready: called.");var l_pElements=this.getRequiredSymbols(); SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"RtmlSubscriber.ready: found {0} quote tags.",l_pElements.length);this.optimiseAndRequestObjects(l_pElements);} function SL_LP(){SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"RtmlSubscriber: Finding quote tags...");var l_oQuoteTag=null; var l_nCount=1; var l_pListOfQuoteElements=new Array(); var l_oBrowserAdapter=SL4B_Accessor.getBrowserAdapter(); if(l_oBrowserAdapter.isInternetExplorer()){for(var i=0;i<document.all.length;i++){if(typeof (document.all[i].id)!='undefined'){if(document.all[i].id.toLowerCase()=="quote"){var l_oQuoteTag=document.all[i]; SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"RtmlSubscriber: Found quote tag... ("+l_nCount+") : "+l_oQuoteTag+"("+l_oQuoteTag.innerHTML+")");l_pListOfQuoteElements.push(l_oQuoteTag);l_oQuoteTag.id="QUOTE"+l_nCount++;}}}}else { do{l_oQuoteTag=l_oBrowserAdapter.getElementById("QUOTE");if(l_oQuoteTag==null){l_oQuoteTag=l_oBrowserAdapter.getElementById("quote");if(l_oQuoteTag==null){l_oQuoteTag=l_oBrowserAdapter.getElementById("Quote");}}if(l_oQuoteTag!=null){SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"RtmlSubscriber: Found quote tag... ("+l_nCount++, +") : "+l_oQuoteTag+"("+l_oQuoteTag.innerHTML+")");l_pListOfQuoteElements.push(l_oQuoteTag);l_oQuoteTag.setAttribute("id","QUOTE"+l_pListOfQuoteElements.length);}}while(l_oQuoteTag!=null);}return l_pListOfQuoteElements; } function SL_JS(A){for(var l_i=0;l_i<A.length;l_i++){var l_oQuoteElement=new SL_AE(A[l_i]); if(this.m_pRtmlObjectContainers[l_oQuoteElement.m_sObjectName]==null){this.m_pRtmlObjectContainers[l_oQuoteElement.m_sObjectName]=new SL_CF(l_oQuoteElement.m_sObjectName);}this.m_pRtmlObjectContainers[l_oQuoteElement.m_sObjectName].addRtmlQuoteElement(l_oQuoteElement);}var l_pTagList=new Array(); for(l_sObjectName in this.m_pRtmlObjectContainers){l_pTagList=l_pTagList.concat(this.m_pRtmlObjectContainers[l_sObjectName].getUniqueFields());}l_pTagList.sort(SL_PB);for(var l_i=l_pTagList.length-1;l_i>0;l_i--){if((l_pTagList[l_i].m_sFieldName==l_pTagList[l_i-1].m_sFieldName)){l_pTagList[l_i-1].m_sObjectName+=SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER+l_pTagList[l_i].m_sObjectName;l_pTagList=l_pTagList.slice(0,l_i).concat(l_pTagList.slice(l_i+1));}}l_pTagList.sort(SL_QT);for(var l_i=l_pTagList.length-1;l_i>0;l_i--){if((l_pTagList[l_i].m_sObjectName==l_pTagList[l_i-1].m_sObjectName)){l_pTagList[l_i-1].m_sFieldName+=","+l_pTagList[l_i].m_sFieldName;l_pTagList=l_pTagList.slice(0,l_i).concat(l_pTagList.slice(l_i+1));}}var l_nRequests=0; if(this.m_nSliceSize>0){for(var l_i=0;l_i<l_pTagList.length;l_i++){var l_sSymbolsArray=l_pTagList[l_i].m_sObjectName.split(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); var l_nStart=0; var l_nEnd=this.m_nSliceSize; while(l_nEnd<l_sSymbolsArray.length){var l_sObjectName=(l_sSymbolsArray.slice(l_nStart,l_nEnd)).join(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"RtmlSubscriber.optimiseAndRequestObjects: Requesting object(s) {0} with fields {1}.",l_sObjectName,l_pTagList[l_i].m_sFieldName);SL4B_Accessor.getRttpProvider().getObjects(this,l_sObjectName,l_pTagList[l_i].m_sFieldName);l_nRequests++;l_nStart=l_nEnd;l_nEnd=l_nEnd+this.m_nSliceSize;}var l_sObjectName=(l_sSymbolsArray.slice(l_nStart,l_sSymbolsArray.length)).join(SL4B_AbstractRttpProvider.const_OBJECT_NAME_DELIMITER); SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"RtmlSubscriber.optimiseAndRequestObjects: Requesting object(s) {0} with fields {1}.",l_sObjectName,l_pTagList[l_i].m_sFieldName);SL4B_Accessor.getRttpProvider().getObjects(this,l_sObjectName,l_pTagList[l_i].m_sFieldName);l_nRequests++;}}else {for(var l_i=0;l_i<l_pTagList.length;l_i++){SL4B_Logger.log(SL4B_DebugLevel.const_RTTP_FINE_INT,"RtmlSubscriber.optimiseAndRequestObjects: Requesting object(s) {0} with fields {1}.",l_pTagList[l_i].m_sObjectName,l_pTagList[l_i].m_sFieldName);SL4B_Accessor.getRttpProvider().getObjects(this,l_pTagList[l_i].m_sObjectName,l_pTagList[l_i].m_sFieldName);l_nRequests++;}}SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"RTML Subscriber: Made {0} requests after optimisation.",l_nRequests);} function SL_PB(A,B){if(A.m_sFieldName>B.m_sFieldName){return 1; }if(A.m_sFieldName<B.m_sFieldName){return -1; }if(A.m_sObjectName>B.m_sObjectName){return 1; }if(A.m_sObjectName<B.m_sObjectName){return -1; }return 0; } function SL_QT(A,B){if(A.m_sObjectName>B.m_sObjectName){return 1; }if(A.m_sObjectName<B.m_sObjectName){return -1; }return 0; } function SL_BA(B,C,A){this.m_pRtmlObjectContainers[B].updateRtmlQuoteElements(C,A);} function SL_OI(D,B,A,C){if(B==SL4B_ObjectStatus.STALE){this.m_pRtmlObjectContainers[D].updateRtmlQuoteElementsStatus(true);}else if(B==SL4B_ObjectStatus.OK||B==SL4B_ObjectStatus.LIMITED){this.m_pRtmlObjectContainers[D].updateRtmlQuoteElementsStatus(false);}} function SL_AE(A){this.m_sObjectName=A.getAttribute("symbol");this.m_sFieldName=A.getAttribute("field");if(this.m_sFieldName==null){this.m_sFieldName=A.getAttribute("fid");}this.m_oHtmlElement=A;this.m_dFlashTime=this.getQuoteAttribute("flashtime",SL_AE.const_INTEGER);this.m_sBgChange=this.getQuoteAttribute("bgchange",SL_AE.const_STRING);this.m_sBgDn=this.getQuoteAttribute("bgdn",SL_AE.const_BGCOLOR);this.m_sBgUp=this.getQuoteAttribute("bgup",SL_AE.const_BGCOLOR);this.m_sBgEq=this.getQuoteAttribute("bgeq",SL_AE.const_BGCOLOR);this.m_sFgChange=this.getQuoteAttribute("fgchange",SL_AE.const_STRING);this.m_sFgDn=this.getQuoteAttribute("fgdn",SL_AE.const_FGCOLOR);this.m_sFgUp=this.getQuoteAttribute("fgup",SL_AE.const_FGCOLOR);this.m_sFgEq=this.getQuoteAttribute("fgeq",SL_AE.const_FGCOLOR);this.m_sFgFlash=this.getQuoteAttribute("fgflash",SL_AE.const_STRING);this.m_sPlus=this.getQuoteAttribute("plus",SL_AE.const_INTEGER);this.m_dFractionHandling=this.getQuoteAttribute("fractionhandling",SL_AE.const_INTEGER);this.m_dToDp=this.getQuoteAttribute("todp",SL_AE.const_INTEGER);this.m_sRound=this.getQuoteAttribute("round",SL_AE.const_STRING);this.m_dAddCommas=this.getQuoteAttribute("addcommas",SL_AE.const_INTEGER);this.m_dToSf=this.getQuoteAttribute("tosf",SL_AE.const_POSITIVE_INTEGER);this.m_sGfxEq=this.getQuoteAttribute("gfxeq",SL_AE.const_STRING);this.m_sRootUrl=SL4B_ScriptLoader.getRelativeUrlPrefix();this.m_sGfxUp=this.getQuoteAttribute("gfxup",SL_AE.const_STRING);if(this.m_sGfxUp==null){this.m_sGfxUp=this.m_sRootUrl+'rtml/img/up.gif';}this.m_sGfxDn=this.getQuoteAttribute("gfxdn",SL_AE.const_STRING);if(this.m_sGfxDn==null){this.m_sGfxDn=this.m_sRootUrl+'rtml/img/down.gif';}this.m_fTransformFunction=null; try {this.m_fTransformFunction=eval(this.getQuoteAttribute("transform",SL_AE.const_STRING));}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"RtmlQuoteElement.constructor: Transform function '{0}' could not be found!",this.getQuoteAttribute("transform",SL_AE.const_STRING));} this.m_oTransformParam=null; try {this.m_oTransformParam=eval("RTML_transformParam="+this.getQuoteAttribute("transformparam",SL_AE.const_STRING));}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"RtmlQuoteElement.constructor: Transform param {0} could not be parsed!",this.getQuoteAttribute("transformparam",SL_AE.const_STRING));} this.m_bIsIndicator=(A.getAttribute("indicator")!=null);l_bContainsChange=false;if(this.m_sFieldName!=null){var l_bContainsChange=((this.m_sFieldName.toLowerCase().indexOf('chng')!=-1)||(this.m_sFieldName.toLowerCase().indexOf('change')!=-1)); }if(this.m_sFgChange==null&&l_bContainsChange==true){this.m_sFgChange="abs";}if(this.m_sPlus==null&&l_bContainsChange==true){this.m_sPlus=1;}if(this.m_sBgChange=="rel"&&this.m_sFgChange=="abs"){this.m_sChangedType="RtmlAbsFgRelBg"+this.m_oHtmlElement.getAttribute("id");this.m_fChangedFunction=RTML_AbsFgRelBgUpdate;}else if(this.m_sBgChange=="abs"&&this.m_sFgChange=="abs"){this.m_sChangedType="RtmlAbsolute"+this.m_oHtmlElement.getAttribute("id");this.m_fChangedFunction=RTML_AbsoluteUpdate;}else if(this.m_sBgChange=="abs"){this.m_sChangedType="RtmlRelFgAbsBg"+this.m_oHtmlElement.getAttribute("id");this.m_fChangedFunction=RTML_RelFgAbsBgUpdate;}else if(this.m_sBgChange=="rel"){this.m_sChangedType="RtmlRelative"+this.m_oHtmlElement.getAttribute("id");this.m_fChangedFunction=RTML_RelativeUpdate;}if(this.m_dFlashTime<=0||this.m_sBgUp.toLowerCase().indexOf("none")!=-1||this.m_sBgDn.toLowerCase().indexOf("none")!=-1||this.m_sBgEq.toLowerCase().indexOf("none")!=-1){this.m_sBgUp=this.m_sBgDn=this.m_sBgEq="";}if(this.m_sFgUp.toLowerCase().indexOf("none")!=-1||this.m_sFgDn.toLowerCase().indexOf("none")!=-1||this.m_sFgEq.toLowerCase().indexOf("none")!=-1){this.m_sFgUp=this.m_sFgDn=this.m_sFgEq=this.m_sFgFlash="";}RTSL_AddFlashType(this.m_sChangedType,this.m_fChangedFunction,this.m_sBgUp,this.m_sBgDn,this.m_sBgEq,'',this.m_sFgFlash,this.m_sFgFlash,this.m_sFgFlash,'black',this.m_sFgUp,this.m_sFgDn,this.m_sFgEq,'black');} SL_AE.prototype.updateQuoteValue = SL_OP;SL_AE.prototype.updateQuoteStatus = SL_QH;SL_AE.prototype.getQuoteAttribute = SL_JQ;SL_AE.prototype.getParentAttribute = SL_MH;SL_AE.const_INTEGER=1;SL_AE.const_POSITIVE_INTEGER=2;SL_AE.const_STRING=3;SL_AE.const_FGCOLOR=4;SL_AE.const_BGCOLOR=5;function RTML_RelativeUpdate(A,C,D,G,B,E,F){var l_oUpdateFlash=SL_CW(A,C,D.value,G,B); return (new GF_Update(C,D.displayValue,l_oUpdateFlash.m_sFlashClr,l_oUpdateFlash.m_sFlashText,l_oUpdateFlash.m_sFinalText,l_oUpdateFlash.m_sFinalClr,G,B,'innerText',F)); } function RTML_AbsoluteUpdate(D,B,C,G,A,E,F){var l_sPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B] : ''); g_pPreviousValue[B]=C.value;var l_oFinalUpdate=SL_NF(D,0,GF_ConvertToDecimal(C.value),'0.00'); return (new GF_Update(B,C.displayValue,l_oFinalUpdate.m_sFlashClr,l_oFinalUpdate.m_sFlashText,l_oFinalUpdate.m_sFinalText,l_oFinalUpdate.m_sFinalClr,G,A,'innerText',F)); } function RTML_AbsFgRelBgUpdate(D,B,C,G,A,E,F){var l_sPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B] : ''); g_pPreviousValue[B]=C.value;var l_nOld=GF_ConvertToDecimal(l_sPrevVal); var l_nNew=GF_ConvertToDecimal(C.value); var l_oRelUpdate=SL_NF(D,l_nOld,l_nNew,l_sPrevVal); var l_oAbsUpdate=SL_NF(D,0,l_nNew,'0.00'); return (new GF_Update(B,C.displayValue,l_oRelUpdate.m_sFlashClr,l_oAbsUpdate.m_sFlashText,l_oAbsUpdate.m_sFinalText,l_oRelUpdate.m_sFinalClr,G,A,'innerText',F)); } function RTML_RelFgAbsBgUpdate(D,B,C,G,A,E,F){var l_sPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B] : ''); g_pPreviousValue[B]=C.value;var l_nOld=GF_ConvertToDecimal(l_sPrevVal); var l_nNew=GF_ConvertToDecimal(C.value); var l_oRelUpdate=SL_NF(D,l_nOld,l_nNew,l_sPrevVal); var l_oAbsUpdate=SL_NF(D,0,l_nNew,'0.00'); return (new GF_Update(B,C.displayValue,l_oAbsUpdate.m_sFlashClr,l_oRelUpdate.m_sFlashText,l_oRelUpdate.m_sFinalText,l_oAbsUpdate.m_sFinalClr,G,A,'innerText',F)); } function SL_OP(A){if(!this.m_bIsIndicator){var l_dNewComparisonValue=A; switch(this.m_dFractionHandling){ case 1:A=RTSL_FractionToDecimal(A);l_dNewComparisonValue=A;break; case 2:A=RTSL_FractionSimplify(A);l_dNewComparisonValue=RTSL_FractionToDecimal(A);break; case 3:l_dNewComparisonValue=RTSL_FractionToDecimal(A);break; }if(this.m_fTransformFunction!=null){var l_oTransformResult=this.m_fTransformFunction(A,this.m_oTransformParam,this.m_sObjectName,this.m_sFieldName); if(l_oTransformResult instanceof RTML_TransformResult){l_dNewComparisonValue=l_oTransformResult.value;A=l_oTransformResult.displayValue;}else {l_dNewComparisonValue=l_oTransformResult;A=l_oTransformResult;}}if(this.m_dToSf>0){A=RTSL_ToSignificantFigures(A,this.m_dToSf);}if(this.m_dToDp>0){A=RTSL_ToDecimalPlaces(A,this.m_dToDp,false,this.m_sRound);}if(this.m_dAddCommas==1){A=RTSL_AddCommas(A);}if((this.m_sPlus==1)&&(parseFloat(A)>0)){A='+'+A;}var l_oUpdateValue=new RTML_TransformResult(l_dNewComparisonValue,A); var l_oUpdate=RTSL_CreateUpdate(this.m_oHtmlElement.getAttribute("id"),this.m_sChangedType,l_oUpdateValue,false,false,null,this.m_dFlashTime); }else {var l_sImgId=this.m_oHtmlElement.id+"Img"; if(this.m_oHtmlElement.innerHTML.indexOf("IMG")==-1&&this.m_oHtmlElement.innerHTML.indexOf("img")==-1){this.m_oHtmlElement.innerHTML="<i"+"mg id="+l_sImgId+" src='"+this.m_sRootUrl+"rtml/img/blank.gif'"+"></i"+"mg>";}var l_oImageArray=new MOD_CreateImages(0,8,8); l_oImageArray.addImage(-1,this.m_sGfxDn);(this.m_sGfxEq==null) ? l_oImageArray.addImage(0,this.m_sRootUrl+'rtml/img/blank.gif') : l_oImageArray.addImage(0,this.m_sGfxEq);l_oImageArray.addImage(1,this.m_sGfxUp);var l_oUpdate=null; if(this.m_sFgChange=='rel'||this.m_sFgChange==null){if(this.m_sGfxEq==null){l_oUpdate=RTSL_CreateUpdate(l_sImgId,'UpDownRelIndicator',A,false,false,l_oImageArray);}else {l_oUpdate=RTSL_CreateUpdate(l_sImgId,'Indicator',A,false,false,l_oImageArray);}}else {l_oUpdate=RTSL_CreateUpdate(l_sImgId,'UpDownAbsIndicator',A,false,false,l_oImageArray);}}RTSL_DisplayUpdate(l_oUpdate);} function SL_QH(A){if(!this.m_bIsIndicator){if(A){RTSL_FlushUpdate(this.m_oHtmlElement.getAttribute("id"));this.m_oHtmlElement.style.textDecoration="line-through";}else {this.m_oHtmlElement.style.textDecoration="none";}}} function SL_JQ(B,A){var isError=false; var l_vAttributeValue=this.m_oHtmlElement.getAttribute(B); if(l_vAttributeValue==null){switch(A){ case SL_AE.const_FGCOLOR:l_vAttributeValue=this.getQuoteAttribute("fg",SL_AE.const_STRING);break; case SL_AE.const_BGCOLOR:l_vAttributeValue=this.getQuoteAttribute("bg",SL_AE.const_STRING);break; }}if(l_vAttributeValue==null){l_vAttributeValue=this.getParentAttribute(B);}if(l_vAttributeValue!=null){switch(A){ case SL_AE.const_INTEGER:isError=!SL4B_Accessor.getConfiguration().checkInteger(l_vAttributeValue);l_vAttributeValue=parseInt(l_vAttributeValue);break; case SL_AE.const_POSITIVE_INTEGER:isError=!SL4B_Accessor.getConfiguration().checkPositiveInteger(l_vAttributeValue);l_vAttributeValue=parseInt(l_vAttributeValue);break; case SL_AE.const_STRING:default :break; }}if(isError){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"LF_RtmlQuoteElement_GetQuoteAttribute: Attribute Value: {0} for Attribute {1} is Incorrect, Using Defaults",l_vAttributeValue,B);}if(l_vAttributeValue==null||isError){switch(A){ case SL_AE.const_INTEGER:l_vAttributeValue=SL4B_Accessor.getConfiguration().getIntegerScriptTagAttribute(B);break; case SL_AE.const_POSITIVE_INTEGER:l_vAttributeValue=SL4B_Accessor.getConfiguration().getPositiveIntegerScriptTagAttribute(B);break; case SL_AE.const_STRING:default :l_vAttributeValue=SL4B_Accessor.getConfiguration().getScriptTagAttribute(B);break; }}return l_vAttributeValue; } function SL_MH(A){var l_vAttributeValue=null; var l_oCurrentElement=this.m_oHtmlElement.parentNode; while(l_oCurrentElement!=window.document&&l_oCurrentElement!=null&&typeof (l_oCurrentElement.getAttribute)!='undefined'){l_vAttributeValue=l_oCurrentElement.getAttribute(A);if(l_vAttributeValue!=null){break; }l_oCurrentElement=l_oCurrentElement.parentNode;}return l_vAttributeValue; } function SL_CF(A){this.m_sObjectName=A;this.m_pRtmlQuoteElements=new Object();} SL_CF.prototype.addRtmlQuoteElement = SL_JH;SL_CF.prototype.getUniqueFields = SL_KT;SL_CF.prototype.updateRtmlQuoteElements = SL_FR;SL_CF.prototype.updateRtmlQuoteElementsStatus = SL_GH;function SL_JH(A){if(this.m_pRtmlQuoteElements[A.m_sFieldName]==null){this.m_pRtmlQuoteElements[A.m_sFieldName]=new Array();}this.m_pRtmlQuoteElements[A.m_sFieldName].push(A);} function SL_KT(){var l_pUniqueFields=new Array(); for(l_sFieldName in this.m_pRtmlQuoteElements){l_pUniqueFields.push(this.m_pRtmlQuoteElements[l_sFieldName][0]);}return l_pUniqueFields; } function SL_FR(B,A){var l_pElements=this.m_pRtmlQuoteElements[B]; for(l_oQuoteElement in l_pElements){l_pElements[l_oQuoteElement].updateQuoteValue(A);}} function SL_GH(A){for(l_sFieldName in this.m_pRtmlQuoteElements){var l_pElements=this.m_pRtmlQuoteElements[l_sFieldName]; for(l_oQuoteElement in l_pElements){l_pElements[l_oQuoteElement].updateQuoteStatus(A);}}} RTML_RtmlSubscriberAccessor = new function(){this.m_oRtmlSubscriber=new SL_KS();this.getRtmlSubscriber = function(A){return ((typeof A=="undefined") ? this.m_oRtmlSubscriber : A); }; }; RTML_TransformResult = function(A,B){this.value=A;this.displayValue=B;}; function RTSL_ToDecimalPlaces(A,B,C,D){if(isNaN(A)){return A; }var l_sRoundType=RTSL_DefaultValue(D,"default"); var l_nPower=Math.pow(10,B); var l_nVal; if(l_sRoundType=="up"){l_nVal=(Math.ceil(A*l_nPower))/l_nPower;}else if(l_sRoundType=="down"){l_nVal=(Math.floor(A*l_nPower))/l_nPower;}else {l_nVal=(Math.round(A*l_nPower))/l_nPower;}var l_sVal=l_nVal.toString(10); if(l_nVal==0){l_sVal+=".";for(var l_nCount=0;l_nCount<B;l_nCount++){l_sVal+="0";}}if(C){var l_nNumZeros=l_sVal.search(/\./); var l_bNeedsDot=false; if(l_nNumZeros==-1){l_nNumZeros=B;l_bNeedsDot=true;}else {l_nNumZeros=B-(l_sVal.length-l_nNumZeros-1);l_nNumZeros=((l_nNumZeros<0) ? (0) : (l_nNumZeros));}if(l_nNumZeros>0){if(l_bNeedsDot){l_sVal+=".";}}for(var l_nCount=0;l_nCount<l_nNumZeros;l_nCount++){l_sVal+="0";}}return l_sVal; } function RTSL_AddCommas(A){if(isNaN(A)){return A; }var l_sAbsVal=new String(Math.abs(A)); l_sAbsVal=l_sAbsVal.split('.');var l_sComma=''; var l_nPosition; do{l_sComma=l_sAbsVal[0].substr(((l_sAbsVal[0].length-3>=0) ? l_sAbsVal[0].length-3 : 0))+((l_sComma!='') ? ',' : '')+l_sComma;l_sAbsVal[0]=l_sAbsVal[0].substr(0,l_sAbsVal[0].length-3);}while(l_sAbsVal[0].length>0);var l_sVal=new String(A); l_sVal=l_sVal.split('.');if(typeof (l_sVal[1])!='undefined'&&l_sVal[1].length>0){l_sComma+='.'+l_sVal[1];}var l_nDir=((A==0) ? 1 : (A/Math.abs(A))); l_sComma=((l_nDir==1) ? l_sComma : ('-'+l_sComma));return l_sComma; } function RTSL_FractionToDecimal(A){if(!SL_LS(A)){return A; }A=A.toString();var l_nVal=new Number(A); var l_nInt=SL_CU(A); if(isNaN(l_nInt)){return A; }var l_nNum=SL_KW(A); if(isNaN(l_nNum)){return A; }var l_nDen=SL_BE(A); if(isNaN(l_nDen)){return A; }var l_nDec=(l_nDen==0) ? (0) : (SL_ET(A)*l_nNum/l_nDen); l_nVal=l_nInt+l_nDec;return l_nVal; } function RTSL_FractionSimplify(A){if(!SL_LS(A)){return A; }var l_nInt=SL_CU(A); if(isNaN(l_nInt)){return A; }var l_nNum=SL_KW(A); if(isNaN(l_nNum)){return A; }else if(l_nNum==0){return l_nInt.toString(); }var l_nDen=SL_BE(A); if(isNaN(l_nDen)){return A; }else if(l_nDen==0){return A; }var l_nHcm=SL_RB(l_nNum,l_nDen); l_nNum/=l_nHcm;l_nDen/=l_nHcm;var l_sStr=((l_nInt==0) ? '' : (l_nInt.toString()+' ')); return (l_sStr+l_nNum.toString()+'/'+l_nDen.toString()); } function RTSL_FractionToHTML(A){var l_sMatch; if(l_sMatch=A.match(/\-?[0-9]+\s[0-9]+\/[0-9]+/)){var l_sInt=(l_sMatch.toString().match(/^\-?[0-9]+/)).toString(); var l_sFraction=(l_sMatch.toString().match(/[0-9]+\/[0-9]+$/)).toString(); A=l_sInt+SL_KO(l_sFraction);}else if(l_sMatch=A.match(/[0-9]+\/[0-9]+$/)){var l_sFraction=(l_sMatch.toString().match(/[0-9]+\/[0-9]+$/)).toString(); A=SL_KO(l_sFraction);if(A.charAt(0)==0){A=A.substring(1);}}return A; } function SL_KO(A){var l_sResult; var l_nFrac=eval(A); switch(l_nFrac){ case 0.25:l_sResult='¼';break; case 0.5:l_sResult='½';break; case 0.75:l_sResult='¾';break; default :l_sResult=' '+A;}return l_sResult; } function RTSL_ToSignificantFigures(B,A){if(B==null||isNaN(B)||A<=0||B=="0"){return B; }B=B.toString();var l_bSign=(B.indexOf("-")==0); if(l_bSign){B=B.substr(1);}var l_oRegExp=/^[^1-9]*/; var l_sBegin=B.match(l_oRegExp).toString(); var l_sEnd=B.replace(l_oRegExp,""); l_sEnd=SL_IE(l_sEnd,A);if(l_sBegin.length){if(l_sEnd.length<A){for(var l_nCount=l_sEnd.length;l_nCount<A;l_nCount++){l_sEnd+="0";}}else if(l_sEnd.length>A){l_sEnd=l_sEnd.substring(0,A);}}return ((l_bSign) ? ("-") : (""))+l_sBegin+l_sEnd; } function SL_IE(B,A){var l_bPadZeros=true; var l_nLengthToUse=Math.round(B).toString().length; var l_nPower=Math.pow(10,-(l_nLengthToUse-A)); var l_nVal; l_nVal=(Math.round(B*l_nPower))/l_nPower;var l_sVal=l_nVal.toString(10); return l_sVal; } function SL_LS(A){return (A.toString().indexOf("/",1)==-1) ? false : true; } function SL_CU(A){var l_nSpacePos=A.indexOf(" ",1); var l_vResult; if(l_nSpacePos==-1){l_vResult=0;}else if('u'+parseInt(A.substring(0,l_nSpacePos))=='uNaN'){l_vResult=A;}else {l_vResult=parseInt(A.substring(0,l_nSpacePos));}return l_vResult; } function SL_KW(A){var l_nSpacePos=A.indexOf(" ",1); var l_nDivPos=A.indexOf('/'); return parseInt(A.substring(l_nSpacePos,l_nDivPos),10); } function SL_BE(A){var l_nDivPos=A.indexOf('/'); return new Number(A.substr(l_nDivPos+1)); } function SL_ET(A){return (A.charAt(0)=='-') ? -1 : 1; } function SL_RB(A,B){var l_nResult; l_nResult=A%B;if(l_nResult==0){return B; }return SL_RB(B,l_nResult); } LF_ElementCache = new function(){this.m_pElementLookup=new Object();this.m_pHtmlElements=new Object();this.getElement = function(A){var l_oElement=this.m_pElementLookup[A]; if(typeof l_oElement=="undefined"||l_oElement==null){if(typeof RTSL_GetElementFromDOM=="function"){l_oElement=RTSL_GetElementFromDOM(A);}else {l_oElement=SL4B_Accessor.getBrowserAdapter().getElementById(A);}this.addElement(A,l_oElement);}return l_oElement; }; this.addElement = function(B,A){var l_bAdded=(typeof A!="undefined"&&A!=null&&typeof B!="undefined"&&B!=null); if(l_bAdded){this.m_pElementLookup[B]=A;}return l_bAdded; }; this.removeElement = function(A){var l_bRemoved=(typeof this.m_pElementLookup[A]!="undefined"); if(l_bRemoved){delete (this.m_pElementLookup[A]);}return l_bRemoved; }; this.reset = function(){this.m_pElementLookup=new Array();}; }; function RTSL_GetElementFromCache(A){return LF_ElementCache.getElement(A); } function RTSL_AddElementToCache(B,A){return LF_ElementCache.addElement(B,A); } function RTSL_RemoveElementFromCache(A){return LF_ElementCache.removeElement(A); } function RTSL_ResetElementCache(){LF_ElementCache.reset();} function RTSL_CreateElement(A,B,C){var l_oElement; if(typeof document.createElement==null){l_oElement=null;}else {var l_oTemplate=LF_ElementCache.m_pHtmlElements[A.toLowerCase()]; if(l_oTemplate){l_oElement=l_oTemplate.cloneNode(true);}else {LF_ElementCache.m_pHtmlElements[A.toLowerCase()]=document.createElement(A);l_oElement=RTSL_CreateElement(A,B,C);}if(typeof B!="undefined"&&B!=null){l_oElement.id=B;RTSL_AddElementToCache(B,l_oElement);}if(C&&typeof C!="undefined"){C.appendChild(l_oElement);}}return l_oElement; } function SL_HH(){} SL_HH.prototype = new SL4B_ConnectionListener;SL_HH.prototype.loginOk = SL_RG;SL_HH.prototype.loginError = SL_PW;SL_HH.prototype.connectionOk = SL_AV;SL_HH.prototype.connectionError = SL_IK;function SL_RG(){if(typeof RTSL_LoginOk=="function"){RTSL_LoginOk(null);}} function SL_PW(A){if(typeof RTSL_LoginFailed=="function"){RTSL_LoginFailed(null,A);}else {SL4B_Logger.synchronizedAlert('Sorry. You do not have the authorisation to view live data from this source.\nPlease contact the web site host if you have received this message in error.');}} function SL_AV(C,A,B){if(typeof RTSL_StatusConnected=="function"){RTSL_StatusConnected(null);}} function SL_IK(){if(typeof RTSL_ConnectionLost=="function"){RTSL_ConnectionLost(null);}else {SL4B_Logger.synchronizedAlert("Connection lost - reconnection failed");}} function SL_IM(){SL4B_Accessor.getRttpProvider().addConnectionListener(new SL_HH());} function SL_ER(){this.initialise();} SL_ER.prototype = new SL4B_AbstractSubscriber;SL_ER.prototype.ready = SL_CG;SL_ER.prototype.directoryUpdated = SL_KA;SL_ER.prototype.newsUpdated = SL_KJ;SL_ER.prototype.objectUpdated = SL_OU;SL_ER.prototype.pageUpdated = SL_BC;SL_ER.prototype.super_recordMultiUpdated = SL_ER.prototype.recordMultiUpdated;SL_ER.prototype.recordMultiUpdated = SL_NV;SL_ER.prototype.recordUpdated = SL_PJ;SL_ER.prototype.storyReset = SL_BD;SL_ER.prototype.storyUpdated = SL_NT;SL_ER.prototype.chat = SL_BZ;SL_ER.prototype.contribFailed = SL_PO;SL_ER.prototype.contribOk = SL_JN;SL_ER.prototype.fieldDeleted = SL_GS;SL_ER.prototype.type2Clear = SL_MU;SL_ER.prototype.type3Clear = SL_PC;SL_ER.prototype.objectDeleted = SL_EN;SL_ER.prototype.objectInfo = SL_EG;SL_ER.prototype.objectNotFound = SL_FD;SL_ER.prototype.objectStatus = SL_KH;SL_ER.prototype.objectType = SL_JE;SL_ER.prototype.objectUnavailable = SL_IN;SL_ER.prototype.objectNotStale = SL_ND;SL_ER.prototype.objectStale = SL_HS;SL_ER.prototype.objectReadDenied = SL_MR;SL_ER.prototype.objectWriteDenied = SL_HR;SL_ER.prototype.clientMethodUndefined = SL_ID;function SL_CG(){if(typeof RTSL_Ready=="function"){RTSL_Ready();}else {if(SL4B_Accessor.getConfiguration().includeRtsl()){this.clientMethodUndefined("RTSL_Ready","This method must be present in your script in order to use RTSL!");SL4B_Accessor.getRttpProvider().stop();}}} function SL_KA(D,C,A,B){if(typeof RTSL_DirUpdated=="function"){RTSL_DirUpdated(D,C,A,B);}else {this.clientMethodUndefined("RTSL_DirUpdated");}} function SL_KJ(C,D,B,A){if(typeof RTSL_NewsUpdated=="function"){RTSL_NewsUpdated(C,D,B,A);}else {this.clientMethodUndefined("RTSL_NewsUpdated");}} function SL_OU(A){if(typeof RTSL_ObjectUpdated=="function"){RTSL_ObjectUpdated(A);}else {this.clientMethodUndefined("RTSL_ObjectUpdated");}} function SL_BC(D,B,A,E,C){if(typeof RTSL_PageUpdated=="function"){RTSL_PageUpdated(D,B,A,E,C);}else {this.clientMethodUndefined("RTSL_PageUpdated");}} function SL_NV(A,B){if(typeof RTSL_RecordMultiUpdated=="function"){RTSL_RecordMultiUpdated(A,B);}else {this.super_recordMultiUpdated(A,B);}} function SL_PJ(B,C,A){if(typeof RTSL_RecordUpdated=="function"){RTSL_RecordUpdated(B,C,A);}else {this.clientMethodUndefined("RTSL_RecordUpdated");}} function SL_BD(A){if(typeof RTSL_StoryReset=="function"){RTSL_StoryReset(A);}else {this.clientMethodUndefined("RTSL_StoryReset");}} function SL_NT(B,A){if(typeof RTSL_StoryUpdated=="function"){RTSL_StoryUpdated(B,A);}else {this.clientMethodUndefined("RTSL_StoryUpdated");}} function SL_BZ(){} function SL_PO(B,A,C){if(typeof RTSL_ContribFailed=="function"){RTSL_ContribFailed(B,A,C);}else {this.clientMethodUndefined("RTSL_ContribFailed");}} function SL_JN(B,A){if(typeof RTSL_ContribOk=="function"){RTSL_ContribOk(B,A);}else {this.clientMethodUndefined("RTSL_ContribOk");}} function SL_GS(C,A,B){if(typeof RTSL_FieldDeleted=="function"){RTSL_FieldDeleted(C,A,B);}else {this.clientMethodUndefined("RTSL_FieldDeleted");}} function SL_MU(A){if(typeof RTSL_Type2Clear=="function"){RTSL_Type2Clear(A);}else {this.clientMethodUndefined("RTSL_Type2Clear");}} function SL_PC(A){if(typeof RTSL_Type3Clear=="function"){RTSL_Type3Clear(A);}else {this.clientMethodUndefined("RTSL_Type3Clear");}} function SL_EN(A){if(typeof RTSL_ObjectDeleted=="function"){RTSL_ObjectDeleted(A);}else {this.clientMethodUndefined("RTSL_ObjectDeleted");}} function SL_EG(B,A,C,D){if(typeof RTSL_ObjectInfo=="function"){RTSL_ObjectInfo(B,A,C,D);}else {this.clientMethodUndefined("RTSL_ObjectInfo");}} function SL_FD(A){if(typeof RTSL_ObjectNotFound=="function"){RTSL_ObjectNotFound(A);}else {this.clientMethodUndefined("RTSL_ObjectNotFound");}} function SL_KH(C,B,A,D){if(typeof RTSL_ObjectStatus=="function"){RTSL_ObjectStatus(C,B,A,D);}else {this.clientMethodUndefined("RTSL_ObjectStatus");}} function SL_JE(C,B,A){if(typeof RTSL_ObjectType=="function"){RTSL_ObjectType(C,B,A);}else {this.clientMethodUndefined("RTSL_ObjectType");}} function SL_IN(A){if(typeof RTSL_ObjectUnavailable=="function"){RTSL_ObjectUnavailable(A);}else {this.clientMethodUndefined("RTSL_ObjectUnavailable");}} function SL_ND(A){} function SL_HS(){} function SL_MR(A){if(typeof RTSL_ObjectReadDenied=="function"){RTSL_ObjectReadDenied(A);}else {this.clientMethodUndefined("RTSL_ObjectReadDenied");}} function SL_HR(A){if(typeof RTSL_ObjectWriteDenied=="function"){RTSL_ObjectWriteDenied(A);}else {this.clientMethodUndefined("RTSL_ObjectWriteDenied");}} function SL_ID(B,A){SL4B_Logger.alert(B+" is undefined."+((typeof A!="undefined") ? " "+A : ""));} RTSL_RtslSubscriberAccessor = new function(){this.m_oRtslSubscriber=new SL_ER();this.getRtslSubscriber = function(A){return ((typeof A=="undefined") ? this.m_oRtslSubscriber : A); }; }; function RTSL_BlockObjectListeners(A,B){SL4B_Accessor.getRttpProvider().blockObjectListeners(RTSL_RtslSubscriberAccessor.getRtslSubscriber(B),A);} function RTSL_ClearObjectListeners(A,B){SL4B_Accessor.getRttpProvider().clearObjectListeners(RTSL_RtslSubscriberAccessor.getRtslSubscriber(B),A);} function RTSL_GetObject(B,A,C){SL4B_Accessor.getRttpProvider().getObject(RTSL_RtslSubscriberAccessor.getRtslSubscriber(C),B,A);} function RTSL_GetObjects(A,B,C){SL4B_Accessor.getRttpProvider().getObjects(RTSL_RtslSubscriberAccessor.getRtslSubscriber(C),A,B);} function RTSL_Reconnect(){SL4B_Accessor.getRttpProvider().reconnect();} function RTSL_RemoveObject(D,C,F,A,B,E){SL4B_Accessor.getRttpProvider().removeObject(RTSL_RtslSubscriberAccessor.getRtslSubscriber(F),D,C);} function RTSL_RemoveObjects(C,D,F,A,B,E){SL4B_Accessor.getRttpProvider().removeObjects(RTSL_RtslSubscriberAccessor.getRtslSubscriber(F),C,D);} function RTSL_SetGlobalThrottle(A){SL4B_Accessor.getRttpProvider().setGlobalThrottle(A);} function RTSL_SetThrottleObject(A,B){SL4B_Accessor.getRttpProvider().setThrottleObject(A,B);} function RTSL_SetThrottleObjects(A,B){SL4B_Accessor.getRttpProvider().setThrottleObjects(A,B);} function RTSL_Stop(){SL4B_Accessor.getRttpProvider().stop();} function RTSL_UnblockObjectListeners(A,B){SL4B_Accessor.getRttpProvider().unblockObjectListeners(RTSL_RtslSubscriberAccessor.getRtslSubscriber(B),A);} function RTSL_CreateObject(B,A){SL4B_Accessor.getRttpProvider().createObject(B,A);} function RTSL_DeleteObject(A){SL4B_Accessor.getRttpProvider().deleteObject(A);} function RTSL_ContribObject(C,D,A,B){var l_oContributionFieldData=SL_OW.getContributionFieldData(C); l_oContributionFieldData.addField(D,A);if(B){var l_oContribSubscriber=new SL_IG(C,l_oContributionFieldData); SL_OW.removeObjectFromQueue(C);return l_oContribSubscriber.m_nIdentifier; }return null; } function RTSL_GetObjectType(A,B){SL4B_Accessor.getRttpProvider().getObjectType(RTSL_RtslSubscriberAccessor.getRtslSubscriber(B),A);} function RTSL_GetFieldNames(){return SL4B_Accessor.getRttpProvider().getFieldNames(); } function RTSL_GetObjectNameDelimiter(){var l_oConfiguration=SL4B_Accessor.getConfiguration(); return l_oConfiguration.getObjectNameDelimiter(); } function RTSL_GetVersion(){return SL4B_Accessor.getRttpProvider().getVersion(); } function RTSL_GetVersionInfo(){return SL4B_Accessor.getRttpProvider().getVersionInfo(); } function RTSL_Version(){return SL4B_Version.getVersion(); } function RTSL_VersionInfo(){return SL4B_Version.getVersionInfo(); } SL_OW = new function(){this.m_pContributionDataQueue=new Object();this.getContributionFieldData = function(A){if(typeof this.m_pContributionDataQueue[A]=="undefined"){this.m_pContributionDataQueue[A]=new SL4B_ContributionFieldData();}return this.m_pContributionDataQueue[A]; }; this.removeObjectFromQueue = function(A){if(typeof this.m_pContributionDataQueue[A]!="undefined"){delete (this.m_pContributionDataQueue[A]);}}; }; SL_HF = new function(){this.m_nCurrentUniqueIdentifier=1;this.getUniqueIdentifier = function(){return this.m_nCurrentUniqueIdentifier++; }; }; function SL_IG(B,A){this.m_nIdentifier=SL_HF.getUniqueIdentifier();this.m_sObjectName=B;this.m_oContributionFieldData=A;this.initialise();} SL_IG.prototype = new SL4B_AbstractSubscriber;SL_IG.prototype.ready = SL_QJ;SL_IG.prototype.getIdentifier = function(){return this.m_nIdentifier; }; SL_IG.prototype.contribOk = SL_BS;SL_IG.prototype.contribFailed = SL_LN;function SL_QJ(){SL4B_Accessor.getRttpProvider().contribObject(this,this.m_sObjectName,this.m_oContributionFieldData);} function SL_BS(A){if(typeof RTSL_ContribOk!="undefined"){RTSL_ContribOk(this.m_nIdentifier,A);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ContributionSubscriber.contribOk: The required method RTSL_ContribOk was not defined in the users code. This is required to receive successful contribution messages.");}} function SL_LN(A,B){if(typeof RTSL_ContribFailed!="undefined"){RTSL_ContribFailed(this.m_nIdentifier,A,B);}else {SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"ContributionSubscriber.contribFailed: The required method RTSL_ContribFailed was not defined in the users code. This is required to receive failed contribution messages.");}} SL_IG.prototype.getContributionIdentifier = function(){return this.m_nIdentifier; }; function RTSL_Assert(A){var l_oConfiguration=SL4B_Accessor.getConfiguration(); try {if(l_oConfiguration.getDebugLevel()>SL4B_DebugLevel.getNumericDebugLevel(SL4B_DebugLevel.CRITICAL)&&!A){RTSL_CallStack();debugger;}}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_WARN_INT,"Unable to launch debugger as an invalid debug level was specified");SL4B_Accessor.getExceptionHandler().processException(e);} } function RTSL_CallStack(){var l_fFunc=RTSL_CallStack; var l_nCount=1; var l_sMsg=''; while(l_fFunc.caller!=null){var l_sFuncName=l_fFunc.toString(); var l_nFuncNameStart=9; var l_nFuncNameEnd=l_sFuncName.search(/\(/)-l_nFuncNameStart; l_sFuncName=l_sFuncName.substr(l_nFuncNameStart,l_nFuncNameEnd);l_sMsg+=((l_sMsg=='') ? '' : '\n')+(l_nCount++)+': '+l_sFuncName;l_sMsg+=' ( ';var l_pArgs=l_fFunc.arguments; for(var l_nArg=0;l_nArg<l_pArgs.length;++l_nArg){l_sMsg+=((l_nArg==0) ? '' : ' , ')+l_pArgs[l_nArg];}l_sMsg+=' )';l_fFunc=l_fFunc.caller;}SL4B_Accessor.getLogger().printMessage('JavaScript call stack follows\n----------------------------------------\n'+l_sMsg+'\n----------------------------------------');} function SL_RA(B,A){var l_oRttpProvider=SL4B_Accessor.getRttpProvider(); if(typeof A=="undefined"){l_oRttpProvider.debug(B);}else {l_oRttpProvider.debug(A,B);}} function RTSL_Alert(A){SL4B_Logger.synchronizedAlert(A);} var g_oUpdateFlash=null; var g_pUpdateClearQueue=new SL_CD(); var g_pPreviousValue=new Object(); var g_fDecimalConvertor=null; RTSL_SetUpdateFlash();RTSL_AddFlashType('Relative',RTSL_RelativeUpdate,'blue','red','yellow','yellow','white','white','black','black','blue','red','','');RTSL_AddFlashType('Absolute',RTSL_AbsoluteUpdate,'blue','red','yellow','yellow','white','white','black','black','blue','red','green','green');RTSL_AddFlashType('Image',RTSL_ImageUpdate);RTSL_AddFlashType('Indicator',RTSL_IndicatorUpdate);RTSL_AddFlashType('NoFlash',RTSL_NoFlashUpdate);RTSL_AddFlashType('Text',RTSL_TextUpdate,'','','','yellow','','','','black','','','','');RTSL_AddFlashType('HTML',RTSL_HTMLUpdate,'','','','yellow','','','','black','','','','');RTSL_AddFlashType('UpDownRelIndicator',RTSL_UpDownRelIndicatorUpdate);RTSL_AddFlashType('UpDownAbsIndicator',RTSL_UpDownAbsIndicatorUpdate);function RTSL_SetUpdateFlash(B,A){if(g_oUpdateFlash==null){g_oUpdateFlash=new Object();g_oUpdateFlash.m_sFlashTypes=new Object();g_oUpdateFlash.m_pCurrHighlights=new Object();}g_oUpdateFlash.m_nFlashTime=RTSL_DefaultValue(B,2000);g_oUpdateFlash.m_nUpdateFreq=RTSL_DefaultValue(A,500);} function RTSL_AddFlashType(G,E,J,R,K,A,O,D,H,B,L,P,Q,I,N,C,F,M){g_oUpdateFlash.m_sFlashTypes[G]=new SL_NR(E,J,R,K,A,O,D,H,B,L,P,Q,I,N,C,F,M);} function RTSL_SetDecimalConvertor(A){g_fDecimalConvertor=A;} function RTSL_UpdateFlashTypes(A){var l_sFlashType; for(l_sFlashType in g_oUpdateFlash.m_sFlashTypes){if(typeof g_oUpdateFlash.m_sFlashTypes[l_sFlashType]!='function'){g_oUpdateFlash.m_sFlashTypes[l_sFlashType].m_oUp.m_RestoreDefaults();g_oUpdateFlash.m_sFlashTypes[l_sFlashType].m_oDown.m_RestoreDefaults();g_oUpdateFlash.m_sFlashTypes[l_sFlashType].m_oEqual.m_RestoreDefaults();g_oUpdateFlash.m_sFlashTypes[l_sFlashType].m_oFresh.m_RestoreDefaults();}}for(l_sUpdatedFlashType in A){if(typeof g_oUpdateFlash.m_sFlashTypes[l_sUpdatedFlashType]!='undefined'&&typeof A[l_sUpdatedFlashType]!='function'){g_oUpdateFlash.m_sFlashTypes[l_sUpdatedFlashType].m_oUp.m_SetColours(A[l_sUpdatedFlashType].m_oUp);g_oUpdateFlash.m_sFlashTypes[l_sUpdatedFlashType].m_oDown.m_SetColours(A[l_sUpdatedFlashType].m_oDown);g_oUpdateFlash.m_sFlashTypes[l_sUpdatedFlashType].m_oEqual.m_SetColours(A[l_sUpdatedFlashType].m_oEqual);g_oUpdateFlash.m_sFlashTypes[l_sUpdatedFlashType].m_oFresh.m_SetColours(A[l_sUpdatedFlashType].m_oFresh);}}} function SL_NR(E,I,Q,J,A,N,D,G,B,K,O,P,H,M,C,F,L){this.m_fEvalUpdate=E;this.m_oUp=new SL_BT(I,N,K,M);this.m_oDown=new SL_BT(Q,D,O,C);this.m_oEqual=new SL_BT(J,G,P,F);this.m_oFresh=new SL_BT(A,B,H,L);} function SL_BT(D,B,A,C){this.m_sFlashClr=RTSL_DefaultValue(D,'');this.m_sFlashText=RTSL_DefaultValue(B,'white');this.m_sFinalText=RTSL_DefaultValue(A,this.m_sFlashClr);this.m_sFinalClr=RTSL_DefaultValue(C,'');this.m_sDefaultFlashClr=this.m_sFlashClr;this.m_sDefaultFlashText=this.m_sFlashText;this.m_sDefaultFinalText=this.m_sFinalText;this.m_sDefaultFinalClr=this.m_sFinalClr;} SL_BT.prototype.m_RestoreDefaults = SL_PI;SL_BT.prototype.m_SetColours = SL_LM;function SL_PI(){this.m_sFlashClr=this.m_sDefaultFlashClr;this.m_sFlashText=this.m_sDefaultFlashText;this.m_sFinalText=this.m_sDefaultFinalText;this.m_sFinalClr=this.m_sDefaultFinalClr;} function SL_LM(A){this.m_sFlashClr=A.m_sFlashClr;this.m_sFlashText=A.m_sFlashText;this.m_sFinalText=A.m_sFinalText;this.m_sFinalClr=A.m_sFinalClr;} function SL_NF(A,C,B,D){var l_oUpdateFlash=g_oUpdateFlash.m_sFlashTypes[A].m_oFresh; if(D==''||D==' '){l_oUpdateFlash=g_oUpdateFlash.m_sFlashTypes[A].m_oFresh;}else if(B==C){l_oUpdateFlash=g_oUpdateFlash.m_sFlashTypes[A].m_oEqual;}else if(B<C){l_oUpdateFlash=g_oUpdateFlash.m_sFlashTypes[A].m_oDown;}else if(B>C){l_oUpdateFlash=g_oUpdateFlash.m_sFlashTypes[A].m_oUp;}return l_oUpdateFlash; } function SL_CW(B,D,A,E,C){var l_sPrevVal=((typeof (g_pPreviousValue[D])!='undefined') ? g_pPreviousValue[D] : ''); g_pPreviousValue[D]=A;l_nOld=GF_ConvertToDecimal(l_sPrevVal);l_nNew=GF_ConvertToDecimal(A);return SL_NF(B,l_nOld,l_nNew,l_sPrevVal); } function RTSL_RelativeUpdate(B,D,A,G,C,E,F){var l_oUpdateFlash=SL_CW(B,D,A,G,C); return (new GF_Update(D,A,l_oUpdateFlash.m_sFlashClr,l_oUpdateFlash.m_sFlashText,l_oUpdateFlash.m_sFinalText,l_oUpdateFlash.m_sFinalClr,G,C,'innerText',F)); } function RTSL_ImageUpdate(A,D,C,F,B,E){C=((typeof (E.m_pImageMappings[C])=='undefined') ? E.m_vDefaultValue : C);var l_sImgSrc=E.m_pImageMappings[C].src; var l_vPrevSrc=((typeof (g_pPreviousValue[D])!='undefined') ? g_pPreviousValue[D] : E.m_vDefaultValue); g_pPreviousValue[D]=C;return ((l_vPrevSrc==C) ? null : (new GF_Update(D,l_sImgSrc,'','','','',true,false,'src'))); } function RTSL_IndicatorUpdate(C,B,D,F,A,E){var l_nPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][0] : null); var l_nPrevDir=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][1] : null); var l_nDir=0; if(l_nPrevVal!=null){if(D>l_nPrevVal){l_nDir=1;}else if(D<l_nPrevVal){l_nDir=-1;}}if(typeof (g_pPreviousValue[B])=='undefined'){g_pPreviousValue[B]=new Array();}g_pPreviousValue[B][0]=D;g_pPreviousValue[B][1]=l_nDir;var l_sImgSrc=E.m_pImageMappings[l_nDir].src; return ((l_nPrevVal==null||l_nPrevDir==l_nDir) ? null : (new GF_Update(B,l_sImgSrc,'','','','',true,false,'src'))); } function RTSL_UpDownRelIndicatorUpdate(C,B,D,F,A,E){var l_nPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][0] : null); var l_nPrevDir=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][1] : null); var l_nDir=0; if(l_nPrevVal!=null){if(D>l_nPrevVal){l_nDir=1;}else if(D<l_nPrevVal){l_nDir=-1;}}if(l_nDir==0&&l_nPrevDir!=null){l_nDir=l_nPrevDir;}if(typeof (g_pPreviousValue[B])=='undefined'){g_pPreviousValue[B]=new Array();}g_pPreviousValue[B][0]=D;g_pPreviousValue[B][1]=l_nDir;var l_sImgSrc=E.m_pImageMappings[l_nDir].src; return ((l_nPrevVal==null||l_nPrevDir==l_nDir) ? null : (new GF_Update(B,l_sImgSrc,'','','','',true,false,'src'))); } function RTSL_UpDownAbsIndicatorUpdate(C,B,D,F,A,E){var l_nPrevVal=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][0] : null); var l_nPrevDir=((typeof (g_pPreviousValue[B])!='undefined') ? g_pPreviousValue[B][1] : null); var l_nDir=0; if(D>0){l_nDir=1;}else if(D<0){l_nDir=-1;}if(typeof (g_pPreviousValue[B])=='undefined'){g_pPreviousValue[B]=new Array();}g_pPreviousValue[B][0]=D;g_pPreviousValue[B][1]=l_nDir;var l_sImgSrc=E.m_pImageMappings[l_nDir].src; return ((l_nPrevDir==l_nDir) ? null : (new GF_Update(B,l_sImgSrc,'','','','',true,false,'src'))); } function RTSL_AbsoluteUpdate(C,B,D,G,A,E,F){var l_oFlashUpdate=SL_CW(C,B,D,G,A); var l_oFinalUpdate=SL_NF(C,0,GF_ConvertToDecimal(D),'0.00'); if(GF_ConvertToDecimal(D)>0){if(D.substring(0,1)!='+'){D='+'+D;}}return (new GF_Update(B,D,l_oFlashUpdate.m_sFlashClr,l_oFlashUpdate.m_sFlashText,l_oFinalUpdate.m_sFinalText,l_oFinalUpdate.m_sFinalClr,G,A,'innerText',F)); } function RTSL_NoFlashUpdate(B,D,A,F,C,E){return (new GF_Update(D,A,'','','','',true,C,'innerText')); } function RTSL_TextUpdate(B,D,A,G,C,E,F){var l_oUpdate=g_oUpdateFlash.m_sFlashTypes[B].m_oFresh; return (new GF_Update(D,A,l_oUpdate.m_sFlashClr,l_oUpdate.m_sFlashText,l_oUpdate.m_sFinalText,'',G,C,'innerText',F)); } function RTSL_HTMLUpdate(B,D,A,G,C,E,F){var l_oUpdate=g_oUpdateFlash.m_sFlashTypes[B].m_oFresh; return (new GF_Update(D,A,l_oUpdate.m_sFlashClr,l_oUpdate.m_sFlashText,l_oUpdate.m_sFinalText,'',G,C,'innerHTML',F)); } function GF_ConvertToDecimal(A){var l_nConverted=A; if(g_fDecimalConvertor){l_nConverted=g_fDecimalConvertor(A);}else { try {if((window.RTML_TransformResult)&&(A instanceof RTML_TransformResult)){l_nConverted=A.value;}else if(typeof A=="Object"){l_nConverted=A.toString();}l_nConverted=parseFloat(l_nConverted);}catch(e){l_nConverted=A;} }return l_nConverted; } function RTSL_CreateUpdate(B,C,D,G,A,E,F){G=RTSL_DefaultValue(G,false);A=RTSL_DefaultValue(A,false);E=RTSL_DefaultValue(E,null);var l_oUpdate=null; var l_nNewFlashTime=RTSL_DefaultValue(F,g_oUpdateFlash.m_nFlashTime); RTSL_GetElementFromCache(B);if(typeof (g_oUpdateFlash.m_sFlashTypes[C])!='undefined'){l_oUpdate=(g_oUpdateFlash.m_sFlashTypes[C].m_fEvalUpdate(C,B,D,G,A,E,l_nNewFlashTime));}else {var l_oRttpProvider=SL4B_Accessor.getRttpProvider(); l_oRttpProvider.debug('Update flash type '+C+' not found','error');}return l_oUpdate; } function GF_Update(D,C,J,G,E,I,H,B,A,F){this.m_sDiv=D;this.m_sValue=C;this.m_sFlashClr=J;this.m_sFlashText=G;this.m_sFinalText=E;this.m_sFinalClr=I;this.m_bNoFlash=H;this.m_bDisplayCommas=B;this.m_sDivElement=A;this.m_nFlashTime=F;return this; } function RTSL_DisplayUpdate(A){if(A!=null){var l_oElement=RTSL_GetElementFromCache(A.m_sDiv); l_oElement.value=A.m_sValue;if(A.m_sDivElement=='src'){l_oElement.src=A.m_sValue;}else if(l_oElement.type=='button'){l_oElement.value=(A.m_bDisplayCommas) ? (SL_PS(A.m_sValue)) : (A.m_sValue);}else {switch(A.m_sDivElement){ case 'innerHTML':l_oElement.innerHTML=(A.m_bDisplayCommas) ? (SL_PS(A.m_sValue)) : (A.m_sValue);break; case 'nodeValue':case 'innerText':l_oElement.childNodes[0].nodeValue=(A.m_bDisplayCommas) ? (SL_PS(A.m_sValue)) : (A.m_sValue);break; default :l_oElement.innerText=(A.m_bDisplayCommas) ? (SL_PS(A.m_sValue)) : (A.m_sValue);break; }if(A.m_bNoFlash==false){ try {l_oElement.style.color=A.m_sFlashText;l_oElement.style.backgroundColor=A.m_sFlashClr;}catch(e){} l_oElement.style.color=A.m_sFlashText;l_oElement.style.backgroundColor=A.m_sFlashClr;g_pUpdateClearQueue.m_Add(A.m_sDiv,A.m_sFinalText,A.m_nFlashTime);}else {l_oElement.style.color=A.m_sFinalText;g_pUpdateClearQueue.m_Remove(A.m_sDiv);}}}} function RTSL_FlushUpdate(A){var l_oUpdate=g_pUpdateClearQueue.m_Remove(A); if(l_oUpdate!=null){var l_oElement=RTSL_GetElementFromCache(A); l_oElement.style.color=l_oUpdate.m_sColour;l_oElement.style.backgroundColor='';}} function SL_CD(){this.m_pQueue=new Array();this.m_pLookup=new Object();} SL_CD.prototype.m_Add = SL_DG;SL_CD.prototype.m_Remove = SL_NB;SL_CD.timeoutID=null;function SL_DG(A,C,B){if(typeof (this.m_pQueue[B])=='undefined'){this.m_pQueue[B]=new Array();}var l_nIndex=this.m_pQueue[B].length; if(l_nIndex==0&&SL_CD.timeoutID==null){SL_CD.timeoutID=setTimeout('C_ClearUpdateFlashes('+B+')',B);}else {this.m_Remove(A);}this.m_pQueue[B][l_nIndex]=new SL_AJ(A,C,B);this.m_pLookup[A]=new SL_ED(B,l_nIndex);} function SL_NB(A){if(typeof (this.m_pLookup[A])!='undefined'){var l_nFlashTime=this.m_pLookup[A].m_nFlashTime; for(var l_nOldIndex=this.m_pLookup[A].m_nIndex;l_nOldIndex>=0;--l_nOldIndex){if(typeof (this.m_pQueue[l_nFlashTime][l_nOldIndex])!='undefined'&&this.m_pQueue[l_nFlashTime][l_nOldIndex].m_sElementId==A){this.m_pQueue[l_nFlashTime][l_nOldIndex].m_bActiveUpdate=false;return this.m_pQueue[l_nFlashTime][l_nOldIndex]; }}}return null; } function SL_AJ(A,C,B){this.m_sElementId=A;this.m_sColour=C;this.m_dtExpiryTime=new Date().valueOf()+B;this.m_bActiveUpdate=true;} function C_ClearUpdateFlashes(A){SL_CD.timeoutID=null;var l_dtCurrentTime=new Date().valueOf(); if(g_pUpdateClearQueue.m_pQueue[A]!=null){while(g_pUpdateClearQueue.m_pQueue[A].length&&g_pUpdateClearQueue.m_pQueue[A][0].m_dtExpiryTime<=l_dtCurrentTime){var l_sElementId=g_pUpdateClearQueue.m_pQueue[A][0].m_sElementId; if(g_pUpdateClearQueue.m_pQueue[A][0].m_bActiveUpdate){var l_oElement=RTSL_GetElementFromCache(l_sElementId); if(l_oElement!=null){l_oElement.style.color=g_pUpdateClearQueue.m_pQueue[A][0].m_sColour;l_oElement.style.backgroundColor='';}delete (g_pUpdateClearQueue.m_pLookup[l_sElementId]);}g_pUpdateClearQueue.m_pQueue[A]=g_pUpdateClearQueue.m_pQueue[A].slice(1);}if(g_pUpdateClearQueue.m_pQueue[A].length>0&&SL_CD.timeoutID==null){var l_nTimeoutPeriod=g_pUpdateClearQueue.m_pQueue[A][0].m_dtExpiryTime-(new Date().valueOf()); if(l_nTimeoutPeriod<0){l_nTimeoutPeriod=0;}else if(l_nTimeoutPeriod>A){l_nTimeoutPeriod=A;}SL_CD.timeoutID=setTimeout('C_ClearUpdateFlashes('+A+')',l_nTimeoutPeriod);}}} function SL_ED(B,A){this.m_nFlashTime=B;this.m_nIndex=A;} function RTSL_ClearPreviousValue(A){if(typeof g_pPreviousValue[A]!='undefined'){delete (g_pPreviousValue[A]);}} function MOD_CreateImages(B,A,C){this.m_vDefaultValue=B;this.m_nWidth=A;this.m_nHeight=C;this.m_pImageMappings=new Object();} MOD_CreateImages.prototype.addImage = SL_IY;function SL_IY(A,B){this.m_pImageMappings[A]=new Image();this.m_pImageMappings[A].src=B;} function SL_PS(A){if(isNaN(A)){return A; }var l_sAbsVal=new String(Math.abs(A)); l_sAbsVal=l_sAbsVal.split('.');var l_sComma=''; var l_nPosition; do{l_sComma=l_sAbsVal[0].substr(((l_sAbsVal[0].length-3>=0) ? l_sAbsVal[0].length-3 : 0))+((l_sComma!='') ? ',' : '')+l_sComma;l_sAbsVal[0]=l_sAbsVal[0].substr(0,l_sAbsVal[0].length-3);}while(l_sAbsVal[0].length>0);var l_sVal=new String(A); l_sVal=l_sVal.split('.');if(typeof (l_sVal[1])!='undefined'&&l_sVal[1].length>0){l_sComma+='.'+l_sVal[1];}var l_nDir=((A==0) ? 1 : (A/Math.abs(A))); l_sComma=((l_nDir==1) ? l_sComma : ('-'+l_sComma));return l_sComma; } var SL4B_UpdateBatcher=function(){}; SL4B_UpdateBatcher = new function(){this.initializeMemberVariables = function(){this.m_nQuantisation=100;this.m_nMaxProcessorUtilisation=0.5;this.m_mBinIdToUpdateBinMap=SL_BB.createMap();this.m_mClearedElementIdToBinIdMap=SL_BB.createMap();this.m_bStarted=false;this.m_bIsRunning=false;}; this.initializeMemberVariables();this.addUpdate = function(A){if(!(A instanceof SL4B_Update)){throw new SL4B_Exception("Update was invalid"); }else {if(!this.m_bStarted){this.m_bStarted=true;this.m_bIsRunning=true;this.m_nNextBinId=this.getBinId(this.getTimeStamp());this.startProccessingBins();}var l_pNextUpdateBin=this.getNextUpdateBin(); var l_nUpdateId=A.getIdentifer(); if(this.m_mClearedElementIdToBinIdMap[l_nUpdateId]){this.removeClearUpdate(l_nUpdateId);}l_pNextUpdateBin[l_nUpdateId]=A;}}; this.start = function(){if(!this.m_bStarted){throw new SL4B_Exception("The addUpdate() method has not yet been called and so the batcher was not yet running."); }else if(this.m_bIsRunning){throw new SL4B_Exception("The update batcher was already running."); }else {this.m_bIsRunning=true;this.startProccessingBins();}}; this.stop = function(){if(!this.m_bIsRunning){throw new SL4B_Exception("The update batcher was not currently running."); }else {this.m_bIsRunning=false;}}; this.getTimeStamp = function(){return (new Date()).valueOf(); }; this.getQuantisationPeriod = function(){return this.m_nQuantisation; }; this.startProccessingBins = function(){this.processPendingBins();}; this.flushUpdates = function(){clearTimeout(this.m_nTimeoutId);delete this.m_nTimeoutId;var l_nStartTime=this.getTimeStamp(); var l_nPresentBinId=this.getBinId(l_nStartTime); var l_nBinId; for(l_nBinId in this.m_mBinIdToUpdateBinMap){l_pUpdateBin=this.m_mBinIdToUpdateBinMap[l_nBinId];this.processUpdateBin(l_pUpdateBin,l_nPresentBinId);this.deleteUpdateBin(l_nBinId);}this.m_pClearedElementIdToBinIdMap={};this.startProccessingBins();}; this.processPendingBins = function(){if(this.m_bIsRunning){var l_nStartTime=this.getTimeStamp(); var l_nFirstBinId=this.m_nNextBinId; var l_nPresentBinId=this.getBinId(l_nStartTime); this.m_nNextBinId=l_nPresentBinId+1;for(var l_nBinId=l_nFirstBinId;l_nBinId<=l_nPresentBinId;++l_nBinId){var l_pUpdateBin=this.m_mBinIdToUpdateBinMap[l_nBinId]; if(l_pUpdateBin){this.processUpdateBin(l_pUpdateBin,l_nPresentBinId);this.deleteUpdateBin(l_nBinId);}}var l_nTimeTaken=this.getTimeStamp()-l_nStartTime; var l_nMinTimeTakenIncludingSleep=l_nTimeTaken/this.m_nMaxProcessorUtilisation; var l_nSleepTime; if(l_nMinTimeTakenIncludingSleep<=this.m_nQuantisation){l_nSleepTime=this.m_nQuantisation-l_nTimeTaken;}else {l_nSleepTime=l_nMinTimeTakenIncludingSleep-l_nTimeTaken;}this.setTimeout(l_nSleepTime);}}; this.setTimeout = function(A){this.m_nTimeoutId=window.setTimeout(this.m_fProcessPendingBins,A);}; this.generateProcessPendingBinsFunction = function(){var l_nThis=this; return function(){l_nThis.processPendingBins();}; }; this.m_fProcessPendingBins=this.generateProcessPendingBinsFunction();this.processUpdateBin = function(A,B){for(l_sUpdateId in A){var l_oUpdate=A[l_sUpdateId]; var l_oClearUpdate=l_oUpdate.drawUpdate(); this.removeClearUpdate(l_sUpdateId);if(l_oClearUpdate){var l_nFlashTime=l_oClearUpdate.getFlashTime(); var l_nFlashBinId=B+Math.ceil(l_nFlashTime/this.m_nQuantisation); var l_pFlashUpdateBin=this.getUpdateBin(l_nFlashBinId); l_pFlashUpdateBin[l_sUpdateId]=l_oUpdate;if(this.m_mClearedElementIdToBinIdMap[l_sUpdateId]){this.m_mClearedElementIdToBinIdMap[l_sUpdateId].push(l_nFlashBinId);}else {this.m_mClearedElementIdToBinIdMap[l_sUpdateId]=[l_nFlashBinId];}}}}; this.removeClearUpdate = function(A){var l_nBinId=this.m_mClearedElementIdToBinIdMap[A]; if(l_nBinId){this.m_mClearedElementIdToBinIdMap=SL_BB.removeItem(this.m_mClearedElementIdToBinIdMap,A);for(var x=0,l=l_nBinId.length;x<l;x++){delete this.m_mBinIdToUpdateBinMap[l_nBinId[x]][A];}}}; this.getBinId = function(A){return Math.floor(A/this.m_nQuantisation); }; this.getNextBinId = function(){return this.m_nNextBinId; }; this.setNextBinId = function(A){this.m_nNextBinId=A;}; this.getUpdateBin = function(A){var l_pUpdateBin=this.m_mBinIdToUpdateBinMap[A]; if(!l_pUpdateBin){l_pUpdateBin={};this.m_mBinIdToUpdateBinMap[A]=l_pUpdateBin;}return l_pUpdateBin; }; this.getNextUpdateBin = function(){return this.getUpdateBin(this.m_nNextBinId); }; this.deleteUpdateBin = function(A){this.m_mBinIdToUpdateBinMap=SL_BB.removeItem(this.m_mBinIdToUpdateBinMap,A);}; this.getBinIdForClearedElement = function(A){return this.m_mClearedElementIdToBinIdMap[A]; }; }; var SL4B_Update=function(){}; if(false){function SL4B_Update(){} }SL4B_Update = function(B,A){this.m_sIdentifier=B;this.m_vValue=A;this.m_nFlashTime=1000;}; SL4B_Update.prototype.getIdentifer = function(){return this.m_sIdentifier; }; SL4B_Update.prototype.toString = function(){return this.m_sIdentifier+": "+this.m_vValue; }; SL4B_Update.prototype.getFlashTime = function(){return this.m_nFlashTime; }; SL4B_Update.prototype.setFlashTime = function(A){this.m_nFlashTime=A;}; SL4B_Update.prototype.drawUpdate = function(){return null; }; var SL4B_ElementCache={}; var SL4B_TestUpdate=function(){}; if(false){function SL4B_TestUpdate(){} }SL4B_TestUpdate = function(D,A,C,B){SL4B_Update.apply(this,[D,A]);this.m_sUpdateType=C;this.m_bFirstDraw=true;this.m_bCacheValue=(B===undefined ? true : B);}; SL4B_TestUpdate.prototype = new SL4B_Update();SL4B_TestUpdate.classPrefixes={};SL4B_TestUpdate.values={};SL4B_TestUpdate.prototype.drawUpdate = function(){var l_oElem=SL4B_ElementCache[this.m_sIdentifier]; var l_bHasOldValue=false; if(!l_oElem){l_oElem=document.getElementById(this.m_sIdentifier);SL4B_ElementCache[this.m_sIdentifier]=l_oElem;}if(l_oElem){var l_sClassPrefix=SL4B_TestUpdate.classPrefixes[this.m_sIdentifier]; if(!l_sClassPrefix){SL4B_TestUpdate.classPrefixes[this.m_sIdentifier]=SL4B_TestUpdate.createClassPrefix(l_oElem.className);l_sClassPrefix=SL4B_TestUpdate.classPrefixes[this.m_sIdentifier];}var l_vOldValue=SL4B_TestUpdate.values[this.m_sIdentifier]; var l_sClass=""; var l_bFirstDraw=this.m_bFirstDraw; if(this.m_bFirstDraw){this.m_bFirstDraw=false;var l_oTextNode=l_oElem.firstChild; if(l_oTextNode){l_oTextNode.nodeValue=this.m_vValue;if(this.callbackFn!==undefined){this.callbackFn();}}if(this.m_bCacheValue){SL4B_TestUpdate.values[this.m_sIdentifier]=this.m_vValue;}l_bHasOldValue=(l_vOldValue!==undefined&&l_vOldValue!=="");if(l_bHasOldValue){this.m_sClassSuffix=this.getDirection(this.m_sUpdateType,l_vOldValue,this.m_vValue);l_sClass="recent"+this.m_sClassSuffix;}}else {l_sClass="old"+this.m_sClassSuffix;}l_sClass=l_sClassPrefix+l_sClass;l_oElem.className=l_sClass;}return (l_bFirstDraw&&l_bHasOldValue) ? this : null; }; SL4B_TestUpdate.createClassPrefix = function(A){l_sClassPrefix=(A) ? A.replace(/((recent)|(old))((Flat)|(Up)|(Down)) ?/,"","g") : null;l_sClassPrefix=(l_sClassPrefix) ? l_sClassPrefix+" " : "";return l_sClassPrefix; }; SL4B_TestUpdate.prototype.getDirection = function(C,B,A){var l_sDirection; if(g_fDecimalConvertor!=null){if(B){B=g_fDecimalConvertor(B);}if(A){A=g_fDecimalConvertor(A);}}if(C=="Relative"){if(!B||(A==B)){l_sDirection="Flat";}else if(A>B){l_sDirection="Up";}else if(A<B){l_sDirection="Down";}}else if(C=="Absolute"){if(this.m_vValue==0){l_sDirection="Flat";}else if(this.m_vValue>0){l_sDirection="Up";}else {l_sDirection="Down";}}else if(C=="Text"){l_sDirection="Flat";}else {debugger;}return l_sDirection; }; SL4B_TestUpdate.prototype.setCacheValueFlag = function(A){this.m_bCacheValue=A;}; SL4B_TestUpdate.prototype.getFlashTime = function(){return 500; }; SL4B_TestUpdate.updateElementClassName = function(B,A){SL4B_TestUpdate.classPrefixes[B]=SL4B_TestUpdate.createClassPrefix(A);}; var SL4B_SingleFile=true; var SL4B_ScriptLoader = new function(){this.const_STANDARD_CREDENTIALS_PROVIDER="standard";this.const_KEYMASTER_CREDENTIALS_PROVIDER="keymaster";this.m_oIndexScript=null;this.m_sRelativeUrlPrefix="";this.m_bLogFileNames=false;this.findIndexScript=SL_LW;this.getRelativeUrlPrefix=SL_OB;this.getRootUrl = function(){return this.m_sRelativeUrlPrefix; }; this.loadRelativeScript=SL_HM;this.loadScript=SL_BI;this.loadRequiredScripts=SL_HO;this.loadConfiguredScripts=SL_HE;this.setCommonDomain=SL_RL;this.createRttpProvider=SL_AI;this.getIndexScript = function(){return this.m_oIndexScript; }; this.loadSl4bScript = function(A){this.loadRelativeScript("sl4b/"+A);}; this.loadRtmlScript = function(A){this.loadRelativeScript("rtml/"+A);}; this.loadRtslScript = function(A){this.loadRelativeScript("rtsl/"+A);}; this.getElementById = function(A){return document.getElementById(A); }; this.isInternetExplorer = function(){return (navigator.userAgent.toLowerCase().match(/msie/)!=null); }; this.m_oIndexScript=this.findIndexScript();this.m_sRelativeUrlPrefix=this.getRelativeUrlPrefix();}; SL4B_ScriptLoader.const_OBJECT_RTTP_PROVIDER="object";SL4B_ScriptLoader.const_APPLET_RTTP_PROVIDER="applet";SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER="javascript";SL4B_ScriptLoader.const_TEST_RTTP_PROVIDER="test";function SL_LW(){var l_oIndexScript=null; if(this.getElementById("sl4b")){l_oIndexScript=this.getElementById("sl4b");}else if(this.getElementById("rtml")){l_oIndexScript=this.getElementById("rtml");}else if(this.getElementById("rtsl")){l_oIndexScript=this.getElementById("rtsl");}else {var l_pScripts=document.getElementsByTagName("script"); if(l_pScripts.length==1){l_oIndexScript=l_pScripts[0];l_oIndexScript.id="sl4b";}else {for(var l_nScript=l_pScripts.length-1;l_nScript>=0;--l_nScript){if(l_pScripts[l_nScript].src.match(/(^|\/)(sl4b|rt[ms]l)($|\/$|\/index2?.js$)/)){l_oIndexScript=l_pScripts[l_nScript];l_oIndexScript.id="sl4b";break; }}if(l_oIndexScript==null){throw new SL4B_Error("ScriptLoader unable to locate SL4B/RTML/RTSL script tag in DOM"); }}}return l_oIndexScript; } function SL_OB(){var l_sRelativeUrlPrefix=""; var l_oMatch=this.m_oIndexScript.src.match(/(.*)(sl4b|rt[ms]l)($|\/$|\/index2?.js$)/); if(l_oMatch==null){l_oMatch=this.m_oIndexScript.src.match(/(([.][.]\/)*)/);l_sRelativeUrlPrefix="../"+l_oMatch[1];}else {l_sRelativeUrlPrefix=l_oMatch[1];}return l_sRelativeUrlPrefix; } function SL_HM(A){this.loadScript(this.m_sRelativeUrlPrefix+A);} function SL_BI(A){if(this.m_bLogFileNames){SL4B_Logger.log(SL4B_DebugLevel.const_DEBUG_INT,"ScriptLoader.loadScript: Loading {0}",A);}document.write("<scr"+"ipt language=\"JavaScript\" src=\""+A+"\"></scr"+"ipt>");} function SL_HO(){SL_LK();SL_JX();} function SL_HE(A){SL4B_WindowEventHandler.initialise();SL_HC();SL4B_Accessor.getLogger().openDebugConsoleOnStartUp(false);if(A.getService()!=null&&A.getScriptTagAttribute("commondomain")==null){alert("FATAL SL4B ERROR:\nThe \"commondomain\" configuration attribute must be explicitly set when the \"service\" attribute is used");return; }if(!this.setCommonDomain(A)){alert("FATAL SL4B ERROR:\nThe host name for the web page you have entered must end with \""+A.getCommonDomain()+"\".\nUnable to connect to establish a streaming connection.");return; }SL4B_Accessor.getLogger().openDebugConsoleOnStartUp(true);C_CallbackQueue.start();this.m_bLogFileNames=true;if(A.isMasterFrame()){if(A.getCredentialsProvider()==this.const_STANDARD_CREDENTIALS_PROVIDER){SL_RD();}else if(A.getCredentialsProvider()==this.const_KEYMASTER_CREDENTIALS_PROVIDER){SL_CT();}else {this.loadScript(A.getCredentialsProvider());}}if(!A.isMasterFrame()){}else {if(false){}if(A.getService()!=null){SL_JJ();}if(A.getRttpProvider()==SL4B_ScriptLoader.const_APPLET_RTTP_PROVIDER){}else if(A.getRttpProvider()==SL4B_ScriptLoader.const_OBJECT_RTTP_PROVIDER){SL_GI();}else if(A.getRttpProvider()==SL4B_ScriptLoader.const_JAVASCRIPT_RTTP_PROVIDER){}else if(A.getRttpProvider()==SL4B_ScriptLoader.const_TEST_RTTP_PROVIDER){}else {this.loadScript(A.getRttpProvider());}}SL_FA();if(A.includeRtml()){}if(A.includeRtsl()||A.includeFlash()){}if(A.includeRtsl()){SL_IM();}if(A.includeFlash()){}} function SL_RL(A){if(window.G_UNIT_TESTING){return true; }var l_bDomainSet=true; var l_sCommonDomain=A.getCommonDomain(); SL4B_FrameRegistrarAccessor.setCommonContainerDomain(l_sCommonDomain);if(l_sCommonDomain!=null){ try {SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"ScriptLoader.setCommonDomain: Setting document.domain to: {0}",l_sCommonDomain);document.domain=l_sCommonDomain;}catch(e){SL4B_Logger.log(SL4B_DebugLevel.const_ERROR_INT,"ScriptLoader.setCommonDomain: Failed to set the common domain to: {0}",l_sCommonDomain);l_bDomainSet=false;} }else {SL4B_Logger.log(SL4B_DebugLevel.const_INFO_INT,"ScriptLoader.setCommonDomain: Setting document.domain to: {0}");}return l_bDomainSet; } function SL_AI(){var l_oConfiguration=SL4B_Accessor.getConfiguration(); var l_oProvider=null; var l_bSetUnderlyingRttpProvider=true; if(!l_oConfiguration.isMasterFrame()){l_oProvider=new SL4B_SlaveFrameRttpProvider();}else if(l_oConfiguration.getService()!=null){l_oProvider=new SL4B_FailoverRttpProvider();l_bSetUnderlyingRttpProvider=false;}else {l_oProvider=SL4B_Accessor.getRttpProviderFactory().createRttpProvider(new SL4B_SimpleLiberatorConfiguration());}if(l_oProvider!=null){SL4B_Accessor.setRttpProvider(l_oProvider);if(l_bSetUnderlyingRttpProvider){SL4B_Accessor.setUnderlyingRttpProvider(l_oProvider);}l_oProvider.addConnectionListener(new SL4B_LogConnectionListener(SL4B_Logger));}} var SL4B_Throwable=function(){}; if(false){function SL4B_Throwable(){} }SL4B_Throwable = function(A){this.m_sClassName=null;this.m_sMessage=null;this.m_pStackTrace=new Array();this.initialise("SL4B_Throwable",A);}; SL4B_Throwable.prototype.initialise = SL_KN;SL4B_Throwable.prototype.getClass = function(){return this.m_sClassName; }; SL4B_Throwable.prototype.getMessage = function(){return this.m_sMessage; }; SL4B_Throwable.prototype.getStackTrace = function(){return this.m_pStackTrace; }; SL4B_Throwable.prototype.toString = function(){return this.m_sClassName+":\n message="+this.m_sMessage+"\n stack trace:\n "+this.getStackTrace().join("\n "); }; function SL_KN(A,B){this.m_sClassName=A;this.m_sMessage=B;var l_fCaller=SL_KN.caller; while((l_fCaller=l_fCaller.caller)!=null){if(this.m_pStackTrace.length>20){this.m_pStackTrace.push("...");break; }else {var l_sFunctionInfo=""; var l_oMatch=l_fCaller.toString().match(/function\x20([^_]*_[^_(]*)_([^(]*)/); if(l_oMatch==null){l_oMatch=l_fCaller.toString().match(/function\x20([^_]*_[^(]*)/);if(l_oMatch==null){l_sFunctionInfo+="{anonymous method call}";}else {l_sFunctionInfo+=""+l_oMatch[1]+".<init>";}}else {l_sFunctionInfo+=""+l_oMatch[1]+"."+l_oMatch[2].charAt(0).toLowerCase()+l_oMatch[2].substr(1);}l_sFunctionInfo+=" (";for(var l_nArgument=0,l_nLength=l_fCaller.arguments.length;l_nArgument<l_nLength;++l_nArgument){var l_vArgValue=l_fCaller.arguments[l_nArgument]; l_sFunctionInfo+=((l_nArgument==0) ? "" : ", ")+((typeof l_vArgValue=="string") ? "\""+l_vArgValue+"\"" : l_vArgValue);}l_sFunctionInfo+=")";this.m_pStackTrace.push(l_sFunctionInfo);}}} var SL4B_Error=function(){}; if(false){function SL4B_Error(){} }SL4B_Error = function(A){this.initialise(SL4B_Error.const_ERROR_CLASS,A);}; SL4B_Error.prototype = new SL4B_Throwable;SL4B_Error.const_ERROR_CLASS="SL4B_Error";var SL4B_Exception=function(){}; if(false){function SL4B_Exception(){} }SL4B_Exception = function(A){this.initialise(SL4B_Exception.const_EXCEPTION_CLASS,A);}; SL4B_Exception.prototype = new SL4B_Throwable;SL4B_Exception.const_EXCEPTION_CLASS="SL4B_Exception";var SL4B_Version=function(){}; if(false){function SL4B_Version(){} }SL4B_Version = new function(){this.m_sVersionNumber="4.5.4";this.m_sBuildNumber="131730";this.m_sBuildDate="12-May-2009";this.m_sCopyright="Copyright 1995-2008 Caplin Systems Ltd";this.getVersion = function(){return this.m_sVersionNumber; }; this.getBuildNumber = function(){return this.m_sBuildNumber; }; this.getBuildDate = function(){return this.m_sBuildDate; }; this.getVersionInfo = function(){return "SL4B "+this.m_sVersionNumber+"-"+this.m_sBuildNumber+" (Built "+this.m_sBuildDate+"), "+this.m_sCopyright; }; }; function RTSL_DefaultValue(A,B){return ((A==null)||(typeof (A)=="undefined") ? B : A); } SL4B_ScriptLoader.loadRequiredScripts();