Info- This info is for the initial uploaded version, 2008-02-27a_borrowdirect_api.zip.
- This version will be replaced by a WAR file, but I wanted to get this up without delay because folk have been asking about it for a while now. (This entire repository will be replaced by a Brown University Library Software anonymous-checkout subversion repository in the future.)
- The one thing you'll need to do is create a PrefsLocal.java class (see the PrefsLocalSample.java class). This is the file that will hold the customized configuration settings for each institution. We can talk elsewhere about why I'm not using the web.xml file for this.
- After that, pop this webapp into Tomcat or the webapp container of your choice and the code should just run; you can try it via a url (but POST is better in production so as not to expose parameters) like: http://127.0.0.1:8080/jws_borrowdirect?barcode=123456789&isbn=01234567890123&action=request
- There is still a bit of extraneous stuff in the code, because this code was initially part of a bigger web-app that could accept a service-parameter and, depending on that parameter, tunnel into other consortial catalogs. Example: since this tunneler is only for the Borrow-Direct service, the service parameter is no longer needed, but references to it still remain in a few places.
- It has occurred to me that some institutions don't use a patron_barcode, but use some other identifier. Please substitute your identifier for the barcode (but for now use the barcode parameter name in the url) and let me know if it works.
- We have an iii ILS; let me know how the code works in other systems.
- I find the included junit tests invaluable. Note that the ones testing for an item held locally will have to be customized or commented out -- eventually I'd like to have all such customization handled by the PrefsLocal.java class.
- Regarding the tests, also NOTE that there is one test that will really generate a request (with the right submitted info)!
- Rats -- I just realized that one of the options which needs to be customized is the individual library code, which I have hardcoded into the RequestManager_Result.runLogic() method. Search for 'ENTEREDLIB=BROWN'. I'll of course put that into PrefsLocal.java, too. You can find out what your library code is by manually going into BorrowDirect with a browser and looking at the html-source.
- Note that this is being released under the LGPL license. That's for the Brown code -- for convenience this download includes the HttpUnit library, as well as utilizes other standard libraries, each of which, of course, has its own open-source-flavored license.
- Enjoy! This API, in conjunction with others, has allowed us to build some very cool automated services.
|