VuFind API Documentation

Aleph extends AbstractBase
in package
implements LoggerAwareInterface, HttpServiceAwareInterface Uses LoggerAwareTrait, HttpServiceAwareTrait

Aleph ILS driver

Tags
category

VuFind

author

Christoph Krempe vufind-tech@lists.sourceforge.net

author

Alan Rykhus vufind-tech@lists.sourceforge.net

author

Jason L. Cooper vufind-tech@lists.sourceforge.net

author

Kun Lin vufind-tech@lists.sourceforge.net

author

Vaclav Rosecky vufind-tech@lists.sourceforge.net

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Interfaces, Classes, Traits and Enums

LoggerAwareInterface
HttpServiceAwareInterface

Table of Contents

RECORD_ID_BASE_SEPARATOR  = '-'
$addressMappings  : array<string|int, mixed>
Mapping of z304 address elements in Aleph to getMyProfile attributes
$admlib  : string
Item library
$alephTranslator  : Translator
Translator object
$available_statuses  : array<string|int, mixed>
Statuses considered as available
$bib  : array<string|int, mixed>
Bibliographic bases
$cacheManager  : Manager
Cache manager
$config  : array<string|int, mixed>
Driver configuration
$dateConverter  : Converter
Date converter object
$debug_enabled  : bool
Is debug mode enabled?
$defaultPatronId  : string
Patron id used when no specific patron defined
$dlfbaseurl  : string
The base URL, where the REST DLF API is running
$dlfport  : int
DLF REST API port
$host  : string
Aleph server
$languages  : array<string|int, mixed>
ISO 3166-1 alpha-2 to ISO 3166-1 alpha-3 mapping for translation in REST DLF API.
$preferredPickUpLocations  : array<string|int, mixed>
Preferred pickup locations
$queuePositionRegex  : string
Regex for extracting position in queue from status in holdings.
$quick_availability  : bool
If enabled and Xserver is disabled, slower RESTful API is used for availability check.
$sublibadm  : array<string|int, mixed>
List of patron hoe libraries
$translator  : TranslatorInterface
Translator
$useradm  : string
User library
$wwwpasswd  : string
X server user password
$wwwuser  : string
X server user name
$xport  : int
X server port (defaults to 80)
$xserver_enabled  : bool
Is X server enabled?
__construct()  : mixed
Constructor
barcodeToID()  : string|null
Convert a barcode to an item ID.
cancelHolds()  : array<string|int, mixed>
Cancel Holds
findReserves()  : array<string|int, mixed>
Find Reserves
getCancelHoldDetails()  : string
Get Cancel Hold Details
getConfig()  : array<string|int, mixed>
Public Function which retrieves historic loan, renew, hold and cancel settings from the driver ini file.
getCourses()  : array<string|int, mixed>
Get Courses
getDefaultPickUpLocation()  : string
Get Default Pick Up Location
getDepartments()  : array<string|int, mixed>
Get Departments
getHoldDefaultRequiredDate()  : int|null
Get Default "Hold Required By" Date (as Unix timestamp) or null if unsupported
getHolding()  : array<string|int, mixed>
Get Holding
getHoldingInfoForItem()  : array<string|int, mixed>
Support method for placeHold -- get holding info for an item.
getInstructors()  : array<string|int, mixed>
Get Instructors
getMyFines()  : mixed
Get Patron Fines
getMyHolds()  : array<string|int, mixed>
Get Patron Holds
getMyProfile()  : array<string|int, mixed>
Get Patron Profile
getMyProfileDLF()  : array<string|int, mixed>
Get profile information using DLF service.
getMyProfileX()  : array<string|int, mixed>
Get profile information using X-server.
getMyTransactionHistory()  : array<string|int, mixed>
Get Patron Loan History
getMyTransactions()  : array<string|int, mixed>
Get Patron Transactions
getNewItems()  : array<string|int, mixed>
Get New Items
getPickUpLocations()  : array<string|int, mixed>
Get Pick Up Locations
getPurchaseHistory()  : array<string|int, mixed>
Get Purchase History
getRenewDetails()  : string
Get Renew Details
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
getStatusesX()  : array<string|int, mixed>
Support method for getStatuses -- load ID information from a particular bibliographic library.
init()  : void
Initialize the driver.
parseDate()  : string
Parse a date.
patronLogin()  : mixed
Patron Login
placeHold()  : mixed
Place Hold
renewMyItems()  : array<string|int, mixed>
Renew My Items
setConfig()  : void
Set configuration.
supportsMethod()  : bool
Helper method to determine whether or not a certain method can be called on this driver. Required method for any smart drivers.
appendQueryString()  : string
Add values to an HTTP query string.
debug()  : void
Log a debug message.
doHTTPRequest()  : SimpleXMLElement
Perform an HTTP request.
doRestDLFRequest()  : SimpleXMLElement
Perform a RESTful DLF request.
doXRequest()  : SimpleXMLElement
Perform an XServer request.
getDefaultAddressMappings()  : array<string|int, mixed>
Return default mapping of z304 address elements in Aleph to getMyProfile attributes.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.
parseId()  : array<string|int, mixed>
Convert an ID string into an array of bibliographic base and ID within the base.
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.

Constants

RECORD_ID_BASE_SEPARATOR

public mixed RECORD_ID_BASE_SEPARATOR = '-'

Properties

$addressMappings

Mapping of z304 address elements in Aleph to getMyProfile attributes

protected array<string|int, mixed> $addressMappings = null

$admlib

Item library

protected string $admlib

$alephTranslator

Translator object

protected Translator $alephTranslator = false

$available_statuses

Statuses considered as available

protected array<string|int, mixed> $available_statuses

$bib

Bibliographic bases

protected array<string|int, mixed> $bib

$config

Driver configuration

protected array<string|int, mixed> $config = []

$dateConverter

Date converter object

protected Converter $dateConverter = null

$debug_enabled

Is debug mode enabled?

protected bool $debug_enabled

$defaultPatronId

Patron id used when no specific patron defined

protected string $defaultPatronId

$dlfbaseurl

The base URL, where the REST DLF API is running

protected string $dlfbaseurl = null

$dlfport

DLF REST API port

protected int $dlfport

$host

Aleph server

protected string $host

$languages

ISO 3166-1 alpha-2 to ISO 3166-1 alpha-3 mapping for translation in REST DLF API.

protected array<string|int, mixed> $languages = []

$preferredPickUpLocations

Preferred pickup locations

protected array<string|int, mixed> $preferredPickUpLocations

$queuePositionRegex

Regex for extracting position in queue from status in holdings.

protected string $queuePositionRegex = '/Waiting in position ' . '(?<position>[0-9]+) in queue;/'

$quick_availability

If enabled and Xserver is disabled, slower RESTful API is used for availability check.

protected bool $quick_availability

$sublibadm

List of patron hoe libraries

protected array<string|int, mixed> $sublibadm

$translator

Translator

protected TranslatorInterface $translator

$useradm

User library

protected string $useradm

$wwwpasswd

X server user password

protected string $wwwpasswd

$wwwuser

X server user name

protected string $wwwuser

$xport

X server port (defaults to 80)

protected int $xport

$xserver_enabled

Is X server enabled?

protected bool $xserver_enabled

Methods

__construct()

Constructor

public __construct(Converter $dateConverter[, Manager $cacheManager = null ][, TranslatorInterface $translator = null ]) : mixed
Parameters
$dateConverter : Converter

Date converter

$cacheManager : Manager = null

Cache manager (optional)

$translator : TranslatorInterface = null

Translator (optional)

Return values
mixed

barcodeToID()

Convert a barcode to an item ID.

public barcodeToID(string $bar) : string|null
Parameters
$bar : string

Barcode

Return values
string|null

cancelHolds()

Cancel Holds

public cancelHolds(array<string|int, mixed> $details) : array<string|int, mixed>

Attempts to Cancel a hold or recall on a particular item. The data in $cancelDetails['details'] is determined by getCancelHoldDetails().

Parameters
$details : array<string|int, mixed>

An array of item and patron data

Return values
array<string|int, mixed>

An array of data on each request including whether or not it was successful and a system message (if available)

findReserves()

Find Reserves

public findReserves(string $course, string $inst, string $dept) : array<string|int, mixed>

Obtain information on course reserves.

Parameters
$course : string

ID from getCourses (empty string to match all)

$inst : string

ID from getInstructors (empty string to match all)

$dept : string

ID from getDepartments (empty string to match all)

Tags
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array of associative arrays representing reserve items.

getCancelHoldDetails()

Get Cancel Hold Details

public getCancelHoldDetails(array<string|int, mixed> $holdDetails[, array<string|int, mixed> $patron = [] ]) : string
Parameters
$holdDetails : array<string|int, mixed>

A single hold array from getMyHolds

$patron : array<string|int, mixed> = []

Patron information from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

Data for use in a form field

getConfig()

Public Function which retrieves historic loan, renew, hold and cancel settings from the driver ini file.

public getConfig(string $func[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$func : string

The name of the feature to be checked

$params : array<string|int, mixed> = []

Optional feature-specific parameters (array)

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array with key-value pairs.

getCourses()

Get Courses

public getCourses() : array<string|int, mixed>

Obtain a list of courses for use in limiting the reserves list.

Tags
throws
ILS
Return values
array<string|int, mixed>

An associative array with key = ID, value = name.

getDefaultPickUpLocation()

Get Default Pick Up Location

public getDefaultPickUpLocation(array<string|int, mixed> $patron[, array<string|int, mixed> $holdInfo = null ]) : string

Returns the default pick up location set in VoyagerRestful.ini

Parameters
$patron : array<string|int, mixed>

Patron information returned by the patronLogin method.

$holdInfo : array<string|int, mixed> = null

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 pickup options or may be ignored.

Return values
string

The default pickup location for the patron.

getDepartments()

Get Departments

public getDepartments() : array<string|int, mixed>

Obtain a list of departments for use in limiting the reserves list.

Tags
throws
ILS
Return values
array<string|int, mixed>

An associative array with key = dept. ID, value = dept. name.

getHoldDefaultRequiredDate()

Get Default "Hold Required By" Date (as Unix timestamp) or null if unsupported

public getHoldDefaultRequiredDate(array<string|int, mixed> $patron, array<string|int, mixed> $holdInfo) : int|null
Parameters
$patron : array<string|int, mixed>

Patron information returned by the patronLogin method.

$holdInfo : array<string|int, mixed>

Contains most of the same values passed to placeHold, minus the patron data.

Return values
int|null

getHolding()

Get Holding

public getHolding(string $id[, array<string|int, mixed> $patron = null ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

This is responsible for retrieving the holding information of a certain record.

Parameters
$id : string

The record id to retrieve the holdings for

$patron : array<string|int, mixed> = null

Patron data

$options : array<string|int, mixed> = []

Extra options (not currently used)

Tags
throws
DateException
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

On success, an associative array with the following keys: id, availability (boolean), status, location, reserve, callnumber, duedate, number, barcode.

getHoldingInfoForItem()

Support method for placeHold -- get holding info for an item.

public getHoldingInfoForItem(string $patronId, string $id, string $group) : array<string|int, mixed>
Parameters
$patronId : string

Patron ID

$id : string

Bib ID

$group : string

Item ID

Return values
array<string|int, mixed>

getInstructors()

Get Instructors

public getInstructors() : array<string|int, mixed>

Obtain a list of instructors for use in limiting the reserves list.

Tags
throws
ILS
Return values
array<string|int, mixed>

An associative array with key = ID, value = name.

getMyFines()

Get Patron Fines

public getMyFines(array<string|int, mixed> $user) : mixed

This is responsible for retrieving all fines by a specific patron.

Parameters
$user : array<string|int, mixed>

The patron array from patronLogin

Tags
throws
DateException
throws
ILS
Return values
mixed

Array of the patron's fines on success.

getMyHolds()

Get Patron Holds

public getMyHolds(array<string|int, mixed> $user) : array<string|int, mixed>

This is responsible for retrieving all holds by a specific patron.

Parameters
$user : array<string|int, mixed>

The patron array from patronLogin

Tags
throws
DateException
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's holds on success.

getMyProfile()

Get Patron Profile

public getMyProfile(array<string|int, mixed> $user) : array<string|int, mixed>

This is responsible for retrieving the profile for a specific patron.

Parameters
$user : array<string|int, mixed>

The patron array

Tags
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's profile data on success.

getMyProfileDLF()

Get profile information using DLF service.

public getMyProfileDLF(array<string|int, mixed> $user) : array<string|int, mixed>
Parameters
$user : array<string|int, mixed>

The patron array

Tags
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's profile data on success.

getMyProfileX()

Get profile information using X-server.

public getMyProfileX(array<string|int, mixed> $user) : array<string|int, mixed>
Parameters
$user : array<string|int, mixed>

The patron array

Tags
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's profile data on success.

getMyTransactionHistory()

Get Patron Loan History

public getMyTransactionHistory(array<string|int, mixed> $user[, array<string|int, mixed> $params = null ]) : array<string|int, mixed>
Parameters
$user : array<string|int, mixed>

The patron array from patronLogin

$params : array<string|int, mixed> = null

Parameters

Tags
throws
DateException
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's historic loans on success.

getMyTransactions()

Get Patron Transactions

public getMyTransactions(array<string|int, mixed> $user[, array<string|int, mixed> $params = [] ][, bool $history = false ]) : array<string|int, mixed>

This is responsible for retrieving all transactions (i.e. checked out items) by a specific patron.

Parameters
$user : array<string|int, mixed>

The patron array from patronLogin

$params : array<string|int, mixed> = []

Parameters

$history : bool = false

History

Tags
throws
DateException
throws
ILS
Return values
array<string|int, mixed>

Array of the patron's transactions on success.

getNewItems()

Get New Items

public getNewItems(int $page, int $limit, int $daysOld[, int $fundId = null ]) : array<string|int, mixed>

Retrieve the IDs of items recently added to the catalog.

Parameters
$page : int

Page number of results to retrieve (counting starts at 1)

$limit : int

The size of each page of results to retrieve

$daysOld : int

The maximum age of records to retrieve in days (max. 30)

$fundId : int = null

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.

Tags
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

Associative array with 'count' and 'results' keys

getPickUpLocations()

Get Pick Up Locations

public getPickUpLocations(array<string|int, mixed> $patron[, array<string|int, mixed> $holdInfo = null ]) : array<string|int, mixed>

This is responsible for gettting a list of valid library locations for holds / recall retrieval

Parameters
$patron : array<string|int, mixed>

Patron information returned by the patronLogin method.

$holdInfo : array<string|int, mixed> = null

Optional array, only passed in when getting a list in the context of placing or editing a hold. When placing a hold, it contains most of the same values passed to placeHold, minus the patron data. When editing a hold it contains all the hold information returned by getMyHolds. May be used to limit the pickup options or may be ignored. The driver must not add new options to the return array based on this data or other areas of VuFind may behave incorrectly.

Tags
throws
ILS
Return values
array<string|int, mixed>

An array of associative arrays with locationID and locationDisplay keys

getPurchaseHistory()

Get Purchase History

public getPurchaseHistory(string $id) : array<string|int, mixed>

This is responsible for retrieving the acquisitions history data for the specific record (usually recently received issues of a serial).

Parameters
$id : string

The record id to retrieve the info for

Tags
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array with the acquisitions data on success.

getRenewDetails()

Get Renew Details

public getRenewDetails(array<string|int, mixed> $details) : string

In order to renew an item, Voyager requires the patron details and an item id. This function returns the item id as a string which is then used as submitted form data in checkedOut.php. This value is then extracted by the RenewMyItems function.

Parameters
$details : array<string|int, mixed>

An array of item data

Return values
string

Data for use in a form field

getStatus()

Get Status

public getStatus(string $id) : mixed

This is responsible for retrieving the status information of a certain record.

Parameters
$id : string

The record id to retrieve the holdings for

Tags
throws
ILS
Return values
mixed

On success, an associative array with the following keys: id, availability (boolean), status, location, reserve, callnumber.

getStatuses()

Get Statuses

public getStatuses(array<string|int, mixed> $idList) : array<string|int, mixed>

This is responsible for retrieving the status information for a collection of records.

Parameters
$idList : array<string|int, mixed>

The array of record ids to retrieve the status for

Tags
throws
ILS
Return values
array<string|int, mixed>

An array of getStatus() return values on success.

getStatusesX()

Support method for getStatuses -- load ID information from a particular bibliographic library.

public getStatusesX(string $bib, array<string|int, mixed> $ids) : array<string|int, mixed>
Parameters
$bib : string

Library to search

$ids : array<string|int, mixed>

IDs to search within library

Return values
array<string|int, mixed>

Description of AVA tag: http://igelu.org/wp-content/uploads/2011/09/Staff-vs-Public-Data-views.pdf (page 28)

a ADM code - Institution Code b Sublibrary code - Library Code c Collection (first found) - Collection Code d Call number (first found) e Availability status - If it is on loan (it has a Z36), if it is on hold shelf (it has Z37=S) or if it has a processing status. f Number of items (for entire sublibrary) g Number of unavailable loans h Multi-volume flag (Y/N) If first Z30-ENUMERATION-A is not blank or 0, then the flag=Y, otherwise the flag=N. i Number of loans (for ranking/sorting) j Collection code

init()

Initialize the driver.

public init() : void

Validate configuration and perform all resource-intensive tasks needed to make the driver active.

Tags
throws
ILS
Return values
void

parseDate()

Parse a date.

public parseDate(string $date) : string
Parameters
$date : string

Date to parse

Return values
string

patronLogin()

Patron Login

public patronLogin(string $user, string $password) : mixed

This is responsible for authenticating a patron against the catalog.

Parameters
$user : string

The patron username

$password : string

The patron's password

Tags
throws
ILS
Return values
mixed

Associative array of patron info on successful login, null on unsuccessful login.

placeHold()

Place Hold

public placeHold(array<string|int, mixed> $details) : mixed

Attempts to place a hold or recall on a particular item and returns an array with result details or throws an exception on failure of support classes

Parameters
$details : array<string|int, mixed>

An array of item and patron data

Tags
throws
ILS
Return values
mixed

An array of data on the request including whether or not it was successful and a system message (if available)

renewMyItems()

Renew My Items

public renewMyItems(array<string|int, mixed> $details) : array<string|int, mixed>

Function for attempting to renew a patron's items. The data in $details['details'] is determined by getRenewDetails().

Parameters
$details : array<string|int, mixed>

An array of data required for renewing items including the Patron ID and an array of renewal IDS

Return values
array<string|int, mixed>

An array of renewal information keyed by item ID

setConfig()

Set configuration.

public setConfig(array<string|int, mixed> $config) : void

Set the configuration for the driver.

Parameters
$config : array<string|int, mixed>

Configuration array (usually loaded from a VuFind .ini file whose name corresponds with the driver class name).

Return values
void

supportsMethod()

Helper method to determine whether or not a certain method can be called on this driver. Required method for any smart drivers.

public supportsMethod(string $method, array<string|int, mixed> $params) : bool
Parameters
$method : string

The name of the called method.

$params : array<string|int, mixed>

Array of passed parameters

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool

True if the method can be called with the given parameters, false otherwise.

appendQueryString()

Add values to an HTTP query string.

protected appendQueryString(string $url, array<string|int, mixed> $params) : string
Parameters
$url : string

URL so far

$params : array<string|int, mixed>

Parameters to add

Return values
string

debug()

Log a debug message.

protected debug(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

doHTTPRequest()

Perform an HTTP request.

protected doHTTPRequest(string $url[, string $method = 'GET' ][, string $body = null ]) : SimpleXMLElement
Parameters
$url : string

URL of request

$method : string = 'GET'

HTTP method

$body : string = null

HTTP body (null for none)

Return values
SimpleXMLElement

doRestDLFRequest()

Perform a RESTful DLF request.

protected doRestDLFRequest(array<string|int, mixed> $path_elements[, array<string|int, mixed> $params = null ][, string $method = 'GET' ][, string $body = null ]) : SimpleXMLElement
Parameters
$path_elements : array<string|int, mixed>

URL path elements

$params : array<string|int, mixed> = null

GET parameters (null for none)

$method : string = 'GET'

HTTP method

$body : string = null

HTTP body

Return values
SimpleXMLElement

doXRequest()

Perform an XServer request.

protected doXRequest(string $op, array<string|int, mixed> $params[, bool $auth = false ]) : SimpleXMLElement
Parameters
$op : string

Operation

$params : array<string|int, mixed>

Parameters

$auth : bool = false

Include authentication?

Return values
SimpleXMLElement

getDefaultAddressMappings()

Return default mapping of z304 address elements in Aleph to getMyProfile attributes.

protected getDefaultAddressMappings() : array<string|int, mixed>
Return values
array<string|int, mixed>

log()

Send a message to the logger.

protected log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
$level : string

Log level

$message : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = false

Prepend class name to message?

Return values
void

logError()

Log an error message.

protected logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

logWarning()

Log a warning message.

protected logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

$context : array<string|int, mixed> = []

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

parseId()

Convert an ID string into an array of bibliographic base and ID within the base.

protected parseId(string $id) : array<string|int, mixed>
Parameters
$id : string

ID to parse.

Return values
array<string|int, mixed>

throwAsIlsException()

Rethrow the provided exception as an ILS exception.

protected throwAsIlsException(Throwable $exception[, string $msg = null ]) : never
Parameters
$exception : Throwable

Exception to rethrow

$msg : string = null

Override exception message (optional)

Tags
throws
ILS
Return values
never

Search results