From: erickson Date: Sat, 30 Aug 2008 16:03:13 +0000 (+0000) Subject: fetch bib/auth attr defs at startup time. leave some debugging for now X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d1115a28862845a9eda62a053030d3a85275b09b;p=Evergreen.git fetch bib/auth attr defs at startup time. leave some debugging for now git-svn-id: svn://svn.open-ils.org/ILS/trunk@10490 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/vandelay/vandelay.html b/Open-ILS/web/vandelay/vandelay.html index f98d063f1a..5c48ae3567 100644 --- a/Open-ILS/web/vandelay/vandelay.html +++ b/Open-ILS/web/vandelay/vandelay.html @@ -24,7 +24,7 @@ - +

Evergreen MARC File Upload

diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index 548f67f1ce..fcfec72323 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -25,6 +25,41 @@ dojo.require('openils.Event'); var authtoken = dojo.cookie('ses') || new openils.CGI().param('ses'); var VANDELAY_URL = '/vandelay'; +var bibAttrDefs = []; +var authAttrDefs = []; + +/** + * Grab initial data + */ +function vlInit() { + + // Fetch the bib and authority attribute definitions + fieldmapper.standardRequest( + ['open-ils.permacrud', 'open-ils.permacrud.search.vqbrad'], + { async: true, + params: [authtoken, {id:{'!=':null}}], + onresponse: function(r) { + var def = r.recv().content(); + if(openils.Event.parse(def)) + return alert(def); + bibAttrDefs.push(def); + }, + } + ); + + fieldmapper.standardRequest( + ['open-ils.permacrud', 'open-ils.permacrud.search.vqarad'], + { async: true, + params: [authtoken, {id:{'!=':null}}], + onresponse: function(r) { + var def = r.recv().content(); + if(openils.Event.parse(def)) + return alert(def); + authAttrDefs.push(def); + } + } + ); +} /** * asynchronously upload a file of MARC records @@ -66,7 +101,7 @@ function createQueue(queueName, type, onload) { var queue = r.recv().content(); if(e = openils.Event.parse(queue)) return alert(e); - onload(queue.id()); + onload(queue); } } ); @@ -105,10 +140,12 @@ function batchUpload() { } var handleUploadMARC = function(key) { + alert('marc uploaded'); processSpool(key, currentQueue, recordType, handleProcessSpool); }; var handleCreateQueue = function(queue) { + alert('queue created ' + queue.name()); currentQueue = queue; uploadMARC(handleUploadMARC); };