[Koha-bugs] [Bug 13930] Add supporting service svc/ncip for xnciptoolkit driver

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 10 18:14:46 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13930

--- Comment #4 from Jiří Kozlovský <mail at jkozlovsky.cz> ---
To apply this patch, you have to create NCIP folder inside C4 with these
modules:
https://github.com/jirislav/Koha/tree/master/C4/NCIP
then add two new subroutines into C4::Reserves (GetReserveCountFromItemnumber &
GetReserveFromBorrowernumberAndItemnumber): 
https://github.com/jirislav/Koha/blob/master/C4/Reserves.pm
then finally create svc/ncip:
https://github.com/jirislav/Koha/blob/master/svc/ncip 


Test plan is as follows:
1. Apply the patch
2. Use json validator on all responses (except when status code isn't 200 OK)
(e.g http://jsonlint.com/) to check the json is valid
3. Try this URLs with your own parameters, check the response is appropriate to
your data :
    Get patron:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_user&userId=<your_patron_id>
(returns basic user data)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_user&userId=<your_patron_id>&loanedItemsDesired&notUserInfo
(returns only items issued by user)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_user&userId=<your_patron_id>&requestedItemsDesired&notUserInfo
(returns only items requested by user)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_user&userId=<your_patron_id>&userFiscalAccountDesired&notUserInfo
(returns only user's transactions - fees etc)
        - notUserInfo says to omit user's info & all parameters can be joined
together as follows:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_user&userId=<your_patron_id>&loanedItemsDesired&requestedItemsDesired&userFiscalAccountDesired&notUserInfo

4. repeat 2.-3. for these URLs:
    Get an item:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item&itemId=<item_number>
(returns basic item data)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item&itemId=<item_number>&holdQueueLengthDesired&notItemInfo
(returns hold queue length - number of reserves placed on item)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item&itemId=<item_number>&circulationStatusDesired&notItemInfo
(returns NCIP formatted circulation status - can be 'Available On Shelf' etc..
all possible values are specified here:
https://github.com/moravianlibrary/xcncip2toolkit/blob/master/core/trunk/service/src/main/java/org/extensiblecatalog/ncip/v2/service/Version1CirculationStatus.java)
        - notItemInfo again says to omit item's info & all params can be
joined:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item&itemId=<item_id>&circulationStatusDesired&holdQueueLengthDesired&notItemInfo

5. repeat 2.-3. for these URLs:
    Get biblio with items:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item_set&bibId=<biblio_id>
(returns bibliographic information & items belonging to this biblio)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item_set&bibId=<biblio_id>&holdQueueLengthDesired&notBibInfo
(returns items belonging to specified biblio & each item now has element
'holdQueueLength' with number of reserves placed on it)
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item_set&bibId=<biblio_id>&circulationStatusDesired&notBibInfo
(returns items of biblio & each item has additional 'circulationStatus' defined
before)
        - notBibInfo again says to omit biblio's info & all params can be
joined:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_item_set&bibId=<biblio_id>&holdQueueLengthDesired&circulationStatusDesired&notBibInfo

6. repeat 2.-3. for these URLs:
    Place reserve as patron on item & write down it's 'reserve_id':
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=request_item&userId=<your_patron_id>&itemId=<item_number>&pickupExpiryDate=<date_in_format:DD/MM/YYYY>&earliestDateNeeded=<date_in_format:DD/MM/YYYY>
        - please note that pickupExpiryDate & earliestDateNeeded are optional
params .. but should be checked if were properly processed

    Place reserve as patron on biblio & write down it's 'reserve_id':
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=request_item&userId=<your_patron_id>&bibId=<biblio_id>
        -  pickupExpiryDate & earliestDateNeeded could be specified here too

    Lookup those reserves using reserve ids you have written down:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_request&requestId=<reserve_id>

    Get reserve from patron & item number:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=lookup_request&userId=<your_patron_id>&itemId=<item_number>

    Cancel reserve by reserve_id & user_id:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=cancel_request_item&requestId=<request_number>&userId=<your_patron_id>

    Cancel reserve by item_id & user_id:
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=cancel_request_item&itemId=<item_number>&userId=<your_patron_id>

    Now check both reserves were properly cancelled ..

7. repeat 2.-3. for these URLs:
    Renew patron's loan (first manually do a checkout to a user ..):
   
http://intranet:8080/cgi-bin/koha/svc/ncip?service=renew_item&itemId=<item_number>&userId=<your_patron_id>&desiredDateDue=<date_in_format:DD/MM/YYYY>
        - desiredDateDue param is optional & if it is bigger than the date
generated from koha's config, than is used the generated one

That should be all .. If you experience any problems don't hesitate to contact
me at mail at jkozlovsky.cz

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list