[open-ils-commits] r10490 - trunk/Open-ILS/web/vandelay
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Aug 30 12:03:15 EDT 2008
Author: erickson
Date: 2008-08-30 12:03:13 -0400 (Sat, 30 Aug 2008)
New Revision: 10490
Modified:
trunk/Open-ILS/web/vandelay/vandelay.html
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
fetch bib/auth attr defs at startup time. leave some debugging for now
Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html 2008-08-30 16:02:29 UTC (rev 10489)
+++ trunk/Open-ILS/web/vandelay/vandelay.html 2008-08-30 16:03:13 UTC (rev 10490)
@@ -24,7 +24,7 @@
<script type="text/javascript" djConfig="parseOnLoad: true" src="/js/dojo/dojo/dojo.js"></script>
<script type="text/javascript" src='vandelay.js'></script>
</head>
- <body class="tundra">
+ <body class="tundra" onload='vlInit();'>
<!-- MARC upload form -->
<div id='vl-marc-upload-div'>
<h1>Evergreen MARC File Upload</h1>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2008-08-30 16:02:29 UTC (rev 10489)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2008-08-30 16:03:13 UTC (rev 10490)
@@ -25,8 +25,43 @@
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
*/
function uploadMARC(onload){
@@ -66,7 +101,7 @@
var queue = r.recv().content();
if(e = openils.Event.parse(queue))
return alert(e);
- onload(queue.id());
+ onload(queue);
}
}
);
@@ -105,10 +140,12 @@
}
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);
};
More information about the open-ils-commits
mailing list