Bug 10407: Add marcxml import (follow-up)
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 7 Jul 2016 12:13:16 +0000 (14:13 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 2 Sep 2016 16:00:13 +0000 (16:00 +0000)
commit3badc57c9339e37e5d6ec660ff0b323614ab045d
tree8d6a551c6507660156559b14e5232f56c2289aa4
parent3e541866cdd00389dc3f28a401911ebd4f5699e9
Bug 10407: Add marcxml import (follow-up)

This patch makes the following changes:

[1] Based on the groundwork of the former patch, add call to
    RecordsFromMARCXMLFile in stage-marc-import. Use format param.
[2] Add format to the template. Use file extension to determine.
    If you use .xml or .marcxml as extension, MARCXML is selected.
[3] In stage-marc-import.tt mark UTF-8 encoding as UTF-8 not as utf8.
[4] BatchStageMarcRecords: do not call plugin if you have no records.
[5] RecordsFromISO2709File: also return errors in an array.
[6] In misc/stage_file.pl also use UTF-8. Handling of errors from [5].

Test plan:
[1] Import an empty file as MARC or MARCXML (with Tools/Stage..import).
[2] Import an non-empty file with invalid contents as MARC or MARCXML.
[3] Export a few records with Tools/Export as MARC and MARCXML.
[4] Import these two files. Check selected format versus file extension.
[5] Import a MARCXML file with misc/stage_file.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/ImportBatch.pm
koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt
misc/stage_file.pl
tools/stage-marc-import.pl