Bugzilla – Attachment 30902 Details for
Bug 6536
Z3950 Search Enhancements: SRU targets and additional XSLT processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6536: Dbrev for Z3950 search improvements
Bug-6536-Dbrev-for-Z3950-search-improvements.patch (text/plain), 5.35 KB, created by
Marcel de Rooy
on 2014-08-18 08:10:40 UTC
(
hide
)
Description:
Bug 6536: Dbrev for Z3950 search improvements
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-08-18 08:10:40 UTC
Size:
5.35 KB
patch
obsolete
>From 98742d60e3ee7a908f6666011c5854e66e50886b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 1 May 2014 15:07:12 +0200 >Subject: [PATCH] Bug 6536: Dbrev for Z3950 search improvements >Content-Type: text/plain; charset=utf-8 > >Adjusts table z3950servers: >Drops unused columns icon, description and position. >Moves id column to first position. >Renames name to servername, and type to servertype. (This is not only more >clear but may eliminate some problems too with DBIx.) >Changes recordtype from varchar(45) to enumeration with two members. [The >upgrade replaces unknown record types with biblio, although it is very >unlikely to find such records.] >Adds SRU as servertype enumeration member. Removes opensearch, since it is >not used/supported. [The upgrade replaces unknown server types with zed >(z3950) (in exceptional cases).] >Adds new columns: sru_options, sru_fields, add_xslt. > >Test plan: >Run database update via webinstaller. >Check your z3950servers table. > >Signed-off-by: Giuseppe Angilella <giuseppe.angilella@ct.infn.it> >--- > installer/data/mysql/kohastructure.sql | 14 +++++++------- > installer/data/mysql/updatedatabase.pl | 29 +++++++++++++++++++++++++++++ > 2 files changed, 36 insertions(+), 7 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index b46dc6a..0e54234 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2334,23 +2334,23 @@ CREATE TABLE `virtualshelfshares` ( -- shared private lists > > DROP TABLE IF EXISTS `z3950servers`; > CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets used in cataloging >+ `id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha > `host` varchar(255) default NULL, -- target's host name > `port` int(11) default NULL, -- port number used to connect to target > `db` varchar(255) default NULL, -- target's database name > `userid` varchar(255) default NULL, -- username needed to log in to target > `password` varchar(255) default NULL, -- password needed to log in to target >- `name` mediumtext, -- name given to the target by the library >- `id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha >+ `servername` mediumtext NOT NULL, -- name given to the target by the library > `checked` smallint(6) default NULL, -- whether this target is checked by default (1 for yes, 0 for no) > `rank` int(11) default NULL, -- where this target appears in the list of targets > `syntax` varchar(80) default NULL, -- marc format provided by this target > `timeout` int(11) NOT NULL DEFAULT '0', -- number of seconds before Koha stops trying to access this server >- `icon` text, -- unused in Koha >- `position` enum('primary','secondary','') NOT NULL default 'primary', >- `type` enum('zed','opensearch') NOT NULL default 'zed', >+ `servertype` enum('zed','sru') NOT NULL default 'zed', -- zed means z39.50 server > `encoding` text default NULL, -- characters encoding provided by this target >- `description` text NOT NULL, -- unused in Koha >- `recordtype` varchar(45) NOT NULL default 'biblio', -- server contains bibliographic or authority records >+ `recordtype` enum('authority','biblio') NOT NULL default 'biblio', -- server contains bibliographic or authority records >+ `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM >+ `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes >+ `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results > PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index de77bf3..6a50005 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8574,6 +8574,35 @@ $DBversion = "3.17.00.010"; > if ( CheckVersion($DBversion) ) { > $dbh->do("DELETE FROM systempreferences WHERE variable='opacsmallimage'"); > print "Upgrade to $DBversion done (Bug 11347 - PROG/CCSR deprecation: Remove opacsmallimage system preference)\n"; >+ SetVersion($DBversion); >+} >+ >+ >+$DBversion = "3.17.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ # Correct invalid recordtypes (should be very exceptional) >+ $dbh->do(q{ >+ UPDATE z3950servers set recordtype='biblio' WHERE recordtype NOT IN ('authority','biblio') >+ }); >+ # Correct invalid server types (should also be very exceptional) >+ $dbh->do(q{ >+ UPDATE z3950servers set type='zed' WHERE type <> 'zed' >+ }); >+ # Adjust table >+ $dbh->do(q{ >+ ALTER TABLE z3950servers >+ DROP COLUMN icon, >+ DROP COLUMN description, >+ DROP COLUMN position, >+ MODIFY COLUMN id int NOT NULL AUTO_INCREMENT FIRST, >+ MODIFY COLUMN recordtype enum('authority','biblio') NOT NULL DEFAULT 'biblio', >+ CHANGE COLUMN name servername mediumtext NOT NULL, >+ CHANGE COLUMN type servertype enum('zed','sru') NOT NULL DEFAULT 'zed', >+ ADD COLUMN sru_options varchar(255) default NULL, >+ ADD COLUMN sru_fields mediumtext default NULL, >+ ADD COLUMN add_xslt mediumtext default NULL >+ }); >+ print "Upgrade to $DBversion done (Bug 6536: Z3950 improvements)\n"; > SetVersion ($DBversion); > } > >-- >1.7.7.6
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 6536
:
4540
|
4541
|
4959
|
6901
|
6919
|
6920
|
6924
|
13462
|
26169
|
26170
|
26171
|
26172
|
29754
|
29755
|
29756
|
29779
|
29780
|
29788
|
29790
|
29791
|
29812
|
29813
|
29814
|
29815
|
29816
|
29817
|
29818
|
29819
|
30189
|
30190
|
30191
|
30192
|
30193
|
30194
|
30900
|
30901
|
30902
|
30903
|
30904
|
30905
|
30906
|
30907
|
30929
|
30930
|
30931
|
30932
|
30933
|
30934
|
30935
|
30936
|
31046
|
31048
|
31137
|
31193
|
31194
|
31195
|
31227
|
31247
|
31248
|
37264