1. Create a test view in Finna (Vufind) by copying your current default (production) view
  2. Edit test view and make changes in
    1. Paikalliset aineistot:
      1. in Hakuindeksi, select Testi-indeksi
      2. in Tietokannat, remove the production database (e.g. 3amk), Then add new database by searching it in the search box (Lisää tietokanta). Move the test server database (e.g. kohakk) to the top of the list.
    2. Muut asetukset:
      1. in Tunnistautuminen, remove Shibboleth (this authentication is not recommended to use in test views)
      2. in Tunnnistautuminen kirjastokortilla, remove the current production library code (e.g. 3amk). Then select the name of the test database (e.g. kohakk)
      3. in Oletus, change database name (e.g. kohakk) to be the default option.
    3. Ulkoasu:
      1. in Etusivu, change background image, change headings etc., and do enough visible changes which help testers to identify that this is an actual test environment


  3. In Koha test server, install Koha Rest API plugin (REST API plugin for Koha for discovery interfaces) and enable it cgi-bin/koha/plugins/plugins-home.pl
    1. for Finna-Koha libraries, National library of Finland is maintaining this plugin, https://github.com/NatLibFi/koha-plugin-rest-di
  4. In Koha, go to Home -> Koha administration -> Global system preferences -> Web services
    1. Set the RESTOAuth2ClientCredentials option to "Enabled"
    2. To verify the API is working go to http://<staff-or-opac-ip-or-hostname>/api/v1/.html
  5. In Koha test server's Staff view, create an account for Finna (Vufind)
    1. Give this account necessary permissions: More > Set permissions. These might differ depending on library's configuration.
      • circulate_remaining_permissions
      • catalogue
      • borrowers
        • delete_borrowers (check if this is necessary)
        • edit_borrowers
        • view_borrower_infos_from_any_libraries
      • reserveforothers

        • modify_holds_priority

        • place_holds

      • updatecharges

        • manual_credit (check if this is necessary)
        • manual_invoice (check if this is necessary)
        • payout

        • remaining_permissions

      • loggedinlibrary (check if this is necessary)

    2. Next create API key(s) for Finna account, click More -> Manage API keys

      1. Generate a new client id/secret pair and give a description for the key (e.g. Finna or Oauth2-Api-Key).

      2. The Client ID and secret will be shown. Copy them to a safe location.

  6. In Finna's test view, go to Tiedostonhallinta (File management). Here we are using kohakk test server as an example, and its Rest API driver is KohaRest_kvkoha.ini

    1. copy suitable KohaRest driver file, which matches your Koha test server, from local/config/finna/     to local/config/vufind

      1. e.g. copy local/config/finna/KohaRest_kvkoha.ini  to local/config/vufind/KohaRest_kvkoha.ini

      2. Edit KohaRest_xxx.ini file and add API key Client ID and client secret, which you created in Koha
        [Catalog]
        ; OAuth2 client ID
        clientId = ""
        ; OAuth2 client secret
        clientSecret = ""

      3. if a library consortium has several Finna views (e.g. 3amk has three different user interfaces) with their own settings and services (like webpayment), make sure that your file path is correct on KohaRest_xxx.ini file

        [Parent_Config]
        relative_path = ../finna/KohaRest_kvkoha.ini"

        In a nutshell

        • the Finna config directory local/config/finna is global (common for all user interfaces), and
        • the Vufind config directory local/config/vufind is local (private for the specific user interface).
          If one wants to override global settings, one can do it modifying files in Vufind folder.



    2. make changes to datasources.ini

      1. if you have  e.g. webpayment and you want to test that in test view and Koha test server. Remove production database settings, and add test settings (e.g. kohakk) in
        /local/config/vufind/datasources.ini

        [kohakk]
        feedbackEmail = ""
        ; Online payment
        onlinePayment['handler'] = 'PaytrailPaymentAPI'
        onlinePayment['url'] = 'payment.verkkomaksut.fi'
        onlinePayment['merchantId'] = ''
        onlinePayment['secret'] = ''

  7. Ask Finna-toimisto to reharvest Koha test server database (if biblios or patrons count is not accurate enough)

  8. More server side technical setup information on: https://github.com/teogramm/koha-vufind-install


  • No labels