From: mike Date: Tue, 13 Dec 2005 17:44:59 +0000 (+0000) Subject: New X-Git-Tag: cpan_1_22~316 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=80b1e8322e0c31c1b0060b7f7c8c812cd52039c2;p=ZOOM-Perl-moved-to-github.git New --- diff --git a/archive/test-server b/archive/test-server new file mode 100644 index 0000000..dfe5e76 --- /dev/null +++ b/archive/test-server @@ -0,0 +1,128 @@ +*.mf +*..LCK +zebrasrv.pid +$Id: README,v 1.1 2005-12-14 10:03:57 mike Exp $ + +This directory contains material that is not to be included in the +ZOOM-Perl distribution, but which is useful to the project -- for +example, the test-server.* files are to do with running the server +that the ZOOM-Perl test-suite runs against. + +README -- this file +agreement.doc -- contract with LibLime/ +update-client -- notes on using update facilities in YAZ. +test-server.notes -- notes on running the test server. +test-server.init -- script to run the test server from /etc/init.d +test-server.cfg -- Zebra configuration file for the test server. +test-server.pw -- password file for test server's Zebra configuration. + +# Simple Zebra configuration file +# $Id: test-server.cfg,v 1.1 2005-12-14 10:04:57 mike Exp $ +# +# Where the schema files, attribute files, etc are located. +profilePath: .:../../tab + +# Files that describe the attribute sets supported. +attset: bib1.att +attset: gils.att +attset: explain.att + +recordtype: grs.sgml +isam: b + +# Flags for the non-authenticated user. w=write (allows ES Updates) +perm.user: r +perm.admin: rw +passwd: xs-pwfile +someCrappyNonExistentDirectiveThatWillJustBeIgnored: fruit + +#rank: zvrank +# Don't use a recordId taken from the record itself: the test-suite +# currently supplies its own recordIds. +#recordId: (bib-1,title) + +modulePath: ../../recctrl/.libs +#shadow: shadow:100M +#register: register:100M +#! /bin/sh + +# $Id: test-server.init,v 1.1 2005-12-14 10:04:57 mike Exp $ +# +# This is a startup/shutdown script for the ZOOM-Perl test-server, +# suitable for use in a SysV-style init directory such as /etc/init.d +# (on Debian systems) and /etc/rc.d/init.d (on Red Hat systems). This +# is configured to run on test.indexdata.com -- if you want to run it +# somewhere else, you'll probably need to tweak it to suit your +# system's paths. + +PATH=/bin:/usr/bin +logfile=/var/log/zoom-perl-test-server +pidfile=/var/run/zoom-perl-test-server.pid + +case "$1" in + start) + if [ -f $pidfile ]; then + echo "ZOOM-Perl test server seems to be already running" + exit 1 + fi + echo "Starting ZOOM-Perl test server" + test -f $logfile && mv $logfile $logfile.old + ( cd /home/mike/universe/src/ZOOM-Perl/archive + ../../../bin/zebrasrv -c test-server.cfg @:2118 \ + > $logfile 2>&1 < /dev/null & + echo $! > $pidfile + ) + ;; + stop) + if [ ! -f $pidfile ]; then + echo "ZOOM-Perl test server does not seem to be running" + exit 1 + fi + echo "Stopping ZOOM-Perl test server" + kill `cat $pidfile` + rm $pidfile + ;; + restart) + $0 stop && $0 start + ;; + *) + echo "Usage: $0 start|stop|restart" >&2 + ;; +esac +$Id: test-server.notes,v 1.1 2005-12-14 09:02:08 mike Exp $ + +To run the test-suite, this module needs an up-to-date Zebra server +(as of Tue Dec 13 17:41:05 GMT 2005) running on test.indexdata.com +port 8017, using isam:b and recognising a normal user "user" with +password "frog" and an administrator "admin" with password "fish". + +To provide this, I needed to build an up-to-date Zebra in a custom +universe, so as not to interfere with the Debian packages used +elsewhere on test, and to start the server with appropriate +configuration. Here's how I did it: + + ssh test + mkdir -p universe/usr/src + cd universe/usr/src + cvs -q -d ":pserver:mike@bagel.indexdata.dk:/home/cvsroot" co yaz + cvs -q -d ":pserver:mike@bagel.indexdata.dk:/home/cvsroot" co zebra + cd yaz + ./buildconf.sh + LDFLAGS=-L/home/mike/universe/usr/lib CPPFLAGS=-I/home/mike/universe/usr/include ./configure --prefix=/home/mike/universe + make + make install + cd ../zebra + ./buildconf.sh + LDFLAGS=-L/home/mike/universe/usr/lib CPPFLAGS=-I/home/mike/universe/usr/include ./configure --prefix=/home/mike/universe + make + make install + cd examples/gils + make clean + ~/universe/bin/zebrasrv -c xs-test.cfg @:8017 + +### Now I need to move the custom Zebra configuration out of the +"zebra" CVS module and into this one, and to provide an init.d script +for starting the server. + +user:frog +admin:fish diff --git a/archive/test-server/update-client b/archive/test-server/update-client deleted file mode 100644 index 2c83704..0000000 --- a/archive/test-server/update-client +++ /dev/null @@ -1,190 +0,0 @@ -From mike Wed Nov 30 17:50:48 2005 -MIME-Version: 1.0 -Envelope-to: mike@indexdata.com -Delivery-date: Wed, 30 Nov 2005 17:49:30 +0100 -Date: Wed, 30 Nov 2005 17:49:11 +0100 -From: Adam Dickmeiss -X-Accept-Language: en-us, da, en -To: Zebra Information Server -Subject: Re: [Zebralist] indexing data from yaz client -In-Reply-To: <20051117161003.M83503@reverseorder.net> -Content-Type: text/plain; charset=us-ascii; format=flowed -Reply-To: Zebra Information Server -Sender: zebralist-bounces@indexdata.dk -X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on bagel.indexdata.dk -X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 - autolearn=unavailable version=3.0.4 -X-Spam-Level: - -scuzzy wrote: -> Is there a way to initiate a re-index of the database through the yaz link? -> furthermore, is there a way to index content that is not a physical file, but -> rather something sent to zebra via the yaz client/link. -> -> I've tried a few things, but I'm not sure how to do this. - -The extended services are not enabled by default in zebra - due to the -fact that they modify the system. - -In order to allow anybody to update, use -perm.anonymous: rw -in zebra.cfg. - -Or, even better, allow only updates for a particular admin user. For -user 'admin', you could use: -perm.admin: rw -passwd: passwordfile - -And in passwordfile, specify users and passwords .. -admin:secret - -We can now start a yaz-client admin session and create a database: - -$ yaz-client localhost:9999 -u admin/secret -Authentication set to Open (admin/secret) -Connecting...OK. -Sent initrequest. -Connection accepted by v3 target. -ID : 81 -Name : Zebra Information Server/GFS/YAZ -Version: Zebra 1.4.0/1.63/2.1.9 -Options: search present delSet triggerResourceCtrl scan sort -extendedServices namedResultSets -Elapsed: 0.007046 -Z> adm-create -Admin request -Got extended services response -Status: done -Elapsed: 0.045009 - -Now Default was created.. We can now insert an XML file (esdd0006.grs -from example/gils/records) and index it: - -Z> update insert 1 esdd0006.grs -Got extended services response -Status: done -Elapsed: 0.438016 - -The 3rd parameter.. 1 here .. is the opaque record id from Ext update. -It a record ID that _we_ assign to the record in question. If we do not -assign one the usual rules for match apply (recordId: from zebra.cfg). - -Actually, we should have a way to specify "no opaque record id" for -yaz-client's update command.. We'll fix that. - -Elapsed: 0.438016 -Z> f utah -Sent searchRequest. -Received SearchResponse. -Search was a success. -Number of hits: 1, setno 1 -SearchResult-1: term=utah cnt=1 -records returned: 0 -Elapsed: 0.014179 - -Let's delete the beast: - -Z> update delete 1 -No last record (update ignored) -Z> update delete 1 esdd0006.grs -Got extended services response -Status: done -Elapsed: 0.072441 -Z> f utah -Sent searchRequest. -Received SearchResponse. -Search was a success. -Number of hits: 0, setno 2 -SearchResult-1: term=utah cnt=0 -records returned: 0 -Elapsed: 0.013610 - -If shadow register is enabled you must run the adm-commit command in -order write your changes.. - -/ Adam - -> -> Any help would be appreciated. -> -> Daine Mamacos -> -- -> random signature -> -> -> -> _______________________________________________ -> Zebralist mailing list -> Zebralist@indexdata.dk -> http://www.indexdata.dk/mailman/listinfo/zebralist -> - - - -_______________________________________________ -Zebralist mailing list -Zebralist@indexdata.dk -http://www.indexdata.dk/mailman/listinfo/zebralist - -From mike Tue Nov 29 11:38:15 2005 -MIME-Version: 1.0 -Envelope-to: mike@miketaylor.org.uk -Delivery-date: Tue, 29 Nov 2005 11:36:14 +0100 -Date: Tue, 29 Nov 2005 11:36:14 +0100 -From: Adam Dickmeiss -X-Accept-Language: en-us, da, en -To: Mike Taylor -Subject: Re: zoomtest9.c -In-Reply-To: <200511241610.jAOGAuSh015366@localhost.localnet> -Content-Type: text/plain; charset=us-ascii; format=flowed -X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on bagel.indexdata.dk -X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham - version=3.0.4 -X-Spam-Level: - -Mike Taylor wrote: -> Hi, Adam, thanks for making this very helpful example code. A few -> followup quesations. -> -> 1. What's the difference between "replace" and "update"? - -For replace, and error is returned if the record does not already exist. -For (special)update it will be inserted or updated/replaced.. - -> 2. What format should the records be in? If I have a choice (e.g. XML -> or MARC) how do I specify which I am using? - -Currently it's XML only. We could have a way to inject other formats.. -Ideally what Zebra would like is a filter name reather than a record -syntax.. In actual fact updating _is_ a weird thing.. if you inject a -record that's already being mangled by presentation... For example, -consider a case where a ISO2709/MARC is inserted by zebraidx update... -Later a client retireves the same record but now it's in DublinCore.. -What happens if it gets updated? I guess it's just a DDTH. - -> 3. Are there options that should be checked after calling send() -Don't think so. -> 4. Do we have a running server that I can test this against? Or does -> any Zebra installation support it, so I can run my own? -You should be able to run it against any Zebra server but you need to -allow-updated in the config. (It would be too much of a security risk if -anybody could update). Add something like this: - -# Flags for the non-authenticated user. w=write (allows ES Updates) -perm.anonymous: rw - -> 5. What steps are taken to authenticate the request? -> -> ... this is complicated stuff, isn't it? :-) -And undocumented stuff. - -/ Adam - -> _/|_ ___________________________________________________________________ -> /o ) \/ Mike Taylor http://www.miketaylor.org.uk -> )_v__/\ "I have no idea what a `strong' or a `weak' verb is, and I truly -> hope I never find out what a `turbo verb' is, but I usually have -> a pretty good idea what the *right* verb is" -- Jane MacDonald. -> -> -