From: Bill Erickson Date: Mon, 5 May 2014 15:28:51 +0000 (-0400) Subject: remove flattener; access via egNet instead for streaming X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8a61bd1d3a1d54b39170412893f3f1087db33036;p=working%2FEvergreen.git remove flattener; access via egNet instead for streaming Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/services/flattener.js b/Open-ILS/web/js/ui/default/staff/services/flattener.js deleted file mode 100644 index 2be914021e..0000000000 --- a/Open-ILS/web/js/ui/default/staff/services/flattener.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Service for communicating with the Evergreen flattener - * web service. - * - * egFlattener.load({ - * hint : aou, - * map : {shortname : shortname, parent_ou : parent_ou.shortname}, - * where : {id : {'<>' : null}} - * slo : {offset : 0, limit : 20, order_by : ['shortname']} - * }).then( function(data) { console.log(data) } ); - */ -angular.module('egFlattenerMod', ['egCoreMod']) - -.factory('egFlattener', - ['$q','$http','egAuth', -function($q, $http, egAuth) { - - var url = '/opac/extras/flattener'; - - return { - load : function(args) { - args.ses = egAuth.token(); - args.format = args.format || 'application/json'; - - angular.forEach(['map', 'where', 'slo'], function(key) { - args[key] = js2JSON(args[key]); - }); - - /** angular $http uses content type application/json natively. - * flattener / mod_perl (?) does not extract that data, so - * we have to encode it ourselves as x-www-form-urlencoded - * http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/ - */ - var query = 'ses=' + args.ses; - angular.forEach(args, function(val, key) { - if (key == 'ses' || !val) return; - query += '&' + key + '=' + encodeURIComponent(val); - }); - - return $http({ - url : url, - data : query, - method : 'POST', - headers : { - 'Content-Type': - 'application/x-www-form-urlencoded; charset=UTF-8' - } - }); - } - }; -}])