rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
request.body += prop + "=" + batch.map[prop] + DWREngine._postSeperator;
request.body += prop + "=" + batch.map[prop] + dwr.engine._postSeperator;
DWREngine._constructRequest = function(batch) { // A quick string to help people that use web log analysers var request = { url:batch.path + batch.mode, body:null }; if (batch.isPoll == true) { request.url += "ReverseAjax.dwr"; } else if (batch.map.callCount == 1) { request.url += batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"] + ".dwr"; } else { request.url += "Multiple." + batch.map.callCount + ".dwr"; } // Play nice with url re-writing var sessionMatch = location.href.match(/jsessionid=(\w+)/); if (sessionMatch != null) { request.url += ";jsessionid=" + sessionMatch[1]; } var prop; if (batch.httpMethod == "GET") { // Some browsers (Opera/Safari2) seem to fail to convert the callCount value // to a string in the loop below so we do it manually here. batch.map.callCount = "" + batch.map.callCount; request.url += "?"; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.url += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } } request.url = request.url.substring(0, request.url.length - 1); } else { // PERFORMANCE: for iframe mode this is thrown away. request.body = ""; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.body += prop + "=" + batch.map[prop] + DWREngine._postSeperator; } } request.body = DWREngine._contentRewriteHandler(request.body); } request.url = DWREngine._urlRewriteHandler(request.url); return request;};
request.body = DWREngine._contentRewriteHandler(request.body);
request.body = dwr.engine._contentRewriteHandler(request.body);
DWREngine._constructRequest = function(batch) { // A quick string to help people that use web log analysers var request = { url:batch.path + batch.mode, body:null }; if (batch.isPoll == true) { request.url += "ReverseAjax.dwr"; } else if (batch.map.callCount == 1) { request.url += batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"] + ".dwr"; } else { request.url += "Multiple." + batch.map.callCount + ".dwr"; } // Play nice with url re-writing var sessionMatch = location.href.match(/jsessionid=(\w+)/); if (sessionMatch != null) { request.url += ";jsessionid=" + sessionMatch[1]; } var prop; if (batch.httpMethod == "GET") { // Some browsers (Opera/Safari2) seem to fail to convert the callCount value // to a string in the loop below so we do it manually here. batch.map.callCount = "" + batch.map.callCount; request.url += "?"; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.url += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } } request.url = request.url.substring(0, request.url.length - 1); } else { // PERFORMANCE: for iframe mode this is thrown away. request.body = ""; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.body += prop + "=" + batch.map[prop] + DWREngine._postSeperator; } } request.body = DWREngine._contentRewriteHandler(request.body); } request.url = DWREngine._urlRewriteHandler(request.url); return request;};
request.url = DWREngine._urlRewriteHandler(request.url);
request.url = dwr.engine._urlRewriteHandler(request.url);
DWREngine._constructRequest = function(batch) { // A quick string to help people that use web log analysers var request = { url:batch.path + batch.mode, body:null }; if (batch.isPoll == true) { request.url += "ReverseAjax.dwr"; } else if (batch.map.callCount == 1) { request.url += batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"] + ".dwr"; } else { request.url += "Multiple." + batch.map.callCount + ".dwr"; } // Play nice with url re-writing var sessionMatch = location.href.match(/jsessionid=(\w+)/); if (sessionMatch != null) { request.url += ";jsessionid=" + sessionMatch[1]; } var prop; if (batch.httpMethod == "GET") { // Some browsers (Opera/Safari2) seem to fail to convert the callCount value // to a string in the loop below so we do it manually here. batch.map.callCount = "" + batch.map.callCount; request.url += "?"; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.url += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } } request.url = request.url.substring(0, request.url.length - 1); } else { // PERFORMANCE: for iframe mode this is thrown away. request.body = ""; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.body += prop + "=" + batch.map[prop] + DWREngine._postSeperator; } } request.body = DWREngine._contentRewriteHandler(request.body); } request.url = DWREngine._urlRewriteHandler(request.url); return request;};
if (location.href.match(/jsessionid/)) { request.url += ";jsessionid=" + DWREngine._httpSessionId;
var sessionMatch = location.href.match(/jsessionid=(\w+)/); if (sessionMatch != null) { request.url += ";jsessionid=" + sessionMatch[1];
DWREngine._constructRequest = function(batch) { // A quick string to help people that use web log analysers var request = { url:batch.path + batch.mode, body:null }; if (batch.isPoll == true) { request.url += "ReverseAjax.dwr"; } else if (batch.map.callCount == 1) { request.url += batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"] + ".dwr"; } else { request.url += "Multiple." + batch.map.callCount + ".dwr"; } // Play nice with url re-writing if (location.href.match(/jsessionid/)) { request.url += ";jsessionid=" + DWREngine._httpSessionId; } var prop; if (batch.httpMethod == "GET") { // Some browsers (Opera/Safari2) seem to fail to convert the callCount value // to a string in the loop below so we do it manually here. batch.map.callCount = "" + batch.map.callCount; request.url += "?"; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.url += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } } request.url = request.url.substring(0, request.url.length - 1); } else { // PERFORMANCE: for iframe mode this is thrown away. request.body = ""; for (prop in batch.map) { if (typeof batch.map[prop] != "function") { request.body += prop + "=" + batch.map[prop] + DWREngine._postSeperator; } } request.body = DWREngine._contentRewriteHandler(request.body); } request.url = DWREngine._urlRewriteHandler(request.url); return request;};
if (dwr.engine._preHook) batch.preHooks.puch(dwr.engine._preHook);
if (dwr.engine._preHook) batch.preHooks.push(dwr.engine._preHook);
dwr.engine._createBatch = function() { var batch = { map:{ callCount:0, page:window.location.pathname, httpSessionId:dwr.engine._getJSessionId(), scriptSessionId:dwr.engine._getScriptSessionId() }, paramCount:0, // TODO: What's this for? isPoll:false, headers:{}, handlers:{}, preHooks:[], postHooks:[], rpcType:dwr.engine._rpcType, httpMethod:dwr.engine._httpMethod, async:dwr.engine._async, timeout:dwr.engine._timeout, errorHandler:dwr.engine._errorHandler, warningHandler:dwr.engine._warningHandler, textHtmlHandler:dwr.engine._textHtmlHandler }; if (dwr.engine._preHook) batch.preHooks.puch(dwr.engine._preHook); if (dwr.engine._postHook) batch.postHooks.push(dwr.engine._postHook); var propname, data; if (dwr.engine._headers) { for (propname in dwr.engine._headers) { data = dwr.engine._headers[propname]; if (typeof data != "function") batch.headers[propname] = "" + data; } } if (dwr.engine._parameters) { for (propname in dwr.engine._parameters) { data = dwr.engine._parameters[propname]; if (typeof data != "function") batch.parameters[propname] = "" + data; } } return batch;}
if (typeof templateNode == "string") {
if (templateNode == null) { var node = doc.createTextNode("--null--"); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else if (typeof templateNode != "object") {
SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) { if (typeof templateNode == "string") { var node = doc.createTextNode(templateNode); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else { var elmt = null; if ("tag" in templateNode) { var tag = templateNode.tag; if (parentElmt != null) { if (tag == "tr") { elmt = parentElmt.insertRow(parentElmt.rows.length); } else if (tag == "td") { elmt = parentElmt.insertCell(parentElmt.cells.length); } } if (elmt == null) { elmt = doc.createElement(templateNode.tag); if (parentElmt != null) { parentElmt.appendChild(elmt); } } } else { elmt = templateNode.elmt; if (parentElmt != null) { parentElmt.appendChild(elmt); } } for (attribute in templateNode) { var value = templateNode[attribute]; if (attribute == "field") { result[value] = elmt; } else if (attribute == "className") { elmt.className = value; } else if (attribute == "id") { elmt.id = value; } else if (attribute == "title") { elmt.title = value; } else if (attribute == "type" && elmt.tagName == "input") { elmt.type = value; } else if (attribute == "children") { for (var i = 0; i < value.length; i++) { Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt); } } else if (attribute != "tag" && attribute != "elmt") { elmt.setAttribute(attribute, value); } } return elmt; }}
elmt = doc.createElement(templateNode.tag);
elmt = tag == "input" ? SimileAjax.DOM.createInputElement(templateNode.type) : doc.createElement(tag);
SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) { if (typeof templateNode == "string") { var node = doc.createTextNode(templateNode); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else { var elmt = null; if ("tag" in templateNode) { var tag = templateNode.tag; if (parentElmt != null) { if (tag == "tr") { elmt = parentElmt.insertRow(parentElmt.rows.length); } else if (tag == "td") { elmt = parentElmt.insertCell(parentElmt.cells.length); } } if (elmt == null) { elmt = doc.createElement(templateNode.tag); if (parentElmt != null) { parentElmt.appendChild(elmt); } } } else { elmt = templateNode.elmt; if (parentElmt != null) { parentElmt.appendChild(elmt); } } for (attribute in templateNode) { var value = templateNode[attribute]; if (attribute == "field") { result[value] = elmt; } else if (attribute == "className") { elmt.className = value; } else if (attribute == "id") { elmt.id = value; } else if (attribute == "title") { elmt.title = value; } else if (attribute == "type" && elmt.tagName == "input") { elmt.type = value; } else if (attribute == "children") { for (var i = 0; i < value.length; i++) { Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt); } } else if (attribute != "tag" && attribute != "elmt") { elmt.setAttribute(attribute, value); } } return elmt; }}
elmt.type = value;
SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) { if (typeof templateNode == "string") { var node = doc.createTextNode(templateNode); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else { var elmt = null; if ("tag" in templateNode) { var tag = templateNode.tag; if (parentElmt != null) { if (tag == "tr") { elmt = parentElmt.insertRow(parentElmt.rows.length); } else if (tag == "td") { elmt = parentElmt.insertCell(parentElmt.cells.length); } } if (elmt == null) { elmt = doc.createElement(templateNode.tag); if (parentElmt != null) { parentElmt.appendChild(elmt); } } } else { elmt = templateNode.elmt; if (parentElmt != null) { parentElmt.appendChild(elmt); } } for (attribute in templateNode) { var value = templateNode[attribute]; if (attribute == "field") { result[value] = elmt; } else if (attribute == "className") { elmt.className = value; } else if (attribute == "id") { elmt.id = value; } else if (attribute == "title") { elmt.title = value; } else if (attribute == "type" && elmt.tagName == "input") { elmt.type = value; } else if (attribute == "children") { for (var i = 0; i < value.length; i++) { Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt); } } else if (attribute != "tag" && attribute != "elmt") { elmt.setAttribute(attribute, value); } } return elmt; }}
Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt);
SimileAjax.DOM._createDOMFromTemplate(doc, value[i], result, elmt);
SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) { if (typeof templateNode == "string") { var node = doc.createTextNode(templateNode); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else { var elmt = null; if ("tag" in templateNode) { var tag = templateNode.tag; if (parentElmt != null) { if (tag == "tr") { elmt = parentElmt.insertRow(parentElmt.rows.length); } else if (tag == "td") { elmt = parentElmt.insertCell(parentElmt.cells.length); } } if (elmt == null) { elmt = doc.createElement(templateNode.tag); if (parentElmt != null) { parentElmt.appendChild(elmt); } } } else { elmt = templateNode.elmt; if (parentElmt != null) { parentElmt.appendChild(elmt); } } for (attribute in templateNode) { var value = templateNode[attribute]; if (attribute == "field") { result[value] = elmt; } else if (attribute == "className") { elmt.className = value; } else if (attribute == "id") { elmt.id = value; } else if (attribute == "title") { elmt.title = value; } else if (attribute == "type" && elmt.tagName == "input") { elmt.type = value; } else if (attribute == "children") { for (var i = 0; i < value.length; i++) { Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt); } } else if (attribute != "tag" && attribute != "elmt") { elmt.setAttribute(attribute, value); } } return elmt; }}
} else if (attribute == "style") { for (n in value) { elmt.style[n] = value[n]; }
SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) { if (templateNode == null) { var node = doc.createTextNode("--null--"); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else if (typeof templateNode != "object") { var node = doc.createTextNode(templateNode); if (parentElmt != null) { parentElmt.appendChild(node); } return node; } else { var elmt = null; if ("tag" in templateNode) { var tag = templateNode.tag; if (parentElmt != null) { if (tag == "tr") { elmt = parentElmt.insertRow(parentElmt.rows.length); } else if (tag == "td") { elmt = parentElmt.insertCell(parentElmt.cells.length); } } if (elmt == null) { elmt = tag == "input" ? SimileAjax.DOM.createInputElement(templateNode.type) : doc.createElement(tag); if (parentElmt != null) { parentElmt.appendChild(elmt); } } } else { elmt = templateNode.elmt; if (parentElmt != null) { parentElmt.appendChild(elmt); } } for (attribute in templateNode) { var value = templateNode[attribute]; if (attribute == "field") { result[value] = elmt; } else if (attribute == "className") { elmt.className = value; } else if (attribute == "id") { elmt.id = value; } else if (attribute == "title") { elmt.title = value; } else if (attribute == "type" && elmt.tagName == "input") { // do nothing } else if (attribute == "children") { for (var i = 0; i < value.length; i++) { SimileAjax.DOM._createDOMFromTemplate(doc, value[i], result, elmt); } } else if (attribute != "tag" && attribute != "elmt") { elmt.setAttribute(attribute, value); } } return elmt; }}
classes.push(className);elmt.className=classes.join(" ");};SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");div.innerHTML="<input type='"+type+"' />";return div.firstChild;};SimileAjax.DOM.createDOMFromTemplate=function(doc,template){var result={};result.elmt=SimileAjax.DOM._createDOMFromTemplate(doc,template,result,null);return result;};SimileAjax.DOM._createDOMFromTemplate=function(doc,templateNode,result,parentElmt){if(templateNode==null){var node=doc.createTextNode("--null--");if(parentElmt!=null){parentElmt.appendChild(node);} return node;}else if(typeof templateNode!="object"){var node=doc.createTextNode(templateNode);if(parentElmt!=null){parentElmt.appendChild(node);}
classes.push(className);elmt.className=classes.join(" ");};SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");div.innerHTML="<input type='"+type+"' />";return div.firstChild;};SimileAjax.DOM.createDOMFromTemplate=function(doc,template){var result={};result.elmt=SimileAjax.DOM._createDOMFromTemplate(doc,template,result,null);return result;};SimileAjax.DOM._createDOMFromTemplate=function(doc,templateNode,result,parentElmt){if(templateNode==null){return null;}else if(typeof templateNode!="object"){var node=doc.createTextNode(templateNode);if(parentElmt!=null){parentElmt.appendChild(node);}
classes.push(className);elmt.className=classes.join(" ");};SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");div.innerHTML="<input type='"+type+"' />";return div.firstChild;};SimileAjax.DOM.createDOMFromTemplate=function(doc,template){var result={};result.elmt=SimileAjax.DOM._createDOMFromTemplate(doc,template,result,null);return result;};SimileAjax.DOM._createDOMFromTemplate=function(doc,templateNode,result,parentElmt){if(templateNode==null){var node=doc.createTextNode("--null--");if(parentElmt!=null){parentElmt.appendChild(node);}return node;}else if(typeof templateNode!="object"){var node=doc.createTextNode(templateNode);if(parentElmt!=null){parentElmt.appendChild(node);}return node;}else{var elmt=null;if("tag"in templateNode){var tag=templateNode.tag;if(parentElmt!=null){if(tag=="tr"){elmt=parentElmt.insertRow(parentElmt.rows.length);}else if(tag=="td"){elmt=parentElmt.insertCell(parentElmt.cells.length);}}if(elmt==null){elmt=tag=="input"?SimileAjax.DOM.createInputElement(templateNode.type):doc.createElement(tag);if(parentElmt!=null){parentElmt.appendChild(elmt);}}}else{elmt=templateNode.elmt;if(parentElmt!=null){parentElmt.appendChild(elmt);}}for(attribute in templateNode){var value=templateNode[attribute];if(attribute=="field"){result[value]=elmt;}else if(attribute=="className"){elmt.className=value;}else if(attribute=="id"){elmt.id=value;}else if(attribute=="title"){elmt.title=value;}else if(attribute=="type"&&elmt.tagName=="input"){}else if(attribute=="style"){for(n in value){var v=value[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";}elmt.style[n]=v;}}else if(attribute=="children"){for(var i=0;i<value.length;i++){SimileAjax.DOM._createDOMFromTemplate(doc,value[i],result,elmt);}}else if(attribute!="tag"&&attribute!="elmt"){elmt.setAttribute(attribute,value);}}return elmt;}}
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents;
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
dwr.engine._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents;
dwr.engine._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
else if (window.opera && window.opera.postError) window.opera.postError(message);
dwr.engine._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents;
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } }};
else if (window.opera && window.opera.postError) window.opera.postError(message);
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } }};
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents;
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } }};
else if (window.opera && window.opera.postError) window.opera.postError(message);
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } }};
if (window.console) { try {
var written = false; try { if (window.console) {
dwr.util._debug = function(message, stacktrace) { if (window.console) { try { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } catch (ex) { // Ignore it. This could happen in live so an alert() is wrong. } } else if (window.opera && window.opera.postError) { window.opera.postError(message); } // else if (window.navigator.product == "Gecko") { // window.dump(message + "\n"); // } else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents; } }};
catch (ex) {
else if (window.opera && window.opera.postError) { window.opera.postError(message); written = true;
dwr.util._debug = function(message, stacktrace) { if (window.console) { try { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } catch (ex) { // Ignore it. This could happen in live so an alert() is wrong. } } else if (window.opera && window.opera.postError) { window.opera.postError(message); } // else if (window.navigator.product == "Gecko") { // window.dump(message + "\n"); // } else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents; } }};
else if (window.opera && window.opera.postError) { window.opera.postError(message); } else {
catch (ex) { } if (!written) {
dwr.util._debug = function(message, stacktrace) { if (window.console) { try { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } catch (ex) { // Ignore it. This could happen in live so an alert() is wrong. } } else if (window.opera && window.opera.postError) { window.opera.postError(message); } // else if (window.navigator.product == "Gecko") { // window.dump(message + "\n"); // } else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents; } }};
if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
try { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } catch (ex) { }
dwr.util._debug = function(message, stacktrace) { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) { window.opera.postError(message); } // else if (window.navigator.product == "Gecko") { // window.dump(message + "\n"); // } else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents; } }};
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents;
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
dwr.util._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message);
var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 2048) contents = contents.substring(0, 2048); debug.innerHTML = contents;
dwr.util._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
else if (window.opera && window.opera.postError) window.opera.postError(message);
dwr.util._debug = function(message, stacktrace) { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHTML = contents; } else { if (window.console) { if (stacktrace && window.console.trace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); }};
DWREngine._debug = function(message) { if (window.console) { window.console.trace(); window.console.log(message); }
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace) window.console.trace(); window.console.log(message); }
DWREngine._debug = function(message) { if (window.console) { window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHtml = contents; } }};
if (stacktrace) window.console.trace();
if (stacktrace && window.console.trace) window.console.trace();
dwr.engine._debug = function(message, stacktrace) { if (window.console) { if (stacktrace) window.console.trace(); window.console.log(message); } else if (window.opera && window.opera.postError) window.opera.postError(message); //else if (window.navigator.product == "Gecko") window.dump(message + "\n"); else { var debug = document.getElementById("dwr-debug"); if (debug) { var contents = message + "<br/>" + debug.innerHTML; if (contents.length > 1024) contents = contents.substring(0, 1024); debug.innerHtml = contents; } }};
DWREngine._defaultInterceptor = function(data) {return data;}
dwr.engine._defaultInterceptor = function(data) {return data;}
DWREngine._defaultInterceptor = function(data) {return data;}
if (typeof func == "string" || func.isString)
if (typeof func == "string")
DWRUtil._drawRowInner = function(frag, row, cellFuncs){ var tr = document.createElement("tr"); for (var j = 0; j < cellFuncs.length; j++) { var td = document.createElement("td"); tr.appendChild(td); var func = cellFuncs[j]; if (typeof func == "string" || func.isString) { var text = document.createTextNode(func); td.appendChild(text); } else { var reply = func(row); if (DWRUtil.isHTMLElement(reply)) { td.appendChild(reply); } else { td.innerHTML = reply; //var text = document.createTextNode(reply); //td.appendChild(text); } } } frag.appendChild(tr);}
if (data.isArray)
if (DWRUtil.isArray(data))
DWRUtil._drawTableInner = function(tbodyID, data, cellFuncs){ var frag = document.createDocumentFragment(); if (data.isArray) { // loop through data source for (var i = 0; i < data.length; i++) { DWRUtil._drawRowInner(frag, data[i], cellFuncs); } } else if (typeof data == "object") { for (var row in data) { DWRUtil._drawRowInner(frag, row, cellFuncs); } } var tbody = DWRUtil.getElementById(tbodyID); tbody.appendChild(frag);}
}
};
DWREngine._eval = function(script) { return eval(script);}
DWREngine._exceptionHandler = function(message) { DWREngine._errorHandler(message);
dwr.engine._exceptionHandler = function(message, ex) { dwr.engine._errorHandler(message, ex);
DWREngine._exceptionHandler = function(message) { DWREngine._errorHandler(message);};
if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; }
if (callData.method != null) DWREngine._batch.method = callData.method; if (callData.verb != null) DWREngine._batch.verb = callData.verb; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; } // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; } // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the callMetaData DWREngine._handlersMap[id] = callData; // Copy extra callData into the map var data, prop; for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; }
if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook);
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; } // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; } // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the callMetaData DWREngine._handlersMap[id] = callData; // Copy extra callData into the map var data, prop; for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; }
if (callData.scriptTagBase != null) DWREngine._batch.scriptTagBase = callData.scriptTagBase;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; } // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; } // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the callMetaData DWREngine._handlersMap[id] = callData; // Copy extra callData into the map var data, prop; for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
DWREngine._handlersMap[id] = callData;
DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback };
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; } // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; } // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the callMetaData DWREngine._handlersMap[id] = callData; // Copy extra callData into the map var data, prop; for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data;
if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; } // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook; } if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) { DWREngine._batch.scriptTagBase = callData.scriptTagBase; delete callData.scriptTagBase; } // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the callMetaData DWREngine._handlersMap[id] = callData; // Copy extra callData into the map var data, prop; for (prop in callData) { data = callData[prop]; if (typeof data != "function") { DWREngine._batch.map[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var callId = DWREngine._lastCallId++;
var callId = DWREngine._nextCallId++;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._lastCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var metadata;
var callData;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
metadata = { callback:args.shift() };
callData = { callback:args.shift() };
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
metadata = { callback:args.pop() };
callData = { callback:args.pop() };
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
metadata = args.pop();
callData = args.pop();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
DWREngine._metadatas[id] = metadata;
DWREngine._callData[id] = callData;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop];
if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop];
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
DWREngine._batch.map.httpSessionId = jSessionId;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); if (callData.rpcType != null) DWREngine._batch.rpcType = callData.rpcType; if (callData.httpMethod != null) DWREngine._batch.httpMethod = callData.httpMethod; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true;
var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3];
} var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (DWREngine._batch.path == null) { DWREngine._batch.path = path;
metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object.");
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; }
return; } var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop];
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1];
} DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; }
DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-";
if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }
DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var metadata; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { metadata = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { metadata = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { metadata = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } metadata = { callback:args.shift() }; params = args; } else if (lastArg == null) { metadata = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._metadatas[id] = metadata; var prefix = "c" + DWREngine._batch.map.callCount + "-"; // merge the metadata from this call into the batch if (metadata != null) { for (var prop in metadata) { DWREngine._batch.metadata[prop] = metadata[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Merge in the global values for timeout and errorHandler if (DWREngine._timeout && !DWREngine._batch.timeout) { DWREngine._batch.timeout = DWREngine._timeout; } if (DWREngine._errorHandler && !DWREngine._batch.metadata.errorHandler) { DWREngine._batch.metadata.errorHandler = DWREngine._errorHandler; } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (singleShot) { DWREngine.endBatch(); }
if (singleShot) DWREngine.endBatch();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) DWREngine._batch.method = callData.method; if (callData.verb != null) DWREngine._batch.verb = callData.verb; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.scriptTagBase != null) DWREngine._batch.scriptTagBase = callData.scriptTagBase;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); // batchMetaData stuff the we allow in callMetaData for convenience if (callData.method != null) DWREngine._batch.method = callData.method; if (callData.verb != null) DWREngine._batch.verb = callData.verb; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; // callMetaData stuff that we handle with the rest of the batchMetaData if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); // ScriptTag method parameter - the scriptTagBase if (callData.scriptTagBase != null) DWREngine._batch.scriptTagBase = callData.scriptTagBase; // Default the error and warning handlers if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook);
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.errorHandler != null) DWREngine._batch.errorHandler = callData.errorHandler; if (callData.warningHandler != null) DWREngine._batch.warningHandler = callData.warningHandler; if (callData.textHtmlHandler != null) DWREngine._batch.textHtmlHandler = callData.textHtmlHandler;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call DWREngine._lastBatchId++; var batchId = DWREngine._lastBatchId; // Merge from the callData into the batch if (callData.rpcType != null) DWREngine._batch.rpcType = callData.rpcType; if (callData.httpMethod != null) DWREngine._batch.httpMethod = callData.httpMethod; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.batchIds[batchId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; var data, prop; if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = batchId; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
var cookies = document.cookie.split(';'); var jSessionId = ""; for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length); if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) { jSessionId = cookie.substring(11, cookie.length); break; } }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); if (callData.rpcType != null) DWREngine._batch.rpcType = callData.rpcType; if (callData.httpMethod != null) DWREngine._batch.httpMethod = callData.httpMethod; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Are we in a session? var cookies = document.cookie.split(';'); var jSessionId = ""; for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length); if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) { jSessionId = cookie.substring(11, cookie.length); break; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = jSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
DWREngine._batch.map.httpSessionId = jSessionId;
DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); if (callData.rpcType != null) DWREngine._batch.rpcType = callData.rpcType; if (callData.httpMethod != null) DWREngine._batch.httpMethod = callData.httpMethod; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Are we in a session? var cookies = document.cookie.split(';'); var jSessionId = ""; for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length); if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) { jSessionId = cookie.substring(11, cookie.length); break; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = jSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
exceptionHandler:overrides.exceptionHandler, callback:overrides.callback
exceptionHandler:callData.exceptionHandler, callback:callData.callback
dwr.engine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (dwr.engine._batch == null) { dwr.engine.beginBatch(); singleShot = true; } var batch = dwr.engine._batch; // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (batch.path == null) { batch.path = path; } else { if (batch.path != path) { dwr.engine._handleError(batch, { name:"dwr.engine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Merge from the callData into the batch dwr.engine.mergeBatch(batch, callData); batch.handlers[batch.map.callCount] = { exceptionHandler:overrides.exceptionHandler, callback:overrides.callback }; // Copy to the map the things that need serializing var prefix = "c" + batch.map.callCount + "-"; batch.map[prefix + "scriptName"] = scriptName; batch.map[prefix + "methodName"] = methodName; batch.map[prefix + "id"] = batch.map.callCount; for (i = 0; i < args.length; i++) { dwr.engine._serializeAll(batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count batch.map.callCount++; if (singleShot) dwr.engine.endBatch();};
DWREngine._callData[id] = callData;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout;
if (callData.method != null) { DWREngine._batch.method = callData.method; delete callData.method; } if (callData.verb != null) { DWREngine._batch.verb = callData.verb; delete callData.verb; } if (callData.async != null) { DWREngine._batch.async = callData.async; delete callData.async; } if (callData.timeout != null) { DWREngine._batch.timeout = callData.timeout; delete callData.timeout; }
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; }
if (callData.preHook != null) { DWREngine._batch.preHooks.unshift(callData.preHook); delete callData.preHook;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
if (callData.postHook != null) { DWREngine._batch.postHooks.push(callData.postHook); delete callData.postHook; } if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; DWREngine._handlersMap[id] = callData;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { if (DWREngine._warningHandler) { DWREngine._warningHandler("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Missing callback function or metadata object."); } return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); DWREngine._callData[id] = callData; var prefix = "c" + DWREngine._batch.map.callCount + "-"; if (callData.preHook) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook) DWREngine._batch.postHooks.push(callData.postHook); if (!callData.errorHandler) callData.errorHandler = DWREngine._errorHandler; if (!callData.warningHandler) callData.warningHandler = DWREngine._warningHandler; if (!callData.timeout) callData.timeout = DWREngine._timeout; // merge the metadata from this call into the batch if (callData != null) { for (var prop in callData) { DWREngine._batch.metadata[prop] = callData[prop]; } } DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map DWREngine._addSerializeFunctions(); for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } DWREngine._removeSerializeFunctions(); // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) { DWREngine.endBatch(); }};
DWREngine._execute = function(path, scriptName, methodName, vararg_params) {
dwr.engine._execute = function(path, scriptName, methodName, vararg_params) {
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (DWREngine._batch == null) { DWREngine.beginBatch();
if (dwr.engine._batch == null) { dwr.engine.beginBatch();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (DWREngine._batch.path == null) { DWREngine._batch.path = path;
if (batch.path == null) { batch.path = path;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." });
if (batch.path != path) { dwr.engine._handleError(null, { name:"dwr.engine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." });
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
var callId = DWREngine._nextCallId++;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler;
if (callData.errorHandler == null) callData.errorHandler = dwr.engine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = dwr.engine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = dwr.engine._textHtmlHandler;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname];
for (var i = 0; i < dwr.engine._propnames.length; i++) { propname = dwr.engine._propnames[i]; if (callData[propname] != null) batch[propname] = callData[propname];
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = {
if (callData.preHook != null) batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) batch.postHooks.push(callData.postHook); batch.handlers[batch.map.callCount] = {
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data;
if (typeof data != "function") batch.headers[propname] = "" + data;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId;
batch.map.httpSessionId = dwr.engine._getJSessionId(); batch.map.scriptSessionId = dwr.engine._getScriptSessionId(); batch.map.page = window.location.pathname; var prefix = "c" + batch.map.callCount + "-"; batch.map[prefix + "scriptName"] = scriptName; batch.map[prefix + "methodName"] = methodName; batch.map[prefix + "id"] = batch.map.callCount;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
if (typeof data != "function") DWREngine._batch.map[propname] = "" + data;
if (typeof data != "function") batch.map[propname] = "" + data;
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i);
dwr.engine._serializeAll(batch, [], args[i], prefix + "param" + i);
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();
batch.map.callCount++; if (singleShot) dwr.engine.endBatch();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError(null, { name:"dwrengine.multipleServlets", message:"Can't batch requests to multiple DWR Servlets." }); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var callData; var lastArg = args[args.length - 1]; if (typeof lastArg == "function" || lastArg == null) callData = { callback:args.pop() }; else callData = args.pop(); // Get a unique ID for this call var callId = DWREngine._nextCallId++; // Copy globals into the batch if they are missing if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; if (callData.textHtmlHandler == null) callData.textHtmlHandler = DWREngine._textHtmlHandler; // Merge from the callData into the batch var propname, data; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (callData[propname] != null) DWREngine._batch[propname] = callData[propname]; } if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); DWREngine._batch.callIds[callId] = { exceptionHandler:callData.exceptionHandler, callback:callData.callback }; if (callData.headers) { for (propname in callData.headers) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.headers[propname] = "" + data; } } // Copy to the map the things that need serializing DWREngine._batch.map.httpSessionId = DWREngine._getJSessionId(); DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId(); DWREngine._batch.map.page = window.location.pathname; var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = callId; if (callData.parameters) { for (propname in callData.parameters) { data = callData[propname]; if (typeof data != "function") DWREngine._batch.map[propname] = "" + data; } } for (i = 0; i < args.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], args[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId;
DWREngine._batch.map.scriptSessionId = DWREngine._getScriptSessionId();
DWREngine._execute = function(path, scriptName, methodName, vararg_params) { var singleShot = false; if (DWREngine._batch == null) { DWREngine.beginBatch(); singleShot = true; } // To make them easy to manipulate we copy the arguments into an args array var args = []; for (var i = 0; i < arguments.length - 3; i++) { args[i] = arguments[i + 3]; } // All the paths MUST be to the same servlet if (DWREngine._batch.path == null) { DWREngine._batch.path = path; } else { if (DWREngine._batch.path != path) { DWREngine._handleError("Can't batch requests to multiple DWR Servlets."); return; } } // From the other params, work out which is the function (or object with // call meta-data) and which is the call parameters var params; var callData; var firstArg = args[0]; var lastArg = args[args.length - 1]; if (typeof firstArg == "function") { callData = { callback:args.shift() }; params = args; } else if (typeof lastArg == "function") { callData = { callback:args.pop() }; params = args; } else if (lastArg != null && typeof lastArg == "object" && lastArg.callback != null && typeof lastArg.callback == "function") { callData = args.pop(); params = args; } else if (firstArg == null) { // This could be a null callback function, but if the last arg is also // null then we can't tell which is the function unless there are only // 2 args, in which case we don't care! if (lastArg == null && args.length > 2) { DWREngine._handleError("Ambiguous nulls at start and end of parameter list. Which is the callback function?"); } callData = { callback:args.shift() }; params = args; } else if (lastArg == null) { callData = { callback:args.pop() }; params = args; } else { DWREngine._handleError("Missing callback function or metadata object."); return; } // Get a unique ID for this call var random = Math.floor(Math.random() * 10001); var id = (random + "_" + new Date().getTime()).toString(); var prefix = "c" + DWREngine._batch.map.callCount + "-"; DWREngine._batch.ids.push(id); if (callData.rpcType != null) DWREngine._batch.rpcType = callData.rpcType; if (callData.httpMethod != null) DWREngine._batch.httpMethod = callData.httpMethod; if (callData.async != null) DWREngine._batch.async = callData.async; if (callData.timeout != null) DWREngine._batch.timeout = callData.timeout; if (callData.preHook != null) DWREngine._batch.preHooks.unshift(callData.preHook); if (callData.postHook != null) DWREngine._batch.postHooks.push(callData.postHook); if (callData.errorHandler == null) callData.errorHandler = DWREngine._errorHandler; if (callData.warningHandler == null) callData.warningHandler = DWREngine._warningHandler; // Save the handlers for later DWREngine._handlersMap[id] = { errorHandler:callData.errorHandler, warningHandler:callData.warningHandler, callback:callData.callback }; // Copy extra callData into the map var data, prop; if (callData.parameters) { for (prop in callData.parameters) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.map[prop] = "" + data; } } if (callData.headers) { for (prop in callData.headers) { data = callData[prop]; if (typeof data != "function") DWREngine._batch.headers[prop] = "" + data; } } // Add in the page and session ids DWREngine._batch.map.httpSessionId = DWREngine._httpSessionId; DWREngine._batch.map.scriptSessionId = DWREngine._scriptSessionId; DWREngine._batch.map.page = window.location.pathname; DWREngine._batch.map[prefix + "scriptName"] = scriptName; DWREngine._batch.map[prefix + "methodName"] = methodName; DWREngine._batch.map[prefix + "id"] = id; // Serialize the parameters into batch.map for (i = 0; i < params.length; i++) { DWREngine._serializeAll(DWREngine._batch, [], params[i], prefix + "param" + i); } // Now we have finished remembering the call, we incr the call count DWREngine._batch.map.callCount++; if (singleShot) DWREngine.endBatch();};
var batch = DWREngine._batchQueue.pop();
var batch = DWREngine._batchQueue.shift();
DWREngine._finalize = function(batch){ DWREngine._removeNode(batch.div); DWREngine._removeNode(batch.iframe); DWREngine._removeNode(batch.form); if (DWREngine._postHook) { DWREngine._postHook(); } // TODO: There must be a better way??? for (var i = 0; i < DWREngine._batches.length; i++) { if (DWREngine._batches[i] == batch) { DWREngine._batches.splice(i, 1); break; } } // If there is anything on the queue waiting to go out, then send it. // We don't need to check for ordered mode, here because when ordered mode // gets turned off, we still process *waiting* batches in an ordered way. if (DWREngine._batchQueue.length != 0) { var batch = DWREngine._batchQueue.pop(); DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; }};
var ioService = getService('component:
var ioService = getService('@mozilla.org/network/io-service;1',
_getChannel: function(request) { // Set up channel. var ioService = getService('component://netscape/network/io-service', 'nsIIOService'); var atomService = getService('component://netscape/atom-service', 'nsIAtomService'); var chann = ioService.newChannelFromURI(this._serverUrl) .QueryInterface(Components.interfaces.nsIHTTPChannel); // Set the request method. chann.SetRequestMethod(atomService.getAtom('POST')); // Create a stream out of the request and attach it to the channel // Note: pending bug #37773, an extra \r\n needs to be added. var handler = ioService.getProtocolHandler(this._serverUrl.scheme) .QueryInterface(Components.interfaces.nsIHTTPProtocolHandler); var postStream = handler.NewPostDataStream(false, '\r\n' + request, handler.ENCODE_NORMAL); chann.UploadStream = postStream; // Set the request headers chann.SetRequestHeader(atomService.getAtom('content-type'), 'text/xml'); chann.SetRequestHeader(atomService.getAtom('content-length'), request.length); return chann; },
var atomService = getService('component:
var atomService = getService('@mozilla.org/atom-service;1',
_getChannel: function(request) { // Set up channel. var ioService = getService('component://netscape/network/io-service', 'nsIIOService'); var atomService = getService('component://netscape/atom-service', 'nsIAtomService'); var chann = ioService.newChannelFromURI(this._serverUrl) .QueryInterface(Components.interfaces.nsIHTTPChannel); // Set the request method. chann.SetRequestMethod(atomService.getAtom('POST')); // Create a stream out of the request and attach it to the channel // Note: pending bug #37773, an extra \r\n needs to be added. var handler = ioService.getProtocolHandler(this._serverUrl.scheme) .QueryInterface(Components.interfaces.nsIHTTPProtocolHandler); var postStream = handler.NewPostDataStream(false, '\r\n' + request, handler.ENCODE_NORMAL); chann.UploadStream = postStream; // Set the request headers chann.SetRequestHeader(atomService.getAtom('content-type'), 'text/xml'); chann.SetRequestHeader(atomService.getAtom('content-length'), request.length); return chann; },
if (map[property] != null && typeof map[property] == "object") { var prefixClone = new Array();
if (dwr.util._isObject(map[property]) && !dwr.util._isArray(map[property])) { var prefixClone = [];
dwr.util._getDataProperties = function(map, prefixes) { for (var property in map) { if (map[property] != null && typeof map[property] == "object") { var prefixClone = new Array(); for (var i = 0; i < prefixes.length; i++) { prefixClone.push(prefixes[i]); } prefixClone.push(property); dwr.util._getDataProperties(map[property], prefixClone); } else { var nestedProperty = property; if (prefixes.length > 0) { nestedProperty = (prefixes.join(".")) + "." + property; } // Are there any elements with that id or name if (dwr.util.byId(nestedProperty) != null || document.getElementsByName(nestedProperty).length >= 1) { dwr.util.setValue(nestedProperty, map[property]); } } }};
DWREngine._getJSessionId = function() {
dwr.engine._getJSessionId = function() {
DWREngine._getJSessionId = function() { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length); if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) { return cookie.substring(11, cookie.length); } } return "";}
if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) {
if (cookie.indexOf(dwr.engine._sessionCookieName + "=") == 0) {
DWREngine._getJSessionId = function() { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length); if (cookie.indexOf(DWREngine._sessionCookieName + "=") == 0) { return cookie.substring(11, cookie.length); } } return "";}
DWREngine._getObjectClassName = function(obj) {
dwr.engine._getObjectClassName = function(obj) {
DWREngine._getObjectClassName = function(obj) { // Try to find the classname by stringifying the object's constructor // and extract <class> from "function <class>". if (obj && obj.constructor && obj.constructor.toString) { var str = obj.constructor.toString(); var regexpmatch = str.match(/function\s+(\w+)/); if (regexpmatch && regexpmatch.length == 2) { return regexpmatch[1]; } } // Now manually test against the core Error classes, as these in some // browsers successfully match to the wrong class in the // Object.toString() test we will do later if (obj && obj.constructor) { for (var errorname in DWREngine._errorClasses) { if (obj.constructor == DWREngine._errorClasses[errorname]) return errorname; } } // Try to find the classname by calling Object.toString() on the object // and extracting <class> from "[object <class>]" if (obj) { var str = Object.prototype.toString.call(obj); var regexpmatch = str.match(/\[object\s+(\w+)/); if (regexpmatch && regexpmatch.length==2) { return regexpmatch[1]; } } // Supplied argument was probably not an object, but what is better? return "Object";};
for (var errorname in DWREngine._errorClasses) { if (obj.constructor == DWREngine._errorClasses[errorname]) return errorname;
for (var errorname in dwr.engine._errorClasses) { if (obj.constructor == dwr.engine._errorClasses[errorname]) return errorname;
DWREngine._getObjectClassName = function(obj) { // Try to find the classname by stringifying the object's constructor // and extract <class> from "function <class>". if (obj && obj.constructor && obj.constructor.toString) { var str = obj.constructor.toString(); var regexpmatch = str.match(/function\s+(\w+)/); if (regexpmatch && regexpmatch.length == 2) { return regexpmatch[1]; } } // Now manually test against the core Error classes, as these in some // browsers successfully match to the wrong class in the // Object.toString() test we will do later if (obj && obj.constructor) { for (var errorname in DWREngine._errorClasses) { if (obj.constructor == DWREngine._errorClasses[errorname]) return errorname; } } // Try to find the classname by calling Object.toString() on the object // and extracting <class> from "[object <class>]" if (obj) { var str = Object.prototype.toString.call(obj); var regexpmatch = str.match(/\[object\s+(\w+)/); if (regexpmatch && regexpmatch.length==2) { return regexpmatch[1]; } } // Supplied argument was probably not an object, but what is better? return "Object";};
DWREngine._getScriptSessionId = function() { if (DWREngine._scriptSessionId == null) { DWREngine._scriptSessionId = DWREngine._origScriptSessionId + Math.floor(Math.random() * 1000);
dwr.engine._getScriptSessionId = function() { if (dwr.engine._scriptSessionId == null) { dwr.engine._scriptSessionId = dwr.engine._origScriptSessionId + Math.floor(Math.random() * 1000);
DWREngine._getScriptSessionId = function() { if (DWREngine._scriptSessionId == null) { DWREngine._scriptSessionId = DWREngine._origScriptSessionId + Math.floor(Math.random() * 1000); } return DWREngine._scriptSessionId;};
return DWREngine._scriptSessionId;
return dwr.engine._scriptSessionId;
DWREngine._getScriptSessionId = function() { if (DWREngine._scriptSessionId == null) { DWREngine._scriptSessionId = DWREngine._origScriptSessionId + Math.floor(Math.random() * 1000); } return DWREngine._scriptSessionId;};
}
};
DWREngine._getTextFromCometIFrame = function() { var frameDocument; if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document; } else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document; } else { return ""; } var bodyNodes = frameDocument.getElementsByTagName("body"); if (bodyNodes == null || bodyNodes.length == 0) return ""; if (bodyNodes[0] == null) return ""; var text = bodyNodes[0].innerHTML.toString(); // IE plays silly-pants and adds <PRE>...</PRE> for some unknown reason if (text.indexOf("<PRE>") == 0) text = text.substring(5, text.length - 7); return text;}
frameDocument = DWREngine._pollFrame.contentWindow.document
frameDocument = DWREngine._pollFrame.contentWindow.document;
DWREngine._getTextFromCometIFrame = function() { var frameDocument; if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document; } else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document } else { return ""; } var bodyNodes = frameDocument.getElementsByTagName("body"); if (bodyNodes == null || bodyNodes.length == 0) return ""; if (bodyNodes[0] == null) return ""; var text = bodyNodes[0].innerHTML.toString(); // IE plays silly-pants and adds <PRE>...</PRE> for some unknown reason if (text.indexOf("<PRE>") == 0) text = text.substring(5, text.length - 7); return text;}
DWREngine._getTextFromCometIFrame = function() {
dwr.engine._getTextFromCometIFrame = function() {
DWREngine._getTextFromCometIFrame = function() { var frameDocument; if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document; } else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document; } else { return ""; } var bodyNodes = frameDocument.getElementsByTagName("body"); if (bodyNodes == null || bodyNodes.length == 0) return ""; if (bodyNodes[0] == null) return ""; var text = bodyNodes[0].innerHTML.toString(); // IE plays silly-pants and adds <PRE>...</PRE> for some unknown reason if (text.indexOf("<PRE>") == 0) text = text.substring(5, text.length - 7); return text;};
if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document;
if (dwr.engine._pollFrame.contentDocument) { frameDocument = dwr.engine._pollFrame.contentDocument.defaultView.document;
DWREngine._getTextFromCometIFrame = function() { var frameDocument; if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document; } else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document; } else { return ""; } var bodyNodes = frameDocument.getElementsByTagName("body"); if (bodyNodes == null || bodyNodes.length == 0) return ""; if (bodyNodes[0] == null) return ""; var text = bodyNodes[0].innerHTML.toString(); // IE plays silly-pants and adds <PRE>...</PRE> for some unknown reason if (text.indexOf("<PRE>") == 0) text = text.substring(5, text.length - 7); return text;};
else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document;
else if (dwr.engine._pollFrame.contentWindow) { frameDocument = dwr.engine._pollFrame.contentWindow.document;
DWREngine._getTextFromCometIFrame = function() { var frameDocument; if (DWREngine._pollFrame.contentDocument) { frameDocument = DWREngine._pollFrame.contentDocument.defaultView.document; } else if (DWREngine._pollFrame.contentWindow) { frameDocument = DWREngine._pollFrame.contentWindow.document; } else { return ""; } var bodyNodes = frameDocument.getElementsByTagName("body"); if (bodyNodes == null || bodyNodes.length == 0) return ""; if (bodyNodes[0] == null) return ""; var text = bodyNodes[0].innerHTML.toString(); // IE plays silly-pants and adds <PRE>...</PRE> for some unknown reason if (text.indexOf("<PRE>") == 0) text = text.substring(5, text.length - 7); return text;};
else { alert("HE"+reason);}
DWREngine._handleError = function(reason, ex) { if (DWREngine._errorHandler) { DWREngine._errorHandler(reason, ex); } else { alert("HE"+reason);}};
else { alert("HE"+reason);}
DWREngine._handleError = function(reason, ex) { if (DWREngine._errorHandler) { DWREngine._errorHandler(reason, ex); }};
DWREngine._handleError = function(id, reason) { if (DWREngine._errorHandler) {
DWREngine._handleError = function(reason) { if (DWREngine._errorHandler) {
DWREngine._handleError = function(id, reason){ if (DWREngine._errorHandler) { DWREngine._errorHandler(reason); }};
DWREngine._handleError = function(batch, ex) {
dwr.engine._handleError = function(batch, ex) {
DWREngine._handleError = function(batch, ex) { if (typeof ex == "string") ex = { name:"unknown", message:ex }; if (ex.message == null) ex.message = ""; if (ex.name == null) ex.name = "unknown"; if (batch && typeof batch.errorHandler == "function") batch.errorHandler(ex.message, ex); else if (DWREngine._errorHandler) DWREngine._errorHandler(ex.message, ex);};
else if (DWREngine._errorHandler) DWREngine._errorHandler(ex.message, ex);
else if (dwr.engine._errorHandler) dwr.engine._errorHandler(ex.message, ex);
DWREngine._handleError = function(batch, ex) { if (typeof ex == "string") ex = { name:"unknown", message:ex }; if (ex.message == null) ex.message = ""; if (ex.name == null) ex.name = "unknown"; if (batch && typeof batch.errorHandler == "function") batch.errorHandler(ex.message, ex); else if (DWREngine._errorHandler) DWREngine._errorHandler(ex.message, ex);};