remove flattener; access via egNet instead for streaming
authorBill Erickson <berick@esilibrary.com>
Mon, 5 May 2014 15:28:51 +0000 (11:28 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 5 May 2014 15:28:51 +0000 (11:28 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/services/flattener.js [deleted file]

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 (file)
index 2be9140..0000000
+++ /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'
-                }
-            });
-        }
-    };
-}])