Deprecating invoker-request-wrapper (unused)

revert-70aa11f8
dilanua 9 years ago
parent 00f98f5cce
commit c57c75945c

@ -16,79 +16,83 @@
* under the License. * under the License.
*/ */
/*
@Deprecated
*/
/** /**
* This invokerRequestWrapper contains the wrappers for invoker util requests. * This invokerRequestWrapper contains the wrappers for invoker util requests.
*/ */
var invokerRequestWrapper = function () { //var invokerRequestWrapper = function () {
//
var constants = require("/modules/constants.js"); // var constants = require("/modules/constants.js");
var serviceInvokers = require("/modules/backend-service-invoker.js").backendServiceInvoker; // var serviceInvokers = require("/modules/backend-service-invoker.js").backendServiceInvoker;
//
var publicWrappers = []; // var publicWrappers = [];
//
publicWrappers.initiate = function (method, url, payload) { // publicWrappers.initiate = function (method, url, payload) {
switch (method) { // switch (method) {
case constants.HTTP_GET: // case constants.HTTP_GET:
var response = serviceInvokers.XMLHttp.get(url, function (responsePayload) { // var response = serviceInvokers.XMLHttp.get(url, function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload["responseContent"]; // response.content = responsePayload["responseContent"];
response.status = "success"; // response.status = "success";
return response; // return response;
}, // },
function (responsePayload) { // function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload; // response.content = responsePayload;
response.status = "error"; // response.status = "error";
return response; // return response;
}); // });
return response; // return response;
break; // break;
case constants.HTTP_POST: // case constants.HTTP_POST:
var response = serviceInvokers.XMLHttp.post(url, payload, function (responsePayload) { // var response = serviceInvokers.XMLHttp.post(url, payload, function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload["responseContent"]; // response.content = responsePayload["responseContent"];
response.status = "success"; // response.status = "success";
return response; // return response;
}, // },
function (responsePayload) { // function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload; // response.content = responsePayload;
response.status = "error"; // response.status = "error";
return response; // return response;
}); // });
return response; // return response;
break; // break;
case constants.HTTP_PUT: // case constants.HTTP_PUT:
var response = serviceInvokers.XMLHttp.put(url, payload, function (responsePayload) { // var response = serviceInvokers.XMLHttp.put(url, payload, function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload["responseContent"]; // response.content = responsePayload["responseContent"];
response.status = "success"; // response.status = "success";
return response; // return response;
}, // },
function (responsePayload) { // function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload; // response.content = responsePayload;
response.status = "error"; // response.status = "error";
return response; // return response;
}); // });
return response; // return response;
break; // break;
case constants.HTTP_DELETE: // case constants.HTTP_DELETE:
var response = serviceInvokers.XMLHttp.delete(url, function (responsePayload) { // var response = serviceInvokers.XMLHttp.delete(url, function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload["responseContent"]; // response.content = responsePayload["responseContent"];
response.status = "success"; // response.status = "success";
return response; // return response;
}, // },
function (responsePayload) { // function (responsePayload) {
var response = {}; // var response = {};
response.content = responsePayload; // response.content = responsePayload;
response.status = "error"; // response.status = "error";
return response; // return response;
}); // });
return response; // return response;
break; // break;
} // }
} // }
//
}(); //}();

Loading…
Cancel
Save