Skip to content
Snippets Groups Projects
Commit bb233133 authored by André Lahmann's avatar André Lahmann
Browse files

integrated implementation from issue #4499:

* added ILS-Driver FincDAIA to finc-module which can be configured to use other identifiers for DAIA-Requests than the Vufind-RecordID
* FincDAIA.ini configuration-files were added to local-folder
parent 497fafd2
No related merge requests found
;####################################################################
;##################### DO NOT DELETE THIS HEADER ####################
;################### Leipzig University Library © 2015 ##############
;
; This is the default ALPHA-INI-file and inherits
; all the settings from the INI-file defined in [Parent_Config] which
; points to the default INI-file located in the folder vufind2/local
;
[Parent_Config]
relative_path = ../../../config/vufind/FincDAIA.ini
; A comma-separated list of config sections from the parent which should be
; completely overwritten by the equivalent sections in this configuration;
; any sections not listed here will be merged on a section-by-section basis.
;override_full_sections = "Languages,AlphaBrowse_Types"
;
; Add ALPHA-specific customization after this header.
;
;##################### DO NOT DELETE THIS HEADER ####################
;####################################################################
;[DAIA]
; this config configures the extended DAIA-Driver FincDAIA
; refer to ticket #4499 for further info on configuring it
; config-examples:
; DE-15
; baseUrl = http://data.ub.uni-leipzig.de/item/DE-15/barcode/
; ilsIdentifier = "barcode"
; ISIL = "DE-15"
; DE-Gla 1
; baseUrl = http://139.18.19.238:8080/DaiaThecaMssql/rs/DE-Gla%201/daia/
; ilsIdentifier = "record_id"
; default
; ilsIdentifier = "default"
\ No newline at end of file
[DAIA]
; this config configures the extended DAIA-Driver FincDAIA
; refer to ticket #4499 for further info on configuring it
baseUrl = http://data.ub.uni-leipzig.de/item/ISIL/identifier/
ilsIdentifier = "default"
;ISIL = "ISIL"
; config-examples:
; DE-15
; baseUrl = http://data.ub.uni-leipzig.de/item/DE-15/barcode/
; ilsIdentifier = "barcode"
; ISIL = "DE-15"
; DE-Gla 1
; baseUrl = http://139.18.19.238:8080/DaiaThecaMssql/rs/DE-Gla%201/daia/
; ilsIdentifier = "record_id"
; default
; ilsIdentifier = "default"
\ No newline at end of file
;####################################################################
;##################### DO NOT DELETE THIS HEADER ####################
;################### Leipzig University Library © 2015 ##############
;
; This is the default DEV-INI-file and inherits
; all the settings from the INI-file defined in [Parent_Config] which
; points to the default INI-file located in the folder vufind2/local
;
[Parent_Config]
relative_path = ../../../config/vufind/FincDAIA.ini
; A comma-separated list of config sections from the parent which should be
; completely overwritten by the equivalent sections in this configuration;
; any sections not listed here will be merged on a section-by-section basis.
;override_full_sections = "Languages,AlphaBrowse_Types"
;
; Add DEV-specific customization after this header.
;
;##################### DO NOT DELETE THIS HEADER ####################
;####################################################################
;[DAIA]
; this config configures the extended DAIA-Driver FincDAIA
; refer to ticket #4499 for further info on configuring it
; config-examples:
; DE-15
; baseUrl = http://data.ub.uni-leipzig.de/item/DE-15/barcode/
; ilsIdentifier = "barcode"
; ISIL = "DE-15"
; DE-Gla 1
; baseUrl = http://139.18.19.238:8080/DaiaThecaMssql/rs/DE-Gla%201/daia/
; ilsIdentifier = "record_id"
; default
; ilsIdentifier = "default"
\ No newline at end of file
......@@ -5,6 +5,9 @@ $config = array(
'vufind' => array(
'plugin_managers' => array(
'ils_driver' => array(
'factories' => array(
'fincdaia' => 'finc\ILS\Driver\Factory::getDAIA',
),
'invokables' => array(
'daia' => 'finc\ILS\Driver\DAIA',
'paia' => 'finc\ILS\Driver\PAIA',
......
......@@ -28,7 +28,7 @@
* @link http://vufind.org/wiki/vufind2:building_an_ils_driver Wiki
*/
namespace finc\ILS\Driver;
use DOMDocument, VuFind\Exception\ILS as ILSException, VuFind\ILS\Driver\AbstractBase as AbstractBase, Zend\Log\LoggerInterface;
use DOMDocument, VuFind\Exception\ILS as ILSException, Zend\Log\LoggerInterface;
/**
* ILS Driver for VuFind to query availability information via DAIA.
......@@ -41,7 +41,7 @@ use DOMDocument, VuFind\Exception\ILS as ILSException, VuFind\ILS\Driver\Abstrac
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:building_an_ils_driver Wiki
*/
class DAIA extends AbstractBase implements \Zend\Log\LoggerAwareInterface
class DAIA extends \VuFind\ILS\Driver\AbstractBase implements \Zend\Log\LoggerAwareInterface
{
/**
* Base URL
......@@ -112,6 +112,7 @@ class DAIA extends AbstractBase implements \Zend\Log\LoggerAwareInterface
* @param array $details Item details from getHoldings return array
*
* @return string URL to ILS's OPAC's place hold screen.
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getHoldLink($id, $details)
{
......@@ -278,8 +279,10 @@ class DAIA extends AbstractBase implements \Zend\Log\LoggerAwareInterface
'label' => '',
'notes' => array()
);
$result['item_id'] = $itemlist->item($c)->attributes
->getNamedItem('id')->nodeValue;
if ($itemlist->item($c)->attributes->getNamedItem('id') !== null) {
$result['item_id'] = $itemlist->item($c)->attributes
->getNamedItem('id')->nodeValue;
}
if ($itemlist->item($c)->attributes->getNamedItem('href') !== null) {
$result['recallhref'] = $itemlist->item($c)->attributes
->getNamedItem('href')->nodeValue;
......@@ -351,53 +354,56 @@ class DAIA extends AbstractBase implements \Zend\Log\LoggerAwareInterface
if ($unavailableElements->item(0) !== null) {
for ($n = 0; $unavailableElements->item($n) !== null; $n++) {
$service = $unavailableElements->item($n)->attributes
->getNamedItem('service')->nodeValue;
->getNamedItem('service');
$expectedNode = $unavailableElements->item($n)->attributes
->getNamedItem('expected');
$queueNode = $unavailableElements->item($n)->attributes
->getNamedItem('queue');
if ($service === 'presentation') {
$result['presentation.availability'] = '0';
$result['presentation_availability'] = '0';
if ($expectedNode !== null) {
$result['presentation.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['presentation.queue']
= $queueNode->nodeValue;
}
$result['availability'] = '0';
} elseif ($service === 'loan') {
$result['loan.availability'] = '0';
$result['loan_availability'] = '0';
if ($expectedNode !== null) {
$result['loan.duedate'] = $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['loan.queue'] = $queueNode->nodeValue;
}
$result['availability'] = '0';
} elseif ($service === 'interloan') {
$result['interloan.availability'] = '0';
if ($expectedNode !== null) {
$result['interloan.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['interloan.queue'] = $queueNode->nodeValue;
if ($service !== null) {
$service = $service->nodeValue;
if ($service === 'presentation') {
$result['presentation.availability'] = '0';
$result['presentation_availability'] = '0';
if ($expectedNode !== null) {
$result['presentation.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['presentation.queue']
= $queueNode->nodeValue;
}
$result['availability'] = '0';
} elseif ($service === 'loan') {
$result['loan.availability'] = '0';
$result['loan_availability'] = '0';
if ($expectedNode !== null) {
$result['loan.duedate'] = $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['loan.queue'] = $queueNode->nodeValue;
}
$result['availability'] = '0';
} elseif ($service === 'interloan') {
$result['interloan.availability'] = '0';
if ($expectedNode !== null) {
$result['interloan.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['interloan.queue'] = $queueNode->nodeValue;
}
$result['availability'] = '0';
} elseif ($service === 'openaccess') {
$result['openaccess.availability'] = '0';
if ($expectedNode !== null) {
$result['openaccess.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['openaccess.queue'] = $queueNode->nodeValue;
}
$result['availability'] = '0';
}
$result['availability'] = '0';
} elseif ($service === 'openaccess') {
$result['openaccess.availability'] = '0';
if ($expectedNode !== null) {
$result['openaccess.duedate']
= $expectedNode->nodeValue;
}
if ($queueNode !== null) {
$result['openaccess.queue'] = $queueNode->nodeValue;
}
$result['availability'] = '0';
}
// TODO: message/limitation
if ($expectedNode !== null) {
......@@ -414,36 +420,39 @@ class DAIA extends AbstractBase implements \Zend\Log\LoggerAwareInterface
if ($availableElements->item(0) !== null) {
for ($n = 0; $availableElements->item($n) !== null; $n++) {
$service = $availableElements->item($n)->attributes
->getNamedItem('service')->nodeValue;
->getNamedItem('service');
$delayNode = $availableElements->item($n)->attributes
->getNamedItem('delay');
if ($service === 'presentation') {
$result['presentation.availability'] = '1';
$result['presentation_availability'] = '1';
if ($delayNode !== null) {
$result['presentation.delay']
= $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'loan') {
$result['loan.availability'] = '1';
$result['loan_availability'] = '1';
if ($delayNode !== null) {
$result['loan.delay'] = $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'interloan') {
$result['interloan.availability'] = '1';
if ($delayNode !== null) {
$result['interloan.delay'] = $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'openaccess') {
$result['openaccess.availability'] = '1';
if ($delayNode !== null) {
$result['openaccess.delay'] = $delayNode->nodeValue;
if ($service !== null) {
$service = $service->nodeValue;
if ($service === 'presentation') {
$result['presentation.availability'] = '1';
$result['presentation_availability'] = '1';
if ($delayNode !== null) {
$result['presentation.delay']
= $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'loan') {
$result['loan.availability'] = '1';
$result['loan_availability'] = '1';
if ($delayNode !== null) {
$result['loan.delay'] = $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'interloan') {
$result['interloan.availability'] = '1';
if ($delayNode !== null) {
$result['interloan.delay'] = $delayNode->nodeValue;
}
$result['availability'] = '1';
} elseif ($service === 'openaccess') {
$result['openaccess.availability'] = '1';
if ($delayNode !== null) {
$result['openaccess.delay'] = $delayNode->nodeValue;
}
$result['availability'] = '1';
}
$result['availability'] = '1';
}
// TODO: message/limitation
if ($delayNode !== null) {
......
<?php
/**
* ILS Driver Factory Class
*
* PHP version 5
*
* Copyright (C) Villanova University 2014.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package ILS_Drivers
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:hierarchy_components Wiki
*/
namespace finc\ILS\Driver;
use Zend\ServiceManager\ServiceManager;
/**
* ILS Driver Factory Class
*
* @category VuFind2
* @package ILS_Drivers
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:hierarchy_components Wiki
*/
class Factory extends \VuFind\ILS\Driver\Factory
{
/**
* Factory for NoILS driver.
*
* @param ServiceManager $sm Service manager.
*
* @return NoILS
*/
public static function getDAIA(ServiceManager $sm)
{
return new FincDAIA($sm->getServiceLocator()->get('VuFind\RecordLoader'));
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -203,6 +203,18 @@ class SolrMarcRemote extends \VuFind\RecordDriver\SolrMarc
}
/**
* Get the field-value identified by $string
*
* @param String field-name
*
* @return String
*/
public function getILSIdentifier($string)
{
return (isset($this->fields[$string]) ? $this->fields[$string] : '');
}
/**
* Set the logger
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment