In Sweden most libraries pulls their MARC records from a central repository run by the Royal Library in Stockholm. These MARC records include a unique identifier in control field 001 which is used to identify a particular bibliographic entry. Anyone can browse this online database of available works. Once an interesting title is found the visitor can list all libraries that holds that particular book. Once a library is selected, the status of that item can be queried in realtime from the home page. In order to facilitate that query the ILS must implement a handler for a specific HTTP request. The request has a single parameter, the Libris ID of the bibliographic entry, stored in the MARC record. This patch adds a new ILS-DI service called GetLibrisAvailability that takes a single string as an ID and uses Zebra/Z39.50 to search for it (Koha luckily indexes this field by default). If found, the search result is used to locate the entry in the SQL database to retrieve the current status of the item. This is returned as an XML document to the central Libris server. I need feedback on how to implement tests for Z39.50 functionality. I would like to programmatically insert a faked work much like how TestBuilder can be used to generate fake SQL data.
Created attachment 45358 [details] [review] Bug 15292 - Libris ILS-DI item status (service) This patch adds the GetLibrisAvailability method to the ILS-DI service module. Sponsored-By: Halland County Library
Created attachment 45359 [details] [review] Bug 15292 - Libris ILS-DI item status (tests) This patch adds the GetLibrisAvailability tests. Sponsored-By: Halland County Library
Created attachment 45360 [details] [review] Bug 15292 - Libris ILS-DI item status (opac) This patch adds the GetLibrisAvailability method to the ILS-DI service endpoint in the OPAC. Sponsored-By: Halland County Library
Created attachment 45363 [details] [review] Bug 15292 - Libris ILS-DI item status (service) This patch adds the GetLibrisAvailability method to the ILS-DI service module. Updated version with whitespace fixes. Sponsored-By: Halland County Library
Setting to 'Needs Signoff' to get feedback.
I don't know what others think, but it seems inappropriate to add GetLibrisAvailability as a ILS-DI function, since ILS-DI is an API with a pre-existing specification to which "GetLibrisAvailability" does not belong: https://old.diglib.org/architectures/ilsdi/DLF_ILS_Discovery_1.1.pdf I'm not an expert on ILS-DI, but that's my understanding. I would suggest adding a service in the "svc/" directory instead as that doesn't depend on any standards. Also, is there a reason why you use Zebra/Z39.50 instead of just checking the database directly?
I think I like the idea of this being separate from ILS-DI somewhere in the svc directory.
(In reply to Martin Persson from comment #5) > Setting to 'Needs Signoff' to get feedback. Hi Martin, patches applies cleanly, no koha-qa errors It's ok to add new services, but please take into account Katrin and David comments. This will not pass in it's current form. Please add some kind of test plan, a tester need to know how to test and what to expect. Perhaps a passing test is enough, but we must know. Lastly, 'prove -v t/db_dependent/ILSDI_Services.t' now fails on last test not ok 18 - Test missing item info
Is this something the Libris libraries would still be interested in? Maybe it could be implemented as a plugin now or using the REST API?