[OPEN-ILS-DEV] Patch: Add renew support in SIP driver for 3M machines
Dan Scott
denials at gmail.com
Fri Jan 22 22:02:27 EST 2010
On 21 January 2010 23:04, Dan Scott <dan at coffeecode.net> wrote:
> 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 slf-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.
FWIW, I've committed this.
--
Dan Scott
Laurentian University
More information about the Open-ils-dev
mailing list