this.stop();
if ( this.resetCallback )
- this.resetCallback();
+ this.resetCallback(this.windowid);
},
init: function (sessionId, serviceId)
context.keepAlive
);
if ( context.initCallback )
- context.initCallback();
+ context.initCallback(context.windowid);
}
else
context.throwError('Init failed. Malformed WS resonse.',
var request = new pzHttpRequest(this.pz2String, this.errorHandler);
request.safeGet(
- { "command": "ping", "session": this.sessionID, "windowid" : this.windowid },
+ { "command": "ping", "session": this.sessionID, "windowid" : context.windowid },
function(data) {
if ( data.getElementsByTagName("status")[0]
.childNodes[0].nodeValue == "OK" ) {
var context = this;
var request = new pzHttpRequest(this.pz2String, this.errorHandler);
request.safeGet(
- { "command": "stat", "session": this.sessionID, "windowid" : this.windowid },
+ { "command": "stat", "session": this.sessionID, "windowid" : context.windowid },
function(data) {
if ( data.getElementsByTagName("stat") ) {
var activeClients =
},
delay
);
- context.statCallback(stat);
+ context.statCallback(stat, context.windowid);
}
else
context.throwError('Stat failed. Malformed WS resonse.',
context.show();
},
delay);
- context.showCallback(show);
+ context.showCallback(show, context.windowid);
}
);
},
record = new Array();
record['xmlDoc'] = data;
record['offset'] = context.currRecOffset;
- callback(record, args);
+ callback(record, args, context.windowid);
//pz2 record
} else if ( recordNode =
data.getElementsByTagName("record")[0] ) {
},
delay
);
- callback(record, args);
+ callback(record, args, context.windowid);
}
else
context.throwError('Record failed. Malformed WS resonse.',
delay
);
- context.termlistCallback(termList);
+ context.termlistCallback(termList, context.windowid);
}
else
context.throwError('Termlist failed. Malformed WS resonse.',
delay
);
- context.bytargetCallback(bytarget);
+ context.bytargetCallback(bytarget, context.windowid);
}
else
context.throwError('Bytarget failed. Malformed WS resonse.',
** AJAX HELPER CLASS ***********************************************************
********************************************************************************
*/
-var pzHttpRequest = function (url, errorHandler, cookieDomain) {
+var pzHttpRequest = function (url, errorHandler, cookieDomain, windowId) {
this.maxUrlLength = 2048;
this.request = null;
this.url = url;
this.isXDR = false;
this.domainRegex = /https?:\/\/([^:/]+).*/;
this.cookieDomain = cookieDomain || null;
+ this.windowId = windowId || window.name;
var xhr = new XMLHttpRequest();
var domain = this._getDomainFromUrl(url);
//session cookie, resend it
var domain = this._getDomainFromUrl(url);
if (domain && this._isCrossDomain(domain) &&
- this.getCookie(domain+":SESSID")) {
+ this.getCookie(domain+":"+this.windowId+":SESSID")) {
//rewrite the URL
- var sessparam = ';jsessionid=' + this.getCookie(domain+":SESSID");
+ var sessparam = ';jsessionid=' + this.getCookie(domain+":"+this.windowId+":SESSID");
var q = url.indexOf('?');
if (q == -1) {
url += sessparam;
var jsessionId = this.request.responseXML
.documentElement.getAttribute('jsessionId');
if (jsessionId)
- this.setCookie(domain+":SESSID", jsessionId);
+ this.setCookie(domain+":"+this.windowId+":SESSID", jsessionId);
}
this.callback(this.request.responseXML);
} else {