Obsah

Added Content from Obalkyknih.cz

Obalkyknih.cz account

If your library wishes to use added content provided by Obalkyknih.cz, you have to create an Obalkyknih.cz account (http://obalkyknih.cz/signup). Please note that the interface is only available in Czech. After logging in your Obalkyknih.cz account, you have to add your IP address and Evergreen server address to your account settings. (In case each library uses an address of its own, all of these addresses have to be added.)

Including added content in Evergreen

Support for displaying added content provided by Obalkyknih.cz is to be included in future releases of Evergreen ILS (from 2017 onwards). At this stage you need to change Evergreen source code to be able to pull the added content from Obalkyknih.cz.

Adding Perl module ObalkyKnih.pm to AddedContent directory

Create a file ObalkyKnih.pm in /usr/local/share/perl/5.20.2/OpenILS/WWW/AddedContent directory.

Customizing online catalog templates

config.tt2

Add the following code to file /openils/var/templates/opac/parts/config.tt2: ############################################################################## # Obalkyknih.cz support ############################################################################## # Obalkyknihy.cz is free Czech service providing added content and book covers # Set to 'true' to enable ############################################################################## obalkyknih_cz.enabled = 'true';

summary.tt2

Change parts of code in /openils/var/templates/opac/parts/record/summary.tt2 file (in 2.10.5 release it can be located at lines 28 to 33):

Delete the following lines:

 <div id="rdetail_image_div">
        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
            alt="[% l('Image of item') %]" id='rdetail_image'
            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
        <br />
    </div>

Replace them with:

   <div id="rdetail_image_div">
           [%- INCLUDE "opac/parts/record/jackets.tt2" %]
    </div>

jackets.tt2

Create a /openils/var/templates/opac/parts/record/jackets.tt2 file with the following contents:

[%- IF obalkyknih_cz.enabled == 'true' %]
    [%- 
      isbnissn = '';
      IF attrs.isbns.0;
              isbnissn = attrs.isbns.0;
              IF (matches = isbnissn.match('^(.+?)(\s.+)$'));
                isbnissn = matches.0;
              END;
            END;
            IF attrs.issns.0;
              isbnissn=attrs.issns.0;
            END;
     %]
        <a href='http://obalkyknih.cz/view?isbn=[% isbnissn %]'  title="[% l('Title info at Obalkyknih.cz') %]">
            <img
              alt="[% l('Image of item') %]" id='rdetail_image'
              src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
        </a>
        <br />
[%  ELSE %]
        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
            alt="[% l('Image of item') %]" id='rdetail_image'
            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
        </a>
[%- END  %]

Adding support for ObalkyKnih.cz to Evergreen configuration

To enable Obalkyknih.cz service add the following code to added_content section of configuration file /openils/conf/opensrf.xml:

<ObalkyKnih>
                <!-- Covers are there always -->

                <!-- Annotations provided by obalkyknih.cz is mapped to evergreen summary -->
                <summary>false</summary>
                
                <!-- Provider obalkyknih.cz provides TOC as text and as PDF plus thumbnail -->
                <tocPdf>true</tocPdf>
                <tocText>false</tocText>
                
                <!-- User reviews from obalkyknih.cz -->
                <reviews>true</reviews>

            </ObalkyKnih>

At the same time you have to disable added content from Open Library (Evergreen's default added content provider) and enable added content from Obalkyknih.cz instead:

 <!-- <module>OpenILS::WWW::AddedContent::OpenLibrary</module> -->
 <module>OpenILS::WWW::AddedContent::ObalkyKnih</module>

Switching on/off some types of added content

Using default settings for Obalkyknih.cz means all types of added content from Obalkyknih.cz are visible in your online catalog. If the module is enabled, book covers are always displayed. Other types of added content (summaries, ratings or tables of contents) can be:

The following types of added content are used:

An example of how to switch off summaries:

 <summary>false</summary>

Getting source file(s)

Project's current code is available via Git.

Česky (Czech)

Dokumentace v češtině / Documentaion in Czech language

A module for pulling added content from Obalkyknih.cz to Evergreen online catalog has been developed as part of „Enhancing Ján Langoš Library services with the aide of Evergreen free software“ project supported by Public Library Information Services 3 (VISK 3 in Czech) grant scheme.