Bug 19353

Summary: Make possible to have custom XSL template for marcxml and marc21 metadata prefixes in OAI server
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: Web servicesAssignee: Josef Moravec <josef.moravec>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: black23, julian.maurice, lucas, m.de.rooy, martin.stastny, rbit, sandboxes
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17807
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:
Bug Depends on: 15108    
Bug Blocks:    
Attachments: Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Use xslt from distribution, not packaged installed one
Bug 19353: Fix tests on UNIMARC
Bug 19353: Add test
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider
Bug 19353: Use xslt from distribution, not packaged installed one
Bug 19353: Fix tests on UNIMARC

Description Josef Moravec 2017-09-21 06:44:07 UTC

    
Comment 1 Josef Moravec 2017-12-05 17:06:33 UTC
Created attachment 69530 [details] [review]
Bug 19353: Add test
Comment 2 Josef Moravec 2017-12-05 17:06:36 UTC
Created attachment 69531 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t
Comment 3 Josef Moravec 2018-02-07 13:12:51 UTC
*** Bug 20129 has been marked as a duplicate of this bug. ***
Comment 4 Josef Moravec 2018-03-09 07:43:37 UTC
Created attachment 72553 [details] [review]
Bug 19353: Add test
Comment 5 Josef Moravec 2018-03-09 07:43:40 UTC
Created attachment 72554 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t
Comment 6 Josef Moravec 2018-06-25 07:07:08 UTC
Created attachment 76331 [details] [review]
Bug 19353: Add test
Comment 7 Josef Moravec 2018-06-25 07:07:14 UTC
Created attachment 76332 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t
Comment 8 Josef Moravec 2018-06-25 07:07:51 UTC
Just rebased on master
Comment 9 Biblibre Sandboxes 2018-08-03 12:28:12 UTC
Patch tested with a sandbox, by Martin 357astný <martin.stastny@teamlibrary.cz>
Comment 10 Biblibre Sandboxes 2018-08-03 12:28:46 UTC
Created attachment 77469 [details] [review]
Bug 19353: Add test

Signed-off-by: Martin 357astný <martin.stastny@teamlibrary.cz>
Comment 11 Biblibre Sandboxes 2018-08-03 12:28:50 UTC
Created attachment 77470 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t

Signed-off-by: Martin 357astný <martin.stastny@teamlibrary.cz>
Signed-off-by: Martin 357astný <martin.stastny@teamlibrary.cz>
Comment 12 Katrin Fischer 2018-08-29 19:54:25 UTC
@Martin Is your sign-off line ok like that? Please let us know in case you want to change it before this is pushed!
Signed-off-by: Martin 357astný <martin.stastny@teamlibrary.cz>

@Josef, can I ask for some more instructions on configuring the OAI server with specific files? A sample file would also be great for testing.
Comment 13 Julian Maurice 2018-10-05 14:13:18 UTC
t/db_dependent/OAI/oaiconf.yaml references a file that exists only if koha is installed using the Debian packages. If this file is not present, tests fail.
Also, tests fail if marcflavour == 'UNIMARC'.

Please fix.
Comment 14 Josef Moravec 2020-09-30 17:53:01 UTC
Created attachment 111005 [details] [review]
Bug 19353: Add test

Signed-off-by: Martin Šťastný <martin.stastny@teamlibrary.cz>
Comment 15 Josef Moravec 2020-09-30 17:53:08 UTC
Created attachment 111006 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t

Signed-off-by: Martin Šťastný <martin.stastny@teamlibrary.cz>
Comment 16 Josef Moravec 2020-09-30 17:53:14 UTC
Created attachment 111007 [details] [review]
Bug 19353: Use xslt from distribution, not packaged installed one
Comment 17 Josef Moravec 2020-09-30 18:09:49 UTC
Created attachment 111009 [details] [review]
Bug 19353: Fix tests on UNIMARC
Comment 18 Josef Moravec 2020-09-30 18:11:40 UTC
(In reply to Julian Maurice from comment #13)
> t/db_dependent/OAI/oaiconf.yaml references a file that exists only if koha
> is installed using the Debian packages. If this file is not present, tests
> fail.

I fixed the path to xslt used oaiconf.yaml to not used the one from package install

> Also, tests fail if marcflavour == 'UNIMARC'.
> 

I fixed that. Please note there are still two failing tests on UNIMARC, but they are failing in master too...

> Please fix.

done ;)
Comment 19 Josef Moravec 2020-09-30 18:17:06 UTC
(In reply to Katrin Fischer from comment #12)

> @Josef, can I ask for some more instructions on configuring the OAI server
> with specific files? A sample file would also be great for testing.

Katrin, this is configuration we are using on production:

https://gitlab.com/open-source-knihovna/KohaCZ/-/blob/master/etc/oaiconf.yaml

https://gitlab.com/open-source-knihovna/KohaCZ/-/tree/master/etc/xslt

I do recomend to try the marc21 metadata format with ModifyMarc.xslt https://gitlab.com/open-source-knihovna/KohaCZ/-/blob/master/etc/xslt/ModifyMARC.xsl

It is relatively simple, other templates we are using are a bit more complex....
Comment 20 Katrin Fischer 2020-10-13 11:07:02 UTC
Created attachment 111524 [details] [review]
Bug 19353: Add test

Signed-off-by: Martin Šťastný <martin.stastny@teamlibrary.cz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2020-10-13 11:07:09 UTC
Created attachment 111525 [details] [review]
Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider

Test plan:
0) apply the patchset
1) setup oai server with oaiconf file defining xsl_file for metadata
format marcxml or marc21
2) play with your oai and confirm that records are transformed as
expected
3) prove t/db_dependent/OAI/Server.t

Signed-off-by: Martin Šťastný <martin.stastny@teamlibrary.cz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Katrin Fischer 2020-10-13 11:07:17 UTC
Created attachment 111526 [details] [review]
Bug 19353: Use xslt from distribution, not packaged installed one

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 23 Katrin Fischer 2020-10-13 11:07:23 UTC
Created attachment 111527 [details] [review]
Bug 19353: Fix tests on UNIMARC

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Katrin Fischer 2020-10-13 11:08:20 UTC
It was a bit of struggle to get the OAI to cooperate (thx to Joonas helping me out!), but I finally managed a proper test and this appears to be working just fine :)
Comment 25 Josef Moravec 2020-10-13 11:28:15 UTC
(In reply to Katrin Fischer from comment #24)
> It was a bit of struggle to get the OAI to cooperate (thx to Joonas helping
> me out!), but I finally managed a proper test and this appears to be working
> just fine :)

Thanks Katrin!
Comment 26 Jonathan Druart 2020-10-14 12:53:40 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 27 Lucas Gass (lukeg) 2020-11-13 14:49:29 UTC
enhancement will not be backported to 20.05.x