About Features Downloads Getting Started Documentation Events Support GitHub

Site Tools


development:plugins:ils_drivers

ILS Drivers

This page refers to VuFind 2.x and later; use of earlier versions is no longer recommended.

This page contains details on writing a custom driver for an integrated library system not already supported by VuFind. VuFind supports many platforms, so check to see if it already has support before you try to write your own!

Key Plugin Details

Default Namespace: \VuFind\ILS\Driver

Interface: \VuFind\ILS\Driver\DriverInterface

Service Locator Configuration Section in module.config.php: ['vufind']['plugin_managers']['ils_driver']

Service Manager Name for Service Locator: VuFind\ILSDriverPluginManager (VuFind 2.x-4.x), VuFind\ILS\Driver\PluginManager (VuFind 5.0+)

See the General Plugin Information page for more details on VuFind plugins.

Basic Structure

  • The PHP driver class must be registered in the service locator with the value used as the driver setting in the [Catalog] section of config.ini.
  • The driver class must implement the VuFind\ILS\Driver\DriverInterface. For convenience, most drivers will achieve this by extending VuFind\ILS\Driver\AbstractBase.
  • You may wish to define a catalog-specific .ini file in VuFind's configuration directory – the name of this file should correspond with the base class name of the driver (i.e. for VuFind\ILS\Driver\Voyager, use Voyager.ini). This configuration will be automatically loaded and sent to the setConfig() method by the VuFind\ILS\Connection wrapper class; you do not need to write explicit config loading into your driver.
  • All heavy-weight initialization logic (i.e. establishing database connections) and configuration validation should take place in the init() method, NOT the constructor. Driver constructors should be as light-weight as possible.

Key Methods

ILS Drivers must contain some or all of the following methods (optional methods are marked as such in their descriptions). It should be assumed that any method may throw a VuFind\Exception\ILS object in case of an unexpected problem.

cancelHolds

This method cancels a list of holds for a specific patron. (optional) Not supported prior to VuFind 1.2

  • Input: cancelDetails An associative array with two keys: patron (array returned by the driver's patronLogin method) and details (an array of strings returned by the driver's getCancelHoldDetails method)
  • Output: Associative array containing:
    • count – The number of items successfully cancelled
    • items – Associative array where key matches one of the item_id values returned by getMyHolds and the value is an associative array with these keys:
      • success – Boolean true or false
      • status – A status message from the language file (required – VuFind-specific message, subject to translation)
      • sysMessage - A system supplied failure message (optional – useful for passing additional details from the ILS)

cancelILLRequests

This method cancels a list of ILL requests for a specific patron. (optional) Not supported prior to VuFind 2.3

  • Input: cancelDetails An associative array with two keys: patron (array returned by the driver's patronLogin method) and details (an array of strings returned by the driver's getCancelILLRequestDetails method)
  • Output: Associative array containing:
    • count – The number of items successfully cancelled
    • items – Associative array where key matches one of the item_id values returned by getMyILLRequests and the value is an associative array with these keys:
      • success – Boolean true or false
      • status – A status message from the language file (required – VuFind-specific message, subject to translation)
      • sysMessage - A system supplied failure message (optional – useful for passing additional details from the ILS)

cancelStorageRetrievalRequests

This method cancels a list of storage retrieval requests for a specific patron. (optional) Not supported prior to VuFind 2.3

  • Input: cancelDetails An associative array with two keys: patron (array returned by the driver's patronLogin method) and details (an array of strings returned by the driver's getCancelStorageRetrievalRequestDetails method)
  • Output: Associative array containing:
    • count – The number of items successfully cancelled
    • items – Associative array where key matches one of the item_id values returned by getMyStorageRetrievalRequests and the value is an associative array with these keys:
      • success – Boolean true or false
      • status – A status message from the language file (required – VuFind-specific message, subject to translation)
      • sysMessage - A system supplied failure message (optional – useful for passing additional details from the ILS)

changePassword

This method changes patron's password (PIN code). (optional) Not supported prior to VuFind 2.4

  • Input: details An associative array with three keys:
    • patron - The patron array from patronLogin
    • oldPassword - Old password
    • newPassword - New password
  • Output: Associative array containing:
    • success – Boolean true or false
    • status – A status message from the language file (required – VuFind-specific message, subject to translation)

checkILLRequestIsValid

Not supported prior to VuFind 2.3

This optional method can be used to check if a particular user is allowed to place an ILL request on a particular item. If you omit this method, the driver will still operate correctly; however, implementing it allows minor enhancements to the user experience.

  • Input: Bibliographic ID, Item Data (similar to the details parameter passed to the placeILLRequest() method, but without the 'patron' key), Patron Data (from patronLogin() method)
  • Output: True if item may be requested, false if not. Prior to VuFind 4.0, this might also return “block” if the patron is blocked from making requests; that functionality has been superseded by the getRequestBlocks method. Starting with VuFind 4.0, this may also return an array with two keys: valid (boolean) plus status (message string to display to user).

checkRequestIsValid

Introduced in VuFind 1.3, this optional method can be used to check if a particular user is allowed to place a hold/recall request on a particular item. If you omit this method, the driver will still operate correctly; however, implementing it allows minor enhancements to the user experience.

  • Input: Bibliographic ID, Item Data (similar to the holdDetails parameter passed to the placeHold() method, but without the 'patron' key), Patron Data (from patronLogin() method)
  • Output: True if item may be requested, false if not. Starting with VuFind 4.0, this may also return an array with two keys: valid (boolean) plus status (message string to display to user).

checkStorageRetrievalRequestIsValid

Not supported prior to VuFind 2.3

This optional method can be used to check if a particular user is allowed to place a storage retrieval request on a particular item. If you omit this method, the driver will still operate correctly; however, implementing it allows minor enhancements to the user experience.

  • Input: Bibliographic ID, Item Data (similar to the details parameter passed to the placeStorageRetrievalRequest() method, but without the 'patron' key), Patron Data (from patronLogin() method)
  • Output: True if item may be requested, false if not. Prior to VuFind 4.0, this might also return “block” if the patron is blocked from making requests; that functionality has been superseded by the getRequestBlocks method. Starting with VuFind 4.0, this may also return an array with two keys: valid (boolean) plus status (message string to display to user).

findReserves

This method returns items that are on reserve for the specified course, instructor and/or department.

  • Input: CourseID, InstructorID, DepartmentID (these values come from the corresponding getCourses, getInstructors and getDepartments methods; any of these three filters may be set to a blank string to skip)
  • Output: An array of associative arrays representing reserve items. Array keys:
    • BIB_ID - The record ID of the current reserve item.
    • COURSE_ID - The course ID associated with the current reserve item, if any (required when using Solr-based reserves).
    • DEPARTMENT_ID - The department ID associated with the current reserve item, if any (required when using Solr-based reserves).
    • INSTRUCTOR_ID - The instructor ID associated with the current reserve item, if any (required when using Solr-based reserves).
    • DISPLAY_CALL_NO - The call number of the current reserve item (never used; deprecated).
    • AUTHOR - The author of the current reserve item (never used; deprecated).
    • TITLE - The title of the current reserve item (never used; deprecated).
    • PUBLISHER - The publisher of the current reserve item (never used; deprecated).
    • PUBLISHER_DATE - The publication date of the current reserve item (never used; deprecated).

getAccountBlocks

This optional method returns an array of strings describing blocks on the user's account (for example, lost items, financial violations, etc.). If no blocks are in place, it returns false. Not supported prior to VuFind 4.0

  • Input: patron (array returned by the driver's patronLogin method)
  • Output: array or false

getCancelHoldDetails

This method returns a string to use as the input form value for cancelling each hold item. (optional, but required if you implement cancelHolds). Not supported prior to VuFind 1.2

  • Input: holdDetails - One of the individual item arrays returned by the getMyHolds method
  • Output: A string to use as the input form value for cancelling each hold item; you can pass any data that is needed by your ILS to identify the hold – the output of this method will be used as part of the input to the cancelHolds method. Starting with VuFind 3.0, you may indicate holds which are not allowed to be cancelled by returning an empty string.

This method returns a URL to use as a link to a native OPAC for cancelling each hold item. (optional – only implement this if your ILS is unable to support implementation of the cancelHolds method). Not supported prior to VuFind 1.2

  • Input: holdDetails - One of the individual item arrays returned by getMyHolds method
  • Output: A URL to a native OPAC for cancelling each hold item

getCancelILLRequestDetails

This method returns a string to use as the input form value for cancelling each hold item. (optional, but required if you implement cancelILLRequests). Not supported prior to VuFind 2.3

  • Input: details - One of the individual item arrays returned by the getMyILLRequests method
  • Output: A string to use as the input form value for cancelling each request; you can pass any data that is needed by your ILS to identify the request – the output of this method will be used as part of the input to the cancelILLRequests method.

getCancelStorageRetrievalRequestDetails

This method returns a string to use as the input form value for cancelling each hold item. (optional, but required if you implement cancelStorageRetrievalRequests). Not supported prior to VuFind 2.3

  • Input: details - One of the individual item arrays returned by the getMyStorageRetrievalRequests method
  • Output: A string to use as the input form value for cancelling each request; you can pass any data that is needed by your ILS to identify the request – the output of this method will be used as part of the input to the cancelStorageRetrievalRequests method.

getConfig

This method returns driver configuration settings related to a particular function. It is primarily used to get the configuration settings for placing holds. (optional, but necessary if you want to implement hold or other request functionality) Not supported prior to VuFind 1.2

  • Input:
    • A string corresponding with the function to check (“cancelHolds”, “Holds”, “Renewals”; from v2.3: “cancelStorageRetrievalRequests”, “storageRetrievalRequests”, “cancelILLRequests”, “ILLRequests”); from v2.4: “changePassword”
    • From 2.4: An optional string (record or patron id) or an array of function-specific parameters
  • Output: An associative array of configuration settings
    • Array keys used for input of “cancelHolds”, “cancelStorageRetrievalRequests” (from v2.3) and “cancelILLRequests” (from v2.3)
      • No required keys at this time
  • Array keys used for input of “Holds”
    • HMACKeys - a colon-separated list of fields to verify with a hash key when submitting a hold form (at a minimum, “id” is recommended). Note that this is used for verifying VuFind's own hold form; it is not directly tied to the ILS in any way. MUST BE PROVIDED in order to place holds within VuFind; if omitted, VuFind will attempt to fail over from placeHold to placeHoldLink functionality. This also serves another important purpose: any keys in the return array from getHolding will be passed to placeHold if they match entries in this list. This makes it possible to pass through all of the the necessary details about placing a hold.
    • extraHoldFields (optional) - a colon-separated list of form fields to include in the place hold form; may include “comments”, “requiredByDate” and “pickUpLocation”. Note that all parameters activated here must be processed by the placeHold method.
    • defaultRequiredDate - A colon-separated list used to set the default “not required after” date for holds in the format days:months:years (e.g. 0:1:0 will set a “not required after” date of 1 month from the current date).
      • This only applies if extraHoldFields includes “requiredByDate.”
      • Starting with VuFind 2.3, you may prefix this string with “driver:” to attempt to load a default date from the ILS based on internal rules instead of calculating one in VuFind; if the ILS calls, the relative rules will still be used (e.g. “driver:0:1:0”); this feature requires that the driver implement the getHoldDefaultRequiredDate() method.
    • consortium (optional) - Boolean true or false (default): Does this driver provide consortial capabilities (e.g., XCNCIP2 driver)? If set to true, then the driver method getConsortialHoldings() will be called in order to to provide multiple Holding statuses in a consortial environment; this feature requires that the driver implement the getConsortialHoldings() method. If set to false (or omitted), the getHolding() method will be called.
  • Array keys used for input of “Renewals”
    • No required keys at this time
  • Array keys used for input of “StorageRetrievalRequests” (from v2.3)
    • HMACKeys - a colon-separated list of fields to verify with a hash key when submitting a hold form (at a minimum, “id” is recommended). Note that this is used for verifying VuFind's own request form; it is not directly tied to the ILS in any way. MUST BE PROVIDED in order to place requests within VuFind. This also serves another important purpose: any keys in the return array from getHolding will be passed to placeStorageRetrievalRequest if they match entries in this list. This makes it possible to pass through all of the the necessary details about placing a request.
    • extraFields (optional) - a colon-separated list of form fields to include in the request form; may include “comments”, “requiredByDate”, “pickUpLocation” and “item-issue”. Note that all parameters activated here must be processed by the placeStorageRetrievalRequest method.
    • defaultRequiredDate - A colon-separated list used to set the default “not required after” date for requests in the format days:months:years (e.g. 0:1:0 will set a “not required after” date of 1 month from the current date).
      • This only applies if extraFields includes “requiredByDate.”
    • helpText - A generic help text displayed on the request form.
    • helpText[lng] - A language-specific help text displayed on the request form.
  • Array keys used for input of “ILLRequests” (from v2.3)
    • HMACKeys - a colon-separated list of fields to verify with a hash key when submitting a hold form (at a minimum, “id” is recommended). Note that this is used for verifying VuFind's own request form; it is not directly tied to the ILS in any way. MUST BE PROVIDED in order to place requests within VuFind. This also serves another important purpose: any keys in the return array from getHolding will be passed to placeILLRequest if they match entries in this list. This makes it possible to pass through all of the the necessary details about placing a request.
    • extraFields (optional) - a colon-separated list of form fields to include in the request form; may include “comments”, “requiredByDate”, “pickUpLocation”, “pickUpLibrary”, “pickUpLibraryLocation” and “itemId”. “pickUpLibraryLocation” is a special dynamic field that is populated based on “pickUpLibrary” using the getILLPickupLocations() method, which must be implemented by the ILS driver. Note that all parameters activated here must be processed by the placeILLRequest method.
    • defaultRequiredDate - A colon-separated list used to set the default “not required after” date for requests in the format days:months:years (e.g. 0:1:0 will set a “not required after” date of 1 month from the current date).
      • This only applies if extraFields includes “requiredByDate.”
    • helpText - A generic help text displayed on the request form.
    • helpText[lng] - A language-specific help text displayed on the request form.
  • Array keys used for input of “changePassword” (from v2.4)
    • minLength - Minimum length for a new password
    • maxLength - Maximum length for a new password

getConsortialHoldings

This optional method (see getConfig()) queries the ILS for consortial holding information.

  • Input: RecordID, output of patronLogin (so that patron-specific data may be added to the return array), an array of RecordIDs (consortial “source records” for RecordID)
  • Output: The same as described in getHolding().

getCourses

This method queries the ILS for a list of courses to be used as input to the findReserves method (Optional)

  • Output: An associative array with key = course ID, value = course name.

getDefaultPickUpLocation

This method returns the default pick up location code or id for use when placing holds and other requests. (optional) Not supported prior to VuFind 1.2

  • Input: Patron array returned by patronLogin method (optional), hold information array similar to placeHold's input (optional, provided only when user is in the process of placing a hold – may be used to limit the available pickup options based on item ID, etc.; not supported prior to VuFind 1.3)
  • Output: A pick up location id or code (string); starting with VuFind 2.3, this may also return false to force the user to choose a location.

getDepartments

This method queries the ILS for a list of departments to be used as input to the findReserves method (Optional)

  • Output: An associative array with key = department ID, value = department name.

getFunds

Get a list of funds that can be used to limit the “new item” search. Note that “fund” may be a misnomer – if funds are not an appropriate way to limit your new item results, you can return a different set of values from this function. For example, you might just make this a wrapper for getDepartments(). The important thing is that whatever you return from this function, the IDs can be used as a limiter to the getNewItems() function, and the names are appropriate for display on the new item search screen. If you do not want or support such limits, just return an empty array here and the limit control on the new item search screen will disappear.

  • Output: An associative array with key = fund ID, value = fund name.

IMPORTANT: The return value for this method changed in r2184. If you are using VuFind 1.0RC2 or earlier, this function returns a flat array of options (no ID-based keys), and empty return values may cause problems. It is recommended that you update to newer code before implementing the new item feature in your driver.

getHoldDefaultRequiredDate

Get Default “Hold Required By” Date (optional). Not supported until VuFind 2.3.

  • Input: Patron array returned by patronLogin method (optional), hold information array similar to placeHold's input (optional, provided only when user is in the process of placing a hold – may be used to limit the available pickup options based on item ID, etc.; must never add new options to the return array – may only be used as a limiter; not supported prior to VuFind 1.3)
  • Output: Unix timestamp (or null if no date available)

getHolding

This method queries the ILS for holding information.

  • Input: RecordID, output of patronLogin (so that patron-specific data may be added to the return array)
  • Output: Returns an array of associative arrays, one for each item attached to the specified bibliographic record. Each associative array contains these keys:
    • id - the RecordID that was passed in
    • availability - boolean: is the item available (i.e. on the shelf and/or available for checkout)?
    • status - string describing the availability status of the item
    • location - string describing the physical location of the item. Note: prior to VuFind 1.3, some drivers HTML entity encoded this string; that is incorrect behavior in VuFind 1.3 or later – this should be plain text, not HTML.
    • locationhref - a URL to link the location name to. (optional, introduced in VuFind 2.5)
    • reserve - string indicating “on reserve” status – legal values: 'Y' or 'N'
    • callnumber - the call number of this item
    • duedate - string showing due date of checked out item (null if not checked out)
    • returnDate - A string showing return date of an item (false if not recently returned)
    • number - the copy number for this item (note: although called “number”, this may actually be a string if individual items are named rather than numbered – the value will be used in displays to distinguish between copies within a list)
    • enumchron - enumeration / chronology data about the current copy (i.e. volume number and/or year); introduced in VuFind 5.0 to separate this detailed information from the simple number field above.
    • requests_placed – The total number of holds and recalls placed on an item (optional)
    • barcode - the barcode number for this item (important: even if you do not have access to real barcode numbers, you may want to include dummy values, since a missing barcode will prevent some other item information from displaying in the VuFind interface).
    • notes - an array of notes associated with holdings (optional; deprecated in VuFind 3.0 in favor of holdings_notes)
    • holdings_notes - an array of notes associated with holdings record containing the current item (optional; introduced in VuFind 3.0)
    • item_notes - an array of notes associated with the current item (optional; introduced in VuFind 3.0)
    • summary - an array of summary information strings associated with holdings (optional)
    • supplements - an array of strings about supplements associated with holdings (optional, introduced in VuFind 2.3)
    • indexes - an array of strings about indexes associated with holdings (optional, introduced in VuFind 2.3)
    • is_holdable – whether or not ANY user can place a hold or recall on the item – allows system administrators to determine hold behaviour (optional)
    • holdtype – the type of hold to be placed – of use for systems with multiple hold types such as “hold” or “recall”. Prior to VuFind 4.0, a value of “block” will inform the user that they cannot place a hold on the item due to account blocks (optional); starting in 4.0, the “block” value was replaced with the separate getRequestBlocks method.
    • addLink – whether not the CURRENT user can place a hold or recall on the item – for use with drivers which can determine hold logic based on patron data; normally a boolean, but until VuFind 4.0 may be set to the special value of “block” to indicate a user permission problem (optional; starting in 4.0, use the getRequestBlocks method instead). Starting with VuFind 1.3, you can also use the special value of “check” which will trigger an AJAX call against the checkRequestIsValid() method to allow complex link rules to be evaluated without holding up the main page load.
    • item_id - the item (as opposed to bibliographic) identifier (optional)
    • holdOverride - Starting with VuFind 1.3, you can use this value to override the usual config.ini Catalog:holds_mode setting on an item-by-item basis; useful for local customizations but not recommended for generic shared driver code. Also note that this feature only works when the Catalog:allow_holds_override setting is turned on in config.ini.
    • addStorageRetrievalRequestLink - Starting with VuFind 2.3, you can use this value to indicate availability of storage retrieval requests. See addLink above for valid values. If “check” is returned, the driver must implement the checkStorageRetrievalRequestIsValid() method. See also getConfig and other storage retrieval request methods. At least placeStorageRetrievalRequest() must be implemented.
    • addILLRequestLink - Starting with VuFind 2.3, you can use this value to indicate availability of Inter-Library Loan (ILL) requests. See addLink above for valid values. If “check” is returned, the driver must implement the checkILLRequestIsValid() method. See also getConfig and other ILL request methods. At least placeILLRequest() must be implemented.
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr, introduced in VuFind 2.4)
    • use_unknown_message - An optional boolean that, when set to true, will cause display of a message indicating that the status of the item is unknown.
    • services - Starting with VuFind 3.0, this value can be used to indicate availability services (loan, presence). For now, 'services' is only used by code calling getStatus(), not getHolding(), but setting it here as well will not hurt anything and may be useful for future enhancements. See the getStatus() documentation for more details.

getHoldings -- DEPRECATED

This method queries the ILS for holding information on multiple records at once

  • Input: Array of RecordIDs
  • Output: Returns an array of associative arrays, each the return value of getHolding for one of the input RecordIDs. The indexing of this array does not necessarily correspond with the input index values; to find a specific record, you should loop through and check “id” values.

This method returns a URL that links into the ILS to allow the patron to place a hold. Optional – should only be defined when the placeHold method cannot be implemented due to ILS limitations.

  • Input: Bibliographic Record ID, Item details array from getHolding (second parameter is optional and was introduced in VuFind 1.2; starting with VuFind 1.4, it is also possible that the second parameter will contain a 'level' key set to 'title' instead of item information for cases where a user has explicitly requested a title-level hold)
  • Output: Link to legacy OPAC for placing hold (or null if no hold link is available for this item).

getILLPickupLibraries

Not supported prior to VuFind 2.3

This method must be implemented if “pickUpLibrary” is specified in extraFields of getConfig('ILLRequests').

  • Input: Bibliographic ID, Patron Data (from patronLogin() method)
  • Output: An array of associative arrays containing:
    • id - Pick up library ID
    • name - Display name for the library
    • isDefault - Whether this is the default pick up library

getILLPickupLocations

Not supported prior to VuFind 2.3

This method must be implemented if “pickUpLibraryLocation” is specified in extraFields of getConfig('ILLRequests').

  • Input: Bibliographic ID, Pick up library ID (from getILLPickupLibraries()), Patron Data (from patronLogin() method)
  • Output: An array of associative arrays containing:
    • id - Pick up library ID
    • name - Display name for the library
    • isDefault - Whether this is the default pick up library

getInstructors

This method queries the ILS for a list of instructors to be used as input to the findReserves method (Optional)

  • Output: An associative array with key = instructor ID, value = instructor name.

getMyFines

This method queries the ILS for a patron's current fines

  • Input: Patron array returned by patronLogin method
  • Output: Returns an array of associative arrays, one for each fine associated with the specified account. Each associative array contains these keys:
    • amount - The total amount of the fine IN PENNIES. Be sure to adjust decimal points appropriately (i.e. for a $1.00 fine, amount should be set to 100).
    • checkout - A string representing the date when the item was checked out.
    • fine - A string describing the reason for the fine (i.e. “Overdue”, “Long Overdue”).
    • balance - The unpaid portion of the fine IN PENNIES.
    • createdate – A string representing the date when the fine was accrued (optional)
    • duedate - A string representing the date when the item was due.
    • id - The bibliographic ID of the record involved in the fine.
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr). Introduced in VuFind 2.4.

getMyHolds

This method queries the ILS for a patron's current holds

  • Input: Patron array returned by patronLogin method
  • Output: Returns an array of associative arrays, one for each hold associated with the specified account. Each associative array contains these keys:
    • type - A string describing the type of hold – i.e. hold vs. recall (optional).
    • id - The bibliographic record ID associated with the hold (optional).
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr). Introduced in VuFind 2.4.
    • location - A string describing the pickup location for the held item (optional). In VuFind 1.2, this should correspond with a locationID value from getPickUpLocations. In VuFind 1.3 and later, it may be either a locationID value or a raw ready-to-display string.
    • reqnum - A control number for the request (optional).
    • expire - The expiration date of the hold (a string).
    • create - The creation date of the hold (a string).
    • position – The position of the user in the holds queue (optional)
    • available – Whether or not the hold is available (true) or not (false) (optional)
    • in_transit - If in transit, either boolean true or a string describing the destination location; false otherwise. (optional)
    • last_pickup_date - A string representing the deadline for picking up the item; ignored unless available (above) is set to true (optional – introduced in release 5.1)
    • item_id – The item id the request item (optional).
    • volume – The volume number of the item (optional)
    • publication_year – The publication year of the item (optional)
    • title - The title of the item (optional – only used if the record cannot be found in VuFind's index).
    • isbn - An ISBN for use in cover image loading (optional – introduced in release 2.3)
    • issn - An ISSN for use in cover image loading (optional – introduced in release 2.3)
    • oclc - An OCLC number for use in cover image loading (optional – introduced in release 2.3)
    • upc - A UPC for use in cover image loading (optional – introduced in release 2.3)
    • cancel_details - The cancel token, or a blank string if cancel is illegal for this hold; if omitted, this will be dynamically generated using getCancelHoldDetails(). You should only fill this in if it is more efficient to calculate the value up front; if it is an expensive calculation, you should omit the value entirely and let getCancelHoldDetails() do its job on demand. This optional feature was introduced in release 3.1.

getMyILLRequests

This method queries the ILS for a patron's current ILL requests. (optional) Not supported prior to VuFind 2.3

  • Input: Patron array returned by patronLogin method
  • Output: Returns an array of associative arrays, one for each request associated with the specified account. Each associative array contains these keys:
    • id - The bibliographic record ID associated with the request (optional).
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr). Introduced in VuFind 2.4.
    • location - A string describing the pickup location for the requested item (optional). It may be either a locationID value or a raw ready-to-display string.
    • reqnum - A control number for the request (optional).
    • expire - The expiration date of the request (a string).
    • create - The creation date of the request (a string).
    • position – The position of the user in the request queue (optional).
    • available – Whether or not the request is available for pickup (true) or not (false) (optional).
    • item_id – The item id the request item (optional).
    • volume – The volume number of the item (optional).
    • issue - The issue of the item (optional).
    • year – The publication year of the item (optional).
    • title - The title of the item (optional – only used if the record cannot be found in VuFind's index).
    • canceled - Boolean or date (string) indicating that the request has been canceled.
    • processed - Boolean or date (string) indicating that the request has been processed.
    • institution_name - Display name of the institution where the item was requested from (optional).
    • isbn - An ISBN for use in cover image loading (optional)
    • issn - An ISSN for use in cover image loading (optional)
    • oclc - An OCLC number for use in cover image loading (optional)
    • upc - A UPC for use in cover image loading (optional)

getMyProfile

This method queries the ILS for a patron's current profile information

  • Input: Patron array returned by patronLogin method
  • Output: An associative array with the following keys (all containing strings):
    • firstname
    • lastname
    • address1
    • address2
    • city (added in VuFind 2.3)
    • country (added in VuFind 2.3)
    • zip
    • phone
    • mobile_phone (added in VuFind 5.0)
    • group – i.e. Student, Staff, Faculty, etc.
    • expiration_date – account expiration date (added in VuFind 4.1)

getMyStorageRetrievalRequests

This method queries the ILS for a patron's current storage retrieval requests. (optional) Not supported prior to VuFind 2.3

  • Input: Patron array returned by patronLogin method
  • Output: Returns an array of associative arrays, one for each request associated with the specified account. Each associative array contains these keys:
    • id - The bibliographic record ID associated with the request (optional).
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr). Introduced in VuFind 2.4.
    • location - A string describing the pickup location for the requested item (optional). It may be either a locationID value or a raw ready-to-display string.
    • reqnum - A control number for the request (optional).
    • expire - The expiration date of the request (a string).
    • create - The creation date of the request (a string).
    • position – The position of the user in the request queue (optional).
    • available – Whether or not the request is available for pickup (true) or not (false) (optional).
    • item_id – The item id the request item (optional).
    • volume – The volume number of the item (optional).
    • issue - The issue of the item (optional).
    • year – The publication year of the item (optional).
    • title - The title of the item (optional – only used if the record cannot be found in VuFind's index).
    • canceled - Boolean or date (string) indicating that the request has been canceled.
    • processed - Boolean or date (string) indicating that the request has been processed.
    • institution_name - Display name of the institution where the request was made (optional).
    • isbn - An ISBN for use in cover image loading (optional)
    • issn - An ISSN for use in cover image loading (optional)
    • oclc - An OCLC number for use in cover image loading (optional)
    • upc - A UPC for use in cover image loading (optional)

getMyTransactionHistory

This method retrieves a patron's historic transactions (previously checked out items).

:!: The getConfig method must return a non-false value for this feature to be enabled. For privacy reasons, the entire feature should be disabled by default unless explicitly turned on in the driver's .ini file.

This feature was added in VuFind 5.0.

  • getConfig may return the following keys if the service supports paging on the ILS side:
    • max_results - Maximum number of results that can be requested at once. Overrides the config.ini Catalog section setting historic_loan_page_size.
    • page_size - An array of allowed page sizes (number of records per page)
    • default_page_size - Default number of records per page
  • getConfig may return also the following keys if the service supports sorting:
    • sort - An associative array where each key is a sort key and its value is a translation key
    • default_sort - Default sort key
  • Input: Patron array returned by patronLogin method and an array of optional parameters (keys = 'limit', 'page', 'sort').
  • Output: Returns an array of associative arrays containing some or all of these keys:
    • title - item title
    • checkoutDate - date checked out
    • dueDate - date due
    • id - bibliographic ID
    • barcode - item barcode
    • returnDate - date returned
    • publication_year - publication year
    • volume - item volume
    • institution_name - owning institution
    • borrowingLocation - checkout location
    • message - message about the transaction

getMyTransactions

This method queries the ILS for a patron's current checked out items

  • Starting with VuFind 5.1, getConfig may return the following keys if the service supports paging on the ILS side:
    • max_results - Maximum number of results that can be requested at once. Overrides the config.ini Catalog section setting historic_loan_page_size.
    • page_size - An array of allowed page sizes (number of records per page)
    • default_page_size - Default number of records per page
  • Starting with VuFind 5.1, getConfig may return also the following keys if the service supports sorting:
    • sort - An associative array where each key is a sort key and its value is a translation key
    • default_sort - Default sort key
  • Input: Patron array returned by patronLogin method, and (starting with VuFind 5.1) an optional array of parameters (keys = 'limit', 'page', 'sort')
  • Output: Starting with VuFind 5.1, may return an array with 'count' and 'records' keys, where 'count' is the total number of transactions available, and 'records' is the currently-requested page of results (in the format described below). Prior to 5.1, always returned an array of associative arrays, one for each item checked out by the specified account; this response format is still supported for drivers that do not allow pagination. Each associative array contains these keys:
    • duedate - The item's due date (a string).
    • dueTime - The item's due time (a string, optional).
    • dueStatus - A special status – may be 'due' (for items due very soon) or 'overdue' (for overdue items). (optional).
    • id - The bibliographic ID of the checked out item.
    • source - The search backend from which the record may be retrieved (optional - defaults to Solr). Introduced in VuFind 2.4.
    • barcode - The barcode of the item (optional).
    • renew - The number of times the item has been renewed (optional).
    • renewLimit - The maximum number of renewals allowed (optional - introduced in VuFind 2.3).
    • request - The number of pending requests for the item (optional).
    • volume – The volume number of the item (optional).
    • publication_year – The publication year of the item (optional).
    • renewable – Whether or not an item is renewable (required for renewals).
    • message – A message regarding the item (optional).
    • title - The title of the item (optional – only used if the record cannot be found in VuFind's index).
    • item_id - this is used to match up renew responses and must match the item_id in the renew response.
    • institution_name - Display name of the institution that owns the item (optional). Used e.g. with received interlibrary loans (ILL) if they are displayed in the checked out items list (e.g. UB Requests between Voyager libraries).
    • isbn - An ISBN for use in cover image loading (optional – introduced in release 2.3)
    • issn - An ISSN for use in cover image loading (optional – introduced in release 2.3)
    • oclc - An OCLC number for use in cover image loading (optional – introduced in release 2.3)
    • upc - A UPC for use in cover image loading (optional – introduced in release 2.3)
    • borrowingLocation - A string describing the location where the item was checked out (optional – introduced in release 2.4)

getNewItems

This method queries the ILS for new items

  • Input: getNewItems takes the following parameters:
    • page - page number of results to retrieve (counting starts at 1)
    • limit - the size of each page of results to retrieve
    • daysOld - the maximum age of records to retrieve in days (maximum 30)
    • fundID - optional fund ID to use for limiting results (use a value returned by getFunds, or exclude for no limit); note that “fund” may be a misnomer – if funds are not an appropriate way to limit your new item results, you can return a different set of values from getFunds. The important thing is that this parameter supports an ID returned by getFunds, whatever that may mean.
  • Output: An associative array with two keys: 'count' (the number of items in the 'results' array) and 'results' (an array of associative arrays, each with a single key: 'id', a record ID).

IMPORTANT: The fundID parameter changed behavior in r2184. In VuFind 1.0RC2 and earlier versions, it receives one of the VALUES returned by getFunds(); in more recent code, it receives one of the KEYS from getFunds(). See getFunds for additional notes.

getOfflineMode

This optional method (introduced in VuFind 1.4) gets the online status of the ILS – “ils-offline” for systems where the main ILS is offline, “ils-none” for systems which do not use an ILS, false for systems that are fully online. If not implemented, the value defaults to false – most drivers will not need to worry about this method, which is primarily used by the special NoILS driver.

  • Output: string or false, as described above

getPickUpLocations

This method returns a list of locations where a user may collect a hold. (optional) Not supported prior to VuFind 1.2

  • Input: Patron array returned by patronLogin method (optional), hold information array similar to placeHold's input (optional, provided only when user is in the process of placing a hold – may be used to limit the available pickup options based on item ID, etc.; must never add new options to the return array – may only be used as a limiter; not supported prior to VuFind 1.3)
  • Output: Array of associative arrays containing these keys:
    • locationID - A pick up location id or code (string)
    • locationDisplay – The text to display for the location (string)

getPurchaseHistory

This method returns information on recently received issues of a serial.

  • Input: Bibliogrpahic record ID
  • Output: Array of associative arrays, each with a single key:
    • issue - String describing the issue

Currently, most drivers do not implement this method, instead always returning an empty array. It is only necessary to implement this in more detail if you want to populate the “Most Recent Received Issues” section of the record holdings tab.

getRenewDetails

This method returns a string to use as the input form value for renewing each hold item. (optional, but required if you implement the renewMyItems method) Not supported prior to VuFind 1.2

  • Input: checkOutDetails - One of the individual item arrays returned by the getMyTransactions method
  • Output: A string to use as the input form value for renewing each item; you can pass any data that is needed by your ILS to identify the transaction to renew – the output of this method will be used as part of the input to the renewMyItems method.

getRequestBlocks

This optional method returns an array of strings describing reasons for blocking the active user from placing requests (holds, recalls, etc.). If no blocks are in place, it returns false. Not supported prior to VuFind 4.0

  • Input: patron (array returned by the driver's patronLogin method)
  • Output: array or false

getRequestGroups

This optional method returns information used to group together collections of pickup locations. Not supported prior to VuFind 2.3.

  • Input: bibID (of record being requested), Patron Data (from patronLogin() method), holdDetails (Optional array, only passed in when getting a list in the context of placing a hold; contains most of the same values passed to placeHold, minus the patron data. May be used to limit the request group options or may be ignored; added in VuFind 4.0).
  • Output: False if request groups not in use or an array of associative arrays with id and name keys

getStatus

This method returns a subset of the information from getHolding

  • Input: Bibliographic record ID
  • Output: Returns an array of associative arrays, one for each item attached to the specified bibliographic record. Each associative array contains these keys:
    • id - The bibliographic record ID (same as input).
    • status - String describing the status of the item.
    • location - The location of the item (string). Note: prior to VuFind 1.3, some drivers HTML entity encoded this string; that is incorrect behavior in VuFind 1.3 or later – this should be plain text, not HTML.
    • reserve - Is the item on course reserve? (“Y” for yes, “N” for no).
    • callnumber - The item's call number.
    • availability - Boolean: is the item available (i.e. on the shelf and/or available for checkout)?
    • use_unknown_message - An optional boolean that, when set to true, will cause display of a message indicating that the status of the item is unknown.
    • services - Starting with VuFind 3.0, this optional value can be used to indicate availability services (loan, presence). When set, the value is expected to be an array of strings representing available services for the current item. These services will be displayed in the result list in order to provide more detailed availability information than simply showing binary available/unavailable status. Further display control can be achieved through CSS classes assigned to every service. For now, only the services “loan” (available to be borrowed) and “presentation” (available for use within the institution) are supported (including appropriate translation strings). See additional documentation on services here.
    • error - Starting with VuFind 5.0, if you set this to an error string, all other fields except id will be ignored, and the error message will be displayed to the user along with an “Item Status Unavailable” status. This is particularly useful in the MultiBackend driver for dealing with partial failures, but other applications may exist.

Note: Some driver implementations add additional values beyond those listed above. However, these extra values are not used by core code and should generally be ignored.

getStatuses

This method calls getStatus for an array of records

  • Input: Array of bibliographic record IDs.
  • Output: Array of return values from getStatus (note – the keys of this array have no special meaning; you will need to search it if you want to retrieve a specific record's values).

getSuppressedAuthorityRecords

Return a list of suppressed authority records (used to remove non-visible items from VuFind's index). Note: this method was introduced in VuFind 1.4.

  • Output: An array of authority record IDs.

getSuppressedRecords

Return a list of suppressed bibliographic records (used to remove non-visible items from VuFind's index).

  • Output: An array of bibliographic record IDs.

hasHoldings

This optional method (introduced in VuFind 1.4) can be used to hide the holdings tab for records where holdings do not apply. Most drivers will not need to implement this – it is primarily for use by the special NoILS driver.

  • Input: Bibliographic ID
  • Output: true if holdings exist, false if they do not.

init

This method is where your driver should initialize all expensive resource dependencies and verify its configuration array (found in $this→config when extending VuFind\ILS\Driver\AbstractBase). If a problem is encountered, this method should throw an Exception.

  • Input: none
  • Output: none

loginIsHidden

This optional method (introduced in VuFind 1.4) can be used to hide VuFind's login options. Most drivers will not need to implement this – it is primarily for use by the special NoILS driver.

  • Output: true if login should be hidden, false otherwise.

patronLogin

This method processes authentication against the ILS.

When ILS or MultiILS authentication is used as the login method, the username in VuFind's user table is, by default, taken from cat_username but it's configurable with the ILS_username_field in [Authentication] section of config.ini.

Starting with version 4.0, VuFind uses the id field as the primary link between the ILS user and the VuFind user. The cat_username field or the field configured above is used if the user cannot be found with id. The idea is to have a more persistent link between the account (since cat_username is typically a library card, and a card may need to be changed, it's not really permanent) while allowing the existing accounts that don't yet have the id in them to be found.

  • Input: Username, Password
  • Output: null on failed login, associative array of patron information on success. Keys:
    • id - the patron's ID in the ILS
    • firstname - the patron's first name
    • lastname - the patron's last name
    • cat_username - the username used to log in
    • cat_password - the password used to log in
    • email - the patron's email address (null if unavailable)
    • major - the patron's major (null if unavailable)
    • college - the patron's college (null if unavailable)

placeHold

This method places a hold on a specific record for a specific patron. (Optional – if this feature is not supported by the ILS, you can define the getHoldLink method instead). This method was not consistently implemented until VuFind 1.2 – earlier drivers may include a placeHold method, but none of those early versions are supported by standard core code.

  • Input: holdDetails - An associative array with several keys. 'patron' will always be defined to contain the array returned by patronLogin method; other fields may vary depending on the fields defined in the HMACKeys and extraHoldFields settings returned by the getConfig method. Some commonly used values:
    • holdtype - type of hold (as provided by the getHolding method)
    • pickUpLocation - user-selected pickup location
    • item_id - item ID
    • comment - user comment
    • id - bibliographic ID
    • level - starting with VuFind 1.4, this key may be passed in set to 'title' when a user requests a title-level hold; in order for the title-level hold mechanism to work correctly, make sure that the HMACKeys setting returned by getConfig('Holds') includes 'level'.
  • Output: Associative array containing:
    • success – Boolean true or false
    • sysMessage – A system supplied failure message (optional)

placeILLRequest

This method places an ILL request on a specific record for a specific patron. (optional) Not supported prior to VuFind 2.3

  • Input: details - An associative array with several keys. 'patron' will always be defined to contain the array returned by patronLogin method; other fields may vary depending on the fields defined in the HMACKeys and extraFields settings returned by the getConfig method. Some commonly used values:
    • pickUpLocation - user-selected pickup location
    • item_id - item ID
    • comment - user comment
    • id - bibliographic ID
    • level - this key may be passed in set to 'title' when a user requests a title-level request; in order for the title-level request mechanism to work correctly, make sure that the HMACKeys setting returned by getConfig('ILLRequests') includes 'level'.
  • Output: Associative array containing:
    • success – Boolean true or false
    • sysMessage – A system supplied failure message (optional)

placeStorageRetrievalRequest

This method places a storage retrieval request on a specific record for a specific patron. (optional) Not supported prior to VuFind 2.3

  • Input: details - An associative array with several keys. 'patron' will always be defined to contain the array returned by patronLogin method; other fields may vary depending on the fields defined in the HMACKeys and extraFields settings returned by the getConfig method. Some commonly used values:
    • pickUpLocation - user-selected pickup location
    • item_id - item ID
    • comment - user comment
    • id - bibliographic ID
    • level - this key may be passed in set to 'title' when a user requests a title-level request; in order for the title-level request mechanism to work correctly, make sure that the HMACKeys setting returned by getConfig('StorageRetrievalRequests') includes 'level'.
  • Output: Associative array containing:
    • success – Boolean true or false
    • sysMessage – A system supplied failure message (optional)

renewMyItems

This method renews a list of items for a specific patron. (optional – you may wish to implement getRenewLink instead if your ILS does not support direct renewals) Not supported prior to VuFind 1.2

  • Input: renewDetails - An associative array with two keys:
    • patron - array returned by patronLogin method
    • details - array of values returned by the getRenewDetails method identifying which items to renew
  • Output: An associative array with two keys:
    • blocks - An array of strings specifying why a user is blocked from renewing (false if no blocks)
    • details - Not set when blocks exist; otherwise, an array of associative arrays (keyed by item ID) with each subarray containing these keys:
      • success – Boolean true or false
      • new_date – string – A new due date
      • new_time – string – A new due time
      • item_id – The item id of the renewed item
      • sysMessage – A system supplied renewal message (optional)

This method returns a URL to use as a link to a native OPAC for renewing each item. (optional, and should not be implemented unless your ILS is unable to support implementation of the renewMyItems method). Not supported prior to VuFind 1.2

  • Input: checkOutDetails - One of the individual item arrays returned by the getMyTransactions method
  • Output: A URL to a native OPAC for renewing each item

setConfig

Set the driver's configuration array. In most circumstances, this will be automatically called by the VuFind\ILS\Connection class and passed a configuration array parsed from an .ini file whose name corresponds with the driver class. This method is implemented by VuFind\ILS\Driver\AbstractBase, so you do not need to add it if you inherit from that class.

  • Input: configuration array
  • Output: none

supportsMethod

If your ILS driver implements __call() for dynamic method calls, you must also implement this method to indicate which methods may be legally called dynamically. Note that this is only really relevant for very unusual drivers like the MultiBackend driver; in general, __call() should almost always be avoided.

  • Input: method name, array of parameters
  • Output: boolean true (method is supported) or false (method is not supported)

Further Reading

development/plugins/ils_drivers.txt · Last modified: 2018/12/20 14:49 by demiankatz