[open-ils-commits] [GIT] Evergreen ILS branch master updated. 8a6f4ba380d2e64cfbb1f0e10a015c7787033af9

Evergreen Git git at git.evergreen-ils.org
Wed Mar 2 13:58:54 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  8a6f4ba380d2e64cfbb1f0e10a015c7787033af9 (commit)
       via  346077677f2d9e72fe9aacbfaa985bb44a295795 (commit)
       via  212cf48a0b07843b675da8a1e623052d61921e04 (commit)
      from  1fe4981782c864f86e75312feb9885421d831c07 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8a6f4ba380d2e64cfbb1f0e10a015c7787033af9
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Mar 2 13:46:19 2016 -0500

    LP#1548147: add release notes
    
    Also, here is a test plan for the future:
    
    [1] Using MARC Batch Import/Export, load a file
        of MARC records into a queue (arranging the matching
        criteria so that at least a few of the records
        aren't automatically imported into the catalog).
    [2] Inspect the queue, and click on the "Export Non-Imported
        Records link", then save the resulting file.
    [3] Verify that the file contains, in MARC format, the set
        of records that were not imported into the catalog.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/export_non_imported_records.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/export_non_imported_records.adoc
new file mode 100644
index 0000000..9c755c0
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Cataloging/export_non_imported_records.adoc
@@ -0,0 +1,7 @@
+Quickly export non-imported records
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+When inspecting a queue in MARC Batch Import/Export, there is now
+a link to download to MARC file any records in the queue that were
+not imported into the catalog.  This allows catalogers to quickly
+manipulate the records that failed to import using an external
+tool, then attempt to import then again.

commit 346077677f2d9e72fe9aacbfaa985bb44a295795
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Mar 2 13:42:11 2016 -0500

    LP#1548147: set export format to MARC
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 8e34921..ba2cbee 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -566,7 +566,7 @@ function exportHandler(type, response) {
 function vlExportRecordQueue(opts) {
     /* conform type to exporter */
     var type = currentType == 'auth' ? 'auth' : 'biblio';
-    var url = '/exporter?format=xml&type='+type+'&queueid='+currentQueueId;
+    var url = '/exporter?type='+type+'&queueid='+currentQueueId;
     if (opts.nonimported) {
         url += '&nonimported=1';
     }

commit 212cf48a0b07843b675da8a1e623052d61921e04
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Feb 25 11:44:23 2016 -0500

    LP#1548147 Quick Export Feature for Vandelay Queues
    
    When we import records into Vandelay, sometimes some of the records
    are not what we expected, so they get rejected.  These records often
    need to be loaded using a different set of options, so this link makes
    it convenient to get a new file of just the rejects.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Exporter.pm
index 058f7a3..bf2fa36 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Exporter.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Exporter.pm
@@ -105,9 +105,50 @@ sub handler {
         @records = map { ($_->target_biblio_record_entry) } @$recs;
     }
 
+    my $type = $cgi->param('rectype') || 'biblio';
+    my $retrieve_func;
+    # STILL no records ...
+    my $queue_id = $cgi->param('queueid');
+    if ($queue_id) {
+        # check that we're logged in -- XXX necessary? conservative for now
+        my $authid = $cgi->cookie('ses') || $cgi->param('ses');
+        my $auth = verify_login($authid);
+        if (!$auth) {
+            return 403;
+        }
+
+        # validate type
+        my $queue_type;
+        if ($type eq 'biblio') {
+            $queue_type = 'bib';
+        } elsif ($type eq 'authority') {
+            $queue_type = $type;
+        } else {
+            return 400;
+        }
+
+        # does queue exist?  This check is really just for better error logging
+        my $queue = $ses->request( "open-ils.cstore.direct.vandelay.${queue_type}_queue.retrieve", $queue_id )->gather(1);
+        unless($queue) {
+            $r->log->error("No such queue $queue_id");
+            $logger->error("No such queue $queue_id");
+            return Apache2::Const::NOT_FOUND;
+        }
+
+        # fetch the records
+        my $query = {queue => $queue_id};
+        if ($cgi->param('nonimported')) {
+            $query->{import_time} = undef;
+        }
+        $retrieve_func = "vandelay.queued_${queue_type}_record";
+        my $recs = $ses->request( "open-ils.cstore.direct.${retrieve_func}.id_list.atomic", $query )->gather(1);
+        @records = @$recs;
+    } else {
+        $retrieve_func = "$type.record_entry";
+    }
+
     return show_template($r) unless (@records);
 
-    my $type = $cgi->param('rectype') || 'biblio';
     if ($type ne 'biblio' && $type ne 'authority') {
         return 400;
     }
@@ -197,7 +238,7 @@ sub handler {
             try {
                 local $SIG{ALRM} = sub { die "TIMEOUT\n" };
                 alarm(1);
-                $bib = $ses->request( "open-ils.cstore.direct.$type.record_entry.retrieve", $i, $flesh )->gather(1);
+                $bib = $ses->request( "open-ils.cstore.direct.$retrieve_func.retrieve", $i, $flesh )->gather(1);
                 alarm(0);
             } otherwise {
                 warn "\n!!!!!! Timed out trying to read record $i\n";
diff --git a/Open-ILS/src/templates/vandelay/inc/queue.tt2 b/Open-ILS/src/templates/vandelay/inc/queue.tt2
index cce9a73..b2c8655 100644
--- a/Open-ILS/src/templates/vandelay/inc/queue.tt2
+++ b/Open-ILS/src/templates/vandelay/inc/queue.tt2
@@ -15,6 +15,7 @@
                                 <tr><td><a href='javascript:;' onclick='vlHandleQueueItemsAction("import")'>[% l('Import Selected Records') %]</a></td></tr>
                                 <tr><td><a href='javascript:;' onclick='vlHandleQueueItemsAction("import_all")'>[% l('Import All  Records') %]</a></td></tr>
                                 <tr><td><a href='javascript:;' onclick='vlLoadErrorUIAll();'>[% l('View Import Items') %]</a></td></tr>
+                                <tr><td><a href='javascript:;' onclick='vlExportRecordQueue({"nonimported":1})'>[% l('Export Non-Imported Records') %]</a></td></tr>
                                 <tr><td><a href='javascript:;' onclick='
                                     if(confirm("[% l('Are you sure you want to delete this queue?') %]")) {
                                         vlDeleteQueue(currentType, currentQueueId, 
diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 682bade..8e34921 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -74,6 +74,7 @@ var authAttrsFetched = false;
 var attrDefMap = {}; // maps attr def code names to attr def ids
 var currentType;
 var currentQueueId = null;
+var currentQueueName = null;
 var userCache = {};
 var currentMatchedRecords; // set of loaded matched bib records
 var currentOverlayRecordsMap; // map of import record to overlay record
@@ -561,6 +562,32 @@ function exportHandler(type, response) {
     }
 }
 
+/* export all (or just non-imported) queue records */
+function vlExportRecordQueue(opts) {
+    /* conform type to exporter */
+    var type = currentType == 'auth' ? 'auth' : 'biblio';
+    var url = '/exporter?format=xml&type='+type+'&queueid='+currentQueueId;
+    if (opts.nonimported) {
+        url += '&nonimported=1';
+    }
+
+    var req = new XMLHttpRequest();
+    req.open('GET',url,true);
+    req.send(null);
+    req.onreadystatechange = function () {
+        if (req.readyState == 4) {
+            var file_tag = opts.nonimported ? '_nonimported' : '';
+            openils.XUL.contentToFileSaveDialog(req.responseText, null, {
+                defaultString : currentQueueName + file_tag + '.xml',
+                defaultExtension : '.xml',
+                filterName : 'XML',
+                filterExtension : '*.xml',
+                filterAll : true
+            } );
+        }
+    }
+}
+
 function retrieveQueuedRecords(type, queueId, onload, doExport) {
     displayGlobalDiv('vl-generic-progress');
     queuedRecords = [];
@@ -1178,7 +1205,8 @@ var handleRetrieveRecords = function() {
     }
     vlFetchQueueSummary(currentQueueId, currentType, 
         function(summary) {
-            dojo.byId('vl-queue-summary-name').innerHTML = summary.queue.name();
+            currentQueueName = summary.queue.name();
+            dojo.byId('vl-queue-summary-name').innerHTML = currentQueueName;
             dojo.byId('vl-queue-summary-total-count').innerHTML = summary.total +'';
             dojo.byId('vl-queue-summary-import-count').innerHTML = summary.imported + '';
             dojo.byId('vl-queue-summary-import-item-count').innerHTML = summary.total_items + '';

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/perlmods/lib/OpenILS/WWW/Exporter.pm  |   45 +++++++++++++++++++-
 Open-ILS/src/templates/vandelay/inc/queue.tt2      |    1 +
 Open-ILS/web/js/ui/default/vandelay/vandelay.js    |   30 +++++++++++++-
 .../Cataloging/export_non_imported_records.adoc    |    7 +++
 4 files changed, 80 insertions(+), 3 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/export_non_imported_records.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list