‡biblios supports the use of plugins to extend its functionality. As of this writing, there is one plugin available for sending records to a Koha instance. This document is intended to document how to develop a plugin for sending records to another web application.
Send plugin API
Plugins to send records from ‡biblios to another web application should be javascript objects which adhere to the following API:
init(url, name, user, password, embedded)
Initialize the plugin with connection and authentication parameters.
Method parameters:
- url: url to send AJAX requests to
- name: name of the web application as referenced by ‡biblios
- user: user ‡biblios will attempt to authenticate as
- password: password to use in authentication
- embedded: boolean telling the plugin whether ‡biblios is embedded in the web application
auth()
Attempt to authenticate to the web application using the credentials passed in the init() method.
If authorization is successful:
Set sessionStatus instance method.
Runs bibprofile() method.
Runs initHandler callback method set by caller.
On error, set sessionStatus instance method.
bibprofile()
Retrieves the bibprofile (see send api).
On success, sets the following instance variables from the bib profile received from the web application.
- recidXpath
- mandatory_tags
- mandatory_subfields
- reserved_tags
- special_entries
Runs the bibProfileHandler set by caller.
retrieve(recid)
Method to retrieve a particular recid and call the retrieveHandler callback function (set by caller).
On success, call retrieveHandler callback with returned xml document.
save(xmldoc)
Save the passed xml document to the web application.
On success call saveHandler callback set by caller.