Browse Source

Bug 20410: Remove OpacGroupResults and PazPar2

This feature is not used as far as we know and it's not known to work.
It's preferable to remove it.

Test plan:
Make sure the OpacGroupResults pref code is removed, as well as the
PazPar2 files and code.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tags/v21.05.00
Jonathan Druart 4 months ago
parent
commit
06a58fe56d
22 changed files with 24 additions and 1615 deletions
  1. +0
    -75
      C4/Search.pm
  2. +0
    -1
      C4/UsageStats.pm
  3. +1
    -60
      Makefile.PL
  4. +0
    -1
      debian/koha-common.install
  5. +0
    -1
      debian/koha-core.install
  6. +0
    -14
      debian/templates/koha-conf-site.xml.in
  7. +0
    -14
      etc/koha-conf.xml
  8. +0
    -65
      etc/pazpar2/MARC21slimUtils.xsl
  9. +0
    -30
      etc/pazpar2/koha-biblios.xml
  10. +0
    -199
      etc/pazpar2/marc21-work-groups.xsl
  11. +0
    -288
      etc/pazpar2/marc21.xsl
  12. +0
    -100
      etc/pazpar2/pazpar2.xml
  13. +0
    -169
      etc/pazpar2/pz2-ourl-base.xsl
  14. +0
    -97
      etc/pazpar2/pz2-ourl-marc21.xsl
  15. +8
    -0
      installer/data/mysql/atomicupdate/bug_20410.perl
  16. +0
    -7
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
  17. +0
    -373
      koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
  18. +0
    -62
      misc/bin/koha-pazpar2-ctl.sh
  19. +0
    -6
      misc/koha-install-log
  20. +15
    -38
      opac/opac-search.pl
  21. +0
    -14
      rewrite-config.PL
  22. +0
    -1
      t/db_dependent/UsageStats.t

+ 0
- 75
C4/Search.pm View File

@@ -23,7 +23,6 @@ use C4::Koha; # getFacets
use Koha::DateUtils;
use Koha::Libraries;
use Lingua::Stem;
use C4::Search::PazPar2;
use XML::Simple;
use C4::XSLT;
use C4::Reserves; # GetReserveStatus
@@ -804,80 +803,6 @@ sub _get_facets_info {
return $facets_info;
}

sub pazGetRecords {
my (
$koha_query, $simple_query, $sort_by_ref, $servers_ref,
$results_per_page, $offset, $branches, $query_type,
$scan
) = @_;
#NOTE: Parameter $branches is not used here !

my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url'));
$paz->init();
$paz->search($simple_query);
sleep 1; # FIXME: WHY?

# do results
my $results_hashref = {};
my $stats = XMLin($paz->stat);
my $results = XMLin($paz->show($offset, $results_per_page, 'work-title:1'), forcearray => 1);

# for a grouped search result, the number of hits
# is the number of groups returned; 'bib_hits' will have
# the total number of bibs.
$results_hashref->{'biblioserver'}->{'hits'} = $results->{'merged'}->[0];
$results_hashref->{'biblioserver'}->{'bib_hits'} = $stats->{'hits'};

HIT: foreach my $hit (@{ $results->{'hit'} }) {
my $recid = $hit->{recid}->[0];

my $work_title = $hit->{'md-work-title'}->[0];
my $work_author;
if (exists $hit->{'md-work-author'}) {
$work_author = $hit->{'md-work-author'}->[0];
}
my $group_label = (defined $work_author) ? "$work_title / $work_author" : $work_title;

my $result_group = {};
$result_group->{'group_label'} = $group_label;
$result_group->{'group_merge_key'} = $recid;

my $count = 1;
if (exists $hit->{count}) {
$count = $hit->{count}->[0];
}
$result_group->{'group_count'} = $count;

for (my $i = 0; $i < $count; $i++) {
# FIXME -- may need to worry about diacritics here
my $rec = $paz->record($recid, $i);
push @{ $result_group->{'RECORDS'} }, $rec;
}

push @{ $results_hashref->{'biblioserver'}->{'GROUPS'} }, $result_group;
}

# pass through facets
my $termlist_xml = $paz->termlist('author,subject');
my $terms = XMLin($termlist_xml, forcearray => 1);
my @facets_loop = ();
#die Dumper($results);
# foreach my $list (sort keys %{ $terms->{'list'} }) {
# my @facets = ();
# foreach my $facet (sort @{ $terms->{'list'}->{$list}->{'term'} } ) {
# push @facets, {
# facet_label_value => $facet->{'name'}->[0],
# };
# }
# push @facets_loop, ( {
# type_label => $list,
# facets => \@facets,
# } );
# }

return ( undef, $results_hashref, \@facets_loop );
}

# TRUNCATION
sub _detect_truncation {
my ( $operand, $index ) = @_;


+ 0
- 1
C4/UsageStats.pm View File

@@ -291,7 +291,6 @@ sub BuildReport {
TalkingTechItivaPhoneNotification
uppercasesurnames
IncludeSeeFromInSearches
OpacGroupResults
QueryAutoTruncate
QueryFuzzy
QueryStemming


+ 1
- 60
Makefile.PL View File

@@ -94,7 +94,6 @@ Makefile.PL - Koha packager and installer
--koha_user Koha Unix user (e.g. koha)
--koha_group Koha Unix group (e.g. koha)
--install_sru Install the SRU server (yes, no)
--install_pazpar2 Install PazPar2 (yes, no)
--use_memcached Use Memcached (yes, no)
--font_dir Location of fonts (e.g. /usr/share/fonts/truetype/dejavu)
--run_database_tests Run database dependent tests (yes, no)
@@ -280,10 +279,6 @@ Directory for backup files produced by Koha.

Directory for external Koha plugins.

=item PAZPAR2_CONF_DIR

Directory for PazPar2 configuration files.

=item FONT_DIR

Directory where DejaVu fonts are installed.
@@ -328,7 +323,6 @@ my $target_map = {
'./etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 },
'./etc/zebradb' => { target => 'ZEBRA_CONF_DIR', trimdir => -1 },
'./etc/z3950' => { target => 'Z3950_CONF_DIR', trimdir => -1 },
'./etc/pazpar2' => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 },
'./help.pl' => 'INTRANET_CGI_DIR',
'./ill' => 'INTRANET_CGI_DIR',
'./installer-CPAN.pl' => 'NONE',
@@ -517,7 +511,6 @@ my %config_defaults = (
'DB_TLS_CLIENT_CERTIFICATE' => '/etc/mysql-ssl/client-cert.pem',
'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
'INSTALL_SRU' => 'yes',
'INSTALL_PAZPAR2' => 'no',
'ZEBRA_MARC_FORMAT' => 'marc21',
'ZEBRA_LANGUAGE' => 'en',
'ZEBRA_TOKENIZER' => 'chr',
@@ -530,8 +523,6 @@ my %config_defaults = (
'KOHA_GROUP' => 'koha',
'MERGE_SERVER_HOST' => 'localhost',
'MERGE_SERVER_PORT' => '11001',
'PAZPAR2_HOST' => 'localhost',
'PAZPAR2_PORT' => '11002',
'RUN_DATABASE_TESTS' => 'no',
'PATH_TO_ZEBRA' => '',
'USE_MEMCACHED' => 'yes',
@@ -603,7 +594,6 @@ my $cli_zebra_sru_auth_port = "";
my $cli_koha_user = "";
my $cli_koha_group = "";
my $cli_koha_install_sru = "";
my $cli_koha_install_pazpar2 = "";
my $cli_koha_use_memcached = "";
my $cli_koha_font_dir = "";
my $cli_koha_run_database_tests = "";
@@ -638,7 +628,6 @@ my $results = GetOptions(
"koha_user=s" => \$cli_koha_user,
"koha_group=s" => \$cli_koha_group,
"install_sru=s" => \$cli_koha_install_sru,
"install_pazpar2=s" => \$cli_koha_install_pazpar2,
"use_memcached=s" => \$cli_koha_use_memcached,
"font_dir=s" => \$cli_koha_font_dir,
"run_database_tests=s" => \$cli_koha_run_database_tests,
@@ -692,15 +681,8 @@ push @{ $pl_files->{'rewrite-config.PL'} }, (
);
push @{ $pl_files->{'rewrite-config.PL'} }, (
'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh',
'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh',
);
if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
push @{ $pl_files->{'rewrite-config.PL'} }, (
'blib/PAZPAR2_CONF_DIR/koha-biblios.xml',
'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
);
}
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
$config{'ZEBRA_BIB_CFG'} = 'zebra-biblios-dom.cfg';
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
@@ -921,7 +903,6 @@ sub get_cli_values {
KOHA_USER => $cli_koha_user,
KOHA_GROUP => $cli_koha_group,
INSTALL_SRU => $cli_koha_install_sru,
INSTALL_PAZPAR2 => $cli_koha_install_pazpar2,
USE_MEMCACHED => $cli_koha_use_memcached,
FONT_DIR => $cli_koha_font_dir,
RUN_DATABASE_TESTS => $cli_koha_run_database_tests,
@@ -1232,41 +1213,6 @@ SRU port for authority data?);

}

$msg = q(
Along with Zebra, you can also choose to install PazPar2,
which is a metasearch tool. With PazPar2,
Koha can perform on-the-fly merging of bibliographic
records during searching, allowing for FRBRization of
the results list.

Install the PazPar2 configuration files?);
$msg .= _add_valid_values_disp('INSTALL_PAZPAR2', $valid_values);
$config{'INSTALL_PAZPAR2'} = _get_value('INSTALL_PAZPAR2', $msg, $defaults->{'INSTALL_PAZPAR2'}, $valid_values, $install_log_values);

if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
$msg = q(
Since you've chosen to configure PazPar2, you must
specify the host and port(s) that PazPar2
uses:
);
$msg = q(
Zebra bibliographic server host?);
$config{'MERGE_SERVER_HOST'} = _get_value('MERGE_SERVER_HOST', $msg, $defaults->{'MERGE_SERVER_HOST'}, $valid_values, $install_log_values);

$msg = q(
Zebra bibliographic port for PazPar2 to use?);
$config{'MERGE_SERVER_PORT'} = _get_value('MERGE_SERVER_PORT', $msg, $defaults->{'MERGE_SERVER_PORT'}, $valid_values, $install_log_values);

$msg = q(
PazPar2 host?);
$config{'PAZPAR2_HOST'} = _get_value('PAZPAR2_HOST', $msg, $defaults->{'PAZPAR2_HOST'}, $valid_values, $install_log_values);

$msg = q(
PazPar2 port?);
$config{'PAZPAR2_PORT'} = _get_value('PAZPAR2_PORT', $msg, $defaults->{'PAZPAR2_PORT'}, $valid_values, $install_log_values);

}

$msg = q(
Use memcached to cache the results of some function calls?
This provides a significant performance improvement.
@@ -1489,7 +1435,6 @@ sub get_target_directories {
$dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
$dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
$dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
$dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2');
$dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
$dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
$dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
@@ -1523,7 +1468,6 @@ sub get_target_directories {
$dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc');
$dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb');
$dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950');
$dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2');
$dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
$dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
#For dev install, point NONDEV_DIR to misc in current dir (not base)
@@ -1552,7 +1496,6 @@ sub get_target_directories {
$dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package);
$dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'zebradb');
$dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'z3950');
$dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'pazpar2');
$dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc');
$dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin');
$dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'};
@@ -1782,8 +1725,6 @@ sub _update_zebra_conf_target {
$target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
$target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n";
$target .= "\tumask 022; \$(MOD_INSTALL) \\\n";
$target .= "\t\t\$(KOHA_INST_PAZPAR2_CONF_DIR) \$(KOHA_DEST_PAZPAR2_CONF_DIR) \n";
$target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_PAZPAR2_CONF_DIR)\n";

return $target;
}
@@ -1809,7 +1750,7 @@ make_upgrade_backup ::
\t\$(NOECHO) umask 022; \$(MOD_BACKUP) \\
/;
foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
PAZPAR2_CONF_DIR ZEBRA_CONF_DIR PLUGINS_DIR/) {
ZEBRA_CONF_DIR PLUGINS_DIR/) {
$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
unless exists $skip_directories->{$key} or
not exists $target_directories->{$key};


+ 0
- 1
debian/koha-common.install View File

@@ -1,5 +1,4 @@
debian/tmp/usr/* usr
debian/tmp/etc/koha/pazpar2
debian/tmp/etc/koha/zebradb/[!z]*
debian/tmp/etc/koha/z3950
debian/templates/* etc/koha


+ 0
- 1
debian/koha-core.install View File

@@ -1,5 +1,4 @@
debian/tmp/usr/* usr
debian/tmp/etc/koha/pazpar2
debian/tmp/etc/koha/zebradb/[!z]*
debian/tmp/etc/koha/z3950
debian/templates/* etc/koha


+ 0
- 14
debian/templates/koha-conf-site.xml.in View File

@@ -10,19 +10,6 @@ __START_SRU_PUBLICSERVER__
<listen id="publicserver" >tcp:@:__SRU_BIBLIOS_PORT__</listen>
__END_SRU_PUBLICSERVER__

<!-- Settings for special biblio server instance for PazPar2.
Because PazPar2 only connects to a Z39.50 server using TCP/IP,
it cannot use the Unix-domain socket that biblioserver uses.
Therefore, a custom server is defined. -->
<!--
<listen id="mergeserver">tcp:@:__MERGE_SERVER_PORT__</listen>
<server id="mergeserver" listenref="mergeserver">
<directory>/var/lib/koha/__KOHASITE__/biblios</directory>
<config>/etc/koha/sites/__KOHASITE__/zebra-biblios-dom.cfg</config>
<cql2rpn>/var/lib/koha/__KOHASITE__/pqf.properties</cql2rpn>
</server>
-->

<!-- BIBLIOGRAPHIC RECORDS -->
<server id="biblioserver" listenref="biblioserver">
<directory>/var/lib/koha/__KOHASITE__/biblios</directory>
@@ -297,7 +284,6 @@ __END_SRU_PUBLICSERVER__
tool -->
<backup_db_via_tools>0</backup_db_via_tools>
<backup_conf_via_tools>0</backup_conf_via_tools>
<!-- <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url> -->
<install_log>/usr/share/koha/misc/koha-install-log</install_log>
<useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
<useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->


+ 0
- 14
etc/koha-conf.xml View File

@@ -14,19 +14,6 @@
<listen id="publicserver" >tcp:@:__ZEBRA_SRU_BIBLIOS_PORT__</listen>
-->

<!-- Settings for special biblio server instance for PazPar2.
Because PazPar2 only connects to a Z39.50 server using TCP/IP,
it cannot use the Unix-domain socket that biblioserver uses.
Therefore, a custom server is defined. -->
__PAZPAR2_TOGGLE_XML_PRE__
<listen id="mergeserver">tcp:@:__MERGE_SERVER_PORT__</listen>
<server id="mergeserver" listenref="mergeserver">
<directory>__ZEBRA_DATA_DIR__/biblios</directory>
<config>__ZEBRA_CONF_DIR__/__ZEBRA_BIB_CFG__</config>
<cql2rpn>__ZEBRA_CONF_DIR__/pqf.properties</cql2rpn>
</server>
__PAZPAR2_TOGGLE_XML_POST__

<!-- BIBLIOGRAPHIC RECORDS -->
<server id="biblioserver" listenref="biblioserver">
<directory>__ZEBRA_DATA_DIR__/biblios</directory>
@@ -114,7 +101,6 @@ __PAZPAR2_TOGGLE_XML_POST__
<!--
<supportdir>__SCRIPT_NONDEV_DIR__</supportdir>
-->
<pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url>
<install_log>__MISC_DIR__/koha-install-log</install_log>
<useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
<useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->


+ 0
- 65
etc/pazpar2/MARC21slimUtils.xsl View File

@@ -1,65 +0,0 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="datafield">
<xsl:param name="tag"/>
<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="subfields"/>
<xsl:element name="datafield">
<xsl:attribute name="tag">
<xsl:value-of select="$tag"/>
</xsl:attribute>
<xsl:attribute name="ind1">
<xsl:value-of select="$ind1"/>
</xsl:attribute>
<xsl:attribute name="ind2">
<xsl:value-of select="$ind2"/>
</xsl:attribute>
<xsl:copy-of select="$subfields"/>
</xsl:element>
</xsl:template>

<xsl:template name="subfieldSelect">
<xsl:param name="codes"/>
<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
<xsl:variable name="str">
<xsl:for-each select="marc:subfield">
<xsl:if test="contains($codes, @code)">
<xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
</xsl:template>

<xsl:template name="buildSpaces">
<xsl:param name="spaces"/>
<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
<xsl:if test="$spaces>0">
<xsl:value-of select="$char"/>
<xsl:call-template name="buildSpaces">
<xsl:with-param name="spaces" select="$spaces - 1"/>
<xsl:with-param name="char" select="$char"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

<xsl:template name="chopPunctuation">
<xsl:param name="chopString"/>
<xsl:variable name="length" select="string-length($chopString)"/>
<xsl:choose>
<xsl:when test="$length=0"/>
<xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="not($chopString)"/>
<xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
<metaInformation>
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->

+ 0
- 30
etc/pazpar2/koha-biblios.xml View File

@@ -1,30 +0,0 @@
<settings target="__MERGE_SERVER_HOST__:__MERGE_SERVER_PORT__/biblios">

<set name="pz:name" value="Koha bib database"/>

<!-- This file introduces default settings for pazpar2 -->
<!-- $Id: loc.xml,v 1.2 2007-07-10 13:43:07 adam Exp $ -->

<!-- mapping for unqualified search -->
<set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>

<!-- field-specific mappings -->
<set name="pz:cclmap:au" value="u=1004 s=al"/>
<set name="pz:cclmap:ti" value="u=4 s=al"/>
<set name="pz:cclmap:su" value="u=21 s=al"/>
<set name="pz:cclmap:isbn" value="u=7"/>
<set name="pz:cclmap:issn" value="u=8"/>
<set name="pz:cclmap:date" value="u=30 r=r"/>

<!-- Retrieval settings -->

<set name="pz:requestsyntax" value="marc21"/>
<set name="pz:elements" value="F"/>

<!-- Result normalization settings -->

<set name="pz:nativesyntax" value="iso2709"/>
<set name="pz:xslt" value="__ZEBRA_MARC_FORMAT__-work-groups.xsl"/>

</settings>

+ 0
- 199
etc/pazpar2/marc21-work-groups.xsl View File

@@ -1,199 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: marc21.xsl,v 1.22 2007-10-04 12:01:15 adam Exp $ -->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim">

<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>

<!-- Extract metadata from MARC21/USMARC
http://www.loc.gov/marc/bibliographic/ecbdhome.html
-->
<xsl:include href="MARC21slimUtils.xsl" />
<xsl:include href="pz2-ourl-marc21.xsl" />
<xsl:template match="/marc:record">
<xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
<xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
<xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
<xsl:variable name="medium">
<xsl:choose>
<xsl:when test="$title_medium">
<xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
</xsl:when>
<xsl:when test="$electronic_location_url">
<xsl:text>electronic resource</xsl:text>
</xsl:when>
<xsl:when test="$journal_title">
<xsl:text>article</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>book</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="uniform_title_key">
<xsl:choose>
<xsl:when test="marc:datafield[@tag='130']">
<xsl:for-each select="marc:datafield[@tag='130']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">adgknmpr</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="marc:datafield[@tag='240']">
<xsl:for-each select="marc:datafield[@tag='240']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">adgknmpr</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="marc:datafield[@tag='243']">
<xsl:for-each select="marc:datafield[@tag='243']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">adgknmpr</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:variable>

<xsl:variable name="title_key">
<xsl:for-each select="marc:datafield[@tag='245']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abnp</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:variable>

<xsl:variable name="work_title">
<xsl:choose>
<xsl:when test="$uniform_title_key != ''">
<xsl:value-of select="$uniform_title_key" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title_key" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="non_ut_main_entry_key">
<xsl:choose>
<xsl:when test="marc:datafield[@tag='100']">
<xsl:for-each select="marc:datafield[@tag='100']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcd</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="marc:datafield[@tag='110']">
<xsl:for-each select="marc:datafield[@tag='110']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcd</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="marc:datafield[@tag='111']">
<xsl:for-each select="marc:datafield[@tag='111']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdnq</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:variable>

<xsl:variable name="mergekey">
<xsl:text>titlekey </xsl:text>
<xsl:value-of select="$work_title" />
<xsl:if test="$non_ut_main_entry_key != ''">
<xsl:text> namemainentry </xsl:text>
<xsl:value-of select="$non_ut_main_entry_key" />
</xsl:if>
</xsl:variable>

<pz:record>
<xsl:attribute name="mergekey">
<xsl:value-of select="$mergekey"/>
</xsl:attribute>

<xsl:for-each select="marc:datafield[@tag='999']">
<pz:metadata type="kohaid">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
</xsl:for-each>

<!--
<xsl:for-each select="marc:datafield[@tag='020']">
<pz:metadata type="isbn">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>
-->

<xsl:for-each select="marc:datafield[@tag='245']">
<pz:metadata type="work-title">
<xsl:value-of select="$work_title" />
</pz:metadata>
</xsl:for-each>

<xsl:if test="$non_ut_main_entry_key != ''">
<pz:metadata type="work-author">
<xsl:value-of select="$non_ut_main_entry_key" />
</pz:metadata>
</xsl:if>
<!--
<xsl:for-each select="marc:datafield[@tag='250']">
<pz:metadata type="edition">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='260']">
<pz:metadata type="publication-place">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="publication-name">
<xsl:value-of select="marc:subfield[@code='b']"/>
</pz:metadata>
<pz:metadata type="publication-date">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
</xsl:for-each>
-->

<!--
<xsl:for-each select="marc:datafield[@tag='300']">
<pz:metadata type="physical-extent">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="physical-format">
<xsl:value-of select="marc:subfield[@code='b']"/>
</pz:metadata>
<pz:metadata type="physical-dimensions">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="physical-accomp">
<xsl:value-of select="marc:subfield[@code='e']"/>
</pz:metadata>
<pz:metadata type="physical-unittype">
<xsl:value-of select="marc:subfield[@code='f']"/>
</pz:metadata>
<pz:metadata type="physical-unitsize">
<xsl:value-of select="marc:subfield[@code='g']"/>
</pz:metadata>
<pz:metadata type="physical-specified">
<xsl:value-of select="marc:subfield[@code='3']"/>
</pz:metadata>
</xsl:for-each>
-->

</pz:record>

</xsl:template>

</xsl:stylesheet>

+ 0
- 288
etc/pazpar2/marc21.xsl View File

@@ -1,288 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: marc21.xsl,v 1.22 2007-10-04 12:01:15 adam Exp $ -->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim">

<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>

<!-- Extract metadata from MARC21/USMARC
http://www.loc.gov/marc/bibliographic/ecbdhome.html
-->
<xsl:include href="pz2-ourl-marc21.xsl" />
<xsl:template match="/marc:record">
<xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
<xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
<xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
<xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
<xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
<xsl:variable name="medium">
<xsl:choose>
<xsl:when test="$title_medium">
<xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
</xsl:when>
<xsl:when test="$fulltext_a">
<xsl:text>electronic resource</xsl:text>
</xsl:when>
<xsl:when test="$fulltext_b">
<xsl:text>electronic resource</xsl:text>
</xsl:when>
<xsl:when test="$electronic_location_url">
<xsl:text>electronic resource</xsl:text>
</xsl:when>
<xsl:when test="$journal_title">
<xsl:text>article</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>book</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="mergekey">
<xsl:text>title </xsl:text>
<xsl:choose>
<xsl:when test="marc:datafield[@tag='240']">
<xsl:value-of select="marc:datafield[@tag='240']/marc:subfield[@code='a']"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> author </xsl:text>
<xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
<!--
<xsl:text> medium </xsl:text>
<xsl:value-of select="$medium"/>
-->
</xsl:variable>

<pz:record>
<xsl:attribute name="mergekey">
<xsl:value-of select="$mergekey"/>
</xsl:attribute>

<xsl:for-each select="marc:controlfield[@tag='001']">
<pz:metadata type="id">
<xsl:value-of select="."/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='010']">
<pz:metadata type="lccn">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='999']">
<pz:metadata type="kohaid">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
</xsl:for-each>


<xsl:for-each select="marc:datafield[@tag='020']">
<pz:metadata type="isbn">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='022']">
<pz:metadata type="issn">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='027']">
<pz:metadata type="tech-rep-nr">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='100']">
<pz:metadata type="author">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="author-title">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="author-date">
<xsl:value-of select="marc:subfield[@code='d']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='110']">
<pz:metadata type="corporate-name">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="corporate-location">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="corporate-date">
<xsl:value-of select="marc:subfield[@code='d']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='111']">
<pz:metadata type="meeting-name">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="meeting-location">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="meeting-date">
<xsl:value-of select="marc:subfield[@code='d']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='260']">
<pz:metadata type="date">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='245']">
<pz:metadata type="title">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="title-remainder">
<xsl:value-of select="marc:subfield[@code='b']"/>
</pz:metadata>
<pz:metadata type="title-responsibility">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="title-dates">
<xsl:value-of select="marc:subfield[@code='f']"/>
</pz:metadata>
<pz:metadata type="title-medium">
<xsl:value-of select="marc:subfield[@code='h']"/>
</pz:metadata>
<pz:metadata type="title-number-section">
<xsl:value-of select="marc:subfield[@code='n']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='250']">
<pz:metadata type="edition">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='260']">
<pz:metadata type="publication-place">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="publication-name">
<xsl:value-of select="marc:subfield[@code='b']"/>
</pz:metadata>
<pz:metadata type="publication-date">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='300']">
<pz:metadata type="physical-extent">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="physical-format">
<xsl:value-of select="marc:subfield[@code='b']"/>
</pz:metadata>
<pz:metadata type="physical-dimensions">
<xsl:value-of select="marc:subfield[@code='c']"/>
</pz:metadata>
<pz:metadata type="physical-accomp">
<xsl:value-of select="marc:subfield[@code='e']"/>
</pz:metadata>
<pz:metadata type="physical-unittype">
<xsl:value-of select="marc:subfield[@code='f']"/>
</pz:metadata>
<pz:metadata type="physical-unitsize">
<xsl:value-of select="marc:subfield[@code='g']"/>
</pz:metadata>
<pz:metadata type="physical-specified">
<xsl:value-of select="marc:subfield[@code='3']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='440']">
<pz:metadata type="series-title">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
[@tag != '506' and @tag != '530' and
@tag != '540' and @tag != '546'
and @tag != '522']">
<pz:metadata type="description">
<xsl:value-of select="*/text()"/>
</pz:metadata>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
<pz:metadata type="subject">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<pz:metadata type="subject-long">
<xsl:for-each select="marc:subfield">
<xsl:if test="position() > 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="."/>
</xsl:for-each>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='856']">
<pz:metadata type="electronic-url">
<xsl:value-of select="marc:subfield[@code='u']"/>
</pz:metadata>
<pz:metadata type="electronic-text">
<xsl:value-of select="marc:subfield[@code='y']"/>
</pz:metadata>
<pz:metadata type="electronic-note">
<xsl:value-of select="marc:subfield[@code='z']"/>
</pz:metadata>
</xsl:for-each>

<xsl:for-each select="marc:datafield[@tag='773']">
<pz:metadata type="citation">
<xsl:for-each select="*">
<xsl:value-of select="normalize-space(.)"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</pz:metadata>
</xsl:for-each>

<pz:metadata type="medium">
<xsl:value-of select="$medium"/>
</pz:metadata>
<xsl:if test="$fulltext_a">
<pz:metadata type="fulltext">
<xsl:value-of select="$fulltext_a"/>
</pz:metadata>
</xsl:if>

<xsl:if test="$fulltext_b">
<pz:metadata type="fulltext">
<xsl:value-of select="$fulltext_b"/>
</pz:metadata>
</xsl:if>

<xsl:if test="$open_url_resolver">
<pz:metadata type="open-url">
<xsl:call-template name="insert-md-openurl" />
</pz:metadata>
</xsl:if>

</pz:record>

</xsl:template>

</xsl:stylesheet>

+ 0
- 100
etc/pazpar2/pazpar2.xml View File

@@ -1,100 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: pazpar2.cfg.dist,v 1.21 2007-10-04 12:01:15 adam Exp $ -->
<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
<server>
<listen port="__PAZPAR2_PORT__"/>
<settings src="__PAZPAR2_CONF_DIR__/koha-biblios.xml"/>

<relevance>
<icu_chain id="relevance" locale="el">
<normalize rule="[:Control:] Any-Remove"/>
<tokenize rule="l"/>
<normalize rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
<casemap rule="l"/>
<index/>
</icu_chain>
</relevance>

<sort>
<icu_chain id="sort" locale="el">
<normalize rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
<casemap rule="l"/>
<sortkey/>
</icu_chain>
</sort>
<mergekey>
<icu_chain id="mergekey" locale="el">
<tokenize rule="l"/>
<normalize rule="[[:Control:][:WhiteSpace:][:Punctuation:]] Remove"/>
<casemap rule="l"/>
<index/>
</icu_chain>
</mergekey>
<service>
<!-- we try to keep same order as in marc21.xsl -->
<metadata name="id"/>
<metadata name="lccn" merge="unique"/>
<metadata name="kohaid" />
<metadata name="isbn"/>
<metadata name="issn"/>
<metadata name="tech-rep-nr"/>
<metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
<metadata name="author-title"/>
<metadata name="author-date"/>
<metadata name="corporate-name"/>
<metadata name="corporate-location"/>
<metadata name="corporate-date"/>
<metadata name="meeting-name"/>
<metadata name="meeting-location"/>
<metadata name="meeting-date"/>
<metadata name="date" brief="yes" sortkey="numeric" type="year"
merge="range" termlist="yes"/>
<metadata name="work-title" brief="yes" sortkey="skiparticle"
merge="longest" rank="6"/>
<metadata name="work-author" brief="yes" sortkey="skiparticle"
merge="longest" rank="6"/>
<metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
<metadata name="title-responsibility" brief="yes" />
<metadata name="title-dates" brief="yes" merge="longest"/>
<metadata name="title-medium" brief="yes" merge="longest"/>
<metadata name="title-number-section" brief="yes" merge="longest"/>
<metadata name="medium" brief="yes" merge="longest"/>
<metadata name="edition"/>
<metadata name="publication-place"/>
<metadata name="publication-name"/>
<metadata name="publication-date"/>
<metadata name="physical-extent"/>
<metadata name="physical-format"/>
<metadata name="physical-dimensions"/>
<metadata name="physical-accomp"/>
<metadata name="physical-unittype"/>
<metadata name="physical-unitsize"/>
<metadata name="physical-specified"/>

<metadata name="series-title"/>

<metadata name="description" merge="longest" rank="3"/>
<metadata name="subject-long" rank="3"/>
<metadata name="subject" termlist="yes" rank="0"/>
<metadata name="electronic-url"/>
<metadata name="electronic-text"/>
<metadata name="electronic-note"/>
<metadata name="citation"/>
<metadata name="fulltext"/>

<metadata name="url_recipe" setting="postproc"/>
<metadata name="open_url_resolver" setting="parameter"/>
<metadata name="open-url" merge="longest"/>
</service>
</server>
</pazpar2>
<!-- Keep this comment at the end of the file
Local variables:
mode: nxml
End:
-->


+ 0
- 169
etc/pazpar2/pz2-ourl-base.xsl View File

@@ -1,169 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str">

<xsl:param name="open_url_resolver"/>
<!--<xsl:variable name="resolver">http://zeus.lib.uoc.gr:3210/sfxtst3</xsl:variable>-->
<xsl:template name="insert-md-openurl">
<xsl:value-of select="$open_url_resolver" /><xsl:text>?generatedby=pz2</xsl:text>
<xsl:call-template name="ou-parse-author" />
<xsl:call-template name="ou-parse-date" />
<xsl:call-template name="ou-parse-volume" />
<xsl:call-template name="ou-parse-any">
<xsl:with-param name="field_name" select="string('isbn')" />
</xsl:call-template>
<xsl:call-template name="ou-parse-any">
<xsl:with-param name="field_name" select="string('issn')" />
</xsl:call-template>
<xsl:call-template name="ou-parse-any">
<xsl:with-param name="field_name" select="string('title')" />
</xsl:call-template>
<xsl:call-template name="ou-parse-any">
<xsl:with-param name="field_name" select="string('atitle')" />
</xsl:call-template>

</xsl:template>
<!-- parsing raw string data -->
<xsl:template name="ou-parse-author" >
<xsl:variable name="author">
<xsl:call-template name="ou-author" />
</xsl:variable>
<xsl:variable name="aulast" select="normalize-space(substring-before($author, ','))"/>

<xsl:variable name="aufirst"
select="substring-before( normalize-space(substring-after($author, ',')), ' ')"/>

<xsl:if test="$aulast != ''">
<xsl:text>&amp;aulast=</xsl:text>
<xsl:value-of select="$aulast" />
</xsl:if>

<xsl:if test="string-length( translate($aufirst, '.', '') ) &gt; 1" >
<xsl:text>&amp;aufirst=</xsl:text>
<xsl:value-of select="$aufirst" />
</xsl:if>

</xsl:template>

<xsl:template name="ou-parse-volume">
<xsl:variable name="volume">
<xsl:call-template name="ou-volume" />
</xsl:variable>

<xsl:variable name="vol" select="substring-after($volume, 'Vol')"/>
<xsl:variable name="issue" select="false()" />
<xsl:variable name="spage" select="false()" />

<xsl:if test="$vol">
<xsl:text>&amp;volume=</xsl:text>
<xsl:value-of select="$vol" />
</xsl:if>

<xsl:if test="$issue">
<xsl:text>&amp;issue=</xsl:text>
<xsl:value-of select="$issue" />
</xsl:if>
<xsl:if test="$spage">
<xsl:text>&amp;spage=</xsl:text>
<xsl:value-of select="$vol" />
</xsl:if>

</xsl:template>


<xsl:template name="ou-parse-date">
<xsl:variable name="date">
<xsl:call-template name="ou-date" />
</xsl:variable>

<xsl:variable name="parsed_date" select="translate($date, '.[]c;', '')"/>

<xsl:if test="$parsed_date">
<xsl:text>&amp;date=</xsl:text>
<xsl:value-of select="$parsed_date" />
</xsl:if>

</xsl:template>

<xsl:template name="ou-parse-any">
<xsl:param name="field_name" />

<xsl:variable name="field_value">
<xsl:choose>

<xsl:when test="$field_name = 'isbn'">
<xsl:call-template name="ou-isbn"/>
</xsl:when>

<xsl:when test="$field_name = 'issn'">
<xsl:call-template name="ou-issn"/>
</xsl:when>
<xsl:when test="$field_name = 'atitle'">
<xsl:call-template name="ou-atitle"/>
</xsl:when>
<xsl:when test="$field_name = 'title'">
<xsl:call-template name="ou-title"/>
</xsl:when>

</xsl:choose>
</xsl:variable>

<xsl:variable name="digits" select="1234567890"/>

<xsl:variable name="parsed_value">
<xsl:choose>

<xsl:when test="$field_name = 'isbn'">
<xsl:value-of select="translate($field_value, translate($field_value, concat($digits, 'X'), ''), '')"/>
</xsl:when>

<xsl:when test="$field_name = 'issn'">
<xsl:value-of select="translate($field_value, translate($field_value, concat($digits, '-', 'X'), ''), '')"/>
</xsl:when>
<xsl:when test="$field_name = 'atitle'">
<xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
</xsl:when>
<xsl:when test="$field_name = 'title'">
<xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
</xsl:when>

</xsl:choose>
</xsl:variable>


<xsl:if test="$parsed_value != ''">
<xsl:text>&amp;</xsl:text>
<xsl:value-of select="$field_name" />
<xsl:text>=</xsl:text>
<xsl:value-of select="$parsed_value" />
</xsl:if>

</xsl:template>


</xsl:stylesheet>
<!--
/*
* Local variables:
* c-basic-offset: 2
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=2 tabstop=4 expandtab
*/
-->

+ 0
- 97
etc/pazpar2/pz2-ourl-marc21.xsl View File

@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str">
<xsl:import href="pz2-ourl-base.xsl"/>

<xsl:template name="ou-author" >
<!-- what to do with multiple authors??-->
<xsl:for-each select="marc:datafield[@tag='100' or @tag='700']">
<xsl:value-of select="marc:subfield[@code='a']"/>
</xsl:for-each>
</xsl:template>

<xsl:template name="ou-title" >
<!-- if 773 exists its a journal/article -->
<xsl:choose>
<xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='t']">
<xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
</xsl:when>

<xsl:when test="marc:datafield[@tag='245']/marc:subfield[@code='a']">
<xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
</xsl:when>

</xsl:choose>
</xsl:template>

<xsl:template name="ou-atitle" >
<!-- return value only if article or journal -->
<xsl:if test="marc:datafield[@tag='773']">
<xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
</xsl:if>
</xsl:template>


<xsl:template name="ou-date" >
<xsl:for-each select="marc:datafield[@tag='260']">
<xsl:value-of select="marc:subfield[@code='c']"/>
</xsl:for-each>
</xsl:template>

<xsl:template name="ou-isbn" >
<!-- if 773 exists its a journal/article -->
<xsl:choose>
<xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='z']">
<xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='z']"/>
</xsl:when>
<xsl:when test="marc:datafield[@tag='020']/marc:subfield[@code='a']">
<xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/>
</xsl:when>

</xsl:choose>
</xsl:template>

<xsl:template name="ou-issn" >
<!-- if 773 exists its a journal/article -->
<xsl:choose>
<xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='x']">
<xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='x']"/>
</xsl:when>

<xsl:when test="marc:datafield[@tag='022']/marc:subfield[@code='a']">
<xsl:value-of select="marc:datafield[@tag='022']/marc:subfield[@code='a']"/>
</xsl:when>

</xsl:choose>
</xsl:template>

<xsl:template name="ou-volume" >
<xsl:if test="marc:datafield[@tag='773']">
<xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='g']"/>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
<!--
/*
* Local variables:
* c-basic-offset: 2
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=2 tabstop=4 expandtab
*/
-->

+ 8
- 0
installer/data/mysql/atomicupdate/bug_20410.perl View File

@@ -0,0 +1,8 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( q{
DELETE FROM systempreferences WHERE variable="OpacGroupResults"
});

NewVersion( $DBversion, 20410, "Remove OpacGroupResults");
}

+ 0
- 7
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref View File

@@ -37,13 +37,6 @@ Searching:
unescape_escaped: Unescape escaped
dont_escape: Don't escape
- "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.)"
-
- pref: OpacGroupResults
default: 0
choices:
yes: Use
no: "Don't use"
- PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running.
-
- pref: TraceCompleteSubfields
default: 0


+ 0
- 373
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt View File

@@ -1,373 +0,0 @@
[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;
[% IF ( searchdesc ) %]
Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
[% ELSE %]
You did not specify any search criteria.
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
<link rel="alternate" type="application/rss+xml" title="Koha - RSS" href="/cgi-bin/koha/opac-rss.pl?[% query_cgi | $raw %][% limit_cgi | url %]" />

</head>
[% INCLUDE 'bodytag.inc' bodyid='results-grouped' %]
[% INCLUDE 'masthead.inc' %]

<div class="main">
<nav aria-label="breadcrumb">
<ul class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
[% IF ( searchdesc ) %]
<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>
[% ELSE %]
<a href="#">You did not specify any search criteria.</a>
[% END %]
</li>
</ul>
</nav>

[% IF ( query_error ) %]
<div class="container-fluid">
<div class="row">
<div class="col order-first order-md-first order-lg-2">
<div class="alert alert-warning">
<h4>Error:</h4>
<p>[% query_error | html %]</p>
</div>
</div> <!-- / .span12 -->
</div> <!-- / .row -->
</div> <!-- / .container-fluid -->
[% END %]

<div class="container-fluid">
<div class="row">
[% IF ( opacfacets && total ) %]
<div class="col-lg-2">
<div id="facetcontainer">
<!-- FACETS START -->
[% INCLUDE 'opac-facets.inc' %]
<!-- FACETS END -->
</div>
</div>
<div class="col-10 order-first order-md-first order-lg-2">
[% ELSE %]
<div class="col order-first order-md-first order-lg-2">
[% END %]
<div id="grouped-results" class="maincontent">
<!-- Search Results Table -->
[% IF ( total ) %]
[% IF ( scan ) %]
<h1>Scan index:</h1>
<form action="/cgi-bin/koha/opac-search.pl" method="get">
<table>
<tbody>
<tr>
<td>
Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
</td>
</tr>
<tr>
<td>
<label for="scan-index">Indexed in:</label>
<select name="idx" id="scan-index">
<option value="">Any word</option>
<option value="kw,phr:">Any phrase</option>
<option value="ti:">Title</option>
<option value="ti,phr:">Title phrase</option>
<option value="au,phr:">Author</option>
<option value="su:">Subject</option>
<option value="su,phr:">Subject phrase</option>
<option value="se:">Series</option>
<option value="pb:">Publisher</option>
<option value="nt:">Notes</option>
<option value="se:">Series Title</option>
<option value="sn:">ISBN</option>
<option value="ss:">ISSN</option>
</select>
<input type="hidden" name="scan" value="1" />
</td>
</tr>
</tbody>
</table>
</form>

<form action="/cgi-bin/koha/opac-search.pl" method="get">
<table>
<thead>
<tr>
<th>Term/Phrase</th>
<th>Count</th>
</tr>
</thead>
<tbody>
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
<tr>
<td>
<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>
</td>
<td>
[% FOREACH subtitl IN SEARCH_RESULT.subtitle.split(' | ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %]
<span class="subtitle">[% subtitl | html %]</span>
[% END %]
<span class="part-number">[% SEARCH_RESULT.part_number | html %]</span> <span class="part-name">[% SEARCH_RESULT.part_name | html %]</span>
</td>
</tr>
[% END %]
</thead>
</table>
</form>
[% ELSE %]

<div class="searchresults">
<form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
[% IF ( searchdesc ) %]
[% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
<input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
[% END %]
[% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
<input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
[% END %]
[% END %]

<!-- TABLE RESULTS START -->
<table class="table table-striped">
<tr>
<td colspan="3" class="resultscontrol">
<div class="resort">
<select id="sort_by" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
<input type="submit" class="submit clearfix" id="sortsubmit" value="Go" />
</div>
[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
<div class="cartlist"><span class="checkall"></span>
<span class="clearall"></span>
<a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
<a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
<span class="addto"></span></div>
[% END %]
</td>
</tr>
<!-- Actual Search Results -->
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
<tr class="grouplabel"><td colspan="3">[% SEARCH_RESULT.group_label | html %]</td></tr>
[% FOREACH GROUP_RESULT IN SEARCH_RESULT.GROUP_RESULTS %]
[% IF ( GROUP_RESULT.even ) %]
<tr class="highlight">
[% ELSE %]
<tr>
[% END %]
<td>
[% IF ( AdlibrisEnabled && GROUP_RESULT.normalized_isbn ) %]
<img src="[% AdlibrisURL | html %]?isbn=[% GROUP_RESULT.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" />
[% END %]
[% IF ( OPACAmazonCoverImages ) %]
<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 %]
</a>
[% ELSE %]
[% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
[% IF ( GROUP_RESULT.imageurl ) %]
<img src="[% GROUP_RESULT.imageurl | html %]" title="[% GROUP_RESULT.description | html %]" />
[% END %]
[% END %]
[% GROUP_RESULT.description | html %]
[% END %]
</td>
<td>
[% GROUP_RESULT.result_number | html %].
[% IF ( GROUP_RESULT.BiblioDefaultViewmarc ) %]
<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 %]
[% ELSE %]
[% IF ( GROUP_RESULT.BiblioDefaultViewisbd ) %]
<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 %]
[% ELSE %]
<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 %]
[% END %]
[% FOREACH subtitl IN GROUP_RESULT.subtitle %]
[% subtitl | html %]
[% END %]
</a>
[% END # / IF GROUP_RESULT.BiblioDefaultViewmarc %]
[% IF ( GROUP_RESULT.author ) %]
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>
[% ELSE %]
&nbsp;
[% END %]
<p>
[% IF ( GROUP_RESULT.publicationyear ) %] - [% GROUP_RESULT.publicationyear | html %][% END %]
[% IF ( GROUP_RESULT.publishercode ) %]- [% GROUP_RESULT.publishercode | html %][% END %]
[% IF ( GROUP_RESULT.place ) %] ; [% GROUP_RESULT.place | html %][% END %]
[% IF ( GROUP_RESULT.pages ) %] - [% GROUP_RESULT.pages | html %][% END %]
[% IF ( GROUP_RESULT.notes ) %] : [% GROUP_RESULT.notes | html %][% END %]
[% IF ( GROUP_RESULT.size ) %] ; [% GROUP_RESULT.size | html %][% END %]
[% IF ( GROUP_RESULT.timestamp ) %] <em>(modified on [% GROUP_RESULT.timestamp | html %])</em>[% END %]
</p>
[% IF ( GROUP_RESULT.searchhighlightblob ) %]
<p class="searchhighlightblob">[% GROUP_RESULT.searchhighlightblob | html %]</p>
[% END %]
<p class="availability">
[% IF ( GROUP_RESULT.available_items_loop ) %]
<span class="available"><strong>Items available at:</strong>
[% FOREACH available_items_loo IN GROUP_RESULT.available_items_loop %]
[% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname | html %][% END %]
[% IF ( OPACItemsResultsDisplay ) %]
[% IF ( available_items_loo.location ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
[% 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 %]
[% END %]
([% available_items_loo.count | html %]),
[% END # / FOREACH available_items_loo %]
</span>
[% ELSE %]
<span class="unavailable">No items available:</span>
[% END # / IF GROUP_RESULT.available_items_loop %]
<span class="unavailable">
[% IF ( GROUP_RESULT.onloancount ) %] Checked out ([% GROUP_RESULT.onloancount | html %]), [% END %]
[% IF ( GROUP_RESULT.withdrawncount ) %] Withdrawn ([% GROUP_RESULT.withdrawncount | html %]), [% END %]
[% IF ( GROUP_RESULT.itemlostcount ) %] Lost ([% GROUP_RESULT.itemlostcount | html %]),[% END %]
[% IF ( GROUP_RESULT.damagedcount ) %] Damaged ([% GROUP_RESULT.damagedcount | html %]),[% END %]
[% IF ( GROUP_RESULT.orderedcount ) %] On order ([% GROUP_RESULT.orderedcount | html %]),[% END %]
[% IF ( GROUP_RESULT.intransitcount ) %] In transit ([% GROUP_RESULT.intransitcount | html %]),[% END %]
</span>
</p>
<p>
[% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
[% UNLESS ( GROUP_RESULT.norequests ) %]
[% IF Koha.Preference( 'opacuserlogin' ) == 1 && GROUP_RESULT.holdable %]
<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-->
[% END %]
[% END %]
[% END %]

[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
<input type="checkbox" name="biblionumber" value="[% GROUP_RESULT.biblionumber | html %]" title="Click to add to cart" /> <label for="bib[% GROUP_RESULT.biblionumber | html %]">
[% END %]
<img src="[% themelang | html %]/images/[% GROUP_RESULT.itemtype | html %].gif" alt="[% GROUP_RESULT.ccode | html %]" title="[% GROUP_RESULT.ccode | html %]" />
[% IF ( ( Koha.Preference( 'opacbookbag' ) = 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]</label>[% END %]
[% IF ( GROUP_RESULT.classification ) %]
<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% GROUP_RESULT.classification |url %]"> [% GROUP_RESULT.classification | html %] </a>
[% END %]
</p>
</td>
</tr>
[% END # / FOREACH GROUP_RESULT %]
[% END # / FOREACH SEARCH_RESULTS %]
</table>
</form>
</div> <!-- / .searchresults -->
[% END # / IF scan %]
[% INCLUDE 'page-numbers.inc' %]
[% END # / IF total %]

[% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 ) %]
<div class="suggestion">
Not finding what you're looking for?
<ul>
[% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
<li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
[% ELSE %]
[% IF ( loggedinusername ) %]
<li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
[% END %]
[% END %]
[% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
<li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
[% END %]
</ul>
</div>
[% END %]
</div> <!-- / #grouped-results -->

</div> <!-- /.col-10/12 -->
</div> <!-- / .row -->
</div> <!-- / .container-fluid -->
</div><!-- / .main -->

[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
<script>
var q_array = new Array(); // will hold the search terms, if possible
$(document).ready(function(){
[% IF ( OpacHighlightedWords ) %]
$('a.title').each(function() {
$(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
});
[% END %]

$('#sort_by').change(function() {
$('#bookbag_form').submit();
});
$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">" + _("Clear all") + "</a>");
$("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">" + _("Select all") + "</a>");
$("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") + "\" />");
$("#addto").change(function(){
cartList();
});
$(".addto").find("input:submit").click(function(){
cartList();
return false;
});
function cartList(){
if($("#addto").find("option:selected").attr("value") == "addtolist"){
var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
[% IF ( loggedinusername ) %]if (vShelfAdd()) {
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
}[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
return false;
} else if($("#addto").find("option:selected").attr("value") == "newlist"){
[% IF ( loggedinusername ) %]if (vShelfAdd()) {
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
}[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
return false;
}
if($("#addto").find("option:selected").attr("value") == "addtocart"){
addMultiple();
return false;
}
}
$("#CheckAll").on("click", function(e){
e.preventDefault();
$("#bookbag_form").find("input:checkbox").prop("checked", true);
});
$("#CheckNone").on("click", function(e){
e.preventDefault();
$("#bookbag_form").find("input:checkbox").prop("checked", true);
});
[% IF ( query_desc ) %]
var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
q_array = query_desc.split(" ");
// ensure that we don't have "" at the end of the array, which can
// break the highlighter
while (q_array.length > 0 && q_array[q_array.length-1] == "") {
q_array = q_array.splice(0,-1);
}
highlightOn();
$("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
$("#highlight_toggle_off").show().click(function() {highlightOff();});
[% END %]
});

function highlightOff() {
$("td").removeHighlight();
$(".highlight_toggle").toggle();
}
function highlightOn() {
var x;
for (x in q_array) {
q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
q_array[x] = q_array[x].toLowerCase();
var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
$("td").highlight(q_array[x]);
}
}
$(".highlight_toggle").toggle();
}

</script>
[% END %]

+ 0
- 62
misc/bin/koha-pazpar2-ctl.sh View File

@@ -1,62 +0,0 @@
#!/bin/bash

# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.

### BEGIN INIT INFO
# Provides: koha-pazpar-daemon
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PazPar2 server daemon for Koha
### END INIT INFO

USER=__KOHA_USER__
GROUP=__KOHA_GROUP__
DBNAME=__DB_NAME__
NAME=koha-pazpar2-ctl.$DBNAME
LOGDIR=__LOG_DIR__
ERRLOG=$LOGDIR/koha-pazpar2daemon.err
STDOUT=$LOGDIR/koha-pazpar2daemon.log
OUTPUT=$LOGDIR/koha-pazpar2daemon-output.log
PAZPAR2_CONF=__PAZPAR2_CONF_DIR__/pazpar2.xml
PAZPAR2SRV=/usr/sbin/pazpar2

test -f $PAZPAR2SRV || exit 0

OTHERUSER=''
if [[ $EUID -eq 0 ]]; then
OTHERUSER="--user=$USER.$GROUP"
fi

case "$1" in
start)
echo "Starting PazPar2 Server"
daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- $PAZPAR2SRV -f $PAZPAR2_CONF
;;
stop)
echo "Stopping PazPar2 Server"
daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --stop -- $PAZPAR2SRV -f $PAZPAR2_CONF
;;
restart)
echo "Restarting the PazPar2 Server"
daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --restart -- $PAZPAR2SRV -f $PAZPAR2_CONF
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac

+ 0
- 6
misc/koha-install-log View File

@@ -37,7 +37,6 @@ OPAC_WWW_DIR=__OPAC_WWW_DIR__
PERL_MODULE_DIR=__PERL_MODULE_DIR__
KOHA_CONF_DIR=__KOHA_CONF_DIR__
ZEBRA_CONF_DIR=__ZEBRA_CONF_DIR__
PAZPAR2_CONF_DIR=__PAZPAR2_CONF_DIR__
MISC_DIR=__MISC_DIR__
SCRIPT_DIR=__SCRIPT_DIR__
MAN_DIR=__MAN_DIR__
@@ -51,15 +50,10 @@ ZEBRA_AUTH_CFG=__ZEBRA_AUTH_CFG__
ZEBRA_BIB_CFG=__ZEBRA_BIB_CFG__
AUTH_RETRIEVAL_CFG=__AUTH_RETRIEVAL_CFG__
BIB_RETRIEVAL_CFG=__BIB_RETRIEVAL_CFG__
MERGE_SERVER_HOST=__MERGE_SERVER_HOST__
MERGE_SERVER_PORT=__MERGE_SERVER_PORT__
PAZPAR2_HOST=__PAZPAR2_HOST__
PAZPAR2_PORT=__PAZPAR2_PORT__
INSTALL_MODE=__INSTALL_MODE__
INSTALL_BASE=__INSTALL_BASE__
INSTALL_ZEBRA=__INSTALL_ZEBRA__
INSTALL_SRU=__INSTALL_SRU__
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__


+ 15
- 38
opac/opac-search.pl View File

@@ -101,13 +101,9 @@ my @params = $cgi->multi_param("limit");
my @searchCategories = $cgi->multi_param('searchcat');

my $format = $cgi->param("format") || '';
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
if ($format =~ /(rss|atom|opensearchdescription)/) {
$template_name = 'opac-opensearch.tt';
}
elsif (@params && $build_grouped_results) {
$template_name = 'opac-results-grouped.tt';
}
elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) {
$template_name = 'opac-results.tt';
}
@@ -618,10 +614,6 @@ if ($tag) {
# FIXME: Because search and standard search don't work together OpacHiddenItems
# displays search results which should be hidden.
# FIXME: No facets for tags search.
} elsif ($build_grouped_results) {
eval {
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,undef,$query_type,$scan);
};
} else {
$pasarParams .= '&amp;query=' . uri_escape_utf8($query);
$pasarParams .= '&amp;count=' . uri_escape_utf8($results_per_page);
@@ -667,20 +659,8 @@ for (my $i=0;$i<@servers;$i++) {
if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
$hits = $results_hashref->{$server}->{"hits"};
my $page = $cgi->param('page') || 0;
my @newresults;
if ($build_grouped_results) {
foreach my $group (@{ $results_hashref->{$server}->{"GROUPS"} }) {
# because pazGetRecords handles retieving only the records
# we want as specified by $offset and $results_per_page,
# we need to set the offset parameter of searchResults to 0
my @group_results = searchResults( $search_context, $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
$group->{"RECORDS"}, $variables);
push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
}
} else {
@newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
my @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
$results_hashref->{$server}->{"RECORDS"}, $variables);
}
$hits = 0 unless @newresults;

my $art_req_itypes;
@@ -799,23 +779,20 @@ for (my $i=0;$i<@servers;$i++) {
exit;
}
if ($hits) {
if ( !$build_grouped_results ) {
# We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
$pasarParams .= '&amp;listBiblios=';
my $j = 0;
foreach (@newresults) {
my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
$pasarParams .= uri_escape_utf8($bibnum) . ',';
$j++;
last if ($j == $results_per_page);
}
chop $pasarParams if ($pasarParams =~ /,$/);
$pasarParams .= '&amp;total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
if ($pasarParams) {
my $session = get_session($cgi->cookie("CGISESSID"));
$session->param('busc' => $pasarParams);
}
#
# We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
$pasarParams .= '&amp;listBiblios=';
my $j = 0;
foreach (@newresults) {
my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
$pasarParams .= uri_escape_utf8($bibnum) . ',';
$j++;
last if ($j == $results_per_page);
}
chop $pasarParams if ($pasarParams =~ /,$/);
$pasarParams .= '&amp;total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/);
if ($pasarParams) {
my $session = get_session($cgi->cookie("CGISESSID"));
$session->param('busc' => $pasarParams);
}
$template->param(total => $hits);
my $limit_cgi_not_availablity = $limit_cgi;


+ 0
- 14
rewrite-config.PL View File

@@ -121,7 +121,6 @@ my %configuration = (
'__PERL_MODULE_DIR__' => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha",
'__KOHA_CONF_DIR__' => "$prefix/etc/koha",
'__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb",
'__PAZPAR2_CONF_DIR__' => "$prefix/etc/koha/pazpar2",
'__MISC_DIR__' => "$prefix/misc",
'__SCRIPT_DIR__' => "$prefix/bin",
'__SCRIPT_NONDEV_DIR__' => "$prefix/bin",
@@ -140,15 +139,9 @@ my %configuration = (
'__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg',
'__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg',
"__MERGE_SERVER_HOST__" => $myhost,
"__MERGE_SERVER_PORT__" => '11001',
"__PAZPAR2_HOST__" => $myhost,
"__PAZPAR2_PORT__" => '11002',
"__INSTALL_MODE__" => 'standard',
"__INSTALL_BASE__" => '/usr/share/koha',
"__INSTALL_SRU__" => 'yes',
"__INSTALL_PAZPAR2__" => 'no',
"__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
"__PAZPAR2_TOGGLE_XML_POST__" => '-->',
"__RUN_DATABASE_TESTS__" => 'no',
"__PATH_TO_ZEBRA__" => "",
"__USE_MEMCACHED__" => 'yes',
@@ -175,13 +168,6 @@ foreach my $key (keys %configuration) {
}
}

# munge commenting out the PazPar2 mergeserver
# entry in koha-conf.xml if necessary
if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') {
$configuration{'__PAZPAR2_TOGGLE_XML_PRE__'} = '';
$configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = '';
}

my $fname = $ARGV[0];
my $file = &read_file($fname);
$file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;


+ 0
- 1
t/db_dependent/UsageStats.t View File

@@ -553,7 +553,6 @@ sub mocking_systempreferences_to_a_set_value {
TalkingTechItivaPhoneNotification
uppercasesurnames
IncludeSeeFromInSearches
OpacGroupResults
QueryAutoTruncate
QueryFuzzy
QueryStemming


Loading…
Cancel
Save