User Tools

Site Tools


dev:opac:template-toolkit

This is an old revision of the document!


Template Toolkit OPAC Installation

Author: Bill Erickson
Date: 2011-03-08

The Code

The code currently lives in an ESI Git branch called "opac-tt-poc". You can view the code and watch changes here.

Downloading the code by creating a git clone of the branch

$ git clone git://git.esilibrary.com/git/evergreen-equinox.git
$ cd evergreen-equinox
$ git checkout -b opac-tt-poc origin/opac-tt-poc

The code changes frequently. You can update the code by pulling changes from the repository.

$ git checkout opac-tt-poc # just in case
$ git pull origin opac-tt-poc
Prerequisites
  1. Install the following additional Perl modules via OS package manager or CPAN:
    • Template::Plugin::POSIX
    • Locale::Maketext::Lexicon
Installing Over an existing Evergreen installation (2.1+)
  1. Copy these files from the repository into place on the file system. Your mileage may vary on OS-dependent paths. Note: Be careful not to clobber local changes you didn't want clobbered.
    • $ sudo cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/
      $ sudo -u opensrf cp Open-ILS/examples/oils_web.xml.example /openils/conf/oils_web.xml
      $ sudo cp -r Open-ILS/src/perlmods/lib/OpenILS/WWW/* /usr/local/share/perl/5.10.1/OpenILS/WWW/
      $ sudo -u opensrf cp -r Open-ILS/web/* /openils/var/web/
  2. Reload or restart Apache.
  3. Navigate to http://SERVER/eg/opac/home and you should see the KCLS-skinned server-side OPAC.
Customizing

Skinning

TODO

Custom Perl Handler

It's possible to override specific behavior of the default OPAC mod_perl handler by sub-classing the default and selecting methods to override.

  • Create a local Perl module that is a subclass of OpenILS::WWW::EGCatLoader. Example:
    package EGCatLoaderLocal;
    use base 'OpenILS::WWW::EGCatLoader';
    # override a single method
    sub redirect_auth {
        my $self = shift;
        return $self->generic_redirect("http://my-fancy-auth-service.example.org");
    }
  • Configure the new Perl module as the OPAC handler in Apache
    <Location /eg/opac>
        #PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader"
        PerlSetVar OILSWebContextLoader "EGCatLoaderLocal"
    </Location>
  • Reload Apache
dev/opac/template-toolkit.1303847034.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.