Bug 17317 - Adding "bib" type to GetAvailability method for ILSDI
Summary: Adding "bib" type to GetAvailability method for ILSDI
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Arthur Suzuki
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-19 08:46 UTC by Arthur Suzuki
Modified: 2017-01-04 22:26 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Email conversation (1.42 KB, text/plain)
2016-09-19 08:46 UTC, Arthur Suzuki
Details
GetAvailability "id_type=bib" quick'n dirty implementation (2.84 KB, patch)
2016-09-20 10:22 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 17317: ILSDI - Getavailability method with id_type=bib implementation (3.19 KB, patch)
2016-09-23 14:11 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Performance Improvement (5.51 KB, patch)
2016-09-30 13:07 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 17317 ILSDI - Getavailability method with id_type=bib implementation (2.84 KB, patch)
2016-10-03 11:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17317: Perfomance Improvement (2.60 KB, patch)
2016-10-03 11:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17317: ILSDI: Getavailability method with id_type=bib implementation (3.18 KB, patch)
2016-10-03 16:16 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 17317: Perfomance Improvement (2.69 KB, patch)
2016-10-03 16:16 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 17317: Perfomance Improvement (2.75 KB, patch)
2016-12-14 13:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17317: ILSDI: Getavailability method with id_type=bib implementation (3.24 KB, patch)
2016-12-20 11:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17317: Perfomance Improvement (2.75 KB, patch)
2016-12-20 11:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Example in 3.22 (59.92 KB, image/png)
2016-12-28 14:05 UTC, Tom Misilo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Suzuki 2016-09-19 08:46:50 UTC
Created attachment 55685 [details]
Email conversation

GetAvailability method has some unimplemented features, it is not possible to query availability by biblionumber.
Only query for one item at a time is implemented.
Comment 1 Julian Maurice 2016-09-19 08:59:56 UTC
Comment on attachment 55685 [details]
Email conversation

Obsolete email attachment in favor of URL to koha-devel archives:

http://lists.koha-community.org/pipermail/koha-devel/2016-September/043075.html
Comment 2 Arthur Suzuki 2016-09-20 10:22:46 UTC
Created attachment 55714 [details] [review]
GetAvailability "id_type=bib" quick'n dirty implementation
Comment 3 Arthur Suzuki 2016-09-22 14:29:54 UTC
To test this patch you should try to send a query to you opac formatted this way :
http://[your-opac-domain-name]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[biblionumber]&id_type=bib

You should get availability status for all the items of the matched bibliographic record.
Comment 4 Héctor Eduardo Castro Avalos 2016-09-23 14:11:54 UTC
Created attachment 55775 [details] [review]
Bug 17317: ILSDI - Getavailability method with id_type=bib implementation

To test this patch you should try to send a query to you opac formatted
this way :
http://[your-opac-domain-name]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[biblionumber]&id_type=bib

You should get availability status for all the items of the matched
bibliographic record.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised
Comment 5 Jonathan Druart 2016-09-28 12:22:53 UTC
Comment on attachment 55775 [details] [review]
Bug 17317: ILSDI - Getavailability method with id_type=bib implementation

Review of attachment 55775 [details] [review]:
-----------------------------------------------------------------

::: C4/ILSDI/Services.pm
@@ +136,5 @@
>              my $msg;
>              my $biblioitem = ( GetBiblioItemByBiblioNumber( $id, undef ) )[0];
>              if ($biblioitem) {
> +                my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
> +                my $items            = (GetItemsByBiblioitemnumber($biblioitemnumber))[0];

I think it would be better to use GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber, we just need the itemnumbers.
Comment 6 Arthur Suzuki 2016-09-30 13:07:28 UTC
Created attachment 55956 [details] [review]
Performance Improvement

Thank you Jonathan!
Comment 8 Jonathan Druart 2016-10-03 11:10:00 UTC
Created attachment 55970 [details] [review]
Bug 17317 ILSDI - Getavailability method with id_type=bib implementation
Comment 9 Jonathan Druart 2016-10-03 11:10:05 UTC
Created attachment 55971 [details] [review]
Bug 17317: Perfomance Improvement

- Use of GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber (thx Jonathan Druart)
Comment 10 Jonathan Druart 2016-10-03 11:10:58 UTC
I have just reuploaded the patches (correctly formatted).
I'd like to get another signoff on these 2 patches, the structure of the XML has changed (and seems to make more sense).
Comment 11 Héctor Eduardo Castro Avalos 2016-10-03 16:16:25 UTC
Created attachment 55981 [details] [review]
[SIGNED-OFF]Bug 17317: ILSDI: Getavailability method with id_type=bib implementation

To test this patch you should try to send a query to you opac formatted
this way :
http://[your-opac-domain-name]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[biblionumber]&id_type=bib

You should get availability status for all the items of the matched
bibliographic record.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Comment 12 Héctor Eduardo Castro Avalos 2016-10-03 16:16:34 UTC
Created attachment 55982 [details] [review]
[SIGNED-OFF]Bug 17317: Perfomance Improvement

- Use of GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber (thx Jonathan Druart)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised
Comment 13 Jonathan Druart 2016-12-14 13:02:55 UTC
Created attachment 58180 [details] [review]
Bug 17317: Perfomance Improvement

- Use of GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber (thx Jonathan Druart)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2016-12-20 11:17:54 UTC
Created attachment 58287 [details] [review]
Bug 17317: ILSDI: Getavailability method with id_type=bib implementation

To test this patch you should try to send a query to you opac formatted
this way :
http://[your-opac-domain-name]/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=[biblionumber]&id_type=bib

You should get availability status for all the items of the matched
bibliographic record.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Jonathan Druart 2016-12-20 11:17:58 UTC
Created attachment 58288 [details] [review]
Bug 17317: Perfomance Improvement

- Use of GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber (thx Jonathan Druart)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Kyle M Hall 2016-12-23 11:39:00 UTC
Pushed to master for 17.05, thanks Arthur!
Comment 17 Katrin Fischer 2016-12-27 22:14:06 UTC
This won't get ported back to 16.11.x as it is an enhancement.
Comment 18 Tom Misilo 2016-12-28 14:05:23 UTC
Created attachment 58469 [details]
Example in 3.22

Katrin, it may be a bug in 16.x if it is a bug in 3.22.10.000 no?

As the ILS-DI Driver lists id_type=bib but it does not return anything. I attached a photo of what I see in 3.22.10 Thanks!
Comment 19 Katrin Fischer 2017-01-04 22:26:19 UTC
I tested this feature to see if it was safe to go in by not changing the existing behaviour of GetAvailability for 'item'. return_type doesn't seem to be implemented as well?

I think that the error page doesn't look good when you give an invalid bibnumber:
.../cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=20000&id_type=bib

<dlf:collection xsi:schemaLocation="http://diglib.org/ilsdi/1.1     http://diglib.org/architectures/ilsdi/schemas/1.1/dlfexpanded.xsd"><dlf:record><dlf:bibliographic id="20000"/><dlf:items>
    </dlf:items></dlf:record></dlf:collection>

For item it looks like this:

<dlf:collection xsi:schemaLocation="http://diglib.org/ilsdi/1.1     http://diglib.org/architectures/ilsdi/schemas/1.1/dlfexpanded.xsd"><dlf:record><dlf:bibliographic id="20000"/><dlf:items><dlf:item id="20000"><dlf:simpleavailability><dlf:identifier>20000</dlf:identifier><dlf:availabilitystatus>unknown</dlf:availabilitystatus><dlf:availabilitymsg>Error: could not retrieve availability for this ID</dlf:availabilitymsg></dlf:simpleavailability></dlf:item></dlf:items></dlf:record></dlf:collection>

What do you think?

return_type doesn't seem to be implemented as well?