example search for Koha database
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jul 2009 15:10:23 +0000 (15:10 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jul 2009 15:10:23 +0000 (15:10 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1239 07558da8-63fa-0310-ba24-9fe276d99e06

vhost/koha/config.yml [new file with mode: 0644]
vhost/koha/html.pm [new file with mode: 0644]
vhost/koha/koha-labels.txt [new file with mode: 0644]
vhost/koha/marc.pl [new file with mode: 0644]

diff --git a/vhost/koha/config.yml b/vhost/koha/config.yml
new file mode 100644 (file)
index 0000000..b2ec4d9
--- /dev/null
@@ -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 (file)
index 0000000..9aabf1e
--- /dev/null
@@ -0,0 +1,18 @@
+package koha::html;
+
+use strict;
+use warnings;
+
+sub url {
+       my ($self,$url) = @_;
+       qq{<a href="$url">$url</a>};
+}
+
+sub title {
+       my ($self,$title,$data) = @_;
+       my $biblionumber = $data->{biblionumber} || die; # title only without biblionumber
+
+       qq|<a target="koha.ffzg.hr" href="http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber">$title</a>|;
+}
+
+1;
diff --git a/vhost/koha/koha-labels.txt b/vhost/koha/koha-labels.txt
new file mode 100644 (file)
index 0000000..46ba28d
--- /dev/null
@@ -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 (file)
index 0000000..767e323
--- /dev/null
@@ -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')
+);