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 under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along with
16 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
17 # Suite 330, Boston, MA 02111-1307 USA
23 use Koha::Indexer::Utils;
30 my $result = GetOptions(
31 'input:s' => \$input_file,
32 'output:s' => \$output_file,
33 'help|h' => \$want_help,
36 if ( not $result or $want_help or not defined $input_file or not defined $output_file ) {
41 open my $infh, '<', $input_file or die "$0: cannot open input file $input_file: $!\n";
42 open my $outfh, '>', $output_file or die "$0: cannot open output file $output_file: $!\n";
44 my $grs1_cfg = join('', <$infh>);
46 my $dom_cfg = Koha::Indexer::Utils::zebra_record_abs_to_dom($grs1_cfg);
47 print $outfh $dom_cfg;
52 $0: generate a DOM filter Zebra index config from a GRS-1 config
54 Given a Zebra record.abs file containing a set of index definitions for
55 Zebra's GRS-1 filter, write an equivalent DOM filter configuration.
57 To generate the XSLT that is to be used by Zebra, run something like
58 the following on the output of this utility:
60 xsltproc ZEBRA_CFG_DIR/xsl/koha-indexdefs-to-zebra.xsl \\
61 biblio-koha-indexdefs.xml \\
62 > ZEBRA_CFG_DIR/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
64 The above example assumes that the output of the program was named
65 biblio-koha-indexdefs.xsl.
68 --input input file name
69 --output output file name
70 --help or -h show this message