[OPEN-ILS-DEV] Patch: Add renew support in SIP driver for 3M machines

Dan Scott dan at coffeecode.net
Thu Jan 21 23:04:21 EST 2010


Despite having added specific renew / renew response messages in SIP 2,
3M machines use the old SIP 1 method of renewing items by setting the
"SC renewal policy" flag of the checkout request (11) to 'Y'.

The Evergreen SIP server didn't support this method of renewing items,
so I set about trying to add support for it. The right way would
probably be to check the value of the $self->renew_ok flag inside
do_checkout, but for some reason I wasn't able to work that out in the
hour or so that I had to get this working on our self-checkout machine.

My next attempt was to take the value of $sc_renew as passed to the
O:A:SIP::checkout() method and pass that value to
O:A:SIP::Transaction::Checkout::do_checkout() as a new parameter. That
ended up always requesting a renewal - when I checked the incoming value
of $sc_renew, it was set to '89' which was a rather unexpected value
(although now that I think of it, that was probably the ASCII value of
'Y' - not sure why that was coming in rather than literal 'Y' but
whatever).

Anyway, the rough approach I took to making this work for now is:

  * check if the patron ID and the ID of the patron that currently has
the item checked out (if any) is the same
  * if yes, set $sc_renew to 1 to indicate that the ILS should actually
request a renewal
  * if no, then set $sc_renew to 0 to say "regular checkout, please"
  * then call do_checkout($sc_renew); inside do_checkout(), we invoke
either the renew operation or the checkout operation depending on the
value of $sc_renew

I've attached the patch (against rel_1_6_0, but would apply with a few
offsets against trunk) in case anyone's interested. Now, a few thoughts
before I commit this:
  * I probably need to check the config policy to ensure that we want
the ACS to issue a renewal if the current borrower ID and patron ID are
the same (AND the policy value with the result of that test before
setting $sc_renew to 1).
  * Any thoughts about why $sc_renew is arriving as an ASCII value in
SIP::Checkout rather than a character string? Fixing this would be the
right thing to do in the long run, but right now I'm satisfied just to
get the renewal functionality working.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: renew.diff
Type: text/x-patch
Size: 4483 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20100121/138487dd/attachment.bin 


More information about the Open-ils-dev mailing list