<<

NAME

Koha::Illrequest::Config - Koha ILL Configuration Object

SYNOPSIS

Object-oriented class that giving access to the illconfig data derived from ill/config.yaml.

DESCRIPTION

Config object providing abstract representation of the expected XML returned by ILL API.

In particular the config object uses a YAML file, whose path is defined by <illconfig> in koha-conf.xml. That YAML file provides the data structure exposed in this object.

By default the configured data structure complies with fields used by the British Library Interlibrary Loan DSS API.

The config file also provides mappings for Record Object accessors.

API

Class Methods

new

    my $config = Koha::Illrequest::Config->new();

Create a new Koha::Illrequest::Config object, with mapping data loaded from the ILL configuration file.

backend

    $backend = $config->backend($name);
    $backend = $config->backend;

Standard setter/accessor for our backend.

backend_dir

    $backend_dir = $config->backend_dir($new_path);
    $backend_dir = $config->backend_dir;

Standard setter/accessor for our backend_directory.

available_backends

Return a list of available backends.

partner_code

    $partner_code = $config->partner_code($new_code);
    $partner_code = $config->partner_code;

Standard setter/accessor for our partner_code.

limits

    $limits = $config->limits($limitshash);
    $limits = $config->limits;

Standard setter/accessor for our limits. No parsing is performed on $LIMITSHASH, so caution should be exercised when using this setter.

getPrefixes

    my $prefixes = $config->getPrefixes('brw_cat' | 'branch');

Return the prefix for ILLs defined by our config.

getLimitRules

    my $rules = $config->getLimitRules('brw_cat' | 'branch')

Return the hash of ILL limit rules defined by our config.

getDigitalRecipients

    my $recipient_rules= $config->getDigitalRecipients('brw_cat' | 'branch');

Return the hash of digital_recipient settings defined by our config.

censorship

    my $censoredValues = $config->censorship($hash);
    my $censoredValues = $config->censorship;

Standard setter/accessor for our limits. No parsing is performed on $HASH, so caution should be exercised when using this setter.

Return our censorship values for the OPAC as loaded from the koha-conf.xml, or the fallback value (no censorship).

_load_configuration

    my $configuration = $config->_load_configuration($config_from_xml);

Read the configuration values passed as the parameter, and populate a hashref suitable for use with these.

A key task performed here is the parsing of the input in the configuration file to ensure we have only valid input there.

_load_unit_config

    my $configuration->{part} = _load_unit_config($params);

$PARAMS is a hashref with the following elements: - unit: the part of the configuration we are parsing. - id: the name within which we will store the parsed unit in config. - config: the configuration we are augmenting. - type: the type of config unit we are parsing. Assumed to be 'default'.

Read `unit', and augment `config' with these under `id'.

This is a helper for _load_configuration.

A key task performed here is the parsing of the input in the configuration file to ensure we have only valid input there.

AUTHOR

Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>

<<