100% found this document useful (1 vote)
436 views44 pages

VuFind Integration With Koha Multiple Instances Special Reference To ILS-DI and RestAPI

This document summarizes the integration of multiple Koha instances with VuFind using different methods including OAI-PMH, ILS-DI, and REST APIs. It details the configuration steps needed in Koha, VuFind, and the database to enable harvesting of records from multiple Koha instances and presenting them in a single search interface in VuFind. The process involves enabling relevant APIs and plugins in Koha, configuring import profiles and driver files for each Koha instance in VuFind, harvesting and indexing records both manually and automatically, and linking the records to the relevant Koha OPACs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
436 views44 pages

VuFind Integration With Koha Multiple Instances Special Reference To ILS-DI and RestAPI

This document summarizes the integration of multiple Koha instances with VuFind using different methods including OAI-PMH, ILS-DI, and REST APIs. It details the configuration steps needed in Koha, VuFind, and the database to enable harvesting of records from multiple Koha instances and presenting them in a single search interface in VuFind. The process involves enabling relevant APIs and plugins in Koha, configuring import profiles and driver files for each Koha instance in VuFind, harvesting and indexing records both manually and automatically, and linking the records to the relevant Koha OPACs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Webinar on Digital Library Software

May 26-28, 2021


Organized by
VuFind Software

VuFind integration with Koha Multiple Instances:


Special reference to ILS-DI and RestAPI
M.JAYAKANANTHAN
SYSTEMS ANALYST
EASTERN UNIVERSITY, SRI LANKA
Contents
•Introduction
•Problem
•Objectives
•Methodology
•Process in details
• Enabling OAI-PMH and ILSDI
• Enabling KoahRestApi
• MySQL configuration
• VuFInd import properties
• VuFind Marc Properties
• Harvest OAI.INI configuration
• Index records [Manually and Automatically]
• Enable DDC number view in the VuFind
• Enable Koha OPAC link in the VuFind
•Outcome
•Conclusion
Introduction
•Every day, in the higher education system, a vast
amount of knowledge is generated. This knowledge
stored as information.
•Staff, students, and the general public can use the
information for academic and research purposes.
•The critical function of the library in the university
system is to coordinate, organize, and disseminate
information among the educational communities.
•In this digital age, the university library system has
introduced several ICT-based applications to provide
reliable information services to the community.
Problem Statement
•Many ICT-based applications and information search
interfaces are available in the libraries to disseminate
knowledge to users. Such as
• Integrated Library Management Systems
• Digital Repository
• Subject Guides
• Web Portal
• e-Journals and Databases

•As a consequence, when using different search


interfaces to access knowledge, information seekers
face many challenges.
• Time consuming
• User need additional knowledge
• Complexity of search interface
• Duplicate resources
Objectives
•To combine all available collection into
single search box.

•Connect all information interfaces through


a real-time process

•Enable all OPAC functionalities such as


circulation data, holds and SDI.

•Configure all the process with an


automated method.
Methodology
OAI-PMH
Harvest XML
Koha Instance 1 records

Indexing with
VuFind Solr
Koha Instance 2 interface

Connecting via
Via MariaDB
KohaILS
KohaILS-DI
Koha Instance 3
KohaRest

Koha Instance N
Process in Details
• Enabling OAI-PMH in Koha
Home › Administration › System preferences > Web services
• Visit the Koha {OPAC URL}/cgi-bin/koha/oai.pl in your web browser to see if the service is enabled. You should see
something similar to the following screenshot if the service is enabled.
• Click the Records tab and check the record metadata format [marc21], and you should see something similar to the
following:
•Enabling ILSDI in Koha
Home › Administration › System preferences > Web services
Enable RestApi in Koha
Go to Home › Administration › System preferences - Web services preferences and enable REST API
Download the .kpz [https://github.com/NatLibFi/koha-plugin-rest-di/releases] file and follow the
instructions given in the web [https://github.com/NatLibFi/koha-plugin-rest-di].
Install Plugin
Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers. It
boosting the performance of Koha web applications. Also, its creates cache for speed. Make sure the PC
has good amount of RAM [>8GB], if you are going to enable Plack.

Enable plack and start.


sudo koha-plack --enable {Instance}
sudo koha-plack --start {Instance}
sudo service apache2 restart
Enable plugin in the koha-conf.xml
in the /etc/koha/sites/<instance>
While using KohaRest Api, in /etc/apache2/sites-available/<instance.conf> add the following line as shown
below:
Login as the user then click more
tab and click Manage API Keys

Generate API client ID and Secret


Key
Create new MariaDB User in Koha servers
MariaDB is a community fork of MySQL. Latest versions of Koha support MariaDB. Either you can use
MySQL or MariaDB.
sudo mysql -u root -p
Enter your password and access the MariaDB client.
Create new MariaDB User
To create a new MariaDB user, type the following command:
CREATE USER 'user1'@%' IDENTIFIED BY 'password';
Grant permission(privileges) to MariaDB, type the following statement:
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Check whether connection permit or not by the following code with a command line from the VuFind end. It
does not succeed; then you have to discuss with your network admin and enable the 3306 port in your
network proxy or firewall.
telnet KohaSeverIP 3306
Configuration setup in VuFind
Configuration of three types of drivers i.e. Koha ILS, Koha ILS-DI and RestApi are enabled.
Koha Instance1: Library1 - using driver Koha ILS
Koha Instance2: Library2 - using driver Koha ILS-DI
Koha Instance3: Library3 - using driver KohaRestApi

Files structure of the import and marc properties

Library1 Library2 Library3


import-Library1.properties import-Library2.properties import-Library3.properties
marc_local_Library1.properties marc_local_Library2.properties marc_local_Library3.properties
Go to $VUFIND_HOME/import and copy following files and move into $VUFIND_LOCAL/import
Directory.
copy usr/local/vufind/import/import.properties usr/local/vufind/local/import
copy usr/local/vufind/import/marc_local.properties usr/local/vufind/local/import

copy import.properties to import-Library1.properties [instance 1]


copy import.properties to import-Library2.properties [instance 2]
copy import.properties to import-Library3.properties [instance3]

copy marc.local.properties to marc_local_Library1.properties [instance 1]


copy marc.local.properties to marc_local_Library2.properties [instance 2]
copy marc.local.properties to marc_local_Library3.properties [instance3]
import-Library1.properties

marc_local_Library1.properties
import-Library2.properties

marc_local_Library2.properties
import-Library3.properties

marc_local_Library3.properties
Go to $VUFIND_HOME/confing/vufind and copy following files and moves into
$VUFIND_LOCAL/config/vufind Directory.

copy usr/local/vufind/config/vufind/Koha.ini usr/local/vufind/local/config/vufind


copy usr/local/vufind/config/vufind/KohaILSDI.ini usr/local/vufind/local/config/vufind
copy usr/local/vufind/config/vufind/KohaRest.ini usr/local/vufind/local/config/vufind
copy usr/local/vufind/config/vufind/MultiBackend.ini usr/local/vufind/local/config/vufind

Rename Koha.ini to Library1.ini [instance 1]


Rename KohaILSDI.ini to Library2.ini [instance 2]
Rename KohaRest.ini to Library3.ini [instance3]
Library1.ini

Library2.ini

In the URL instead of IP you can use


your domain name as well
Library3.ini
MultiBackend.ini
Confing.ini
Edit /usr/local/vufind/local/harvest/oai.ini
for Koha instances
Manually harvest and indexing marc records into VuFind.

Run the following commands under $VUFIND_HOME/harvest

php harvest_oai.php

./batch-import-marc.sh -p /usr/local/vufind/local/import/import-Library1.properties KOHA_Library1

./batch-import-marc.sh -p /usr/local/vufind/local/import/import-Library2.properties KOHA_Library2

./batch-import-marc.sh -p /usr/local/vufind/local/import/import-Library3.properties KOHA_Library3

./batch-import-xsl.sh DSpace dspace.properties


Instead of using manual harvesting, auto incremental harvesting and indexing can also be done as given below:
#!/bin/bash
# Set up necessary environment variables
export PATH=/bin:/usr/bin:/usr/local/bin
source /etc/profile.d/vufind.sh

# Harvest new records:


php $VUFIND_HOME/harvest/harvest_oai.php KOHA_Library1
php $VUFIND_HOME/harvest/harvest_oai.php KOHA_Library2
php $VUFIND_HOME/harvest/harvest_oai.php KOHA_Library3

# Process harvested Koha records:


$VUFIND_HOME/harvest/batch-import-marc.sh -p $VUFIND_LOCAL_DIR/import/import-Library1.properties KOHA_Library1
$VUFIND_HOME/harvest/batch-delete.sh KOHA_Library1
$VUFIND_HOME/harvest/batch-import-marc.sh -p $VUFIND_LOCAL_DIR/import/import-Library2.properties KOHA_Library2
$VUFIND_HOME/harvest/batch-delete.sh KOHA_Library2
$VUFIND_HOME/harvest/batch-import-marc.sh -p $VUFIND_LOCAL_DIR/import/import-Library3.properties KOHA_Library3
$VUFIND_HOME/harvest/batch-delete.sh KOHA_Library3
# Rebuild index
$VUFIND_HOME/index-alphabetic-browse.sh
Locate the above auto script harvesting file under the $VUFIND_HOME/harvest and add the cronjob in
crontab -e file.
15 20 * * * $VUFIND_HOME/harvest/harvest.sh
(15 20 * * * = Timing in 24 hour format; evening 8:15 p.m)
Auto deleting cache file
#!/bin/bash
COMMAND_LINE_USER=root
sudo rm -rf $VUFIND_LOCAL_DIR/cache/*
sudo mkdir $VUFIND_LOCAL_DIR/cache/cli
sudo chown $COMMAND_LINE_USER:$COMMAND_LINE_USER $VUFIND_LOCAL_DIR/cache/cli
curl http://localhost:8983/solr/biblio/update -H "Content-Type: text/xml" --data-binary
'<delete><query>id:Library1.*</query></delete>'
Auto deleting harvest records
#!/bin/bash
COMMAND_LINE_USER=root

sudo rm -rf $VUFIND_LOCAL_DIR/harvest/KOHA*


sudo rm -rf $VUFIND_LOCAL_DIR/harvest/Dspace

Auto deleting index records


#!/bin/bash
COMMAND_LINE_USER=root

sudo rm -rf $VUFIND_HOME/solr/vufind/biblio/index


sudo rm -rf $VUFIND_HOME/solr/vufind/biblio/spell*
Linking KOHA OPAC records into VuFind search results
Linking KOHA OPAC records into VuFind search results
Edit $VUFIND_HOME/ module/VuFind/src/VuFind/RecordDriver/MarcAdvancedTrait.php as follows.
Go to end of the {public function getURL} section and insert following lines into the file.
In the highlighted area you have to insert your Library names like Library1, Library2 and Libray3……
And the getUniqueId(9) you have mentioned your {instance name +1} digits total.
Here instance name Library1 and + 1 = 9.
Otherwise, you can get the details from the marc_local_Library1.Properties file.
if (in_array('Library1', $this->fields['building'] ?? [])) {
$retVal[] = [
'url' => 'http://182.93.84.137:7006/cgi-bin/koha/opac-detail.pl?biblionumber=' . urlencode(substr($this->getUniqueId(), 9)),
'desc' => 'See in Koha'
];
}
if (in_array('Library2', $this->fields['building'] ?? [])) {
$retVal[] = [
'url' => 'http://182.93.84.137:9012/cgi-bin/koha/opac-detail.pl?biblionumber=' . urlencode(substr($this->getUniqueId(), 9)),
'desc' => 'See in Koha'
];
}
if (in_array('Library3', $this->fields['building'] ?? [])) {
$retVal[] = [
'url' => 'http://182.93.84.137:6002/cgi-bin/koha/opac-detail.pl?biblionumber=' . urlencode(substr($this->getUniqueId(), 9)),
'desc' => 'See in Koha'
];
}
return $retVal;
}
Enabling the DDC Number in Vufind front page
The default VuFind page shows the call number according to the LLC, but mostly in the South Asian region
we are using DDC. Therefore, the following steps show how to change LLCC to DCC
Enabling configuration in the $VUFIND_LOCAL_DIR/config/vufind/config.ini file
1. Make dewy = true and lcc = false
Copy facets.ini from $VUFIND_HOME/config/vufind to $VUFIND_LOCAL_DIR/config/vufind and edit as
follow.
Disable callnumber-first and enable dewey-hundreds.
Copy searches.ini from $VUFIND_HOME/config/vufind to $VUFIND_LOCAL_DIR/config/vufind and edit as
follow.

Disable callnumber-sort and enable dewey-sort.


Outcome
Access the VuFind interface via Koha Credentials

In this document we have connected Koha database through three different processes such as KohaILS,
KohaILS-DI and KohaRestApi. According to our observation, there are some fewer facilities through
KohaILS and KohaILS-DI interface, but the RestApi we can easily login into the VuFind interface using
Koha credentials and have more OPAC functionalities.
Conclusion
The VuFind based discovery tool is not a replacement for the existing integrated management
systems or repositories. Yet, it adds value to the user experience.
Also, the strongly recommended implementation of ILS-DI and RestApi based discovery
applications in universities and academic libraries will increase organizations' expectations and
attract their users with better quality services.
Thank You

You might also like