Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/irspy
authorMike Taylor <mike@miketaylor.org.uk>
Thu, 6 May 2010 09:56:31 +0000 (10:56 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Thu, 6 May 2010 09:56:31 +0000 (10:56 +0100)
125 files changed:
Changes
MANIFEST
Makefile.PL
README
archive/Notes
archive/architecture-notes
archive/separate-apache
bin/.gdbinit
bin/.perldb
bin/irspy-rewrite-records.pl [changed mode: 0644->0755]
bin/irspy-update.sh
lib/ZOOM/IRSpy.pm
lib/ZOOM/IRSpy/Connection.pm
lib/ZOOM/IRSpy/Maintenance.pod
lib/ZOOM/IRSpy/Node.pm
lib/ZOOM/IRSpy/Record.pm
lib/ZOOM/IRSpy/Stats.pm
lib/ZOOM/IRSpy/Task.pm
lib/ZOOM/IRSpy/Task/Connect.pm
lib/ZOOM/IRSpy/Task/Retrieve.pm
lib/ZOOM/IRSpy/Task/Search.pm
lib/ZOOM/IRSpy/Test.pm
lib/ZOOM/IRSpy/Test/Main.pm
lib/ZOOM/IRSpy/Test/Ping.pm
lib/ZOOM/IRSpy/Test/Quick.pm
lib/ZOOM/IRSpy/Test/Record/Fetch.pm
lib/ZOOM/IRSpy/Test/Record/Main.pm
lib/ZOOM/IRSpy/Test/ResultSet/Main.pm
lib/ZOOM/IRSpy/Test/ResultSet/Named.pm
lib/ZOOM/IRSpy/Test/Search/Bib1.pm
lib/ZOOM/IRSpy/Test/Search/Boolean.pm
lib/ZOOM/IRSpy/Test/Search/CQL.pm
lib/ZOOM/IRSpy/Test/Search/DBDate.pm
lib/ZOOM/IRSpy/Test/Search/Dan1.pm
lib/ZOOM/IRSpy/Test/Search/Explain.pm
lib/ZOOM/IRSpy/Test/Search/Main.pm
lib/ZOOM/IRSpy/Test/Search/Title.pm
lib/ZOOM/IRSpy/Utils.pm
lib/ZOOM/IRSpy/Web.pm
lib/ZOOM/IRSpy/WebService.pod
lib/ZOOM/IRSpy/x.pl
lib/ZOOM/Pod.pm
lib/ZOOM/XML/Simple.pm
web/conf/apache2.0/irspy-test.conf
web/conf/apache2.0/irspy.conf
web/htdocs/add.html [deleted file]
web/htdocs/add_target.html [new file with mode: 0644]
web/htdocs/admin/all.html
web/htdocs/admin/check.html
web/htdocs/admin/delete.html
web/htdocs/admin/edit.html
web/htdocs/ap.html
web/htdocs/chrome/layout.mc
web/htdocs/details/ap.mc
web/htdocs/details/check.mc
web/htdocs/details/country-list.mc
web/htdocs/details/delete.mc
web/htdocs/details/doc.mc
web/htdocs/details/edit.mc
web/htdocs/details/error.mc
web/htdocs/details/find.mc
web/htdocs/details/found.mc
web/htdocs/details/full.mc
web/htdocs/details/home.mc
web/htdocs/details/libtype-list.mc
web/htdocs/details/software.mc
web/htdocs/details/stats.mc
web/htdocs/details/upload.mc
web/htdocs/doc.html
web/htdocs/find.html
web/htdocs/full.html
web/htdocs/help.html
web/htdocs/help/edit.html
web/htdocs/help/edit/author.html
web/htdocs/help/edit/contact.html
web/htdocs/help/edit/country.html
web/htdocs/help/edit/dbname.html
web/htdocs/help/edit/description.html
web/htdocs/help/edit/disabled.html [new file with mode: 0644]
web/htdocs/help/edit/extent.html
web/htdocs/help/edit/history.html
web/htdocs/help/edit/host.html
web/htdocs/help/edit/hosturl.html
web/htdocs/help/edit/language.html
web/htdocs/help/edit/password.html
web/htdocs/help/edit/port.html
web/htdocs/help/edit/protocol.html
web/htdocs/help/edit/restrictions.html
web/htdocs/help/edit/subjects.html
web/htdocs/help/edit/title.html
web/htdocs/help/edit/type.html
web/htdocs/help/edit/username.html
web/htdocs/help/info.html
web/htdocs/help/info/reliability.html
web/htdocs/help/link.mc
web/htdocs/index.html
web/htdocs/offtopic/sru-auth.html
web/htdocs/raw.html
web/htdocs/robots-test.txt [new file with mode: 0644]
web/htdocs/robots.txt
web/htdocs/software.html
web/htdocs/stats.html
web/htdocs/style.css
web/htdocs/upload.html
web/images/Makefile
xsl/irspy2zeerex.xsl
xsl/use-attr-names.xml
zebra/Makefile
zebra/README
zebra/crontab
zebra/dom-filter/zebra.cfg
zebra/ezeerex2pqfproperties.pl
zebra/filterconf.xml
zebra/form.html
zebra/pqf.properties
zebra/profile
zebra/yazserver-test.xml
zebra/yazserver.xml
zebra/zeerex-test.xml
zebra/zeerex.xml
zebra/zeerex2dc.xsl
zebra/zeerex2id.xsl
zebra/zeerex2index.xsl
zebra/zeerex2noauth.xsl
zebra/zeerex2zeerex.xsl

diff --git a/Changes b/Changes
index c302cd2..e67dfed 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,4 +1,3 @@
-$Id: Changes,v 1.23 2007-09-18 16:58:01 mike Exp $
 
 Revision history for Perl extension ZOOM::IRSpy.
 
index 4074cb1..807760f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -7,7 +7,7 @@ README
 bin/Makefile
 bin/irspy-stats.pl
 bin/irspy.pl
-bin/irspy_xsltproc.pl
+bin/irspy-xsltproc.pl
 bin/reindex.pl
 bin/setrlimit.c
 lib/ZOOM/IRSpy.pm
@@ -46,7 +46,7 @@ web/htdocs/admin/check.html
 web/htdocs/admin/delete.html
 web/htdocs/admin/edit.html
 web/htdocs/admin/index.html
-web/htdocs/admin/upload.html
+web/htdocs/upload.html
 web/htdocs/ap.html
 web/htdocs/beach.jpeg
 web/htdocs/chrome/layout.mc
index 0566a8c..0568172 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Makefile.PL,v 1.14 2007-05-09 12:04:36 mike Exp $
 
 use 5.008;
 use strict;
diff --git a/README b/README
index e19d4c1..8020b8d 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,3 @@
-
 ZOOM::IRSpy
 ===========
 
@@ -32,11 +31,12 @@ sudo apt-get install \
 you may need one of the following packages for development:
 
 sudo apt-get install \
-       make perl-doc libxml2-utils tidy
+       make perl-doc libxml2-utils tidy yaz libyaz4-dev 
 
-and may enable mod_apreq
+and may enable mod_apreq: sudo a2enmod apreq
 
-sudo a2enmod apreq
+Note: mod_perl works only safe without threads. Please use the non-threaded 
+debian package: sudo apt-get install apache2-mpm-prefork
 
 
 To install this module type the following:
index d0fdc1f..d2a5311 100644 (file)
@@ -1,4 +1,3 @@
-$Id: Notes,v 1.1 2006-05-31 12:04:19 mike Exp $
 
 Some things that it would be nice to check (varying priorities!)
 
index 4764775..6f6395a 100644 (file)
@@ -1,4 +1,3 @@
-$Id: architecture-notes,v 1.1 2007-02-20 12:10:02 mike Exp $
 
 The basic approach is this: The IRSpy::Connection is an IRSpy-specific
 subclass of ZOOM::Connection, and its only important extra
index 14c9611..fef03c9 100644 (file)
@@ -1,4 +1,3 @@
-$Id: separate-apache,v 1.1 2007-03-22 12:25:36 mike Exp $
 
 /etc/apache-irspy -- Apache configuration
 /var/log/apache-irspy -- Apache logs
index 2a49aa4..00091b8 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: .gdbinit,v 1.7 2007-03-15 11:34:51 mike Exp $
 set env YAZ_LOG=irspy,irspy_test,irspy_task,zoom,zoom_details,irspy_event
 set args -I../lib irspy.pl -t Quick -f 'net.host=*indexdata*' localhost:8018/IR-Explain---1
 set args -I../lib irspy.pl -n 2 -t Quick localhost:8018/IR-Explain---1 z3950.loc.gov:7090/Voyager bagel.indexdata.dk/gils bagel.indexdata.dk:210/marc
index 5d3ba06..cf40584 100644 (file)
@@ -1,2 +1 @@
-# $Id: .perldb,v 1.1 2007-02-09 10:48:37 mike Exp $
 print "=== loading .perldb ===\n"
old mode 100644 (file)
new mode 100755 (executable)
index f994de6..fc3de55
@@ -1,22 +1,64 @@
 #!/usr/bin/perl
-
+#
 # perl -I ../lib irspy-rewrite-records.pl localhost:8018/IR-Explain---1
 
+use lib '../lib';
+use Data::Dumper;
+use Getopt::Long;
+use ZOOM::IRSpy;
+use ZOOM::IRSpy::Utils qw(render_record validate_record);
+
 use strict;
 use warnings;
-use ZOOM::IRSpy;
-use ZOOM::IRSpy::Utils qw(render_record);
 
-my($dbname) = @ARGV;
-die "$0 no database name specified" if !defined $dbname;
-my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
-my $rs = $spy->{conn}->search(new ZOOM::Query::CQL("cql.allRecords=1"));
-print STDERR "rewriting ", $rs->size(), " target records";
+my $irspy_to_zeerex_xsl = '../xsl/irspy2zeerex.xsl';
+my $debug               = 1;
+my $cql_query           = "cql.allRecords=1";
 
-foreach my $i (1 .. $rs->size()) {
-    my $xml = render_record($rs, $i-1, "zeerex");
+sub usage {
+    my $message = shift;
+
+    warn "$message\n" if defined $message;
+
+    <<EOF
+usage $0 [ options ] database
+
+--xslt=$irspy_to_zeerex_xsl    set xslt sheet
+--debug=0..2                   verbose level
+--query=$cql_query
+EOF
+}
+
+GetOptions(
+    "xslt"    => \$irspy_to_zeerex_xsl,
+    "debug=i" => \$debug,
+    "query=s" => \$cql_query,
+);
+
+my $dbname = shift;
+die usage("no database name specified\n") if !defined $dbname;
+
+$ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
+  if $irspy_to_zeerex_xsl;
+
+my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
+my $rs = $spy->{conn}->search( new ZOOM::Query::CQL($cql_query) );
+print STDERR "rewriting ", $rs->size(), " target records\n" if $debug;
+
+foreach my $i ( 1 .. $rs->size() ) {
+    my $xml = render_record( $rs, $i - 1, "zeerex" );
     my $rec = $spy->{libxml}->parse_string($xml)->documentElement();
-    ZOOM::IRSpy::_rewrite_zeerex_record($spy->{conn}, $rec);
-    print STDERR ".";
+
+    if ( $debug >= 2 ) {
+        my ( $ok, $errors ) = validate_record($rec);
+        if ( !$ok ) {
+            my @e  = @$errors;
+            my $id = shift @e;
+            print "Id: $id => ", join( " / ", @e ), "\n";
+        }
+    }
+    ZOOM::IRSpy::_rewrite_zeerex_record( $spy->{conn}, $rec );
+    print STDERR "." if $debug == 1;
 }
-print STDERR "\nDone\n";
+print STDERR "Done\n" if $debug;
+
index 90d5259..5113d50 100755 (executable)
@@ -8,11 +8,27 @@
 home=/usr/local/src/git
 cd $home/irspy/bin || exit 2
 logdir=../tmp
+lockfile=../tmp/irspy-update.lock
+: ${irspy_test=Main}
 
+if [ -f $lockfile ]; then
+    pid=`cat $lockfile`
+    if kill -0 $pid 2>/dev/null; then
+       echo "This script is already running with pid: $pid"
+       exit 1
+    fi
+fi
+echo $$ > $lockfile || exit 2
+
+weekday=`date '+%w'`
 for i in 0 1 2 3 4 5 6
 do
-   logfile=$logdir/irspy-mod-$i.log.`date '+%w'`
-   YAZ_LOG=irspy,irspy_test nice -10 time perl -I../lib irspy.pl -n 50 -d -M 3500 -a -t Main -m 7,$i localhost:8018/IR-Explain---1 > $logfile 2>&1
+   logfile=$logdir/irspy-mod-$i.log.$weekday
+   YAZ_LOG=irspy,irspy_test,irspy_task nice -10 time perl -I../lib irspy.pl -n 50 -d -M 3500 -f'cql.allRecords=1 not zeerex.disabled = 1' -t $irspy_test -m 7,$i localhost:8018/IR-Explain---1 > $logfile 2>&1
+
+   sleep 1 # catch ctr-c before compressing the log
    gzip -f $logfile
 done
 
+rm -f $lockfile
+
index 81fa911..4e2040c 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: IRSpy.pm,v 1.90 2008-07-16 11:42:13 mike Exp $
 
 package ZOOM::IRSpy;
 
@@ -26,6 +25,7 @@ our $VERSION = '1.02';
 our $irspy_to_zeerex_xsl = dirname(__FILE__) . '/../../xsl/irspy2zeerex.xsl';
 our $debug = 0;
 our $xslt_max_depth = 250;
+our $max_timeout_errors = 3;
 
 
 # Enumeration for callback functions to return
@@ -443,10 +443,12 @@ sub check {
     while (1) {
        my @copy_conn = @conn;  # avoid alias problems after splice()
        my $nconn = scalar(@copy_conn);
+
        foreach my $i0 (0 .. $#copy_conn) {
            my $conn = $copy_conn[$i0];
            #print "connection $i0 of $nconn/", scalar(@conn), " is $conn\n";
            next if !defined $conn;
+
            if (!$conn->current_task()) {
                if (!$conn->next_task()) {
                    # Out of tasks: we need a new test
@@ -460,6 +462,12 @@ sub check {
                                   "checking for next test after '$address'");
                        $nextaddr = $this->_next_test($address);
                    }
+
+                    if (ZOOM::IRSpy::Test::zoom_error_timeout_check($conn)) {
+                       $conn->log("irspy", "Got to many timeouts, stop testing");
+                       undef $nextaddr;
+                    }
+
                    if (!defined $nextaddr) {
                        $conn->log("irspy", "has no more tests: removing");
                        $this->_rewrite_irspy_record($conn);
@@ -501,6 +509,13 @@ sub check {
 
                my $task = $conn->next_task();
                die "no next task queued for $conn" if !defined $task;
+
+               # do not run the next task if we got too many timeouts
+                if (ZOOM::IRSpy::Test::zoom_error_timeout_check($conn)) {
+                    $conn->log("irspy_task", "Got to many timeouts for this target, do not start a new task");
+                    next;
+                }
+
                $conn->log("irspy_task", "preparing task $task");
                $conn->next_task(0);
                $conn->current_task($task);
index 469968e..6157f98 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Connection.pm,v 1.21 2007-12-20 12:35:01 mike Exp $
 
 package ZOOM::IRSpy::Connection;
 
index 4c8e310..ef08f45 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Maintenance.pod,v 1.4 2006-09-18 10:27:57 mike Exp $
 
 package ZOOM::IRSpy::Maintenance;
 
index 9d2f5c7..7e0b9b1 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Node.pm,v 1.6 2007-02-28 17:34:54 mike Exp $
 
 package ZOOM::IRSpy::Node;
 
index e80fe12..c5b6c1b 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Record.pm,v 1.28 2007-12-12 08:49:58 mike Exp $
 
 package ZOOM::IRSpy::Record;
 ### I don't think there's any reason for this to be separate from
@@ -42,6 +41,7 @@ sub new {
        target => $target,
        parser => $parser,
        zeerex => $parser->parse_string($zeerex)->documentElement(),
+       zoom_error => { TIMEOUT => 0 },
     }, $class;
 
     #Scalar::Util::weaken($this->{irspy});
@@ -50,6 +50,7 @@ sub new {
     return $this;
 }
 
+sub zoom_error { return shift->{'zoom_error'} }
 
 sub _empty_zeerex_record {
     my($target) = @_;
index f701740..6a59c6b 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Stats.pm,v 1.7 2007-10-31 16:42:13 mike Exp $
 
 package ZOOM::IRSpy::Stats;
 
@@ -114,7 +113,7 @@ sub _gather_stats {
 
        # Record syntax support by database
        foreach my $node ($xc->findnodes('e:recordInfo/e:recordSyntax/@name')) {
-           $this->{recordSyntaxes}->{$node->findvalue(".")}++;
+           $this->{recordSyntaxes}->{lc($node->findvalue("."))}++;
        }
 
        # Explain support
@@ -136,7 +135,7 @@ sub _gather_stats {
        # Top Domains
        my $host = $xc->findvalue('e:serverInfo/e:host');
        $host =~ s/.*\.//;
-       $this->{domains}->{$host}++;
+       $this->{domains}->{lc($host)}++;
 
        # Implementation
        foreach my $node ($xc->findnodes('i:status/i:serverImplementationName/@value')) {
index 4340198..a115649 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Task.pm,v 1.7 2007-08-01 15:11:03 mike Exp $
 
 package ZOOM::IRSpy::Task;
 
index 5080a7a..117f062 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Connect.pm,v 1.6 2006-11-02 16:11:44 mike Exp $
 
 # See ZOOM/IRSpy/Task/Search.pm for documentation
 
index 4d7a8c5..1580e94 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Retrieve.pm,v 1.6 2007-05-09 11:05:30 mike Exp $
 
 package ZOOM::IRSpy::Task::Retrieve;
 
index 68397c0..8437586 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Search.pm,v 1.16 2007-12-18 11:59:42 mike Exp $
 
 package ZOOM::IRSpy::Task::Search;
 
index 765cd4f..0bf89bd 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Test.pm,v 1.8 2007-04-18 15:24:45 mike Exp $
 
 package ZOOM::IRSpy::Test;
 
@@ -8,6 +7,9 @@ use warnings;
 
 use Scalar::Util;
 
+use Exporter 'import';
+our @EXPORT = qw(zoom_error_timeout_update zoom_error_timeout_check); 
+
 =head1 NAME
 
 ZOOM::IRSpy::Test - base class for tests in IRSpy
@@ -22,6 +24,7 @@ I<## To follow>
 
 =cut
 
+
 sub subtests { () }
 
 sub timeout { undef }
@@ -34,6 +37,29 @@ sub start {
 }
 
 
+our $max_timeout_errors = $ZOOM::IRSpy::max_timeout_errors;
+
+sub zoom_error_timeout_update {
+    my ($conn, $exception) = @_;
+
+    if ($exception =~ /Timeout/i) {
+        $conn->record->zoom_error->{TIMEOUT}++;
+        $conn->log("irspy_test", "Increase timeout error counter to: " .
+                $conn->record->zoom_error->{TIMEOUT});
+    }
+}
+
+sub zoom_error_timeout_check {
+    my $conn = shift;
+
+    if ($conn->record->zoom_error->{TIMEOUT} >= $max_timeout_errors) {
+        $conn->log("irspy_test", "Got $max_timeout_errors or more timeouts, give up...");
+        return  1;
+    }
+
+    return 0;
+}
+
 =head1 SEE ALSO
 
 ZOOM::IRSpy
index 6814217..428afd3 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Main.pm,v 1.14 2007-04-18 15:24:55 mike Exp $
 
 package ZOOM::IRSpy::Test::Main;
 
index bc915db..31b7f4d 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Ping.pm,v 1.28 2008-07-16 11:51:09 mike Exp $
 
 # See the "Main" test package for documentation
 
index 8a2f54b..c184ccd 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Quick.pm,v 1.4 2007-04-18 15:25:07 mike Exp $
 
 package ZOOM::IRSpy::Test::Quick;
 
index ccaaa9f..4d42200 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Fetch.pm,v 1.31 2009-04-21 13:42:58 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -11,6 +10,7 @@ use warnings;
 use ZOOM::IRSpy::Test;
 our @ISA = qw(ZOOM::IRSpy::Test);
 
+our $max_timeout_errors = $ZOOM::IRSpy::max_timeout_errors;
 
 # These queries 
 my @queries = (
@@ -42,12 +42,22 @@ sub completed_search {
     $conn->log("irspy_test", "Fetch test search (", $task->render_query(), ") ",
               ref $event && $event->isa("ZOOM::Exception") ?
               "failed: $event" : "found $n records (event=$event)");
+
+    # remember how often a target record hit a timeout
+    if (ref $event && $event->isa("ZOOM::Exception")) {
+       if ($event =~ /Timeout/i) {
+           $conn->record->zoom_error->{TIMEOUT}++;
+            $conn->log("irspy_test", "Increase timeout error counter to: " . 
+               $conn->record->zoom_error->{TIMEOUT});
+        }
+    }
+
     if ($n == 0) {
        $task->{rs}->destroy();
        my $qindex = $udata->{queryindex}+1;
        my $q = $queries[$qindex];
        return ZOOM::IRSpy::Status::TEST_SKIPPED
-           if !defined $q;
+           if !defined $q || $conn->record->zoom_error->{TIMEOUT} >= $max_timeout_errors;
 
        $conn->log("irspy_test", "Trying another search ...");
        $conn->irspy_search_pqf($queries[$qindex], { queryindex => $qindex }, {},
@@ -66,7 +76,7 @@ sub completed_search {
                    'librismarc',
                    'mab',
                    'normarc',
-#                   'opac',
+                   'opac',
                    'picamarc',
                    'rusmarc',
                    'summary',
index 67bd259..0dc78c7 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Main.pm,v 1.1 2006-10-23 13:54:52 sondberg Exp $
 
 package ZOOM::IRSpy::Test::Record::Main;
 
index 7b3e3ab..c562246 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Main.pm,v 1.1 2006-11-02 11:46:40 sondberg Exp $
 
 package ZOOM::IRSpy::Test::ResultSet::Main;
 
index eb3a342..9acc097 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Named.pm,v 1.6 2007-08-01 15:11:20 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -104,6 +103,7 @@ sub error {
     my($conn, $task, $test_args, $exception) = @_;
 
     $conn->log("irspy_test", "Named resultset check failed:", $exception);
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TASK_DONE;
 }
 
index 7dc644e..fd4d1d6 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Bib1.pm,v 1.18 2007-03-15 11:40:27 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -52,6 +51,7 @@ sub error {
     $conn->log("irspy_test", "search on access-point $attr had error: ",
               $exception);
     update($conn, $attr, 0);
+    zoom_error_timeout_update($conn, $exception);
 
     return ZOOM::IRSpy::Status::TEST_BAD
        if ($exception->code() == 1 || # permanent system error
@@ -69,5 +69,4 @@ sub update {
                                             'ok'        => $ok);
 }
 
-
 1;
index 8d3e5bb..ea8233a 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Boolean.pm,v 1.5 2007-03-15 11:40:39 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -53,6 +52,7 @@ sub error {
     $conn->log("irspy_test", "search using boolean operator ", $operator,
                              " had error: ", $exception);
     update($conn, $operator, 0);
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TASK_DONE;
 }
 
index 5a5385c..5c21281 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: CQL.pm,v 1.1 2007-05-01 15:32:16 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -53,6 +52,7 @@ sub error {
     $task->{rs}->destroy();
     $conn->log("irspy_test", "CQL search on '$index' had error: $exception");
     $conn->record()->store_result("search_cql", index => $index, ok => 0);
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TEST_BAD
        if $exception->code() == 11; # Unsupported query type
 
index 5359477..b349f1b 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: DBDate.pm,v 1.4 2007-02-23 15:03:44 mike Exp $
 
 # This plugin tests searching on BIB-1 access-point 1011 (Date/time
 # added to db), the significance of which is that this search
@@ -51,6 +50,7 @@ sub error {
     my $rec = $conn->record();
     $rec->append_entry("irspy:status", "<irspy:search_dbdate ok='0'>" .
                       isodate(time()) . "</irspy:search_dbdate>");
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TEST_BAD;
 }
 
index 51b6607..415c5aa 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Dan1.pm,v 1.7 2007-03-15 11:40:52 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -49,6 +48,7 @@ sub error {
     $conn->log("irspy_test", "search on access-point $attr had error: ",
               $exception);
     update($conn, $attr, 0);
+    zoom_error_timeout_update($conn, $exception);
 
     ### How about TEST_BAD if $exception->code() == 121?
     return ZOOM::IRSpy::Status::TASK_DONE;
index 28a18da..087b846 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Explain.pm,v 1.7 2007-03-15 11:41:24 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -54,6 +53,7 @@ sub error {
     $task->{rs}->destroy();
     $conn->log("irspy_test", "Explain category lookup failed: ", $exception);
     update($conn, $category, 0);
+    zoom_error_timeout_update($conn, $exception);
 
     return ZOOM::IRSpy::Status::TEST_BAD
        if ($exception->code() == 109 || # Database unavailable
index f657a9d..9e928ce 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Main.pm,v 1.8 2007-05-01 15:30:38 mike Exp $
 
 package ZOOM::IRSpy::Test::Search::Main;
 
index 86f5aec..16d3a06 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Title.pm,v 1.10 2007-02-23 15:03:44 mike Exp $
 
 # See the "Main" test package for documentation
 
@@ -45,6 +44,7 @@ sub error {
     my $rec = $conn->record();
     $rec->append_entry("irspy:status", "<irspy:search_title ok='0'>" .
                       isodate(time()) . "</irspy:search_title>");
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TEST_BAD;
 }
 
index dfe4e99..4fd7677 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Utils.pm,v 1.38 2009-04-15 18:16:45 wosch Exp $
 
 package ZOOM::IRSpy::Utils;
 
@@ -10,6 +9,8 @@ use Scalar::Util;
 
 use Exporter 'import';
 our @EXPORT_OK = qw(utf8param
+                   trimField
+                   utf8paramTrim
                    isodate
                    xml_encode 
                    cql_quote
@@ -21,6 +22,7 @@ our @EXPORT_OK = qw(utf8param
                    modify_xml_document
                    bib1_access_point
                    render_record
+                   validate_record
                    calc_reliability_string
                    calc_reliability_stats);
 
@@ -83,7 +85,6 @@ sub utf8param {
     return $cooked;
 }
 
-
 # Utility functions follow, exported for use of web UI
 sub utf8param_apache1 {
     my($r, $key, $value) = @_;
@@ -105,6 +106,26 @@ sub isodate {
                   $year+1900, $mon+1, $mday, $hour, $min, $sec);
 }
 
+# strips whitespaces at start and ends of a field
+sub trimField {
+    my $field  = shift;
+
+    $field =~ s/^\s+//;
+    $field =~ s/\s+$//;
+
+    return $field;
+}
+
+# utf8param() with trim
+sub utf8paramTrim {
+    my $result = utf8param(@_);
+
+    if (defined $result) {
+       $result = trimField($result);   
+    }
+
+    return $result;
+}
 
 # I can't -- just can't, can't, can't -- believe that this function
 # isn't provided by one of the core XML modules.  But the evidence all
@@ -332,7 +353,7 @@ sub modify_xml_document {
            }
 
        } else {
-           next if !$value; # No need to create a new empty node
+           next if !defined $value; # No need to create a new empty node
            my($ppath, $selector) = $xpath =~ /(.*)\/(.*)/;
            dom_add_node($xc, $ppath, $selector, $value, @addAfter);
            #print "New $key ($xpath) = '$value'<br/>\n";
@@ -796,9 +817,59 @@ sub calc_reliability_stats {
     return (0, 0, 0) if $nall == 0;
     my @okpings = $xc->findnodes('i:status/i:probe[@ok = "1"]');
     my $nok = @okpings;
-    my $percent = int(100*$nok/$nall);
+    my $percent = int(100*$nok/$nall + 0.5);
     return ($nok, $nall, $percent);
 }
 
+#
+# validate_record( record, ( "port" => 1, "database" => 1, "country" => 0, ... ))
+#
+sub validate_record {
+    my $rec = shift;
+    my %args = @_;
+
+    my %required = map { $_ => 1 } qw/port host database protocol/;
+    my %optional = map { $_ => 1 } qw/country type hosturl contact language/;
+    my %tests = ( %required, %args );
+
+    my $xc = irspy_xpath_context($rec);
+
+    my $protocol = $xc->findnodes("e:serverInfo/\@protocol") || "";
+    my $port = $xc->findnodes("e:serverInfo/e:port") || "";
+    my $host = $xc->findnodes("e:serverInfo/e:host") || "";
+    my $dbname = $xc->findnodes("e:serverInfo/e:database") || "";
+
+    my $id = irspy_make_identifier($protocol, $host, $port, $dbname);
+
+    if ($protocol =~ /\s+$/ || $dbname =~ /\s+$/) {
+       warn "xxx: $protocol:$host:$port:$dbname: whitespaces\n";
+    } 
+
+    my @errors = $id;
+
+    if ($tests{'protocol'}) {
+       push(@errors, 'protocol number is not valid') if $protocol !~ /^(z39\.50|sru|srw|tcp)$/i;
+    }
+
+    if ($tests{'port'}) {
+       push(@errors, 'port number is not valid') if $port !~ /^\d+$/;
+    }
+
+    if ($tests{'host'}) {
+       push(@errors, 'host name is not valid') if $host !~ /^[0-9a-z]+[0-9a-z\.\-]*\.[0-9a-z]+$/i;
+    }
+
+    if ($tests{'database'}) {
+       push(@errors, 'database name is not valid') if $dbname =~ m,/,i;
+       push(@errors, 'database has trailing spaces') if $dbname =~ /^\s+|\s+$/;
+    }
+
+    if ($tests{'hosturl'}) {
+        my $hosturl = $xc->findnodes("i:status/i:hostURL") || "";
+       push(@errors, 'This hosturl name is not valid') if $hosturl !~ /^\w+$/i;
+    }
+
+    return ( !$#errors, \@errors );
+}
 
 1;
index 7f7dd9d..f99ae67 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Web.pm,v 1.5 2007-05-08 16:20:04 mike Exp $
 
 package ZOOM::IRSpy::Web;
 
index a30bfa6..a30d52a 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: WebService.pod,v 1.5 2007-01-24 09:28:02 mike Exp $
 
 package ZOOM::IRSpy::WebService;
 
index 20b2d97..c2d0a21 100644 (file)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl -w
 
-# $Id: x.pl,v 1.1 2007-02-28 16:52:34 mike Exp $
 
 ### This should be massaged into a test-suite script in ../../../t
 
index 5faee4d..15644ed 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Pod.pm,v 1.22 2006-10-06 11:33:07 mike Exp $
 
 package ZOOM::Pod;
 
index e666ba0..8c8a62e 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Simple.pm,v 1.2 2006-07-21 11:29:17 mike Exp $
 
 package ZOOM::XML::Simple;
 
index bc53345..c091986 100644 (file)
@@ -16,6 +16,9 @@
     ErrorLog     /var/log/apache2/irspy-test-error.log
     CustomLog    /var/log/apache2/irspy-test-access.log combined
     DocumentRoot /usr/local/src/git/irspy-test/web/htdocs
+
+    Alias /robots.txt /usr/local/src/git/irspy-test/web/htdocs/robots-test.txt
+
     <FilesMatch "\.(html|css)$">
      SetHandler perl-script
      PerlHandler HTML::Mason::ApacheHandler
index 5b0a6e3..53720a3 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: cfspy.conf,v 1.4 2009-04-16 18:31:20 wosch Exp $
-#
 # Sample configuration for running an IRSpy web-site under Apache 2.x.
 #
 # This is the configuration that I use on the development machine 
diff --git a/web/htdocs/add.html b/web/htdocs/add.html
deleted file mode 100644 (file)
index 1ff60a9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-%# $Id: add.html,v 1.3 2007-07-16 11:55:31 mike Exp $
-<& /chrome/layout.mc, %ARGS,
-    title => "Add target record",
-    component => "/details/edit.mc", op => "new" &>
diff --git a/web/htdocs/add_target.html b/web/htdocs/add_target.html
new file mode 100644 (file)
index 0000000..9df79ee
--- /dev/null
@@ -0,0 +1,3 @@
+<& /chrome/layout.mc, %ARGS,
+    title => "Add target record",
+    component => "/details/edit.mc", op => "new" &>
index 2fd1516..c7881b0 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: all.html,v 1.1 2007-02-20 19:17:14 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "Test all targets",
     component => "/details/check.mc", id => "" &>
index 8925856..81354e8 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: check.html,v 1.1 2007-02-20 19:17:14 mike Exp $
 <%args>
 @id
 $test => undef
index 8206bf0..51182d8 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: delete.html,v 1.1 2007-02-20 19:17:14 mike Exp $
 <%args>
 $id => undef
 </%args>
index 70915a4..bf4d758 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: edit.html,v 1.1 2007-02-20 19:17:14 mike Exp $
 <%args>
 $op
 $id => undef
index 05401aa..435ced8 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: ap.html,v 1.1 2007-06-28 12:19:28 mike Exp $
 <%args>
 $set
 </%args>
index d7dc956..4de8b67 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: layout.mc,v 1.38 2007-07-17 13:07:57 mike Exp $
 <%args>
 $debug => undef
 $title
@@ -8,7 +7,7 @@ $component
 use URI::Escape qw(uri_escape uri_escape_utf8);
 use ZOOM;
 use ZOOM::IRSpy::Web;
-use ZOOM::IRSpy::Utils qw(utf8param isodate xml_encode cql_target cql_quote
+use ZOOM::IRSpy::Utils qw(utf8param trimField utf8paramTrim isodate xml_encode cql_target cql_quote
                           irspy_xpath_context irspy_make_identifier
                          irspy_record2identifier
                          irspy_identifier2target modify_xml_document
@@ -64,9 +63,9 @@ use ZOOM::IRSpy::Utils qw(utf8param isodate xml_encode cql_target cql_quote
     <td valign="top" class="panel1">
      <p>
       <a href="/"><b>Home</b></a><br/>
-      <a href="/admin/all.html">Test&nbsp;all&nbsp;targets</a><br/>
+      <!-- <a href="/admin/all.html">Test&nbsp;all&nbsp;targets</a><br/> -->
       <a href="/find.html">Find a target</a><br/>
-      <a href="/add.html">Add a target</a><br/>
+      <a href="/add_target.html">Add a target</a><br/>
       <a href="/upload.html">Upload a target</a><br/>
       <a href="/stats.html">Statistics</a><br/>
      </p>
index 51ba3ea..4db59c8 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: ap.mc,v 1.1 2007-06-28 12:19:37 mike Exp $
 <%args>
 $id
 $set
index 7d22a03..bc99268 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: check.mc,v 1.18 2007-05-09 10:45:14 mike Exp $
 <%args>
 @id
 $test => "Quick"
index 296946e..f986334 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: country-list.mc,v 1.2 2007-03-30 11:14:56 mike Exp $
 <%perl>
 return [
        "",
index a1ae5f2..fce37c1 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: delete.mc,v 1.7 2007-06-27 11:09:32 mike Exp $
 <%args>
 $id
 $really => 0
index 58c255f..5b93d30 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: doc.mc,v 1.4 2007-05-03 14:13:19 mike Exp $
 <%once>
 use Pod::Html;
 use IO::Dir;
index de18268..4d926f6 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: edit.mc,v 1.40 2009-04-15 18:16:46 wosch Exp $
 <%args>
 $op
 $id => undef ### should be extracted using utf8param()
@@ -37,10 +36,11 @@ my $conn = new ZOOM::Connection($db, 0,
                                user => "admin", password => "fruitbat",
                                elementSetName => "zeerex");
 
-my $protocol = utf8param($r, "protocol");
-my $host = utf8param($r, "host");
-my $port = utf8param($r, "port");
-my $dbname = utf8param($r, "dbname");
+my $protocol = utf8paramTrim($r, "protocol");
+my $host = utf8paramTrim($r, "host");
+my $port = utf8paramTrim($r, "port");
+my $dbname = utf8paramTrim($r, "dbname");
+my $title = utf8paramTrim($r, "title");
 
 if ((!defined $port || $port eq "") &&
     (defined $protocol && $protocol ne "")) {
@@ -54,6 +54,7 @@ my $newid;
 if (defined $protocol && $protocol ne "" &&
     defined $host && $host ne "" &&
     defined $port && $port ne "" &&
+    defined $title && $title ne "" &&
     defined $dbname && $dbname ne "") {
     $newid = irspy_make_identifier($protocol, $host, $port, $dbname);
 }
@@ -67,7 +68,7 @@ if (!defined $id) {
     } elsif (!defined $newid) {
        # Tried to create new record but data is insufficient
        print qq[<p class="error">
-               Please specify protocol, host, port and database name.</p>\n];
+               Please specify title, protocol, host, port and database name.</p>\n];
        undef $update;
     } elsif ($host !~ /^\w+\.[\w.]*\w$/i) {
        print qq[<p class="error">
@@ -336,6 +337,8 @@ my @fields =
        qw(e:title e:description) ],
      [ subjects     => 2, "Subjects", "e:databaseInfo/e:subjects",
        qw(e:title e:description) ],
+     [ disabled     => [ qw(0 1) ],
+       "Target Test Disabled", "i:status/i:disabled" ],
      );
 
 # Update record with submitted data
@@ -343,7 +346,7 @@ my %fieldsByKey = map { ( $_->[0], $_) } @fields;
 my %data;
 foreach my $key (&utf8param($r)) {
     next if grep { $key eq $_ } qw(op id update);
-    $data{$key} = utf8param($r, $key);
+    $data{$key} = trimField( utf8param($r, $key) );
 }
 my @changedFields = modify_xml_document($xc, \%fieldsByKey, \%data);
 if ($update && @changedFields) {
index 81a73e4..085b153 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: error.mc,v 1.1 2006-09-19 11:11:44 mike Exp $
 <%args>
 $message
 </%args>
index 9edbe8d..dff561f 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: find.mc,v 1.12 2009-04-15 18:16:46 wosch Exp $
 % if (&utf8param($r,"_search")) {
 %     $m->comp("found.mc");
 % } else {
index 307239d..e4312fb 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: found.mc,v 1.33 2009-04-15 18:16:46 wosch Exp $
 <%once>
 sub print_navlink {
     my($params, $cond, $caption, $skip) = @_;
index baec260..19008a9 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: full.mc,v 1.30 2007-07-03 13:10:50 mike Exp $
 <%args>
 $id
 </%args>
index fcebe6c..1f42fb2 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: home.mc,v 1.11 2008-07-03 08:14:21 mike Exp $
      <div class="essay">
      <h2>The Z39.50 Target Directory</h2>
      <p>
index 8a40f57..1126b91 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: libtype-list.mc,v 1.2 2007-03-30 11:14:56 mike Exp $
 <%perl>
 return [
        "", qw(Academic Public Corporate Special National Education Other)
index 3039074..3fa573e 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: software.mc,v 1.3 2007-04-18 12:13:01 mike Exp $
      <div class="essay">
      <p>
       Index Data uses
index f44c349..e50f56a 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: stats.mc,v 1.9 2007-11-02 12:49:28 mike Exp $
 <%doc>
 Here are the headings in the Z-Spy version:
        The ten most commonly supported Bib-1 Use attributes
@@ -41,12 +40,12 @@ if (!defined $stats || $reload) {
      <p>Recalculating stats</p>
 % }
 <& table, stats => $stats, data => "bib1AccessPoints",
-       title => "The ten most commonly supported Bib-1 Use attributes",
-       headings => [ "Attribute", "Name"],
+       title => "The twenty most commonly supported Bib-1 Use attributes",
+       headings => [ "Attribute", "Name"], maxrows => 20, 
        col3 => sub { bib1_access_point(@_) } &>
 <& table, stats => $stats, data => "recordSyntaxes",
        title => "Record syntax support by database",
-       headings => [ "Record Syntax"] &>
+       headings => [ "Record Syntax"], maxrows => 30 &>
 <& table, stats => $stats, data => "explain",
        title => "Explain Support",
        headings => [ "Explain Category"] &>
@@ -84,7 +83,7 @@ $col3 => undef
 my $hr;
 $hr = $stats->{$data};
 my @sorted = sort { $hr->{$b} <=> $hr->{$a} || $a <=> $b } keys %$hr;
-my $n = @sorted; $n = $maxrows if @sorted > 10;
+my $n = @sorted; $n = $maxrows if @sorted > 10 && $n > $maxrows;
 foreach my $i (1..$n) {
     my $key = $sorted[$i-1];
 </%perl>
index 4a639ad..8324d3f 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: upload.mc,v 1.3 2009-04-16 18:09:44 wosch Exp $
 <%args>
 $filename => undef
 </%args>
index 424d5db..d24a81d 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: doc.html,v 1.1 2006-09-28 16:48:00 mike Exp $
 <& /chrome/layout.mc, %ARGS, component => "/details/doc.mc",
     title => defined $ARGS{module} ? $ARGS{module} : "Documentation" &>
index 49f32ad..4a341b7 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: find.html,v 1.2 2006-09-19 16:30:25 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "Find a target",
     component => "/details/find.mc" &>
index 3924bf4..b6c806b 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: full.html,v 1.1 2006-10-20 16:57:40 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "Full target record",
     component => "/details/full.mc" &>
index c211356..4c47c64 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: help.html,v 1.5 2006-12-06 14:07:17 mike Exp $
 <%args>
 $help
 </%args>
index bd41d37..7466ccc 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: edit.html,v 1.1 2006-12-05 12:26:37 mike Exp $
   <p class="small">
    (The fields used to describe targets in the IRSpy database are for
    the most part those described in the
index 33c9302..0de8703 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: author.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    The author element should contain the name of the person or
    organisation to be credited with the creation of the database, and
index 3786d4d..8d5fa5e 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: contact.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    The contact element is used to record information on a contact
    person for the database.  This should include at least a name and
index 3db8b2e..9776395 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: country.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    The country in which the service is hosted, if known.
   </p>
index c2a30e7..15e9a76 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: dbname.html,v 1.1 2006-12-05 12:26:37 mike Exp $
   <p>
    For Z39.50 databases, contains the name of the Z39.50 database
    which the service provides.  If the service provides multiple
index c5155b6..2e77d21 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: description.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
 
    Should contain a description of why this database might be of
diff --git a/web/htdocs/help/edit/disabled.html b/web/htdocs/help/edit/disabled.html
new file mode 100644 (file)
index 0000000..cabb1cc
--- /dev/null
@@ -0,0 +1,3 @@
+  <p>The target will not be tested automatically if set and is not zero.</p>
+
+  <p>This option is mainly for the administrator of IRSpy in case of trouble.</p>
index 8ab835c..7b6a9ef 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: extent.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    Used to describe the completeness of the database, or the range of
    material that is included in it. For example a database which
index 907f31c..899a898 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: history.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    Any information which is considered useful regarding the history of
    the database may be recorded in the history element. This might
index fcb41d7..f26128f 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: host.html,v 1.2 2006-12-06 14:20:25 mike Exp $
   <p>
    The address of the server which hosts the service. This address
    should be in a name which will resolve to the correct IP
index 20f43e5..582a9d6 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: hosturl.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    A URL for the organisation which hosts the database.  This URL may
    or not refer to the same host as the
index df77e8c..88d9b67 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: language.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    Used to record the languages used in the database records (as
    opposed to the target record).  For example, in an English-language
index e898117..80da6d6 100644 (file)
@@ -1,2 +1 @@
-%# $Id: password.html,v 1.1 2006-12-06 14:22:22 mike Exp $
 <& username.html &>
index cce93de..631ec62 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: port.html,v 1.1 2006-12-05 12:26:37 mike Exp $
   <p>
    The port that the service is running on.  For Z39.50 servers, this
    is often 210, 3950 or 7090.  IRSpy needs this information in order
index 4d9fddc..2f493c2 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: protocol.html,v 1.1 2006-12-05 12:26:37 mike Exp $
   <p>
    Used to record the protocol that should be used to connect to the
    server.  The default value is
index 2022536..b823e2a 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: restrictions.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    If there are any restrictions on the usage or availability of the
    database or its contents then these should be recorded in this
index 4af2fdd..ff95cfe 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: subjects.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    If the database concerns particular subjects from a controlled
    vocabulary then these may be recorded using this field.  These
index 9b984e4..bc9920a 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: title.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    The name by which the database is known.
   </p>
index f5eb71f..2b21736 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: type.html,v 1.1 2006-12-05 16:40:46 mike Exp $
   <p>
    The type of library that this is a catlogue for.  This field is not
    part of the ZeeRex data model, and may require further thought -
index 003a8d5..302af3e 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: username.html,v 1.1 2006-12-06 14:22:22 mike Exp $
   <p>
    Some Z39.50 servers require authentication before access is
    allowed.  For such servers, a suitable username and password may be
index 3f40365..3d8711a 100644 (file)
@@ -1,2 +1 @@
-%# $Id: info.html,v 1.1 2007-04-26 13:56:46 mike Exp $
   <!-- No generic help needed for "info" category -->
index 6f768e4..e7ffdc6 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: reliability.html,v 1.1 2007-04-26 13:56:53 mike Exp $
   <p>
    Measures the reliability of the target only in its ability to
    respond to connections: the display indicates the number of
index cca692c..a3df767 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: link.mc,v 1.9 2007-06-25 10:38:35 mike Exp $
 <%args>
 $help
 </%args>
index 716d916..fed9825 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: index.html,v 1.3 2006-09-15 16:47:47 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "Welcome",
     component => "/details/home.mc" &>
index ed911c2..b53f4d8 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: sru-auth.html,v 1.1 2007-08-21 09:48:41 mike Exp $
 <%doc>
        In order to test the authentication feature of Simple2ZOOM, we
        need an authenticator script, accessible via HTTP.  The
index 694652b..fc8bec2 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: raw.html,v 1.9 2007-05-11 13:53:40 mike Exp $
 <%args>
 $id
 </%args>
diff --git a/web/htdocs/robots-test.txt b/web/htdocs/robots-test.txt
new file mode 100644 (file)
index 0000000..1f53798
--- /dev/null
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /
index beef7ee..fed2b3a 100644 (file)
@@ -1,8 +1,12 @@
 User-agent: *
-Disallow: /full.html
-Disallow: /all.html
+Disallow: /admin/
 Disallow: /add.html
-Disallow: /upload.html
+Disallow: /add_target.html
+Disallow: /all.html
+Disallow: /doc.html
+Disallow: /find.html
+Disallow: /full.html
 Disallow: /raw.html
-Disallow: /admin/
+Disallow: /stats.html
+Disallow: /upload.html
 
index 000e048..d32cb78 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: software.html,v 1.1 2007-03-30 11:43:59 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "About the IRSpy software",
     component => "/details/software.mc" &>
index bea5cd7..6c0edf6 100644 (file)
@@ -1,3 +1,2 @@
-%# $Id: stats.html,v 1.1 2006-12-14 16:11:03 mike Exp $
 <& /chrome/layout.mc, %ARGS, title => "Target statistic",
     component => "/details/stats.mc" &>
index 429bee7..56e1fba 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: style.css,v 1.4 2007-03-22 07:57:34 mike Exp $ */
 body {
   color: black;
   background: white;
index 3ba0688..ddfb2a2 100644 (file)
@@ -1,4 +1,3 @@
-%# $Id: upload.html,v 1.1 2007-07-16 11:55:20 mike Exp $
 <& /chrome/layout.mc, %ARGS,
     title => "Upload target record",
     component => "/details/upload.mc" &>
index cecb2a4..bc709e0 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile,v 1.1 2006-12-05 12:26:37 mike Exp $
-
 PNG = ../htdocs/help-20px.png ../htdocs/help-16px.png
 
 all: $(PNG)
index 76ad5a1..3f22386 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <!--
-    $Id: irspy2zeerex.xsl,v 1.21 2007-06-28 14:01:56 sondberg Exp $
 
     This stylesheet is used by IRSpy to map the internal mixed Zeerex/IRSpy
     record format into the Zeerex record which we store.
index ef604f0..16b0e99 100644 (file)
@@ -1,7 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    $Id: use-attr-names.xml,v 1.2 2006-10-27 12:50:06 sondberg Exp $
-
     Maps numeric use attributes to human readable names - credits to Per
 -->
 <mapping>
index b56e633..710456f 100644 (file)
@@ -5,6 +5,7 @@ DUMP_DIR=               irspy-dump
 ZEBRA_DIR=             db
 ZEBRAIDX=              zebraidx-2.0 
 ZEBRAIDX_TEST=         zebraidx-2.0 -c zebra-test.cfg
+IRSPY_DATABASE=                $${IRSpyDbName-"localhost:8018/IR-Explain---1"}
 
 # debugging
 ZEBRA_TEST_DIR=                db-test
@@ -41,7 +42,7 @@ dump:
        rm -rf records-${DATE}.old
        -test -e records-${DATE} && mv records-${DATE} records-${DATE}.old
        mkdir records-${DATE}
-       cd records-${DATE} && ../../bin/irspy-dump.pl localhost:8018/IR-Explain---1
+       cd records-${DATE} && ../../bin/irspy-dump.pl ${IRSPY_DATABASE}
        cd records-${DATE} && ( for i in *.xml; do tidy -xml -i -m -w 140 $$i; done ) > /dev/null 2>&1 
        tar cf - records-${DATE} | gzip > records-${DATE}.tar.gz
        
index 2ac6c19..af38aa6 100644 (file)
@@ -1,4 +1,3 @@
-$Id: README,v 1.21 2007-05-09 16:48:31 mike Exp $
 
 What's what in this directory:
 
@@ -111,3 +110,4 @@ zebraidx-2.0 update records-2010-04-06
 zebraidx-2.0 commit
 
 zebrasrv-2.0 -f yazserver.xml
+
index 356ecb5..d53a276 100644 (file)
@@ -1,9 +1,5 @@
-# $Id: crontab,v 1.4 2007-09-18 17:02:19 mike Exp $
+# Example crontab file for a weekly update cycle, testing 1/7 of the 
+# database every day. See also the script ../bin/irspy-update.sh 
+#
 # m h  dom mon dow   command
-0 1 * * 0 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,0 localhost:8018/IR-Explain---1
-0 1 * * 1 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,1 localhost:8018/IR-Explain---1
-0 1 * * 2 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,2 localhost:8018/IR-Explain---1
-0 1 * * 3 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,3 localhost:8018/IR-Explain---1
-0 1 * * 4 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,4 localhost:8018/IR-Explain---1
-0 1 * * 5 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,5 localhost:8018/IR-Explain---1
-0 1 * * 6 cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,6 localhost:8018/IR-Explain---1
+0 1 * * * cd /home/mike/cvs/irspy/bin && YAZ_LOG=irspy ./setrlimit -v -a 500 -- perl -I ../lib irspy.pl -a -n 50 -t Main -m 7,`date '+%w'` localhost:8018/IR-Explain---1
index 76c3946..c06a152 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: zebra.cfg,v 1.12 2006-12-19 12:53:16 sondberg Exp $
 
 # Where to look for config files
 profilePath: .:/usr/local/share/idzebra-2.0/tab:/usr/share/idzebra-2.0/tab
index 2201b83..bd71e26 100755 (executable)
@@ -1,6 +1,5 @@
 #! /usr/bin/perl -w
 
-# $Id: ezeerex2pqfproperties.pl,v 1.7 2006-06-20 11:24:22 mike Exp $
 #
 # Run like this:
 #      ./ezeerex2pqfproperties.pl zeerex.xml
index 08b28d5..543a296 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: filterconf.xml,v 1.4 2007-05-11 08:30:23 mike Exp $ -->
 <schemaInfo>
  <schema name="index" stylesheet="zeerex2index.xsl"
         identifier="http://indexdata.dk/zebra/xslt/1"/>
index d782e40..eed61a0 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- $Id: form.html,v 1.3 2007-01-24 09:28:03 mike Exp $ -->
 <!DOCTYPE html 
        PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
index 225b4fa..34c83d2 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: pqf.properties,v 1.18 2007-03-29 17:14:13 mike Exp $
 #
 # Properties file to drive the YAZ CQL-to-PQF converter for Zebra.
 # This specifies the interpretation of various CQL indexes, relations,
@@ -50,6 +49,7 @@ index.zeerex.default_index            = 1=zeerex:default_index
 # Extensions
 index.zeerex.libType                   = 1=zeerex:libType 4=3
 index.zeerex.country                   = 1=zeerex:country 4=3
+index.zeerex.disabled                  = 1=zeerex:disabled 4=3
 
 # Relation attributes are selected according to the CQL relation by
 # looking up the "relation.<relation>" property:
index 67500c1..a1bcd53 100644 (file)
@@ -1,4 +1,3 @@
-$Id: profile,v 1.2 2006-06-16 14:16:12 mike Exp $
 
 Notes on the indexes in the ZeeRex profile, with indications of
 whether they are yet supported by the Zebra configuration in this
index 92b64cf..8758565 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: yazserver.xml,v 1.4 2007-01-24 09:28:03 mike Exp $ -->
 <yazgfs>
  <listen id="tcp8019">tcp:@:8019</listen>
  <server id="alvis" listenref="tcp8019">
index 9f4cb1c..f5db2bb 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: yazserver.xml,v 1.4 2007-01-24 09:28:03 mike Exp $ -->
 <yazgfs>
  <listen id="tcp8018">tcp:@:8018</listen>
  <server id="alvis" listenref="tcp8018">
index aba40eb..800a304 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex.xml,v 1.15 2007-01-24 09:28:03 mike Exp $ -->
 <explain xmlns="http://explain.z3950.org/dtd/2.0/">
 
  <serverInfo protocol="SRW/SRU/Z39.50" version="1.1" method="GET/POST">
index abd8de0..c7c0d08 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex.xml,v 1.15 2007-01-24 09:28:03 mike Exp $ -->
 <explain xmlns="http://explain.z3950.org/dtd/2.0/">
 
  <serverInfo protocol="SRW/SRU/Z39.50" version="1.1" method="GET/POST">
index c57aab9..0689a4d 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex2dc.xsl,v 1.2 2007-04-27 14:04:40 mike Exp $ -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:z="http://indexdata.dk/zebra/xslt/1"
                 xmlns:e="http://explain.z3950.org/dtd/2.0/"
index fd7ed64..26f9493 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex2id.xsl,v 1.2 2007-04-27 14:04:40 mike Exp $ -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:e="http://explain.z3950.org/dtd/2.0/"
                 version="1.0">
index 7c4f5eb..fd7556f 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex2index.xsl,v 1.15 2009-04-16 15:28:26 mike Exp $ -->
 <!-- See the ZeeRex profile at http://srw.cheshire3.org/profiles/ZeeRex/ -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:z="http://indexdata.dk/zebra/xslt/1"
    </xsl:for-each>
 
    <!-- recordInfo -->
-   <z:index name="zeerex:recordSyntax" type="0">
+   <z:index name="zeerex:recordSyntax" type="w">
     <xsl:value-of select="e:recordInfo/e:recordSyntax/@name"/>
     <!-- ### But @identifier is an OID for Z39.50 -->
    </z:index>
    <z:index name="zeerex:country" type="0">
     <xsl:value-of select="i:status/i:country"/>
    </z:index>
+   <z:index name="zeerex:disabled" type="0">
+    <xsl:value-of select="i:status/i:disabled"/>
+   </z:index>
 
   </z:record>
  </xsl:template>
index 632cf8d..92c430e 100644 (file)
@@ -1,7 +1,4 @@
 <?xml version="1.0"?>
-<!--
-   $Id: zeerex2noauth.xsl,v 1.2 2007-06-25 12:32:13 sondberg Exp $
--->
 <xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:ex="http://explain.z3950.org/dtd/2.0/"
index cfbdde2..be2ab54 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex2zeerex.xsl,v 1.1 2006-04-13 14:53:18 mike Exp $ -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
  <xsl:template match="/">