View | Details | Raw Unified | Return to bug 20410
Collapse All | Expand All

(-)a/C4/Search.pm (-75 lines)
Lines 23-29 use C4::Koha; # getFacets Link Here
23
use Koha::DateUtils;
23
use Koha::DateUtils;
24
use Koha::Libraries;
24
use Koha::Libraries;
25
use Lingua::Stem;
25
use Lingua::Stem;
26
use C4::Search::PazPar2;
27
use XML::Simple;
26
use XML::Simple;
28
use C4::XSLT;
27
use C4::XSLT;
29
use C4::Reserves;    # GetReserveStatus
28
use C4::Reserves;    # GetReserveStatus
Lines 804-883 sub _get_facets_info { Link Here
804
    return $facets_info;
803
    return $facets_info;
805
}
804
}
806
805
807
sub pazGetRecords {
808
    my (
809
        $koha_query,       $simple_query, $sort_by_ref,    $servers_ref,
810
        $results_per_page, $offset,       $branches,       $query_type,
811
        $scan
812
    ) = @_;
813
    #NOTE: Parameter $branches is not used here !
814
815
    my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url'));
816
    $paz->init();
817
    $paz->search($simple_query);
818
    sleep 1;   # FIXME: WHY?
819
820
    # do results
821
    my $results_hashref = {};
822
    my $stats = XMLin($paz->stat);
823
    my $results = XMLin($paz->show($offset, $results_per_page, 'work-title:1'), forcearray => 1);
824
825
    # for a grouped search result, the number of hits
826
    # is the number of groups returned; 'bib_hits' will have
827
    # the total number of bibs.
828
    $results_hashref->{'biblioserver'}->{'hits'} = $results->{'merged'}->[0];
829
    $results_hashref->{'biblioserver'}->{'bib_hits'} = $stats->{'hits'};
830
831
    HIT: foreach my $hit (@{ $results->{'hit'} }) {
832
        my $recid = $hit->{recid}->[0];
833
834
        my $work_title = $hit->{'md-work-title'}->[0];
835
        my $work_author;
836
        if (exists $hit->{'md-work-author'}) {
837
            $work_author = $hit->{'md-work-author'}->[0];
838
        }
839
        my $group_label = (defined $work_author) ? "$work_title / $work_author" : $work_title;
840
841
        my $result_group = {};
842
        $result_group->{'group_label'} = $group_label;
843
        $result_group->{'group_merge_key'} = $recid;
844
845
        my $count = 1;
846
        if (exists $hit->{count}) {
847
            $count = $hit->{count}->[0];
848
        }
849
        $result_group->{'group_count'} = $count;
850
851
        for (my $i = 0; $i < $count; $i++) {
852
            # FIXME -- may need to worry about diacritics here
853
            my $rec = $paz->record($recid, $i);
854
            push @{ $result_group->{'RECORDS'} }, $rec;
855
        }
856
857
        push @{ $results_hashref->{'biblioserver'}->{'GROUPS'} }, $result_group;
858
    }
859
860
    # pass through facets
861
    my $termlist_xml = $paz->termlist('author,subject');
862
    my $terms = XMLin($termlist_xml, forcearray => 1);
863
    my @facets_loop = ();
864
    #die Dumper($results);
865
#    foreach my $list (sort keys %{ $terms->{'list'} }) {
866
#        my @facets = ();
867
#        foreach my $facet (sort @{ $terms->{'list'}->{$list}->{'term'} } ) {
868
#            push @facets, {
869
#                facet_label_value => $facet->{'name'}->[0],
870
#            };
871
#        }
872
#        push @facets_loop, ( {
873
#            type_label => $list,
874
#            facets => \@facets,
875
#        } );
876
#    }
877
878
    return ( undef, $results_hashref, \@facets_loop );
879
}
880
881
# TRUNCATION
806
# TRUNCATION
882
sub _detect_truncation {
807
sub _detect_truncation {
883
    my ( $operand, $index ) = @_;
808
    my ( $operand, $index ) = @_;
(-)a/C4/UsageStats.pm (-1 lines)
Lines 291-297 sub BuildReport { Link Here
291
        TalkingTechItivaPhoneNotification
291
        TalkingTechItivaPhoneNotification
292
        uppercasesurnames
292
        uppercasesurnames
293
        IncludeSeeFromInSearches
293
        IncludeSeeFromInSearches
294
        OpacGroupResults
295
        QueryAutoTruncate
294
        QueryAutoTruncate
296
        QueryFuzzy
295
        QueryFuzzy
297
        QueryStemming
296
        QueryStemming
(-)a/Makefile.PL (-60 / +1 lines)
Lines 94-100 Makefile.PL - Koha packager and installer Link Here
94
    --koha_user                  Koha Unix user (e.g. koha)
94
    --koha_user                  Koha Unix user (e.g. koha)
95
    --koha_group                 Koha Unix group (e.g. koha)
95
    --koha_group                 Koha Unix group (e.g. koha)
96
    --install_sru                Install the SRU server (yes, no)
96
    --install_sru                Install the SRU server (yes, no)
97
    --install_pazpar2            Install PazPar2 (yes, no)
98
    --use_memcached              Use Memcached (yes, no)
97
    --use_memcached              Use Memcached (yes, no)
99
    --font_dir                   Location of fonts (e.g. /usr/share/fonts/truetype/dejavu)
98
    --font_dir                   Location of fonts (e.g. /usr/share/fonts/truetype/dejavu)
100
    --run_database_tests         Run database dependent tests (yes, no)
99
    --run_database_tests         Run database dependent tests (yes, no)
Lines 280-289 Directory for backup files produced by Koha. Link Here
280
279
281
Directory for external Koha plugins.
280
Directory for external Koha plugins.
282
281
283
=item PAZPAR2_CONF_DIR
284
285
Directory for PazPar2 configuration files.
286
287
=item FONT_DIR
282
=item FONT_DIR
288
283
289
Directory where DejaVu fonts are installed.
284
Directory where DejaVu fonts are installed.
Lines 328-334 my $target_map = { Link Here
328
  './etc'                       => { target => 'KOHA_CONF_DIR', trimdir => -1 },
323
  './etc'                       => { target => 'KOHA_CONF_DIR', trimdir => -1 },
329
  './etc/zebradb'               => { target => 'ZEBRA_CONF_DIR', trimdir => -1 },
324
  './etc/zebradb'               => { target => 'ZEBRA_CONF_DIR', trimdir => -1 },
330
  './etc/z3950'                 => { target => 'Z3950_CONF_DIR', trimdir => -1 },
325
  './etc/z3950'                 => { target => 'Z3950_CONF_DIR', trimdir => -1 },
331
  './etc/pazpar2'               => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 },
332
  './help.pl'                   => 'INTRANET_CGI_DIR',
326
  './help.pl'                   => 'INTRANET_CGI_DIR',
333
  './ill'                       => 'INTRANET_CGI_DIR',
327
  './ill'                       => 'INTRANET_CGI_DIR',
334
  './installer-CPAN.pl'         => 'NONE',
328
  './installer-CPAN.pl'         => 'NONE',
Lines 517-523 my %config_defaults = ( Link Here
517
  'DB_TLS_CLIENT_CERTIFICATE'  => '/etc/mysql-ssl/client-cert.pem',
511
  'DB_TLS_CLIENT_CERTIFICATE'  => '/etc/mysql-ssl/client-cert.pem',
518
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
512
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
519
  'INSTALL_SRU'       => 'yes',
513
  'INSTALL_SRU'       => 'yes',
520
  'INSTALL_PAZPAR2'   => 'no',
521
  'ZEBRA_MARC_FORMAT' => 'marc21',
514
  'ZEBRA_MARC_FORMAT' => 'marc21',
522
  'ZEBRA_LANGUAGE'    => 'en',
515
  'ZEBRA_LANGUAGE'    => 'en',
523
  'ZEBRA_TOKENIZER'   => 'chr',
516
  'ZEBRA_TOKENIZER'   => 'chr',
Lines 530-537 my %config_defaults = ( Link Here
530
  'KOHA_GROUP'        => 'koha',
523
  'KOHA_GROUP'        => 'koha',
531
  'MERGE_SERVER_HOST' => 'localhost',
524
  'MERGE_SERVER_HOST' => 'localhost',
532
  'MERGE_SERVER_PORT' => '11001',
525
  'MERGE_SERVER_PORT' => '11001',
533
  'PAZPAR2_HOST' => 'localhost',
534
  'PAZPAR2_PORT' => '11002',
535
  'RUN_DATABASE_TESTS' => 'no',
526
  'RUN_DATABASE_TESTS' => 'no',
536
  'PATH_TO_ZEBRA' => '',
527
  'PATH_TO_ZEBRA' => '',
537
  'USE_MEMCACHED'     => 'yes',
528
  'USE_MEMCACHED'     => 'yes',
Lines 603-609 my $cli_zebra_sru_auth_port = ""; Link Here
603
my $cli_koha_user = "";
594
my $cli_koha_user = "";
604
my $cli_koha_group = "";
595
my $cli_koha_group = "";
605
my $cli_koha_install_sru = "";
596
my $cli_koha_install_sru = "";
606
my $cli_koha_install_pazpar2 = "";
607
my $cli_koha_use_memcached = "";
597
my $cli_koha_use_memcached = "";
608
my $cli_koha_font_dir = "";
598
my $cli_koha_font_dir = "";
609
my $cli_koha_run_database_tests = "";
599
my $cli_koha_run_database_tests = "";
Lines 638-644 my $results = GetOptions( Link Here
638
    "koha_user=s"                  => \$cli_koha_user,
628
    "koha_user=s"                  => \$cli_koha_user,
639
    "koha_group=s"                 => \$cli_koha_group,
629
    "koha_group=s"                 => \$cli_koha_group,
640
    "install_sru=s"                => \$cli_koha_install_sru,
630
    "install_sru=s"                => \$cli_koha_install_sru,
641
    "install_pazpar2=s"            => \$cli_koha_install_pazpar2,
642
    "use_memcached=s"              => \$cli_koha_use_memcached,
631
    "use_memcached=s"              => \$cli_koha_use_memcached,
643
    "font_dir=s"                   => \$cli_koha_font_dir,
632
    "font_dir=s"                   => \$cli_koha_font_dir,
644
    "run_database_tests=s"         => \$cli_koha_run_database_tests,
633
    "run_database_tests=s"         => \$cli_koha_run_database_tests,
Lines 692-706 push @{ $pl_files->{'rewrite-config.PL'} }, ( Link Here
692
);
681
);
693
push @{ $pl_files->{'rewrite-config.PL'} }, (
682
push @{ $pl_files->{'rewrite-config.PL'} }, (
694
    'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
683
    'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
695
    'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh',
696
    'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh',
684
    'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh',
697
);
685
);
698
if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
699
    push @{ $pl_files->{'rewrite-config.PL'} }, (
700
        'blib/PAZPAR2_CONF_DIR/koha-biblios.xml',
701
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
702
    );
703
}
704
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
686
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
705
$config{'ZEBRA_BIB_CFG'}  = 'zebra-biblios-dom.cfg';
687
$config{'ZEBRA_BIB_CFG'}  = 'zebra-biblios-dom.cfg';
706
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
688
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
Lines 921-927 sub get_cli_values { Link Here
921
        KOHA_USER                  => $cli_koha_user,
903
        KOHA_USER                  => $cli_koha_user,
922
        KOHA_GROUP                 => $cli_koha_group,
904
        KOHA_GROUP                 => $cli_koha_group,
923
        INSTALL_SRU                => $cli_koha_install_sru,
905
        INSTALL_SRU                => $cli_koha_install_sru,
924
        INSTALL_PAZPAR2            => $cli_koha_install_pazpar2,
925
        USE_MEMCACHED              => $cli_koha_use_memcached,
906
        USE_MEMCACHED              => $cli_koha_use_memcached,
926
        FONT_DIR                   => $cli_koha_font_dir,
907
        FONT_DIR                   => $cli_koha_font_dir,
927
        RUN_DATABASE_TESTS         => $cli_koha_run_database_tests,
908
        RUN_DATABASE_TESTS         => $cli_koha_run_database_tests,
Lines 1232-1272 SRU port for authority data?); Link Here
1232
1213
1233
    }
1214
    }
1234
1215
1235
    $msg = q(
1236
Along with Zebra, you can also choose to install PazPar2,
1237
which is a metasearch tool.  With PazPar2,
1238
Koha can perform on-the-fly merging of bibliographic
1239
records during searching, allowing for FRBRization of
1240
the results list.
1241
1242
Install the PazPar2 configuration files?);
1243
    $msg .= _add_valid_values_disp('INSTALL_PAZPAR2', $valid_values);
1244
    $config{'INSTALL_PAZPAR2'} = _get_value('INSTALL_PAZPAR2', $msg, $defaults->{'INSTALL_PAZPAR2'}, $valid_values, $install_log_values);
1245
1246
    if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
1247
        $msg = q(
1248
Since you've chosen to configure PazPar2, you must
1249
specify the host and port(s) that PazPar2
1250
uses:
1251
);
1252
        $msg = q(
1253
Zebra bibliographic server host?);
1254
        $config{'MERGE_SERVER_HOST'} = _get_value('MERGE_SERVER_HOST', $msg, $defaults->{'MERGE_SERVER_HOST'}, $valid_values, $install_log_values);
1255
1256
        $msg = q(
1257
Zebra bibliographic port for PazPar2 to use?);
1258
        $config{'MERGE_SERVER_PORT'} = _get_value('MERGE_SERVER_PORT', $msg, $defaults->{'MERGE_SERVER_PORT'}, $valid_values, $install_log_values);
1259
1260
        $msg = q(
1261
PazPar2 host?);
1262
        $config{'PAZPAR2_HOST'} = _get_value('PAZPAR2_HOST', $msg, $defaults->{'PAZPAR2_HOST'}, $valid_values, $install_log_values);
1263
1264
        $msg = q(
1265
PazPar2 port?);
1266
        $config{'PAZPAR2_PORT'} = _get_value('PAZPAR2_PORT', $msg, $defaults->{'PAZPAR2_PORT'}, $valid_values, $install_log_values);
1267
1268
    }
1269
1270
  $msg = q(
1216
  $msg = q(
1271
Use memcached to cache the results of some function calls?
1217
Use memcached to cache the results of some function calls?
1272
This provides a significant performance improvement.
1218
This provides a significant performance improvement.
Lines 1489-1495 sub get_target_directories { Link Here
1489
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
1435
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
1490
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
1436
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
1491
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
1437
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
1492
        $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2');
1493
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1438
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1494
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1439
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1495
        $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
1440
        $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
Lines 1523-1529 sub get_target_directories { Link Here
1523
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
1468
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
1524
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
1469
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
1525
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
1470
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
1526
        $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2');
1527
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1471
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1528
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1472
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1529
        #For dev install, point NONDEV_DIR to misc in current dir (not base)
1473
        #For dev install, point NONDEV_DIR to misc in current dir (not base)
Lines 1552-1558 sub get_target_directories { Link Here
1552
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package);
1496
        $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package);
1553
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'zebradb');
1497
        $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'zebradb');
1554
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'z3950');
1498
        $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'z3950');
1555
        $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'pazpar2');
1556
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1499
        $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
1557
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1500
        $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
1558
        $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
1501
        $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
Lines 1782-1789 sub _update_zebra_conf_target { Link Here
1782
    $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
1725
    $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
1783
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n";
1726
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n";
1784
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1727
    $target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
1785
    $target .= "\t\t\$(KOHA_INST_PAZPAR2_CONF_DIR) \$(KOHA_DEST_PAZPAR2_CONF_DIR) \n";
1786
    $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_PAZPAR2_CONF_DIR)\n";
1787
1728
1788
    return $target;
1729
    return $target;
1789
}
1730
}
Lines 1809-1815 make_upgrade_backup :: Link Here
1809
\t\$(NOECHO) umask 022; \$(MOD_BACKUP) \\
1750
\t\$(NOECHO) umask 022; \$(MOD_BACKUP) \\
1810
/;
1751
/;
1811
    foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
1752
    foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
1812
                     PAZPAR2_CONF_DIR ZEBRA_CONF_DIR PLUGINS_DIR/) {
1753
                     ZEBRA_CONF_DIR PLUGINS_DIR/) {
1813
    	$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
1754
    	$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
1814
            unless exists $skip_directories->{$key} or
1755
            unless exists $skip_directories->{$key} or
1815
                   not exists $target_directories->{$key};
1756
                   not exists $target_directories->{$key};
(-)a/debian/koha-common.install (-1 lines)
Lines 1-5 Link Here
1
debian/tmp/usr/*                            usr
1
debian/tmp/usr/*                            usr
2
debian/tmp/etc/koha/pazpar2
3
debian/tmp/etc/koha/zebradb/[!z]*
2
debian/tmp/etc/koha/zebradb/[!z]*
4
debian/tmp/etc/koha/z3950
3
debian/tmp/etc/koha/z3950
5
debian/templates/* etc/koha
4
debian/templates/* etc/koha
(-)a/debian/koha-core.install (-1 lines)
Lines 1-5 Link Here
1
debian/tmp/usr/*                            usr
1
debian/tmp/usr/*                            usr
2
debian/tmp/etc/koha/pazpar2
3
debian/tmp/etc/koha/zebradb/[!z]*
2
debian/tmp/etc/koha/zebradb/[!z]*
4
debian/tmp/etc/koha/z3950
3
debian/tmp/etc/koha/z3950
5
debian/templates/* etc/koha
4
debian/templates/* etc/koha
(-)a/debian/templates/koha-conf-site.xml.in (-14 lines)
Lines 10-28 __START_SRU_PUBLICSERVER__ Link Here
10
<listen id="publicserver" >tcp:@:__SRU_BIBLIOS_PORT__</listen>
10
<listen id="publicserver" >tcp:@:__SRU_BIBLIOS_PORT__</listen>
11
__END_SRU_PUBLICSERVER__
11
__END_SRU_PUBLICSERVER__
12
12
13
<!-- Settings for special biblio server instance for PazPar2.
14
     Because PazPar2 only connects to a Z39.50 server using TCP/IP,
15
     it cannot use the Unix-domain socket that biblioserver uses.
16
     Therefore, a custom server is defined. -->
17
<!--
18
<listen id="mergeserver">tcp:@:__MERGE_SERVER_PORT__</listen>
19
<server id="mergeserver"  listenref="mergeserver">
20
    <directory>/var/lib/koha/__KOHASITE__/biblios</directory>
21
    <config>/etc/koha/sites/__KOHASITE__/zebra-biblios-dom.cfg</config>
22
    <cql2rpn>/var/lib/koha/__KOHASITE__/pqf.properties</cql2rpn>
23
</server>
24
-->
25
26
<!-- BIBLIOGRAPHIC RECORDS -->
13
<!-- BIBLIOGRAPHIC RECORDS -->
27
<server id="biblioserver"  listenref="biblioserver">
14
<server id="biblioserver"  listenref="biblioserver">
28
    <directory>/var/lib/koha/__KOHASITE__/biblios</directory>
15
    <directory>/var/lib/koha/__KOHASITE__/biblios</directory>
Lines 297-303 __END_SRU_PUBLICSERVER__ Link Here
297
      tool -->
284
      tool -->
298
 <backup_db_via_tools>0</backup_db_via_tools>
285
 <backup_db_via_tools>0</backup_db_via_tools>
299
 <backup_conf_via_tools>0</backup_conf_via_tools>
286
 <backup_conf_via_tools>0</backup_conf_via_tools>
300
 <!-- <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url> -->
301
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
287
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
302
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
288
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
303
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
289
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
(-)a/etc/koha-conf.xml (-14 lines)
Lines 14-32 Link Here
14
<listen id="publicserver" >tcp:@:__ZEBRA_SRU_BIBLIOS_PORT__</listen>
14
<listen id="publicserver" >tcp:@:__ZEBRA_SRU_BIBLIOS_PORT__</listen>
15
-->
15
-->
16
16
17
<!-- Settings for special biblio server instance for PazPar2.
18
     Because PazPar2 only connects to a Z39.50 server using TCP/IP,
19
     it cannot use the Unix-domain socket that biblioserver uses.
20
     Therefore, a custom server is defined. -->
21
__PAZPAR2_TOGGLE_XML_PRE__
22
<listen id="mergeserver">tcp:@:__MERGE_SERVER_PORT__</listen>
23
<server id="mergeserver"  listenref="mergeserver"> 
24
    <directory>__ZEBRA_DATA_DIR__/biblios</directory>
25
    <config>__ZEBRA_CONF_DIR__/__ZEBRA_BIB_CFG__</config>
26
    <cql2rpn>__ZEBRA_CONF_DIR__/pqf.properties</cql2rpn>
27
</server>
28
__PAZPAR2_TOGGLE_XML_POST__
29
30
<!-- BIBLIOGRAPHIC RECORDS -->
17
<!-- BIBLIOGRAPHIC RECORDS -->
31
<server id="biblioserver"  listenref="biblioserver"> 
18
<server id="biblioserver"  listenref="biblioserver"> 
32
    <directory>__ZEBRA_DATA_DIR__/biblios</directory>
19
    <directory>__ZEBRA_DATA_DIR__/biblios</directory>
Lines 114-120 __PAZPAR2_TOGGLE_XML_POST__ Link Here
114
 <!--
101
 <!--
115
 <supportdir>__SCRIPT_NONDEV_DIR__</supportdir>
102
 <supportdir>__SCRIPT_NONDEV_DIR__</supportdir>
116
 -->
103
 -->
117
 <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url>
118
 <install_log>__MISC_DIR__/koha-install-log</install_log>
104
 <install_log>__MISC_DIR__/koha-install-log</install_log>
119
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
105
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
120
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
106
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
(-)a/etc/pazpar2/MARC21slimUtils.xsl (-65 lines)
Lines 1-65 Link Here
1
<?xml version='1.0'?>
2
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
	<xsl:template name="datafield">
4
		<xsl:param name="tag"/>
5
		<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
6
		<xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
7
		<xsl:param name="subfields"/>
8
		<xsl:element name="datafield">
9
			<xsl:attribute name="tag">
10
				<xsl:value-of select="$tag"/>
11
			</xsl:attribute>
12
			<xsl:attribute name="ind1">
13
				<xsl:value-of select="$ind1"/>
14
			</xsl:attribute>
15
			<xsl:attribute name="ind2">
16
				<xsl:value-of select="$ind2"/>
17
			</xsl:attribute>
18
			<xsl:copy-of select="$subfields"/>
19
		</xsl:element>
20
	</xsl:template>
21
22
	<xsl:template name="subfieldSelect">
23
		<xsl:param name="codes"/>
24
		<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
25
		<xsl:variable name="str">
26
			<xsl:for-each select="marc:subfield">
27
				<xsl:if test="contains($codes, @code)">
28
					<xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
29
				</xsl:if>
30
			</xsl:for-each>
31
		</xsl:variable>
32
		<xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
33
	</xsl:template>
34
35
	<xsl:template name="buildSpaces">
36
		<xsl:param name="spaces"/>
37
		<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
38
		<xsl:if test="$spaces>0">
39
			<xsl:value-of select="$char"/>
40
			<xsl:call-template name="buildSpaces">
41
				<xsl:with-param name="spaces" select="$spaces - 1"/>
42
				<xsl:with-param name="char" select="$char"/>
43
			</xsl:call-template>
44
		</xsl:if>
45
	</xsl:template>
46
47
	<xsl:template name="chopPunctuation">
48
		<xsl:param name="chopString"/>
49
		<xsl:variable name="length" select="string-length($chopString)"/>
50
		<xsl:choose>
51
			<xsl:when test="$length=0"/>
52
			<xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
53
				<xsl:call-template name="chopPunctuation">
54
					<xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
55
				</xsl:call-template>
56
			</xsl:when>
57
			<xsl:when test="not($chopString)"/>
58
			<xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
59
		</xsl:choose>
60
	</xsl:template>
61
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
62
<metaInformation>
63
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
64
</metaInformation>
65
-->
(-)a/etc/pazpar2/koha-biblios.xml (-30 lines)
Lines 1-30 Link Here
1
<settings target="__MERGE_SERVER_HOST__:__MERGE_SERVER_PORT__/biblios">
2
3
  <set name="pz:name" value="Koha bib database"/>
4
5
  <!-- This file introduces default settings for pazpar2 -->
6
  <!-- $Id: loc.xml,v 1.2 2007-07-10 13:43:07 adam Exp $ -->
7
8
  <!-- mapping for unqualified search -->
9
  <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
10
11
  <!-- field-specific mappings -->
12
  
13
  <set name="pz:cclmap:au" value="u=1004 s=al"/>
14
  <set name="pz:cclmap:ti" value="u=4 s=al"/>
15
  <set name="pz:cclmap:su" value="u=21 s=al"/>
16
  <set name="pz:cclmap:isbn" value="u=7"/>
17
  <set name="pz:cclmap:issn" value="u=8"/>
18
  <set name="pz:cclmap:date" value="u=30 r=r"/>
19
20
  <!-- Retrieval settings -->
21
22
  <set name="pz:requestsyntax" value="marc21"/>
23
  <set name="pz:elements" value="F"/>
24
25
  <!-- Result normalization settings -->
26
27
  <set name="pz:nativesyntax" value="iso2709"/>
28
  <set name="pz:xslt" value="__ZEBRA_MARC_FORMAT__-work-groups.xsl"/>
29
30
</settings>
(-)a/etc/pazpar2/marc21-work-groups.xsl (-199 lines)
Lines 1-199 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: marc21.xsl,v 1.22 2007-10-04 12:01:15 adam Exp $ -->
3
<xsl:stylesheet
4
    version="1.0"
5
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
7
    xmlns:marc="http://www.loc.gov/MARC21/slim">
8
9
  
10
  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
11
12
<!-- Extract metadata from MARC21/USMARC 
13
      http://www.loc.gov/marc/bibliographic/ecbdhome.html
14
-->  
15
  <xsl:include href="MARC21slimUtils.xsl" />
16
  <xsl:include href="pz2-ourl-marc21.xsl" />
17
  
18
  <xsl:template match="/marc:record">
19
    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
20
    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
21
    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
22
    <xsl:variable name="medium">
23
      <xsl:choose>
24
	<xsl:when test="$title_medium">
25
	  <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
26
	</xsl:when>
27
	<xsl:when test="$electronic_location_url">
28
	  <xsl:text>electronic resource</xsl:text>
29
	</xsl:when>
30
	<xsl:when test="$journal_title">
31
	  <xsl:text>article</xsl:text>
32
	</xsl:when>
33
	<xsl:otherwise>
34
	  <xsl:text>book</xsl:text>
35
	</xsl:otherwise>
36
      </xsl:choose>
37
    </xsl:variable>
38
39
    <xsl:variable name="uniform_title_key">
40
        <xsl:choose>
41
            <xsl:when test="marc:datafield[@tag='130']">
42
                <xsl:for-each select="marc:datafield[@tag='130']">
43
                    <xsl:call-template name="subfieldSelect">
44
                        <xsl:with-param name="codes">adgknmpr</xsl:with-param>
45
                    </xsl:call-template>
46
                </xsl:for-each>
47
            </xsl:when>
48
            <xsl:when test="marc:datafield[@tag='240']">
49
                <xsl:for-each select="marc:datafield[@tag='240']">
50
                    <xsl:call-template name="subfieldSelect">
51
                        <xsl:with-param name="codes">adgknmpr</xsl:with-param>
52
                    </xsl:call-template>
53
                </xsl:for-each>
54
            </xsl:when>
55
            <xsl:when test="marc:datafield[@tag='243']">
56
                <xsl:for-each select="marc:datafield[@tag='243']">
57
                    <xsl:call-template name="subfieldSelect">
58
                        <xsl:with-param name="codes">adgknmpr</xsl:with-param>
59
                    </xsl:call-template>
60
                </xsl:for-each>
61
            </xsl:when>
62
        </xsl:choose>
63
    </xsl:variable>
64
65
    <xsl:variable name="title_key">
66
        <xsl:for-each select="marc:datafield[@tag='245']">
67
            <xsl:call-template name="subfieldSelect">
68
                <xsl:with-param name="codes">abnp</xsl:with-param>
69
            </xsl:call-template>
70
        </xsl:for-each>
71
    </xsl:variable>
72
73
    <xsl:variable name="work_title">
74
        <xsl:choose>
75
          <xsl:when test="$uniform_title_key != ''">
76
             <xsl:value-of select="$uniform_title_key" />
77
          </xsl:when>
78
          <xsl:otherwise>
79
             <xsl:value-of select="$title_key" />
80
          </xsl:otherwise>
81
        </xsl:choose>
82
    </xsl:variable>
83
84
    <xsl:variable name="non_ut_main_entry_key">
85
        <xsl:choose>
86
            <xsl:when test="marc:datafield[@tag='100']">
87
                <xsl:for-each select="marc:datafield[@tag='100']">
88
                    <xsl:call-template name="subfieldSelect">
89
                        <xsl:with-param name="codes">abcd</xsl:with-param>
90
                    </xsl:call-template>
91
                </xsl:for-each>
92
            </xsl:when>
93
            <xsl:when test="marc:datafield[@tag='110']">
94
                <xsl:for-each select="marc:datafield[@tag='110']">
95
                    <xsl:call-template name="subfieldSelect">
96
                        <xsl:with-param name="codes">abcd</xsl:with-param>
97
                    </xsl:call-template>
98
                </xsl:for-each>
99
            </xsl:when>
100
            <xsl:when test="marc:datafield[@tag='111']">
101
                <xsl:for-each select="marc:datafield[@tag='111']">
102
                    <xsl:call-template name="subfieldSelect">
103
                        <xsl:with-param name="codes">abcdnq</xsl:with-param>
104
                    </xsl:call-template>
105
                </xsl:for-each>
106
            </xsl:when>
107
        </xsl:choose>
108
    </xsl:variable>
109
110
    <xsl:variable name="mergekey">
111
        <xsl:text>titlekey </xsl:text>
112
        <xsl:value-of select="$work_title" />
113
        <xsl:if test="$non_ut_main_entry_key != ''">
114
            <xsl:text> namemainentry </xsl:text>
115
            <xsl:value-of select="$non_ut_main_entry_key" />
116
        </xsl:if>
117
    </xsl:variable>
118
119
    <pz:record>
120
      <xsl:attribute name="mergekey">
121
        <xsl:value-of select="$mergekey"/>
122
      </xsl:attribute>
123
124
      <xsl:for-each select="marc:datafield[@tag='999']">
125
        <pz:metadata type="kohaid">
126
	  <xsl:value-of select="marc:subfield[@code='c']"/>
127
	</pz:metadata>
128
      </xsl:for-each>
129
130
<!--
131
      <xsl:for-each select="marc:datafield[@tag='020']">
132
        <pz:metadata type="isbn">
133
	  <xsl:value-of select="marc:subfield[@code='a']"/>
134
	</pz:metadata>
135
      </xsl:for-each>
136
-->
137
138
      <xsl:for-each select="marc:datafield[@tag='245']">
139
        <pz:metadata type="work-title">
140
          <xsl:value-of select="$work_title" />
141
        </pz:metadata>
142
      </xsl:for-each>
143
144
      <xsl:if test="$non_ut_main_entry_key != ''">
145
        <pz:metadata type="work-author">
146
          <xsl:value-of select="$non_ut_main_entry_key" />
147
        </pz:metadata>
148
      </xsl:if>
149
<!--
150
      <xsl:for-each select="marc:datafield[@tag='250']">
151
	<pz:metadata type="edition">
152
	    <xsl:value-of select="marc:subfield[@code='a']"/>
153
	</pz:metadata>
154
      </xsl:for-each>
155
156
      <xsl:for-each select="marc:datafield[@tag='260']">
157
        <pz:metadata type="publication-place">
158
	  <xsl:value-of select="marc:subfield[@code='a']"/>
159
	</pz:metadata>
160
        <pz:metadata type="publication-name">
161
	  <xsl:value-of select="marc:subfield[@code='b']"/>
162
	</pz:metadata>
163
        <pz:metadata type="publication-date">
164
	  <xsl:value-of select="marc:subfield[@code='c']"/>
165
	</pz:metadata>
166
      </xsl:for-each>
167
-->
168
169
<!--
170
      <xsl:for-each select="marc:datafield[@tag='300']">
171
	<pz:metadata type="physical-extent">
172
	  <xsl:value-of select="marc:subfield[@code='a']"/>
173
	</pz:metadata>
174
	<pz:metadata type="physical-format">
175
	  <xsl:value-of select="marc:subfield[@code='b']"/>
176
	</pz:metadata>
177
	<pz:metadata type="physical-dimensions">
178
	  <xsl:value-of select="marc:subfield[@code='c']"/>
179
	</pz:metadata>
180
	<pz:metadata type="physical-accomp">
181
	  <xsl:value-of select="marc:subfield[@code='e']"/>
182
	</pz:metadata>
183
	<pz:metadata type="physical-unittype">
184
	  <xsl:value-of select="marc:subfield[@code='f']"/>
185
	</pz:metadata>
186
	<pz:metadata type="physical-unitsize">
187
	  <xsl:value-of select="marc:subfield[@code='g']"/>
188
	</pz:metadata>
189
	<pz:metadata type="physical-specified">
190
	  <xsl:value-of select="marc:subfield[@code='3']"/>
191
	</pz:metadata>
192
      </xsl:for-each>
193
-->
194
195
    </pz:record>
196
197
  </xsl:template>
198
199
</xsl:stylesheet>
(-)a/etc/pazpar2/marc21.xsl (-288 lines)
Lines 1-288 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: marc21.xsl,v 1.22 2007-10-04 12:01:15 adam Exp $ -->
3
<xsl:stylesheet
4
    version="1.0"
5
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
7
    xmlns:marc="http://www.loc.gov/MARC21/slim">
8
9
  
10
  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
11
12
<!-- Extract metadata from MARC21/USMARC 
13
      http://www.loc.gov/marc/bibliographic/ecbdhome.html
14
-->  
15
  <xsl:include href="pz2-ourl-marc21.xsl" />
16
  
17
  <xsl:template match="/marc:record">
18
    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
19
    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
20
    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
21
    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
22
    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
23
    <xsl:variable name="medium">
24
      <xsl:choose>
25
	<xsl:when test="$title_medium">
26
	  <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
27
	</xsl:when>
28
	<xsl:when test="$fulltext_a">
29
	  <xsl:text>electronic resource</xsl:text>
30
	</xsl:when>
31
	<xsl:when test="$fulltext_b">
32
	  <xsl:text>electronic resource</xsl:text>
33
	</xsl:when>
34
	<xsl:when test="$electronic_location_url">
35
	  <xsl:text>electronic resource</xsl:text>
36
	</xsl:when>
37
	<xsl:when test="$journal_title">
38
	  <xsl:text>article</xsl:text>
39
	</xsl:when>
40
	<xsl:otherwise>
41
	  <xsl:text>book</xsl:text>
42
	</xsl:otherwise>
43
      </xsl:choose>
44
    </xsl:variable>
45
46
    <xsl:variable name="mergekey">
47
        <xsl:text>title </xsl:text>
48
        <xsl:choose>
49
          <xsl:when test="marc:datafield[@tag='240']">
50
             <xsl:value-of select="marc:datafield[@tag='240']/marc:subfield[@code='a']"/>
51
          </xsl:when>
52
          <xsl:otherwise>
53
             <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
54
          </xsl:otherwise>
55
        </xsl:choose>
56
        <xsl:text> author </xsl:text>
57
        <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
58
<!--
59
        <xsl:text> medium </xsl:text>
60
        <xsl:value-of select="$medium"/>
61
-->
62
    </xsl:variable>
63
64
    <pz:record>
65
      <xsl:attribute name="mergekey">
66
        <xsl:value-of select="$mergekey"/>
67
      </xsl:attribute>
68
69
      
70
      <xsl:for-each select="marc:controlfield[@tag='001']">
71
        <pz:metadata type="id">
72
          <xsl:value-of select="."/>
73
        </pz:metadata>
74
      </xsl:for-each>
75
76
      <xsl:for-each select="marc:datafield[@tag='010']">
77
        <pz:metadata type="lccn">
78
	  <xsl:value-of select="marc:subfield[@code='a']"/>
79
	</pz:metadata>
80
      </xsl:for-each>
81
82
      <xsl:for-each select="marc:datafield[@tag='999']">
83
        <pz:metadata type="kohaid">
84
	  <xsl:value-of select="marc:subfield[@code='c']"/>
85
	</pz:metadata>
86
      </xsl:for-each>
87
88
89
      <xsl:for-each select="marc:datafield[@tag='020']">
90
        <pz:metadata type="isbn">
91
	  <xsl:value-of select="marc:subfield[@code='a']"/>
92
	</pz:metadata>
93
      </xsl:for-each>
94
95
      <xsl:for-each select="marc:datafield[@tag='022']">
96
        <pz:metadata type="issn">
97
	  <xsl:value-of select="marc:subfield[@code='a']"/>
98
	</pz:metadata>
99
      </xsl:for-each>
100
101
      <xsl:for-each select="marc:datafield[@tag='027']">
102
        <pz:metadata type="tech-rep-nr">
103
	  <xsl:value-of select="marc:subfield[@code='a']"/>
104
	</pz:metadata>
105
      </xsl:for-each>
106
107
      <xsl:for-each select="marc:datafield[@tag='100']">
108
	<pz:metadata type="author">
109
	  <xsl:value-of select="marc:subfield[@code='a']"/>
110
	</pz:metadata>
111
	<pz:metadata type="author-title">
112
	  <xsl:value-of select="marc:subfield[@code='c']"/>
113
	</pz:metadata>
114
	<pz:metadata type="author-date">
115
	  <xsl:value-of select="marc:subfield[@code='d']"/>
116
	</pz:metadata>
117
      </xsl:for-each>
118
119
      <xsl:for-each select="marc:datafield[@tag='110']">
120
	<pz:metadata type="corporate-name">
121
	    <xsl:value-of select="marc:subfield[@code='a']"/>
122
	</pz:metadata>
123
	<pz:metadata type="corporate-location">
124
	    <xsl:value-of select="marc:subfield[@code='c']"/>
125
	</pz:metadata>
126
	<pz:metadata type="corporate-date">
127
	    <xsl:value-of select="marc:subfield[@code='d']"/>
128
	</pz:metadata>
129
      </xsl:for-each>
130
131
      <xsl:for-each select="marc:datafield[@tag='111']">
132
	<pz:metadata type="meeting-name">
133
	    <xsl:value-of select="marc:subfield[@code='a']"/>
134
	</pz:metadata>
135
	<pz:metadata type="meeting-location">
136
	    <xsl:value-of select="marc:subfield[@code='c']"/>
137
	</pz:metadata>
138
	<pz:metadata type="meeting-date">
139
	    <xsl:value-of select="marc:subfield[@code='d']"/>
140
	</pz:metadata>
141
      </xsl:for-each>
142
143
      <xsl:for-each select="marc:datafield[@tag='260']">
144
	<pz:metadata type="date">
145
	    <xsl:value-of select="marc:subfield[@code='c']"/>
146
	</pz:metadata>
147
      </xsl:for-each>
148
149
      <xsl:for-each select="marc:datafield[@tag='245']">
150
        <pz:metadata type="title">
151
          <xsl:value-of select="marc:subfield[@code='a']"/>
152
        </pz:metadata>
153
        <pz:metadata type="title-remainder">
154
          <xsl:value-of select="marc:subfield[@code='b']"/>
155
        </pz:metadata>
156
        <pz:metadata type="title-responsibility">
157
          <xsl:value-of select="marc:subfield[@code='c']"/>
158
        </pz:metadata>
159
        <pz:metadata type="title-dates">
160
          <xsl:value-of select="marc:subfield[@code='f']"/>
161
        </pz:metadata>
162
        <pz:metadata type="title-medium">
163
          <xsl:value-of select="marc:subfield[@code='h']"/>
164
        </pz:metadata>
165
        <pz:metadata type="title-number-section">
166
          <xsl:value-of select="marc:subfield[@code='n']"/>
167
        </pz:metadata>
168
      </xsl:for-each>
169
170
      <xsl:for-each select="marc:datafield[@tag='250']">
171
	<pz:metadata type="edition">
172
	    <xsl:value-of select="marc:subfield[@code='a']"/>
173
	</pz:metadata>
174
      </xsl:for-each>
175
176
      <xsl:for-each select="marc:datafield[@tag='260']">
177
        <pz:metadata type="publication-place">
178
	  <xsl:value-of select="marc:subfield[@code='a']"/>
179
	</pz:metadata>
180
        <pz:metadata type="publication-name">
181
	  <xsl:value-of select="marc:subfield[@code='b']"/>
182
	</pz:metadata>
183
        <pz:metadata type="publication-date">
184
	  <xsl:value-of select="marc:subfield[@code='c']"/>
185
	</pz:metadata>
186
      </xsl:for-each>
187
188
      <xsl:for-each select="marc:datafield[@tag='300']">
189
	<pz:metadata type="physical-extent">
190
	  <xsl:value-of select="marc:subfield[@code='a']"/>
191
	</pz:metadata>
192
	<pz:metadata type="physical-format">
193
	  <xsl:value-of select="marc:subfield[@code='b']"/>
194
	</pz:metadata>
195
	<pz:metadata type="physical-dimensions">
196
	  <xsl:value-of select="marc:subfield[@code='c']"/>
197
	</pz:metadata>
198
	<pz:metadata type="physical-accomp">
199
	  <xsl:value-of select="marc:subfield[@code='e']"/>
200
	</pz:metadata>
201
	<pz:metadata type="physical-unittype">
202
	  <xsl:value-of select="marc:subfield[@code='f']"/>
203
	</pz:metadata>
204
	<pz:metadata type="physical-unitsize">
205
	  <xsl:value-of select="marc:subfield[@code='g']"/>
206
	</pz:metadata>
207
	<pz:metadata type="physical-specified">
208
	  <xsl:value-of select="marc:subfield[@code='3']"/>
209
	</pz:metadata>
210
      </xsl:for-each>
211
212
      <xsl:for-each select="marc:datafield[@tag='440']">
213
	<pz:metadata type="series-title">
214
	  <xsl:value-of select="marc:subfield[@code='a']"/>
215
	</pz:metadata>
216
      </xsl:for-each>
217
218
      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
219
			    [@tag != '506' and @tag != '530' and
220
			    @tag != '540' and @tag != '546'
221
                            and @tag != '522']">
222
	<pz:metadata type="description">
223
            <xsl:value-of select="*/text()"/>
224
        </pz:metadata>
225
      </xsl:for-each>
226
      
227
      <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
228
        <pz:metadata type="subject">
229
	  <xsl:value-of select="marc:subfield[@code='a']"/>
230
	</pz:metadata>
231
	<pz:metadata type="subject-long">
232
	  <xsl:for-each select="marc:subfield">
233
	    <xsl:if test="position() > 1">
234
	      <xsl:text>, </xsl:text>
235
	    </xsl:if>
236
	    <xsl:value-of select="."/>
237
	  </xsl:for-each>
238
	</pz:metadata>
239
      </xsl:for-each>
240
241
      <xsl:for-each select="marc:datafield[@tag='856']">
242
	<pz:metadata type="electronic-url">
243
	  <xsl:value-of select="marc:subfield[@code='u']"/>
244
	</pz:metadata>
245
	<pz:metadata type="electronic-text">
246
	  <xsl:value-of select="marc:subfield[@code='y']"/>
247
	</pz:metadata>
248
	<pz:metadata type="electronic-note">
249
	  <xsl:value-of select="marc:subfield[@code='z']"/>
250
	</pz:metadata>
251
      </xsl:for-each>
252
253
      <xsl:for-each select="marc:datafield[@tag='773']">
254
	<pz:metadata type="citation">
255
	  <xsl:for-each select="*">
256
	    <xsl:value-of select="normalize-space(.)"/>
257
	    <xsl:text> </xsl:text>
258
	  </xsl:for-each>
259
	</pz:metadata>
260
      </xsl:for-each>
261
262
      <pz:metadata type="medium">
263
	<xsl:value-of select="$medium"/>
264
      </pz:metadata>
265
      
266
      <xsl:if test="$fulltext_a">
267
	<pz:metadata type="fulltext">
268
	  <xsl:value-of select="$fulltext_a"/>
269
	</pz:metadata>
270
      </xsl:if>
271
272
      <xsl:if test="$fulltext_b">
273
	<pz:metadata type="fulltext">
274
	  <xsl:value-of select="$fulltext_b"/>
275
	</pz:metadata>
276
      </xsl:if>
277
278
      <xsl:if test="$open_url_resolver">
279
        <pz:metadata type="open-url">
280
            <xsl:call-template name="insert-md-openurl" />
281
        </pz:metadata>
282
      </xsl:if>
283
284
    </pz:record>
285
286
  </xsl:template>
287
288
</xsl:stylesheet>
(-)a/etc/pazpar2/pazpar2.xml (-100 lines)
Lines 1-100 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- $Id: pazpar2.cfg.dist,v 1.21 2007-10-04 12:01:15 adam Exp $ -->
3
<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
4
  
5
  <server>
6
    <listen port="__PAZPAR2_PORT__"/>
7
    <settings src="__PAZPAR2_CONF_DIR__/koha-biblios.xml"/>
8
9
    <relevance>
10
      <icu_chain id="relevance" locale="el">
11
	<normalize rule="[:Control:] Any-Remove"/>
12
	<tokenize rule="l"/>
13
	<normalize rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
14
	<casemap rule="l"/>
15
	<index/>
16
      </icu_chain>
17
    </relevance>
18
19
    <sort>
20
      <icu_chain id="sort" locale="el">
21
	<normalize rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
22
	<casemap rule="l"/>
23
	<sortkey/>
24
      </icu_chain>
25
    </sort>
26
    
27
    <mergekey>
28
      <icu_chain id="mergekey" locale="el">
29
	<tokenize rule="l"/>
30
	<normalize rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
31
	<casemap rule="l"/>
32
	<index/>
33
      </icu_chain>
34
    </mergekey>
35
    
36
    <service>
37
      <!-- we try to keep same order as in marc21.xsl -->
38
      <metadata name="id"/>
39
      <metadata name="lccn" merge="unique"/>
40
      <metadata name="kohaid" />
41
      <metadata name="isbn"/>
42
      <metadata name="issn"/>
43
      <metadata name="tech-rep-nr"/>
44
      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
45
      <metadata name="author-title"/>
46
      <metadata name="author-date"/>
47
      <metadata name="corporate-name"/>
48
      <metadata name="corporate-location"/>
49
      <metadata name="corporate-date"/>
50
      <metadata name="meeting-name"/>
51
      <metadata name="meeting-location"/>
52
      <metadata name="meeting-date"/>
53
      <metadata name="date" brief="yes" sortkey="numeric" type="year"
54
		merge="range" termlist="yes"/>
55
      <metadata name="work-title" brief="yes" sortkey="skiparticle"
56
		merge="longest" rank="6"/>
57
      <metadata name="work-author" brief="yes" sortkey="skiparticle"
58
		merge="longest" rank="6"/>
59
      <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
60
      <metadata name="title-responsibility" brief="yes" />
61
      <metadata name="title-dates" brief="yes" merge="longest"/>
62
      <metadata name="title-medium" brief="yes" merge="longest"/>
63
      <metadata name="title-number-section" brief="yes" merge="longest"/>
64
      <metadata name="medium" brief="yes" merge="longest"/>
65
      <metadata name="edition"/>
66
      <metadata name="publication-place"/>
67
      <metadata name="publication-name"/>
68
      <metadata name="publication-date"/>
69
      <metadata name="physical-extent"/>	
70
      <metadata name="physical-format"/>	
71
      <metadata name="physical-dimensions"/>	
72
      <metadata name="physical-accomp"/>	
73
      <metadata name="physical-unittype"/>	
74
      <metadata name="physical-unitsize"/>	
75
      <metadata name="physical-specified"/>	
76
77
      <metadata name="series-title"/>	
78
79
      <metadata name="description" merge="longest" rank="3"/>
80
      <metadata name="subject-long" rank="3"/>
81
      <metadata name="subject" termlist="yes" rank="0"/>
82
      <metadata name="electronic-url"/>
83
      <metadata name="electronic-text"/>
84
      <metadata name="electronic-note"/>
85
      <metadata name="citation"/>
86
      <metadata name="fulltext"/>
87
88
      <metadata name="url_recipe" setting="postproc"/>
89
      <metadata name="open_url_resolver" setting="parameter"/>
90
      <metadata name="open-url" merge="longest"/>
91
    </service>
92
  </server>
93
  
94
</pazpar2>
95
<!-- Keep this comment at the end of the file
96
     Local variables:
97
     mode: nxml
98
     End:
99
-->
100
(-)a/etc/pazpar2/pz2-ourl-base.xsl (-169 lines)
Lines 1-169 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet
3
    version="1.0"
4
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
6
    xmlns:marc="http://www.loc.gov/MARC21/slim"
7
    xmlns:str="http://exslt.org/strings"
8
    extension-element-prefixes="str">
9
10
  <xsl:param name="open_url_resolver"/>
11
  <!--<xsl:variable name="resolver">http://zeus.lib.uoc.gr:3210/sfxtst3</xsl:variable>-->
12
 
13
  <xsl:template name="insert-md-openurl">
14
  
15
    <xsl:value-of select="$open_url_resolver" /><xsl:text>?generatedby=pz2</xsl:text>
16
    <xsl:call-template name="ou-parse-author" />
17
    <xsl:call-template name="ou-parse-date" />
18
    <xsl:call-template name="ou-parse-volume" />
19
    <xsl:call-template name="ou-parse-any">
20
      <xsl:with-param name="field_name" select="string('isbn')" />
21
    </xsl:call-template>
22
    <xsl:call-template name="ou-parse-any">
23
      <xsl:with-param name="field_name" select="string('issn')" />
24
    </xsl:call-template>
25
    <xsl:call-template name="ou-parse-any">
26
      <xsl:with-param name="field_name" select="string('title')" />
27
    </xsl:call-template>
28
    <xsl:call-template name="ou-parse-any">
29
      <xsl:with-param name="field_name" select="string('atitle')" />
30
    </xsl:call-template>
31
32
  </xsl:template>
33
 
34
  <!-- parsing raw string data -->
35
  
36
  <xsl:template name="ou-parse-author" >
37
    <xsl:variable name="author">
38
      <xsl:call-template name="ou-author" />
39
    </xsl:variable>
40
    
41
    <xsl:variable name="aulast" select="normalize-space(substring-before($author, ','))"/>
42
43
    <xsl:variable name="aufirst" 
44
      select="substring-before( normalize-space(substring-after($author, ',')), ' ')"/>
45
46
    <xsl:if test="$aulast != ''">
47
      <xsl:text>&amp;aulast=</xsl:text>
48
      <xsl:value-of select="$aulast" />
49
    </xsl:if>
50
51
    <xsl:if test="string-length( translate($aufirst, '.', '') ) &gt; 1" >
52
      <xsl:text>&amp;aufirst=</xsl:text>
53
      <xsl:value-of select="$aufirst" />
54
    </xsl:if>
55
56
  </xsl:template>
57
58
  <xsl:template name="ou-parse-volume">
59
    <xsl:variable name="volume">
60
      <xsl:call-template name="ou-volume" />
61
    </xsl:variable>
62
63
    <xsl:variable name="vol" select="substring-after($volume, 'Vol')"/>
64
    <xsl:variable name="issue" select="false()" />
65
    <xsl:variable name="spage" select="false()" />
66
67
    <xsl:if test="$vol">
68
      <xsl:text>&amp;volume=</xsl:text>
69
      <xsl:value-of select="$vol" />
70
    </xsl:if>
71
72
    <xsl:if test="$issue">
73
      <xsl:text>&amp;issue=</xsl:text>
74
      <xsl:value-of select="$issue" />
75
    </xsl:if>
76
    
77
    <xsl:if test="$spage">
78
      <xsl:text>&amp;spage=</xsl:text>
79
      <xsl:value-of select="$vol" />
80
    </xsl:if>
81
82
  </xsl:template>
83
84
85
  <xsl:template name="ou-parse-date">
86
    <xsl:variable name="date">
87
      <xsl:call-template name="ou-date" />
88
    </xsl:variable>
89
90
    <xsl:variable name="parsed_date" select="translate($date, '.[]c;', '')"/>
91
92
    <xsl:if test="$parsed_date">
93
      <xsl:text>&amp;date=</xsl:text>
94
      <xsl:value-of select="$parsed_date" />
95
    </xsl:if>
96
97
  </xsl:template>
98
99
  
100
  <xsl:template name="ou-parse-any">
101
    <xsl:param name="field_name" />
102
103
    <xsl:variable name="field_value">
104
      <xsl:choose>
105
106
      <xsl:when test="$field_name = 'isbn'">
107
        <xsl:call-template name="ou-isbn"/>
108
      </xsl:when>
109
110
      <xsl:when test="$field_name = 'issn'">
111
        <xsl:call-template name="ou-issn"/>
112
      </xsl:when>
113
      
114
      <xsl:when test="$field_name = 'atitle'">
115
        <xsl:call-template name="ou-atitle"/>
116
      </xsl:when>
117
     
118
      <xsl:when test="$field_name = 'title'">
119
        <xsl:call-template name="ou-title"/>
120
      </xsl:when>
121
122
      </xsl:choose>
123
    </xsl:variable>
124
125
    <xsl:variable name="digits" select="1234567890"/>
126
127
    <xsl:variable name="parsed_value">
128
      <xsl:choose>
129
130
      <xsl:when test="$field_name = 'isbn'">
131
        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, 'X'), ''), '')"/>
132
      </xsl:when>
133
134
      <xsl:when test="$field_name = 'issn'">
135
        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, '-', 'X'), ''), '')"/>
136
      </xsl:when>
137
      
138
      <xsl:when test="$field_name = 'atitle'">
139
        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
140
      </xsl:when>
141
     
142
      <xsl:when test="$field_name = 'title'">
143
        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
144
      </xsl:when>
145
146
      </xsl:choose>
147
    </xsl:variable>
148
149
150
    <xsl:if test="$parsed_value != ''">
151
      <xsl:text>&amp;</xsl:text>
152
      <xsl:value-of select="$field_name" />
153
      <xsl:text>=</xsl:text>
154
      <xsl:value-of select="$parsed_value" />
155
    </xsl:if>
156
157
  </xsl:template>
158
159
160
</xsl:stylesheet>
161
<!--
162
/*
163
 * Local variables:
164
 * c-basic-offset: 2
165
 * indent-tabs-mode: nil
166
 * End:
167
 * vim: shiftwidth=2 tabstop=4 expandtab
168
 */
169
-->
(-)a/etc/pazpar2/pz2-ourl-marc21.xsl (-97 lines)
Lines 1-97 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet
3
    version="1.0"
4
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
6
    xmlns:marc="http://www.loc.gov/MARC21/slim"
7
    xmlns:str="http://exslt.org/strings"
8
    extension-element-prefixes="str">  
9
  
10
  <xsl:import href="pz2-ourl-base.xsl"/>
11
12
  <xsl:template name="ou-author" >
13
  <!-- what to do with multiple authors??-->
14
    <xsl:for-each select="marc:datafield[@tag='100' or @tag='700']">
15
      <xsl:value-of select="marc:subfield[@code='a']"/>
16
    </xsl:for-each>
17
  </xsl:template>
18
19
  <xsl:template name="ou-title" >
20
  <!-- if 773 exists its a journal/article -->
21
    <xsl:choose>
22
    
23
      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='t']">
24
        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
25
      </xsl:when>
26
27
      <xsl:when test="marc:datafield[@tag='245']/marc:subfield[@code='a']">
28
        <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
29
      </xsl:when>
30
31
    </xsl:choose>
32
  </xsl:template>
33
34
  
35
  <xsl:template name="ou-atitle" >
36
    <!-- return value only if article or journal -->
37
    <xsl:if test="marc:datafield[@tag='773']">
38
      <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
39
    </xsl:if>
40
  </xsl:template>
41
42
43
  <xsl:template name="ou-date" >
44
    <xsl:for-each select="marc:datafield[@tag='260']">
45
      <xsl:value-of select="marc:subfield[@code='c']"/>
46
    </xsl:for-each>
47
  </xsl:template>
48
49
  
50
  <xsl:template name="ou-isbn" >
51
  <!-- if 773 exists its a journal/article -->
52
    <xsl:choose>  
53
    
54
      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='z']">
55
        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='z']"/>
56
      </xsl:when>
57
      
58
      <xsl:when test="marc:datafield[@tag='020']/marc:subfield[@code='a']">
59
        <xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/>
60
      </xsl:when>
61
62
    </xsl:choose>
63
  </xsl:template>
64
65
  
66
  <xsl:template name="ou-issn" >
67
  <!-- if 773 exists its a journal/article -->
68
    <xsl:choose>
69
    
70
      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='x']">
71
        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='x']"/>
72
      </xsl:when>
73
74
      <xsl:when test="marc:datafield[@tag='022']/marc:subfield[@code='a']">
75
        <xsl:value-of select="marc:datafield[@tag='022']/marc:subfield[@code='a']"/>
76
      </xsl:when>
77
78
      </xsl:choose>
79
  </xsl:template>
80
81
  
82
  <xsl:template name="ou-volume" >
83
    <xsl:if test="marc:datafield[@tag='773']">
84
	  <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='g']"/>
85
    </xsl:if>
86
  </xsl:template>
87
88
</xsl:stylesheet>
89
<!--
90
/*
91
 * Local variables:
92
 * c-basic-offset: 2
93
 * indent-tabs-mode: nil
94
 * End:
95
 * vim: shiftwidth=2 tabstop=4 expandtab
96
 */
97
-->
(-)a/installer/data/mysql/atomicupdate/bug_20410.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q{
4
        DELETE FROM systempreferences WHERE variable="OpacGroupResults"
5
    });
6
7
    NewVersion( $DBversion, 20410, "Remove OpacGroupResults");
8
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-7 lines)
Lines 37-49 Searching: Link Here
37
                  unescape_escaped: Unescape escaped
37
                  unescape_escaped: Unescape escaped
38
                  dont_escape: Don't escape
38
                  dont_escape: Don't escape
39
            - "regular expressions within query strings. If \"Escape\" is selected occurences of \"/\" in search terms will be automatically escaped, and regular expressions interpreted as regular strings. If \"Unescape escaped\" is selected this will allow writing regular expressions \"\/like this\/\" while \"/this/\", \"or/this\" will be escaped and interpreted as regular strings. (Elasticsearch only.)"
39
            - "regular expressions within query strings. If \"Escape\" is selected occurences of \"/\" in search terms will be automatically escaped, and regular expressions interpreted as regular strings. If \"Unescape escaped\" is selected this will allow writing regular expressions \"\/like this\/\" while \"/this/\", \"or/this\" will be escaped and interpreted as regular strings. (Elasticsearch only.)"
40
        -
41
            - pref: OpacGroupResults
42
              default: 0
43
              choices:
44
                  yes: Use
45
                  no: "Don't use"
46
            - PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running.
47
        -
40
        -
48
            - pref: TraceCompleteSubfields
41
            - pref: TraceCompleteSubfields
49
              default: 0
42
              default: 0
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt (-373 lines)
Lines 1-373 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
5
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;
8
[% IF ( searchdesc ) %]
9
    Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
10
[% ELSE %]
11
    You did not specify any search criteria.
12
[% END %]</title>
13
[% INCLUDE 'doc-head-close.inc' %]
14
[% BLOCK cssinclude %][% END %]
15
<link rel="alternate" type="application/rss+xml" title="Koha - RSS" href="/cgi-bin/koha/opac-rss.pl?[% query_cgi | $raw %][% limit_cgi | url %]" />
16
17
</head>
18
[% INCLUDE 'bodytag.inc' bodyid='results-grouped' %]
19
[% INCLUDE 'masthead.inc' %]
20
21
    <div class="main">
22
        <nav aria-label="breadcrumb">
23
            <ul class="breadcrumb">
24
                <li class="breadcrumb-item">
25
                <a href="/cgi-bin/koha/opac-main.pl">Home</a>
26
                </li>
27
                <li class="breadcrumb-item active" aria-current="page">
28
                    [% IF ( searchdesc ) %]
29
                        <a href="#">Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</a>
30
                    [% ELSE %]
31
                        <a href="#">You did not specify any search criteria.</a>
32
                    [% END %]
33
                </li>
34
            </ul>
35
        </nav>
36
37
        [% IF ( query_error ) %]
38
            <div class="container-fluid">
39
                <div class="row">
40
                    <div class="col order-first order-md-first order-lg-2">
41
                        <div class="alert alert-warning">
42
                            <h4>Error:</h4>
43
                            <p>[% query_error | html %]</p>
44
                        </div>
45
                    </div> <!-- / .span12 -->
46
                </div> <!-- / .row -->
47
            </div> <!-- / .container-fluid -->
48
        [% END %]
49
50
        <div class="container-fluid">
51
            <div class="row">
52
                [% IF ( opacfacets && total ) %]
53
                    <div class="col-lg-2">
54
                        <div id="facetcontainer">
55
                            <!-- FACETS START -->
56
                            [% INCLUDE 'opac-facets.inc' %]
57
                            <!-- FACETS END -->
58
                        </div>
59
                    </div>
60
                    <div class="col-10 order-first order-md-first order-lg-2">
61
                [% ELSE %]
62
                    <div class="col order-first order-md-first order-lg-2">
63
                [% END %]
64
                    <div id="grouped-results" class="maincontent">
65
                        <!-- Search Results Table -->
66
                        [% IF ( total ) %]
67
                            [% IF ( scan ) %]
68
                                <h1>Scan index:</h1>
69
                                    <form action="/cgi-bin/koha/opac-search.pl" method="get">
70
                                        <table>
71
                                            <tbody>
72
                                                <tr>
73
                                                    <td>
74
                                                        Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
75
                                                    </td>
76
                                                </tr>
77
                                                <tr>
78
                                                    <td>
79
                                                        <label for="scan-index">Indexed in:</label>
80
                                                        <select name="idx" id="scan-index">
81
                                                            <option value="">Any word</option>
82
                                                            <option value="kw,phr:">Any phrase</option>
83
                                                            <option value="ti:">Title</option>
84
                                                            <option value="ti,phr:">Title phrase</option>
85
                                                            <option value="au,phr:">Author</option>
86
                                                            <option value="su:">Subject</option>
87
                                                            <option value="su,phr:">Subject phrase</option>
88
                                                            <option value="se:">Series</option>
89
                                                            <option value="pb:">Publisher</option>
90
                                                            <option value="nt:">Notes</option>
91
                                                            <option value="se:">Series Title</option>
92
                                                            <option value="sn:">ISBN</option>
93
                                                            <option value="ss:">ISSN</option>
94
                                                        </select>
95
                                                        <input type="hidden" name="scan" value="1" />
96
                                                    </td>
97
                                                </tr>
98
                                            </tbody>
99
                                        </table>
100
                                    </form>
101
102
                                    <form action="/cgi-bin/koha/opac-search.pl" method="get">
103
                                        <table>
104
                                            <thead>
105
                                                <tr>
106
                                                    <th>Term/Phrase</th>
107
                                                    <th>Count</th>
108
                                                </tr>
109
                                            </thead>
110
                                            <tbody>
111
                                                [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
112
                                                <tr>
113
                                                    <td>
114
                                                        <a href="/cgi-bin/koha/opac-search.pl?q=[% SEARCH_RESULT.scan_use |url %]&quot;[% SEARCH_RESULT.title |url %]&quot;"><span class="biblio-title">[% SEARCH_RESULT.title | html %]</span></a>
115
                                                    </td>
116
                                                    <td>
117
                                                        [% FOREACH subtitl IN SEARCH_RESULT.subtitle.split(' | ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %]
118
                                                            <span class="subtitle">[% subtitl | html %]</span>
119
                                                        [% END %]
120
                                                        <span class="part-number">[% SEARCH_RESULT.part_number | html %]</span> <span class="part-name">[% SEARCH_RESULT.part_name | html %]</span>
121
                                                    </td>
122
                                                </tr>
123
                                                [% END %]
124
                                            </thead>
125
                                        </table>
126
                                    </form>
127
                            [% ELSE %]
128
129
                                <div class="searchresults">
130
                                    <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
131
                                        [% IF ( searchdesc ) %]
132
                                            [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
133
                                                <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
134
                                            [% END %]
135
                                            [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
136
                                                <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
137
                                            [% END %]
138
                                        [% END %]
139
140
                                        <!-- TABLE RESULTS START -->
141
                                        <table class="table table-striped">
142
                                            <tr>
143
                                                <td colspan="3" class="resultscontrol">
144
                                                    <div class="resort">
145
                                                        <select id="sort_by" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
146
                                                        <input type="submit" class="submit clearfix" id="sortsubmit" value="Go" />
147
                                                    </div>
148
                                                    [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
149
                                                        <div class="cartlist"><span class="checkall"></span>
150
                                                        <span class="clearall"></span>
151
                                                        <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
152
                                                        <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
153
                                                        <span class="addto"></span></div>
154
                                                    [% END %]
155
                                                </td>
156
                                            </tr>
157
                                            <!-- Actual Search Results -->
158
                                            [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
159
                                                <tr class="grouplabel"><td colspan="3">[% SEARCH_RESULT.group_label | html %]</td></tr>
160
                                                [% FOREACH GROUP_RESULT IN SEARCH_RESULT.GROUP_RESULTS %]
161
                                                    [% IF ( GROUP_RESULT.even ) %]
162
                                                        <tr class="highlight">
163
                                                    [% ELSE %]
164
                                                        <tr>
165
                                                    [% END %]
166
                                                        <td>
167
                                                            [% IF ( AdlibrisEnabled && GROUP_RESULT.normalized_isbn ) %]
168
                                                                <img src="[% AdlibrisURL | html %]?isbn=[% GROUP_RESULT.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" />
169
                                                            [% END %]
170
                                                            [% IF ( OPACAmazonCoverImages ) %]
171
                                                                <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="https://images-na.ssl-images-amazon.com/images/P/[% GROUP_RESULT.isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %]
172
                                                            </a>
173
                                                        [% ELSE %]
174
                                                            [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
175
                                                                [% IF ( GROUP_RESULT.imageurl ) %]
176
                                                                    <img src="[% GROUP_RESULT.imageurl | html %]" title="[% GROUP_RESULT.description | html %]" />
177
                                                                [% END %]
178
                                                            [% END %]
179
                                                            [% GROUP_RESULT.description | html %]
180
                                                        [% END %]
181
                                                        </td>
182
                                                        <td>
183
                                                            [% GROUP_RESULT.result_number | html %].
184
                                                            [% IF ( GROUP_RESULT.BiblioDefaultViewmarc ) %]
185
                                                                <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title | html %]
186
                                                            [% ELSE %]
187
                                                                [% IF ( GROUP_RESULT.BiblioDefaultViewisbd ) %]
188
                                                                    <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title | html %]
189
                                                                [% ELSE %]
190
                                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title | html %]
191
                                                                [% END %]
192
                                                                [% FOREACH subtitl IN GROUP_RESULT.subtitle %]
193
                                                                    [% subtitl | html %]
194
                                                                [% END %]
195
                                                                </a>
196
                                                            [% END # / IF GROUP_RESULT.BiblioDefaultViewmarc %]
197
                                                            [% IF ( GROUP_RESULT.author ) %]
198
                                                                by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% GROUP_RESULT.author |url %]" title="Search for works by this author">[% GROUP_RESULT.author | html %]</a>
199
                                                            [% ELSE %]
200
                                                                &nbsp;
201
                                                            [% END %]
202
                                                            <p>
203
                                                                [% IF ( GROUP_RESULT.publicationyear ) %] - [% GROUP_RESULT.publicationyear | html %][% END %]
204
                                                                [% IF ( GROUP_RESULT.publishercode ) %]- [% GROUP_RESULT.publishercode | html %][% END %]
205
                                                                [% IF ( GROUP_RESULT.place ) %] ; [% GROUP_RESULT.place | html %][% END %]
206
                                                                [% IF ( GROUP_RESULT.pages ) %] - [% GROUP_RESULT.pages | html %][% END %]
207
                                                                [% IF ( GROUP_RESULT.notes ) %] : [% GROUP_RESULT.notes | html %][% END %]
208
                                                                [% IF ( GROUP_RESULT.size ) %] ; [% GROUP_RESULT.size | html %][% END %]
209
                                                                [% IF ( GROUP_RESULT.timestamp ) %] <em>(modified on [% GROUP_RESULT.timestamp | html %])</em>[% END %]
210
                                                            </p>
211
                                                            [% IF ( GROUP_RESULT.searchhighlightblob ) %]
212
                                                                <p class="searchhighlightblob">[% GROUP_RESULT.searchhighlightblob | html %]</p>
213
                                                            [% END %]
214
                                                            <p class="availability">
215
                                                                [% IF ( GROUP_RESULT.available_items_loop ) %]
216
                                                                    <span class="available"><strong>Items available at:</strong>
217
                                                                        [% FOREACH available_items_loo IN GROUP_RESULT.available_items_loop %]
218
                                                                            [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname | html %][% END %]
219
                                                                            [% IF ( OPACItemsResultsDisplay ) %]
220
                                                                                [% IF ( available_items_loo.location ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
221
                                                                                [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber | html %]</a>][% END %]
222
                                                                            [% END %]
223
                                                                            ([% available_items_loo.count | html %]),
224
                                                                        [% END # / FOREACH available_items_loo %]
225
                                                                    </span>
226
                                                                [% ELSE %]
227
                                                                    <span class="unavailable">No items available:</span>
228
                                                                [% END # / IF GROUP_RESULT.available_items_loop %]
229
                                                                <span class="unavailable">
230
                                                                    [% IF ( GROUP_RESULT.onloancount ) %] Checked out ([% GROUP_RESULT.onloancount | html %]), [% END %]
231
                                                                    [% IF ( GROUP_RESULT.withdrawncount ) %] Withdrawn ([% GROUP_RESULT.withdrawncount | html %]), [% END %]
232
                                                                    [% IF ( GROUP_RESULT.itemlostcount ) %] Lost ([% GROUP_RESULT.itemlostcount | html %]),[% END %]
233
                                                                    [% IF ( GROUP_RESULT.damagedcount ) %] Damaged ([% GROUP_RESULT.damagedcount | html %]),[% END %]
234
                                                                    [% IF ( GROUP_RESULT.orderedcount ) %] On order ([% GROUP_RESULT.orderedcount | html %]),[% END %]
235
                                                                    [% IF ( GROUP_RESULT.intransitcount ) %] In transit ([% GROUP_RESULT.intransitcount | html %]),[% END %]
236
                                                                </span>
237
                                                            </p>
238
                                                            <p>
239
                                                                [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
240
                                                                    [% UNLESS ( GROUP_RESULT.norequests ) %]
241
                                                                        [% IF Koha.Preference( 'opacuserlogin' ) == 1 && GROUP_RESULT.holdable %]
242
                                                                            <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% GROUP_RESULT.biblionumber | html %]">Place hold</a><!-- add back when available 0 holds in queue-->
243
                                                                        [% END %]
244
                                                                    [% END %]
245
                                                                [% END %]
246
247
                                                                [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
248
                                                                    <input type="checkbox" name="biblionumber" value="[% GROUP_RESULT.biblionumber | html %]" title="Click to add to cart" /> <label for="bib[% GROUP_RESULT.biblionumber | html %]">
249
                                                                [% END %]
250
                                                                <img src="[% themelang | html %]/images/[% GROUP_RESULT.itemtype | html %].gif" alt="[% GROUP_RESULT.ccode | html %]" title="[% GROUP_RESULT.ccode | html %]" />
251
                                                                [% IF ( ( Koha.Preference( 'opacbookbag' ) = 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]</label>[% END %]
252
                                                                [% IF ( GROUP_RESULT.classification ) %]
253
                                                                    <a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% GROUP_RESULT.classification |url %]"> [% GROUP_RESULT.classification | html %] </a>
254
                                                                [% END %]
255
                                                            </p>
256
                                                        </td>
257
                                                    </tr>
258
                                                [% END # / FOREACH GROUP_RESULT %]
259
                                            [% END # / FOREACH SEARCH_RESULTS %]
260
                                        </table>
261
                                    </form>
262
                                </div> <!-- / .searchresults -->
263
                            [% END # /  IF scan %]
264
                            [% INCLUDE 'page-numbers.inc' %]
265
                        [% END # / IF total %]
266
267
                        [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 ) %]
268
                            <div class="suggestion">
269
                                Not finding what you're looking for?
270
                                <ul>
271
                                    [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
272
                                        <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
273
                                    [% ELSE %]
274
                                        [% IF ( loggedinusername ) %]
275
                                            <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
276
                                        [% END %]
277
                                    [% END %]
278
                                    [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
279
                                        <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
280
                                    [% END %]
281
                                </ul>
282
                            </div>
283
                        [% END %]
284
                    </div> <!-- / #grouped-results -->
285
286
                </div> <!-- /.col-10/12 -->
287
            </div> <!-- / .row -->
288
        </div> <!-- / .container-fluid -->
289
    </div><!-- / .main -->
290
291
[% INCLUDE 'opac-bottom.inc' %]
292
[% BLOCK jsinclude %]
293
    <script>
294
        var q_array = new Array();  // will hold the search terms, if possible
295
        $(document).ready(function(){
296
            [% IF ( OpacHighlightedWords ) %]
297
                $('a.title').each(function() {
298
                    $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
299
                });
300
            [% END %]
301
302
            $('#sort_by').change(function() {
303
                $('#bookbag_form').submit();
304
            });
305
            $("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">" + _("Clear all") + "</a>");
306
            $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">" + _("Select all") + "</a>");
307
            $("span.addto").html("<label for=\"addto\">" + _("Add to: ") + "</label><select name=\"addto\" id=\"addto\"><option value=\"\"></option>[% IF Koha.Preference( 'opacbookbag' ) == 1 %]<option value=\"addtocart\">" + _("Cart") + "</option>[% END %][% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %]<optgroup label=\"" + _("Lists:") + "\">[% IF ( barshelves ) %][% FOREACH barshelvesloo IN barshelvesloop %][% IF ( category == 1 ) %]<option id=\"s[% barshelvesloo.shelfnumber | html %]\" value=\"addtolist\">[% barshelvesloo.shelfname | html %]</option>[% END %][% END %][% END %]<option value=\"newlist\">" + _("[ New list ]") + "</option></optgroup>[% ELSE %]<option value=\"newlist\">" + _("List") + "</option>[% END %][% END %]</select> <input type=\"submit\" class=\"submit\" value=\"" + _("Save") + "\" />");
308
            $("#addto").change(function(){
309
                cartList();
310
            });
311
            $(".addto").find("input:submit").click(function(){
312
                cartList();
313
                return false;
314
            });
315
            function cartList(){
316
                    if($("#addto").find("option:selected").attr("value") == "addtolist"){
317
                    var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
318
                    [% IF ( loggedinusername ) %]if (vShelfAdd()) {
319
                    Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
320
                    }[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
321
                    return false;
322
                } else if($("#addto").find("option:selected").attr("value") == "newlist"){
323
                    [% IF ( loggedinusername ) %]if (vShelfAdd()) {
324
                    Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
325
                    }[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
326
                    return false;
327
                }
328
                if($("#addto").find("option:selected").attr("value") == "addtocart"){
329
                    addMultiple();
330
                    return false;
331
                }
332
            }
333
            $("#CheckAll").on("click", function(e){
334
                e.preventDefault();
335
                $("#bookbag_form").find("input:checkbox").prop("checked", true);
336
            });
337
            $("#CheckNone").on("click", function(e){
338
                e.preventDefault();
339
                $("#bookbag_form").find("input:checkbox").prop("checked", true);
340
            });
341
            [% IF ( query_desc ) %]
342
            var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
343
            q_array = query_desc.split(" ");
344
            // ensure that we don't have "" at the end of the array, which can
345
            // break the highlighter
346
            while (q_array.length > 0 && q_array[q_array.length-1] == "") {
347
                q_array = q_array.splice(0,-1);
348
            }
349
            highlightOn();
350
            $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
351
            $("#highlight_toggle_off").show().click(function() {highlightOff();});
352
            [% END %]
353
        });
354
355
        function highlightOff() {
356
            $("td").removeHighlight();
357
            $(".highlight_toggle").toggle();
358
        }
359
        function highlightOn() {
360
            var x;
361
            for (x in q_array) {
362
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
363
                q_array[x] = q_array[x].toLowerCase();
364
                var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
365
                if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
366
                    $("td").highlight(q_array[x]);
367
                }
368
            }
369
            $(".highlight_toggle").toggle();
370
        }
371
372
    </script>
373
[% END %]
(-)a/misc/bin/koha-pazpar2-ctl.sh (-62 lines)
Lines 1-62 Link Here
1
#!/bin/bash
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
### BEGIN INIT INFO
19
# Provides:          koha-pazpar-daemon
20
# Required-Start:    $syslog $remote_fs
21
# Required-Stop:     $syslog $remote_fs
22
# Default-Start:     2 3 4 5
23
# Default-Stop:      0 1 6
24
# Short-Description: PazPar2 server daemon for Koha
25
### END INIT INFO
26
27
USER=__KOHA_USER__
28
GROUP=__KOHA_GROUP__
29
DBNAME=__DB_NAME__
30
NAME=koha-pazpar2-ctl.$DBNAME
31
LOGDIR=__LOG_DIR__
32
ERRLOG=$LOGDIR/koha-pazpar2daemon.err
33
STDOUT=$LOGDIR/koha-pazpar2daemon.log
34
OUTPUT=$LOGDIR/koha-pazpar2daemon-output.log
35
PAZPAR2_CONF=__PAZPAR2_CONF_DIR__/pazpar2.xml
36
PAZPAR2SRV=/usr/sbin/pazpar2
37
38
test -f $PAZPAR2SRV || exit 0
39
40
OTHERUSER=''
41
if [[ $EUID -eq 0 ]]; then
42
    OTHERUSER="--user=$USER.$GROUP"
43
fi
44
45
case "$1" in
46
    start)
47
      echo "Starting PazPar2 Server"
48
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- $PAZPAR2SRV -f $PAZPAR2_CONF 
49
      ;;
50
    stop)
51
      echo "Stopping PazPar2 Server"
52
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --stop -- $PAZPAR2SRV -f $PAZPAR2_CONF 
53
      ;;
54
    restart)
55
      echo "Restarting the PazPar2 Server"
56
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --restart -- $PAZPAR2SRV -f $PAZPAR2_CONF 
57
      ;;
58
    *)
59
      echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
60
      exit 1
61
      ;;
62
esac
(-)a/misc/koha-install-log (-6 lines)
Lines 37-43 OPAC_WWW_DIR=__OPAC_WWW_DIR__ Link Here
37
PERL_MODULE_DIR=__PERL_MODULE_DIR__
37
PERL_MODULE_DIR=__PERL_MODULE_DIR__
38
KOHA_CONF_DIR=__KOHA_CONF_DIR__
38
KOHA_CONF_DIR=__KOHA_CONF_DIR__
39
ZEBRA_CONF_DIR=__ZEBRA_CONF_DIR__
39
ZEBRA_CONF_DIR=__ZEBRA_CONF_DIR__
40
PAZPAR2_CONF_DIR=__PAZPAR2_CONF_DIR__
41
MISC_DIR=__MISC_DIR__
40
MISC_DIR=__MISC_DIR__
42
SCRIPT_DIR=__SCRIPT_DIR__
41
SCRIPT_DIR=__SCRIPT_DIR__
43
MAN_DIR=__MAN_DIR__
42
MAN_DIR=__MAN_DIR__
Lines 51-65 ZEBRA_AUTH_CFG=__ZEBRA_AUTH_CFG__ Link Here
51
ZEBRA_BIB_CFG=__ZEBRA_BIB_CFG__
50
ZEBRA_BIB_CFG=__ZEBRA_BIB_CFG__
52
AUTH_RETRIEVAL_CFG=__AUTH_RETRIEVAL_CFG__
51
AUTH_RETRIEVAL_CFG=__AUTH_RETRIEVAL_CFG__
53
BIB_RETRIEVAL_CFG=__BIB_RETRIEVAL_CFG__
52
BIB_RETRIEVAL_CFG=__BIB_RETRIEVAL_CFG__
54
MERGE_SERVER_HOST=__MERGE_SERVER_HOST__
55
MERGE_SERVER_PORT=__MERGE_SERVER_PORT__
56
PAZPAR2_HOST=__PAZPAR2_HOST__
57
PAZPAR2_PORT=__PAZPAR2_PORT__
58
INSTALL_MODE=__INSTALL_MODE__
53
INSTALL_MODE=__INSTALL_MODE__
59
INSTALL_BASE=__INSTALL_BASE__
54
INSTALL_BASE=__INSTALL_BASE__
60
INSTALL_ZEBRA=__INSTALL_ZEBRA__
55
INSTALL_ZEBRA=__INSTALL_ZEBRA__
61
INSTALL_SRU=__INSTALL_SRU__
56
INSTALL_SRU=__INSTALL_SRU__
62
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
63
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
57
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
64
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
58
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
65
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
59
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
(-)a/opac/opac-search.pl (-38 / +15 lines)
Lines 101-113 my @params = $cgi->multi_param("limit"); Link Here
101
my @searchCategories = $cgi->multi_param('searchcat');
101
my @searchCategories = $cgi->multi_param('searchcat');
102
102
103
my $format = $cgi->param("format") || '';
103
my $format = $cgi->param("format") || '';
104
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
105
if ($format =~ /(rss|atom|opensearchdescription)/) {
104
if ($format =~ /(rss|atom|opensearchdescription)/) {
106
    $template_name = 'opac-opensearch.tt';
105
    $template_name = 'opac-opensearch.tt';
107
}
106
}
108
elsif (@params && $build_grouped_results) {
109
    $template_name = 'opac-results-grouped.tt';
110
}
111
elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) {
107
elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) {
112
    $template_name = 'opac-results.tt';
108
    $template_name = 'opac-results.tt';
113
}
109
}
Lines 618-627 if ($tag) { Link Here
618
    # FIXME: Because search and standard search don't work together OpacHiddenItems
614
    # FIXME: Because search and standard search don't work together OpacHiddenItems
619
    #        displays search results which should be hidden.
615
    #        displays search results which should be hidden.
620
    # FIXME: No facets for tags search.
616
    # FIXME: No facets for tags search.
621
} elsif ($build_grouped_results) {
622
    eval {
623
        ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,undef,$query_type,$scan);
624
    };
625
} else {
617
} else {
626
    $pasarParams .= '&amp;query=' . uri_escape_utf8($query);
618
    $pasarParams .= '&amp;query=' . uri_escape_utf8($query);
627
    $pasarParams .= '&amp;count=' . uri_escape_utf8($results_per_page);
619
    $pasarParams .= '&amp;count=' . uri_escape_utf8($results_per_page);
Lines 667-686 for (my $i=0;$i<@servers;$i++) { Link Here
667
    if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
659
    if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
668
        $hits = $results_hashref->{$server}->{"hits"};
660
        $hits = $results_hashref->{$server}->{"hits"};
669
        my $page = $cgi->param('page') || 0;
661
        my $page = $cgi->param('page') || 0;
670
        my @newresults;
662
        my @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
671
        if ($build_grouped_results) {
672
            foreach my $group (@{ $results_hashref->{$server}->{"GROUPS"} }) {
673
                # because pazGetRecords handles retieving only the records
674
                # we want as specified by $offset and $results_per_page,
675
                # we need to set the offset parameter of searchResults to 0
676
                my @group_results = searchResults( $search_context, $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
677
                                                   $group->{"RECORDS"}, $variables);
678
                push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
679
            }
680
        } else {
681
            @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
682
                                        $results_hashref->{$server}->{"RECORDS"}, $variables);
663
                                        $results_hashref->{$server}->{"RECORDS"}, $variables);
683
        }
684
        $hits = 0 unless @newresults;
664
        $hits = 0 unless @newresults;
685
665
686
        my $art_req_itypes;
666
        my $art_req_itypes;
Lines 799-821 for (my $i=0;$i<@servers;$i++) { Link Here
799
            exit;
779
            exit;
800
        }
780
        }
801
        if ($hits) {
781
        if ($hits) {
802
            if ( !$build_grouped_results ) {
782
            # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
803
                # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
783
            $pasarParams .= '&amp;listBiblios=';
804
                $pasarParams .= '&amp;listBiblios=';
784
            my $j = 0;
805
                my $j = 0;
785
            foreach (@newresults) {
806
                foreach (@newresults) {
786
                my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
807
                    my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
787
                $pasarParams .= uri_escape_utf8($bibnum) . ',';
808
                    $pasarParams .= uri_escape_utf8($bibnum) . ',';
788
                $j++;
809
                    $j++;
789
                last if ($j == $results_per_page);
810
                    last if ($j == $results_per_page);
790
            }
811
                }
791
            chop $pasarParams if ($pasarParams =~ /,$/);
812
                chop $pasarParams if ($pasarParams =~ /,$/);
792
            $pasarParams .= '&amp;total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
813
                $pasarParams .= '&amp;total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
793
            if ($pasarParams) {
814
                if ($pasarParams) {
794
                my $session = get_session($cgi->cookie("CGISESSID"));
815
                    my $session = get_session($cgi->cookie("CGISESSID"));
795
                $session->param('busc' => $pasarParams);
816
                    $session->param('busc' => $pasarParams);
817
                }
818
                #
819
            }
796
            }
820
            $template->param(total => $hits);
797
            $template->param(total => $hits);
821
            my $limit_cgi_not_availablity = $limit_cgi;
798
            my $limit_cgi_not_availablity = $limit_cgi;
(-)a/rewrite-config.PL (-14 lines)
Lines 121-127 my %configuration = ( Link Here
121
  '__PERL_MODULE_DIR__' =>  ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha",
121
  '__PERL_MODULE_DIR__' =>  ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha",
122
  '__KOHA_CONF_DIR__' => "$prefix/etc/koha",
122
  '__KOHA_CONF_DIR__' => "$prefix/etc/koha",
123
  '__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb",
123
  '__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb",
124
  '__PAZPAR2_CONF_DIR__' => "$prefix/etc/koha/pazpar2",
125
  '__MISC_DIR__' => "$prefix/misc",
124
  '__MISC_DIR__' => "$prefix/misc",
126
  '__SCRIPT_DIR__' => "$prefix/bin",
125
  '__SCRIPT_DIR__' => "$prefix/bin",
127
  '__SCRIPT_NONDEV_DIR__' => "$prefix/bin",
126
  '__SCRIPT_NONDEV_DIR__' => "$prefix/bin",
Lines 140-154 my %configuration = ( Link Here
140
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg',
139
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg',
141
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg',
140
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg',
142
  "__MERGE_SERVER_HOST__" => $myhost,
141
  "__MERGE_SERVER_HOST__" => $myhost,
143
  "__MERGE_SERVER_PORT__" => '11001',
144
  "__PAZPAR2_HOST__" => $myhost,
145
  "__PAZPAR2_PORT__" => '11002',
146
  "__INSTALL_MODE__" => 'standard',
142
  "__INSTALL_MODE__" => 'standard',
147
  "__INSTALL_BASE__" => '/usr/share/koha',
143
  "__INSTALL_BASE__" => '/usr/share/koha',
148
  "__INSTALL_SRU__" => 'yes',
144
  "__INSTALL_SRU__" => 'yes',
149
  "__INSTALL_PAZPAR2__" => 'no',
150
  "__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
151
  "__PAZPAR2_TOGGLE_XML_POST__" => '-->',
152
  "__RUN_DATABASE_TESTS__" => 'no',
145
  "__RUN_DATABASE_TESTS__" => 'no',
153
  "__PATH_TO_ZEBRA__" => "",
146
  "__PATH_TO_ZEBRA__" => "",
154
  "__USE_MEMCACHED__" => 'yes',
147
  "__USE_MEMCACHED__" => 'yes',
Lines 175-187 foreach my $key (keys %configuration) { Link Here
175
  }
168
  }
176
}
169
}
177
170
178
# munge commenting out the PazPar2 mergeserver
179
# entry in koha-conf.xml if necessary
180
if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') {
181
    $configuration{'__PAZPAR2_TOGGLE_XML_PRE__'} = '';
182
    $configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = '';
183
}
184
185
my $fname = $ARGV[0];
171
my $fname = $ARGV[0];
186
my $file = &read_file($fname);
172
my $file = &read_file($fname);
187
$file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
173
$file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
(-)a/t/db_dependent/UsageStats.t (-2 lines)
Lines 553-559 sub mocking_systempreferences_to_a_set_value { Link Here
553
        TalkingTechItivaPhoneNotification
553
        TalkingTechItivaPhoneNotification
554
        uppercasesurnames
554
        uppercasesurnames
555
        IncludeSeeFromInSearches
555
        IncludeSeeFromInSearches
556
        OpacGroupResults
557
        QueryAutoTruncate
556
        QueryAutoTruncate
558
        QueryFuzzy
557
        QueryFuzzy
559
        QueryStemming
558
        QueryStemming
560
- 

Return to bug 20410