Direct database lookup would be an option, but I want to build an API only driver first and then probably an API+SQL driver later.

I want it to be the reverse of the HorizonXMLAPI driver where the SQL is primary and the XML API is secondary. It's always safer to pass things through the API because that's what it's designed for.

On Tue, Jun 26, 2012 at 11:26 AM, Demian Katz <demian.katz@villanova.edu> wrote:

I think you’re right – the .ini file fallback list is probably your best bet unless there is some tricky way (i.e. direct database lookup) to get the full list.

 

- Demian

 

From: Jay Roos [mailto:jayroos@gmail.com]
Sent: Tuesday, June 26, 2012 12:21 PM
To: Demian Katz
Cc: vufind-tech@lists.sourceforge.net
Subject: Re: [VuFind-Tech] Why is getPickUpLocations called from MyResearch/Holds?

 

Unfortunately the API absolutely requires a titleKey to be passed or it returns an error. It makes a lot of sense because for some libraries the pickup locations are very specific to the item and borrower combination.

 

Unfortunately, I don't think caching a value will be a good option for some libraries and I want to keep the driver generic enough for anyone. I think I'll probably end up using a similar approach to the HorizonXMLAPI driver where the list is specified in the .ini file. I would then use those values as a fall back for cases where no titleKey is available.

 

I'm open to other suggestions though.

 

On Fri, Jun 22, 2012 at 8:46 AM, Demian Katz <demian.katz@villanova.edu> wrote:

All of the parameters to getPickUpLocations are optional.  The idea is that they are meant to be used as filters -- if you pass none in, you get all possible pickup locations.  If you pass in patron and/or item information, you only get locations that are legal for that patron and/or item.  The reason getPickUpLocations is called by MyResearch/Holds is that it returns a map of internal location IDs to user-readable strings.  That map needs to be used to translate location codes in the hold arrays into display strings for the user.

What kind of ID does the API require?  Could you possibly cache the last good value inside the driver and use that if no external value is passed in?

- Demian


From: Jay Roos [jayroos@gmail.com]
Sent: Thursday, June 21, 2012 5:27 PM
To: vufind-tech@lists.sourceforge.net
Subject: [VuFind-Tech] Why is getPickUpLocations called from MyResearch/Holds?

I'm having some trouble writing a getPickUpLocations function because the API requires and ID to be passed to be a valid request. That's fine when someone is actually placing a request, but it fails on MyResearch/Holds because it's called without an ID.

 

I'm wondering what the purpose is in calling it from MyResearch/Holds? Any ideas how I might work around it besides creating a static list of locations?

 

--
Jay Roos
Computer & Information Systems Coordinator
Great River Regional Library
1300 W. St. Germain
St. Cloud, MN 56301



 

--
Jay Roos
Computer & Information Systems Coordinator
Great River Regional Library
1300 W. St. Germain
St. Cloud, MN 56301
(320) 650-2534




--
Jay Roos
Computer & Information Systems Coordinator
Great River Regional Library
1300 W. St. Germain
St. Cloud, MN 56301
(320) 650-2534