Bugzilla – Attachment 20182 Details for
Bug 8507
koha-create should be updated to use DOM indexing for bib
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8507: koha-create should be updated to use DOM indexing for bib
Bug-8507-koha-create-should-be-updated-to-use-DOM-.patch (text/plain), 8.53 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-08-08 18:44:06 UTC
(
hide
)
Description:
Bug 8507: koha-create should be updated to use DOM indexing for bib
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-08-08 18:44:06 UTC
Size:
8.53 KB
patch
obsolete
>From 9133617c1932f9522645d4dcd347f35a3159a70b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 8 Aug 2013 15:15:53 -0300 >Subject: [PATCH] Bug 8507: koha-create should be updated to use DOM indexing > for bib > >This patch makes the koha-create script install the file zebra-biblios-dom.cfg >with the proper string substitutions inside on the new instance. > >It also adds two option switches that control the indexing mode for the instance: > > --biblio-idx {dom|grs1} > --auth-idx {dom|grs1} > >DOM indexing is set as the default for both authorities and bibliographic records. > >To test: >- Apply the patch >- Build your own packages and install them on a test server >a) Create a new instance without using the new switches like: > $ koha-create --create-db domtest > - Check there's a file /etc/koha/sites/domtest/zebra-biblios-dom.cfg > - Check that /etc/koha/sites/domtest/koha-conf.xml points to: > * zebra-biblios-dom.cfg (biblioserver section) > * zebra-biblios-dom.cfg (publicserver section) > * zebra-authorities-dom.cfg (authorityserver section) > - Success means the new default is DOM >b) Play with the 4 possible combination of option switches > $ koha-create --create-db --auth-idx grs1 --biblio-idx grs1 domtest > $ koha-create --create-db --auth-idx grs1 --biblio-idx dom domtest > $ koha-create --create-db --auth-idx dom --biblio-idx grs1 domtest > $ koha-create --create-db --auth-idx dom --biblio-idx dom domtest > - Check the koha-conf.xml file reflects the chosen options. >c) Run > $ koha-create --help > - It should advertise this addition accordingly. >d) Run > $ man koha-create > - Man page for koha-create should provide good information on the new switches behaviour > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > debian/docs/koha-create.xml | 16 +++++++++++ > debian/scripts/koha-create | 46 +++++++++++++++++++++++++++++++- > debian/templates/koha-conf-site.xml.in | 6 ++--- > 3 files changed, 64 insertions(+), 4 deletions(-) > >diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml >index 491da62..31c168a 100644 >--- a/debian/docs/koha-create.xml >+++ b/debian/docs/koha-create.xml >@@ -27,6 +27,8 @@ > <arg choice="req"><option>--create-db</option>|<option>--request-db</option>|<option>--populate-db</option>|<option>--use-db</option></arg> > <arg><option>--marcflavor</option> marc21|normarc|unimarc</arg> > <arg><option>--zebralang</option> en|es|fr|nb|ru|uk</arg> >+ <arg><option>--auth-idx</option> dom|grs1</arg> >+ <arg><option>--biblio-idx</option> dom|grs1</arg> > <arg><option>--defaultsql</option> /path/to/some.sql</arg> > <arg><option>--configfile</option> /path/to/config</arg> > <arg><option>--passwdfile</option> /path/to/passwd</arg> >@@ -109,6 +111,20 @@ > </listitem> > </varlistentry> > >+ <varlistentry> >+ <term><option>--auth-idx</option></term> >+ <listitem> >+ <para>Specified the desired indexing mode for authority records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para> >+ </listitem> >+ </varlistentry> >+ >+ <varlistentry> >+ <term><option>--biblio-idx</option></term> >+ <listitem> >+ <para>Specified the desired indexing mode for bibliographic records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para> >+ </listitem> >+ </varlistentry> >+ > </variablelist> > </refsect1> > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index a0a830a..811e36f 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -22,6 +22,7 @@ set -e > usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ > [--marcflavor marc21|normarc|unimarc] \ > [--zebralang en|es|fr|nb|ru|uk] \ >+ [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \ > [--defaultsql /path/to/some.sql] \ > [--configfile /path/to/config] [--passwdfile /path/to/passwd] \ > [--database database] [--adminuser n] instancename" >@@ -45,6 +46,8 @@ generate_config_file() { > -e "s/__ZEBRA_PASS__/$zebrapwd/g" \ > -e "s/__ZEBRA_MARC_FORMAT__/$ZEBRA_MARC_FORMAT/g" \ > -e "s/__ZEBRA_LANGUAGE__/$ZEBRA_LANGUAGE/g" \ >+ -e "s/__BIBLIO_INDEXING__/$BIBLIO_INDEXING/g" \ >+ -e "s/__AUTHORITY_INDEXING__/$AUTHORITY_INDXING/g" \ > -e "s/__DB_NAME__/$mysqldb/g" \ > -e "s/__DB_HOST__/$mysqlhost/g" \ > -e "s/__DB_USER__/$mysqluser/g" \ >@@ -75,6 +78,40 @@ getinstancemysqldatabase() { > xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" > } > >+set_authority_indexing() >+{ >+ indexing_mode=$1 >+ >+ case $indexing_mode in >+ "grs1") >+ AUTHORITY_INDEXING="" >+ ;; >+ "dom") >+ AUTHORITY_INDEXING="-dom" >+ ;; >+ *) >+ die "Error: '$indexing_mode' is not a valid indexing mode for authority records." >+ ;; >+ esac >+} >+ >+set_biblio_indexing() >+{ >+ indexing_mode=$1 >+ >+ case $indexing_mode in >+ "grs1") >+ BIBLIO_INDEXING="" >+ ;; >+ "dom") >+ BIBLIO_INDEXING="-dom" >+ ;; >+ *) >+ die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records." >+ ;; >+ esac >+} >+ > # Set defaults and read config file, if it exists. > DOMAIN="" > OPACPORT="80" >@@ -86,6 +123,8 @@ INTRASUFFIX="" > DEFAULTSQL="" > ZEBRA_MARC_FORMAT="marc21" > ZEBRA_LANGUAGE="en" >+BIBLIO_INDEXING="-dom" >+AUTHORITY_INDEXING="-dom" > ADMINUSER="1" > PASSWDFILE="/etc/koha/passwd" > if [ -e /etc/koha/koha-sites.conf ] >@@ -95,7 +134,8 @@ fi > > [ $# -ge 2 ] && [ $# -le 16 ] || die $usage > >-TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \ >+TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,\ >+ auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! >@@ -115,6 +155,8 @@ while true ; do > -u|--use-db) op=use ; shift ;; > -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; > -l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; >+ --auth-idx) set_authority_indexing "$2" ; shift 2 ;; >+ --biblio-idx) set_biblio_indexing "$2" ; shift 2 ;; > -d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; > -f|--configfile) configfile="$2" ; shift 2 ;; > -s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;; >@@ -261,6 +303,8 @@ eof > # Generate and install Zebra config files. > generate_config_file zebra-biblios-site.cfg.in \ > "/etc/koha/sites/$name/zebra-biblios.cfg" >+ generate_config_file zebra-biblios-dom-site.cfg.in \ >+ "/etc/koha/sites/$name/zebra-biblios-dom.cfg" > generate_config_file zebra-authorities-site.cfg.in \ > "/etc/koha/sites/$name/zebra-authorities.cfg" > generate_config_file zebra-authorities-dom-site.cfg.in \ >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index ab8aff5..d0f1388 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -26,7 +26,7 @@ > <!-- BIBLIOGRAPHIC RECORDS --> > <server id="biblioserver" listenref="biblioserver"> > <directory>/var/lib/koha/__KOHASITE__/biblios</directory> >- <config>/etc/koha/sites/__KOHASITE__/zebra-biblios.cfg</config> >+ <config>/etc/koha/sites/__KOHASITE__/zebra-biblios__BIBLIO_INDEXING__.cfg</config> > <cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn> > <retrievalinfo> > <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/> >@@ -102,7 +102,7 @@ > <!-- AUTHORITY RECORDS --> > <server id="authorityserver" listenref="authorityserver" > > <directory>/var/lib/koha/__KOHASITE__/authorities</directory> >- <config>/etc/koha/sites/__KOHASITE__/zebra-authorities-dom.cfg</config> >+ <config>/etc/koha/sites/__KOHASITE__/zebra-authorities__AUTHORITY_INDEXING__.cfg</config> > <cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn> > <xi:include href="/etc/koha/__ZEBRA_MARC_FORMAT__-retrieval-info-auth-dom.xml" > xmlns:xi="http://www.w3.org/2001/XInclude"> >@@ -176,7 +176,7 @@ > > <server id="publicserver" listenref="publicserver"> > <directory>/var/lib/koha/__KOHASITE__/biblios</directory> >- <config>/etc/koha/sites/__KOHASITE__/zebra-biblios.cfg</config> >+ <config>/etc/koha/sites/__KOHASITE__/zebra-biblios__BIBLIO_INDXING__.cfg</config> > <cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn> > <retrievalinfo> > <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/> >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8507
:
20182
|
20189
|
20212
|
20247
|
20251
|
20256
|
20263
|
20288
|
20289