Bug 10058 - Fix unapi for NORMARC
authorMagnus Enger <magnus@enger.priv.no>
Mon, 15 Apr 2013 19:56:53 +0000 (21:56 +0200)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 20 Apr 2013 02:57:32 +0000 (22:57 -0400)
commitc5e2c06a791f97f39cc2e93fa0092de6eaa9cb07
tree1f76dd7eb168c2a78143cd9ea0c7f05976d58539
parent8101d83af67f696fc12cc1830d9b51fd120ef6a4
Bug 10058 - Fix unapi for NORMARC

This patch uses a lot of MARC21 XSLT to transform NORMARC records
to desired formats. Since NORMARC is mostly a subset of MARC21, I
think this should give passable results. And better results than
no unapi-support at all for NORMARC!

To reproduce:
- Make sure you have marcflavour = NORMARC
- Visit /cgi-bin/koha/unapi in a browser
- Observe the empty <formats></formats> element

To test:
- Apply the patch
- Visit /cgi-bin/koha/unapi in a browser
- Observe the the list of formats in the <formats></formats> element
- Import the provided sample NORMARC record and make a note of its
  biblionumber
- View the record at /cgi-bin/koha/unapi?id=koha:biblionumber:x&format=y
  where x = the biblionumber of the sample record and y = one of the
  formats marcxml, marcxml-full, mods, mods-full, mods3, mods3-full,
  oai_dc, rdfdc, rss2, rss2-full and srw_dc
- Check that the transformed records make some kind of superficial
  sense

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
opac/unapi