3 # Copyright (c) 2012 Equinox Software, Inc.
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
24 use Koha::Indexer::Utils;
31 my $result = GetOptions(
32 'input:s' => \$input_file,
33 'output:s' => \$output_file,
34 'help|h' => \$want_help,
37 if ( not $result or $want_help or not defined $input_file or not defined $output_file ) {
42 open my $infh, '<', $input_file or die "$0: cannot open input file $input_file: $!\n";
43 open my $outfh, '>', $output_file or die "$0: cannot open output file $output_file: $!\n";
45 my $grs1_cfg = join('', <$infh>);
47 my $dom_cfg = Koha::Indexer::Utils::zebra_record_abs_to_dom($grs1_cfg);
48 print $outfh $dom_cfg;
53 $0: generate a DOM filter Zebra index config from a GRS-1 config
55 Given a Zebra record.abs file containing a set of index definitions for
56 Zebra's GRS-1 filter, write an equivalent DOM filter configuration.
58 To generate the XSLT that is to be used by Zebra, run something like
59 the following on the output of this utility:
61 xsltproc ZEBRA_CFG_DIR/xsl/koha-indexdefs-to-zebra.xsl \\
62 biblio-koha-indexdefs.xml \\
63 > ZEBRA_CFG_DIR/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
65 The above example assumes that the output of the program was named
66 biblio-koha-indexdefs.xsl.
69 --input input file name
70 --output output file name
71 --help or -h show this message