Bug 5478 - Automate MARC framework import/export
Summary: Automate MARC framework import/export
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) enhancement with 10 votes (vote)
Assignee: Salva Zaragoza Rubio
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-08 10:26 UTC by MJ Ray (software.coop)
Modified: 2012-10-25 23:03 UTC (History)
5 users (show)

See Also:
Change sponsored?: Seeking cosponsors
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Importing/Exporting the marc structure of a specific framework to a spreadsheet (58.34 KB, patch)
2011-03-08 11:52 UTC, Salva Zaragoza Rubio
Details | Diff | Splinter Review
bullet images (16.72 KB, image/png)
2011-03-08 13:43 UTC, Nicole C. Engard
Details
bullet in chrome (76.39 KB, image/png)
2011-03-08 13:49 UTC, Nicole C. Engard
Details
New proposed patch for export/import fields and subfields of a framework (68.52 KB, patch)
2011-03-23 18:15 UTC, Salva Zaragoza Rubio
Details | Diff | Splinter Review
Corrected patch for export/import fields and subfields of a framework (76.33 KB, patch)
2011-03-29 09:02 UTC, Salva Zaragoza Rubio
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description MJ Ray (software.coop) 2010-12-08 10:26:30 UTC
The thread under
http://lists.katipo.co.nz/pipermail/koha/2010-December/026566.html
suggests a desire for making MARC framework import/export easier.

http://wiki.koha-community.org/wiki/Mysqldump_Library#A_specific_MARC_framework
describes the process idea.
Comment 1 Salva Zaragoza Rubio 2011-03-08 11:52:21 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2011-03-08 12:58:03 UTC
Okay, initial testing shows:


#1 - the bullets shouldn't display, they clutter the interface
#2 - exporting to ODS creates a corrupt file that I can't open in OpenOffice
#3 - exporting to Excel works!
#4 - the close bullet doesn't do anything ... 
#5 - why is there an import next to each framework? shouldn't you be importing
a new framework? what happens if I import over an existing framework?
#6 - I think there should be an export to MySQL


I didn't test importing yet because of #5 above.
Comment 3 Salva Zaragoza Rubio 2011-03-08 13:37:19 UTC
(In reply to comment #2)
> Okay, initial testing shows:
> 
> 
> #1 - the bullets shouldn't display, they clutter the interface
If the bullets are the input radio from the form they are needed to choose between the two possible formats. If they are the symbols of the rows list (<li>) they shouldn't be on display.
Let me know what OS and browser you're testing with, or send me an screenshot to see what's your view.


> #2 - exporting to ODS creates a corrupt file that I can't open in OpenOffice
Have you installed the perl module Archive::Zip or zip/unzip system command?, to create a valid ODS file it has to ZIP compress a directory full of xml files.
I don't know how to make a patch to install a missing perl module.

> #3 - exporting to Excel works!
I'm happy to hear about it. :)

> #4 - the close bullet doesn't do anything ... 
Again, let me know what OS and browser you're testing with because I've tested it with Firefox/Chrome/Safari/Opera/IE8/KMeleon under Windows 7 Professional and it closes the layer opened.

> #5 - why is there an import next to each framework? shouldn't you be importing
> a new framework? what happens if I import over an existing framework?
To import to a new framework you have to create it first and afterwards import the structure from the spreadsheet. The spreadsheet only affects to the fields and subfields (marc_tag_structure and marc_subfield_structure MySQL tables).
If you import over an existing framework and you haven't modified the spreadsheet the framework should remain unaltered. If you have modified the spreadsheet (adding a field, adding subfield, deleting a field, ...) importing it should make the same operations on the framework (MySQL tables).

> #6 - I think there should be an export to MySQL
No problem, can make it too.
> 
> 
> I didn't test importing yet because of #5 above.

Thanks fot the rapid response and testing.
Comment 4 Nicole C. Engard 2011-03-08 13:43:22 UTC Comment hidden (obsolete)
Comment 5 Nicole C. Engard 2011-03-08 13:45:14 UTC
(In reply to comment #3)

> > #2 - exporting to ODS creates a corrupt file that I can't open in OpenOffice
> Have you installed the perl module Archive::Zip or zip/unzip system command?,
> to create a valid ODS file it has to ZIP compress a directory full of xml
> files.
> I don't know how to make a patch to install a missing perl module.

This I did not do, I will try that now.

> > #4 - the close bullet doesn't do anything ... 
> Again, let me know what OS and browser you're testing with because I've tested
> it with Firefox/Chrome/Safari/Opera/IE8/KMeleon under Windows 7 Professional
> and it closes the layer opened.

I'm on FF on Mac OS X.
 
> > #5 - why is there an import next to each framework? shouldn't you be importing
> > a new framework? what happens if I import over an existing framework?
> To import to a new framework you have to create it first and afterwards import
> the structure from the spreadsheet. The spreadsheet only affects to the fields
> and subfields (marc_tag_structure and marc_subfield_structure MySQL tables).
> If you import over an existing framework and you haven't modified the
> spreadsheet the framework should remain unaltered. If you have modified the
> spreadsheet (adding a field, adding subfield, deleting a field, ...) importing
> it should make the same operations on the framework (MySQL tables).

Thanks! I'll test.
Comment 6 Nicole C. Engard 2011-03-08 13:49:03 UTC
Created attachment 3263 [details]
bullet in chrome

This is what it looks like in Chrome on Mac OS X - which I think is what you were going for ... so I'm not sure what the deal is with Firefox on Mac.
Comment 7 Nicole C. Engard 2011-03-08 13:51:00 UTC
I did a shift refresh in FF and now the export pop up looks right! So, nothing to fix there :)
Comment 8 Nicole C. Engard 2011-03-08 13:52:04 UTC
I installed Archive::Zip but I still can't open the ods file.
Comment 9 Nicole C. Engard 2011-03-08 14:07:24 UTC
Wouldn't exporting as CSV and as SQL make the most sense? Then the CSV can be opened in any spreadsheet application and SQL can be imported into a new DB.
Comment 10 Salva Zaragoza Rubio 2011-03-08 15:43:18 UTC
Sure thing, just wanted to offer more of xml spreadsheet formats.

I'll include CSV as the default format, SQL format too and test ODS on a MAC OS X.

Thanks again for the invaluable testing and suggestions.
Comment 11 Salva Zaragoza Rubio 2011-03-23 18:15:55 UTC Comment hidden (obsolete)
Comment 12 Nicole C. Engard 2011-03-25 00:49:30 UTC
Okay we're almost there.  I tested the export and it works in all formats and opens in those apps.

The import however is confusing. First I created a new framework, then i clicked import next to it.  The box asks for a speadsheet file so I tried the *.ods and that didn't import, just threw and error. So I tried to import the csv and that worked - sort of - it took me to the page that asks me what framework to base my new one off of - so I chose one and then I had to do the import again for it to take.

We should be clear what files can be imported back into Koha and if you create a new framework, the import option shouldn't be there until you pick a framework to base it off of - if that's necessary.
Comment 13 Salva Zaragoza Rubio 2011-03-29 09:02:25 UTC
Created attachment 3495 [details] [review]
Corrected patch for export/import fields and subfields of a framework

The error in the ods importing was a bug in the uncompressing method, I've changed it to work fine now.

I've modified the importing to allow the use of exported files from a framework to a different one. The problem was that it was importing ok, but to the original framework it was exported from, so you ended up with the page asking you to choose the framework to base the new one on.
Comment 14 Nicole C. Engard 2011-03-29 12:14:12 UTC
Woo hoo!! This last patch works beautifully, I have submitted it with my sign off.
Comment 15 Chris Cormack 2011-04-01 08:22:38 UTC
Pushed please test