From 3f2da5feb7a81fe92e484d2e691905ee2d97f4e9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 12 Jul 2009 15:10:23 +0000 Subject: [PATCH] example search for Koha database git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1239 07558da8-63fa-0310-ba24-9fe276d99e06 --- vhost/koha/config.yml | 24 ++++++++++++++++++++++++ vhost/koha/html.pm | 18 ++++++++++++++++++ vhost/koha/koha-labels.txt | 4 ++++ vhost/koha/marc.pl | 29 +++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 vhost/koha/config.yml create mode 100644 vhost/koha/html.pm create mode 100644 vhost/koha/koha-labels.txt create mode 100644 vhost/koha/marc.pl diff --git a/vhost/koha/config.yml b/vhost/koha/config.yml new file mode 100644 index 0000000..b2ec4d9 --- /dev/null +++ b/vhost/koha/config.yml @@ -0,0 +1,24 @@ +# Encoding of this file must be UTF-8! + +vhost: + no_results: 'nema rezultata' + +databases: + koha: + name: 'Katalog knjižnice Filozofskog fakulteta' + description: 'pretraživanje kataloga' + input: + - name: 'database' + module: 'WebPAC::Input::Koha' + path: 'var/koha.marc' + hide: 1 + - name: 'marc' + module: 'WebPAC::Input::MARC' + path: 'var/koha.marc' + decription: 'Zapisi iz kataloga' + normalize: + path: 'vhost/koha/marc.pl' + output: + module: 'WebPAC::Output::SWISH' + database: 'ecas' + diff --git a/vhost/koha/html.pm b/vhost/koha/html.pm new file mode 100644 index 0000000..9aabf1e --- /dev/null +++ b/vhost/koha/html.pm @@ -0,0 +1,18 @@ +package koha::html; + +use strict; +use warnings; + +sub url { + my ($self,$url) = @_; + qq{$url}; +} + +sub title { + my ($self,$title,$data) = @_; + my $biblionumber = $data->{biblionumber} || die; # title only without biblionumber + + qq|$title|; +} + +1; diff --git a/vhost/koha/koha-labels.txt b/vhost/koha/koha-labels.txt new file mode 100644 index 0000000..46ba28d --- /dev/null +++ b/vhost/koha/koha-labels.txt @@ -0,0 +1,4 @@ +author Author +title Title +isbn ISBN +impressum Impressum diff --git a/vhost/koha/marc.pl b/vhost/koha/marc.pl new file mode 100644 index 0000000..767e323 --- /dev/null +++ b/vhost/koha/marc.pl @@ -0,0 +1,29 @@ +search( 'author', + join_with(' ; ', + rec('100','a'), + rec('700','a') + ) +); +search( 'title', + join_with(' ', + rec('245','a'), + rec('245','b'), + rec('245','c'), + ) +); +search( 'isbn', rec('020','a') ); +search( 'impressum', + join_with(' ', + rec('260','a'), + rec('260','b'), + rec('260','c'), + ) +); +search( 'keywords', + join_with(' ; ', + rec('653','a') + ) +); +search( 'biblionumber', + rec('999','c') +); -- 2.20.1