Comment 4 for bug 1208875

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I will be pushing a working branch either later today or early tomorrow. I have abandoned the notion of adding a new Fieldmapper entry because it cannot do what I want. Instead, I've gone with a series of JSON queries and cached results.

I will also add an additional commit that uses the same approach for downloading the My List CSV reports.

My approach also adds a Template Toolkit 2 plugin for a CSV field filter in Template::Plugin::CSVFilter. This is a generically useful filter that could be used by projects other than Evergreen. It could conceivably also be used to replace the csv_datum subroutine that gets exported to Template Toolkit 2 in OpenILS::Application::Trigger::Reactor.

I have tested the circ history export code on my development machine using a patron account that has 4,196 retained circulations. While it takes over a minute to generate the CSV file, the complete file is eventually returned to the user, unlike the current process where it times out and returns an empty CSV.

Finally, I have altered the columns in the output file in two ways.

First, I have added the checkout date, due date, and date returned columns from the web form to the CSV output.

Second, the format column has been changed from using the relatively cryptic MARC item type to returning the text description of the icon format. This change means that if you have customized icon formats, your patrons will see the descriptions for those. It also means that they should see more meaningful text, such as DVD or Blu-ray, instead of "Projected Medium."

This second change takes advantage of the Multi-Value Fields code added in 2.6. This means that the code cannot be backported prior to 2.6.0 without some modification. If multiple icon formats are retrieved for a copy, the values are separated by a + on output, i.e. a DVD and Blu-ray combo usually shows up as Blu-ray+DVD.