-$Id: README,v 1.6 2007-04-18 15:22:48 mike Exp $
ZOOM::IRSpy
===========
INSTALLATION
+for debian/ubuntu:
+-------------------
+
+DEBIAN DEPENDENCIES
+
+If you have a Debian-based operating system, you can get what you need
+by installing the following packages from the operating system's
+package store, using apt-get:
+
+sudo apt-get install \
+ libnet-z3950-zoom-perl \
+ libxml-libxml-common-perl \
+ liburi-perl \
+ libxml-libxml-perl \
+ libapache2-mod-perl2 \
+ libhtml-mason-perl \
+ libapache2-request-perl \
+ libapache2-mod-apreq2 \
+ libxml-libxslt-perl \
+ idzebra-2.0 \
+
+you may need one of the following packages for development:
+
+sudo apt-get install \
+ make perl-doc libxml2-utils tidy
+
+and may enable mod_apreq
+
+sudo a2enmod apreq
+
+
To install this module type the following:
perl Makefile.PL
This module requires these other modules and libraries, in addition to
those specified in Makefile.PL:
- Zebra, release 1.4.0 or later: see http://indexdata.com/zebra/
+ Zebra, release 2.0 or later: see http://www.indexdata.com/zebra/
COPYRIGHT AND LICENCE
-Copyright (C) 2006 by Index Data ApS.
+Copyright (C) 2006-2010 by Index Data ApS.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.7 or,
+++ /dev/null
-zspy.zip
-zeerez-record-display
--- /dev/null
+zspy.zip
+zeerez-record-display
+++ /dev/null
-test-zoom-c
-setrlimit
--- /dev/null
+test-zoom-c
+setrlimit
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# Invoke as:
# $ mkdir records-2010-04-06
# $ irspy-dump.pl irspy.indexdata.com:8018/IR-Explain---1
# $ cd ..
# $ tar cfz records-2010-04-06.tar.gz records-2010-04-06
+#
+# or: cd zebra; make dump
use strict;
use warnings;
my $n = $rs->size();
$| = 1;
print "$0: dumping $n records\n";
+
+my $step = 200;
+my $step2 = 10;
foreach my $i (1..$n) {
- print ".";
- print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0;
+ print "." if $i % $step2 == 0;
+ print " $i/$n (", int($i*100/$n), "%)\n" if $i % $step == 0;
my $rec = $rs->record($i-1);
my $xml = $rec->render();
open F, ">$i.xml";
print F $xml;
close F;
}
-print " $n/$n (100%)\n" if $n % 50 != 0;
+print " $n/$n (100%)\n" if $n % $step != 0;
print "complete\n";
-#!/usr/bin/perl -w
+#!/usr/bin/perl
-# $Id: irspy.pl,v 1.29 2007-09-18 16:58:18 mike Exp $
-#
# Run like this:
# YAZ_LOG=irspy,irspy_test IRSPY_SAVE_XML=1 perl -I../lib irspy.pl -t Quick localhost:8018/IR-Explain---1 Z39.50:amicus.oszk.hu:1616/ANY
# YAZ_LOG=irspy,irspy_test sudo ./setrlimit -n 3000 -u mike -- perl -I../lib irspy.pl -t Main -a localhost:8018/IR-Explain---1
# I have no idea why this directory is not in Ubuntu's default Perl
# path, but we need it because just occasionally overload.pm:88
# requires Scalar::Util, which is in this directory.
+#use lib '/usr/share/perl/5.8.7';
-use lib '/usr/share/perl/5.8.7';
use Scalar::Util;
-
-use strict;
-use warnings;
use Getopt::Std;
use ZOOM::IRSpy::Web;
use Carp;
+use strict;
+use warnings;
+
$SIG{__DIE__} = sub {
my($msg) = @_;
confess($msg);
};
my %opts;
-if (!getopts('wt:af:n:m:', \%opts) || @ARGV < 1) {
+if (!getopts('dwt:af:n:m:M:', \%opts) || @ARGV < 1) {
print STDERR "\
Usage $0: [options] <IRSpy-database> [<target> ...]
+ -d debug
-w Use ZOOM::IRSpy::Web subclass
-t <test> Run the specified <test> [default: all tests]
-a Test all targets (slow!)
-f <query> Test targets found by the specified query
-n <number> Number of connection to keep in active set
-m <n>,<i> Only test targets whose hash mod <n> is <i>
+ -M max_depth maximum number of nested template calls and variables/params
";
exit 1;
}
my $class = "ZOOM::IRSpy";
$class .= "::Web" if $opts{w};
+if ($opts{M} && $opts{M} > 0) {
+ no warnings;
+ $ZOOM::IRSpy::xslt_max_depth = $opts{M};
+}
+if ($opts{d}) {
+ no warnings;
+ $ZOOM::IRSpy::debug = $opts{d};
+}
+
my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n});
if (@targets) {
$spy->targets(@targets);
--- /dev/null
+#!/bin/sh
+#
+# wrapper for irspy.pl
+#
+# run irspy with a smaller set of records in a loop to avoid out-of-memory
+#
+
+home=/usr/local/src/git
+cd $home/irspy/bin || exit 2
+logdir=../tmp
+
+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
+ gzip -f $logfile
+done
+
-#!/usr/bin/perl -w
+#!/usr/bin/perl
-# $Id: irspy_xsltproc.pl,v 1.4 2007-06-28 13:57:53 sondberg Exp $
-# ------------------------------------------------------------------
# This script is only for debugging purposes - it takes a raw IRspy
# xml output document as argument and executes the irspy2zeerex.xsl
# transformation right in front of you:
#
-# ./irspy_xsltproc.pl irspy_output_raw.xml
-#
+# ./irspy_xsltproc.pl irspy_output_raw.xml ...
-use strict;
-use warnings;
+use Getopt::Long;
+use Data::Dumper;
use lib '../lib';
use ZOOM::IRSpy;
-if (@ARGV && $ARGV[0] eq "-d") {
- shift;
- XML::LibXSLT->debug_callback(\&xslt_debug);
+use strict;
+
+#use warnings;
+
+sub usage {
+
+ <<EOF
+usage $0 [ options ] file.xml ...
+
+-d enable xslt debug
+-v verbose level
+-f irspy.xsl set irspy_to_zeerex_xsl
+EOF
}
+my $irspy_to_zeerex_xsl;
+my $xslt_debug;
+my $verbose = 0;
+
+GetOptions(
+ "d" => \$xslt_debug,
+ "v" => \$verbose,
+ "f=s" => \$irspy_to_zeerex_xsl,
+);
+
+die usage if $#ARGV < 0;
+XML::LibXSLT->debug_callback( \&xslt_debug ) if defined $xslt_debug;
+
+$ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
+ if $irspy_to_zeerex_xsl;
+
my $dbname = 'localhost:8018/IR-Explain---1';
-my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
-my $source_file = shift || die("$0: Please specify xml instance file");
-my $source_doc = $spy->{libxml}->parse_file($source_file);
-my $results = $spy->{irspy_to_zeerex_style}->transform($source_doc);
+my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
+
+warn Dumper($spy) if $verbose;
+foreach my $source_file (@ARGV) {
+ my $source_doc = $spy->{libxml}->parse_file($source_file);
+ my $results = $spy->{irspy_to_zeerex_style}->transform($source_doc);
+
+ print $results->toString(1);
+}
-print $results->toString(1);
modify_xml_document);
our @ISA = qw();
-our $VERSION = '1.01';
+our $VERSION = '1.02';
our $irspy_to_zeerex_xsl = dirname(__FILE__) . '/../../xsl/irspy2zeerex.xsl';
+our $debug = 0;
+our $xslt_max_depth = 250;
# Enumeration for callback functions to return
my $class = shift();
my($dbname, $user, $password, $activeSetSize) = @_;
+
my @options;
push @options, (user => $user, password => $password)
if defined $user;
my $xslt = new XML::LibXSLT;
+ # raise the maximum number of nested template calls and variables/params (default 250)
+ warn "raise the maximum number of nested template calls: $xslt_max_depth\n" if $debug;
+ $xslt->max_depth($xslt_max_depth);
+
$xslt->register_function($ZOOM::IRSpy::Utils::IRSPY_NS, 'strcmp',
\&ZOOM::IRSpy::Utils::xslt_strcmp);
my $libxml = new XML::LibXML;
+ warn "use irspy_to_zeerex_xsl xslt sheet: $irspy_to_zeerex_xsl\n" if $debug;
my $xsl_doc = $libxml->parse_file($irspy_to_zeerex_xsl);
my $irspy_to_zeerex_style = $xslt->parse_stylesheet($xsl_doc);
use strict;
use warnings;
+use Scalar::Util;
=head1 NAME
sub new {
my $class = shift();
my($name, @subnodes) = @_;
- return bless {
+ my $this = bless {
name => $name,
subnodes => \@subnodes,
address => undef, # filled in by resolve()
previous => undef, # filled in by resolve()
next => undef, # filled in by resolve()
}, $class;
+
+ return $this;
}
=head2 name()
use strict;
use warnings;
+use Scalar::Util;
use XML::LibXML;
use XML::LibXML::XPathContext;
use ZOOM::IRSpy::Utils qw(xml_encode isodate irspy_xpath_context);
### Parser should be in the IRSpy object
my $parser = new XML::LibXML();
- return bless {
+ my $this = bless {
irspy => $irspy,
target => $target,
parser => $parser,
zeerex => $parser->parse_string($zeerex)->documentElement(),
}, $class;
+
+ #Scalar::Util::weaken($this->{irspy});
+ #Scalar::Util::weaken($this->{parser});
+
+ return $this;
}
use 5.008;
use strict;
use warnings;
+
+use Scalar::Util;
use ZOOM::IRSpy::Utils qw(irspy_xpath_context);
=head1 NAME
use strict;
use warnings;
+use Scalar::Util;
+
=head1 NAME
ZOOM::IRSpy::Task - base class for tasks in IRSpy
my $class = shift();
my($conn, $udata, $options, %cb) = @_;
- return bless {
+ my $this = bless {
irspy => $conn->{irspy},
conn => $conn,
udata => $udata,
cb => \%cb,
timeRegistered => time(),
}, $class;
+
+ #Scalar::Util::weaken($this->{irspy});
+ #Scalar::Util::weaken($this->{udata});
+
+ return $this;
}
use strict;
use warnings;
+use Scalar::Util;
+
=head1 NAME
ZOOM::IRSpy::Test - base class for tests in IRSpy
use strict;
use warnings;
+use Scalar::Util;
+
use Exporter 'import';
our @EXPORT_OK = qw(utf8param
isodate
if !defined $id;
my($protocol, $target) = ($id =~ /(.*?):(.*)/);
- if (uc($protocol) eq "Z39.50") {
+ if (uc($protocol) eq "Z39.50" || uc($protocol) eq "TCP") {
return "tcp:$target";
} elsif (uc($protocol) eq "SRU") {
return "sru=get,http:$target";
-# $Id: ZOOM-IRSpy.t,v 1.1 2007-04-18 11:23:01 mike Exp $
-
# change 'tests => 1' to 'tests => last_test_to_print';
-use Test::More tests => 1;
-BEGIN { use_ok('ZOOM::IRSpy') };
+
+use Test::More qw(no_plan);
+
+BEGIN {
+ use_ok('ZOOM::IRSpy');
+}
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
+use strict;
+use warnings;
+
+my $irspy_to_zeerex_xsl = 'xsl/irspy2zeerex.xsl';
+
+$ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
+ if $irspy_to_zeerex_xsl;
+
+my $dbname = 'localhost:8018/IR-Explain---1';
+my $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
+
+isa_ok( $spy, 'ZOOM::IRSpy' );
+
+# test for failure if template not exists
+eval {
+ $ZOOM::IRSpy::irspy_to_zeerex_xsl = '/nonexist';
+ $ZOOM::IRSpy::debug = 1;
+ $ZOOM::IRSpy::xslt_max_depth = 100;
+ $spy = new ZOOM::IRSpy( $dbname, "admin", "fruitbat" );
+};
+
+like( $@, qr/No such file or directory/, "xslt configure test" );
+
+1;
+
+__DATA__;
+foo
+!!!Note: most part of this document is outdated!!!
+
+Please have a look at the README in the top-level directory.
+
+April 2010, Wolfram
+
$Id: README,v 1.5 2006-10-31 14:17:54 sondberg Exp $
To install the web UI (assuming you're using some version of Apache as
+++ /dev/null
-# $Id: newshawarma-proxy.conf,v 1.3 2007-06-25 10:39:22 mike Exp $
-#
-# A very simple configuration to proxy the IRSpy server to a separate
-# Apache instance running on the same host. This separation is useful
-# to isolate IRSpy from other sites' errors and vice versa.
-
-<VirtualHost 83.133.64.64>
- ServerName irspy.indexdata.com
- ServerAlias targettest.indexdata.com
- ProxyPass / http://irspy.indexdata.com:81/
- ProxyPassReverse / http://irspy.indexdata.com:81/
-
- # These are the logs for the proxying operation
- ErrorLog /var/log/apache/irspy-error.log
- CustomLog /var/log/apache/irspy-access.log combined
-</VirtualHost>
+++ /dev/null
-# $Id: newshawarma.conf,v 1.4 2009-05-26 07:29:56 mike Exp $
-#
-# Sample configuration for running an IRSpy web-site under Apache 1.3.
-#
-# This is the configuration that I use on the live machine,
-# newshawarma, which is a PC running Debian GNU/Linux 3.1.
-# On this machine, the IRSpy software is at
-# /home/mike/cvs/irspy
-#
-# This file can be included in the Apache configuration by adding a
-# line like this to apache.conf or one of its included files:
-# Include /home/mike/cvs/irspy/web/conf/apache1.3/newshawarma.conf
-#
-# When running on Debian, don't forget to
-# install libapache-request-perl as well as libhtml-mason-perl,
-# otherwise Mason will fail mysteriously.
-#
-# And do NOT attempt to install ZAP on the same apache, that is known
-# to fail!
-
-<VirtualHost 83.133.64.64>
- ServerName irspy.indexdata.com
- ErrorLog /var/log/apache-irspy/irspy-error.log
- CustomLog /var/log/apache-irspy/irspy-access.log combined
- DocumentRoot /home/mike/cvs/irspy/web/htdocs
- <FilesMatch "\.(html|css)$">
- SetHandler perl-script
- PerlHandler HTML::Mason::ApacheHandler
- </FilesMatch>
- PerlAddVar MasonCompRoot "private => /home/mike/cvs/irspy/web/htdocs"
- PerlSetVar MasonDataDir /home/mike/cvs/irspy/web/data
- PerlSetVar IRSpyLibDir /home/mike/cvs/irspy/lib
- PerlSetEnv PERL5LIB /home/mike/cvs/irspy/lib
- <Location /admin>
- AuthType Basic
- AuthName "IRSpy Administration"
- AuthUserFile /home/mike/cvs/irspy/web/conf/htpasswd
- Require user admin
- </Location>
-</VirtualHost>
-
-<VirtualHost 83.133.64.64>
- ServerName targettest.indexdata.com
- Redirect permanent / http://irspy.indexdata.com/
-</VirtualHost>
+++ /dev/null
-# $Id: rafa.conf,v 1.1 2007-05-02 13:54:40 mike Exp $
-#
-# Sample configuration for running an IRSpy web-site under Apache 1.3.
-#
-# This is the configuration that I use on the development machine,
-# xeno, which is a Fujitu-Siemens SCENIC X102 PC running Ubuntu Linux
-# release 6.06. On this machine, the IRSpy software is at
-# /usr/local/src/cvs/irspy
-#
-# This file can be included in the Apache configuration by adding a
-# line like this to apache.conf or one of its included files:
-# Include /usr/local/src/cvs/irspy/web/conf/apache1.3/xeno.conf
-#
-# When running on Ubuntu (and probably Debian), don't forget to
-# install libapache-request-perl as well as libhtml-mason-perl,
-# otherwise Mason will fail mysteriously.
-
-<VirtualHost localhost>
- ServerName x.irspy.indexdata.com
- ErrorLog /var/log/apache/irspy-error.log
- CustomLog /var/log/apache/irspy-access.log combined
- DocumentRoot /usr/local/src/cvs/irspy/web/htdocs
- <FilesMatch "\.(html|css)$">
- SetHandler perl-script
- PerlHandler HTML::Mason::ApacheHandler
- </FilesMatch>
- PerlAddVar MasonCompRoot "private => /usr/local/src/cvs/irspy/web/htdocs"
- PerlSetVar MasonDataDir /usr/local/src/cvs/irspy/web/data
- PerlSetVar IRSpyLibDir /usr/local/src/cvs/irspy/lib
- PerlSetEnv PERL5LIB /usr/local/src/cvs/irspy/lib
- PerlInitHandler Apache::Reload
- PerlSetVar ReloadAll Off
- PerlSetVar ReloadModules "ZOOM::IRSpy::Utils"
- <Location /admin>
- AuthType Basic
- AuthName "IRSpy Administration"
- AuthUserFile /usr/local/src/cvs/irspy/web/conf/htpasswd
- Require user admin
- </Location>
-</VirtualHost>
+++ /dev/null
-# $Id: test.conf,v 1.5 2007-02-20 18:51:37 mike Exp $
-#
-# Sample configuration for running an IRSpy web-site under Apache 1.3.
-#
-# This is the configuration that I use on the staging machine,
-# test, which is a PC running Debian GNU/Linux 3.1.
-# On this machine, the IRSpy software is at
-# /usr/local/src/cvs/irspy
-#
-# This file can be included in the Apache configuration by adding a
-# line like this to apache.conf or one of its included files:
-# Include /usr/local/src/cvs/irspy/web/conf/apache1.3/test.conf
-#
-# When running on Debian, don't forget to
-# install libapache-request-perl as well as libhtml-mason-perl,
-# otherwise Mason will fail mysteriously.
-
-<VirtualHost 10.0.0.4>
- ServerName irspy.indexdata.com
- ErrorLog /var/log/apache/irspy-error.log
- CustomLog /var/log/apache/irspy-access.log combined
- DocumentRoot /usr/local/src/cvs/irspy/web/htdocs
- <FilesMatch "\.(html|css)$">
- SetHandler perl-script
- PerlHandler HTML::Mason::ApacheHandler
- </FilesMatch>
- PerlAddVar MasonCompRoot "private => /usr/local/src/cvs/irspy/web/htdocs"
- PerlSetVar MasonDataDir /usr/local/src/cvs/irspy/web/data
- PerlSetVar IRSpyLibDir /usr/local/src/cvs/irspy/lib
- PerlSetEnv PERL5LIB /usr/local/src/cvs/irspy/lib
- <Location /admin>
- AuthType Basic
- AuthName "IRSpy Administration"
- AuthUserFile /usr/local/src/cvs/irspy/web/conf/htpasswd
- Require user admin
- </Location>
-</VirtualHost>
+++ /dev/null
-# $Id: xeno.conf,v 1.9 2008-08-29 18:58:13 mike Exp $
-#
-# Sample configuration for running an IRSpy web-site under Apache 1.3.
-#
-# This is the configuration that I use on the development machine,
-# xeno, which is a Fujitu-Siemens SCENIC X102 PC running Ubuntu Linux
-# release 6.06. On this machine, the IRSpy software is at
-# /usr/local/src/cvs/irspy
-#
-# This file can be included in the Apache configuration by adding a
-# line like this to apache.conf or one of its included files:
-# Include /usr/local/src/cvs/irspy/web/conf/apache1.3/xeno.conf
-#
-# When running on Ubuntu (and probably Debian), don't forget to
-# install libapache-request-perl as well as libhtml-mason-perl,
-# otherwise Mason will fail mysteriously.
-
-NameVirtualHost 192.168.1.75
-
-<VirtualHost 192.168.1.75>
- ServerName x.irspy.indexdata.com
- ErrorLog /var/log/apache/irspy-error.log
- CustomLog /var/log/apache/irspy-access.log combined
- DocumentRoot /usr/local/src/cvs/irspy/web/htdocs
- <FilesMatch "\.(html|css)$">
- SetHandler perl-script
- PerlHandler HTML::Mason::ApacheHandler
- </FilesMatch>
- PerlAddVar MasonCompRoot "private => /usr/local/src/cvs/irspy/web/htdocs"
- PerlSetVar MasonDataDir /usr/local/src/cvs/irspy/web/data
- PerlSetVar IRSpyLibDir /usr/local/src/cvs/irspy/lib
- PerlSetEnv PERL5LIB /usr/local/src/cvs/irspy/lib
- <Location /admin>
- AuthType Basic
- AuthName "IRSpy Administration"
- AuthUserFile /usr/local/src/cvs/irspy/web/conf/htpasswd
- Require user admin
- </Location>
-</VirtualHost>
+++ /dev/null
-# $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 us2
-# /home/wosch/indexdata/irspy
-#
-# This file can be included in the Apache configuration by adding a
-# line like this to apache.conf or one of its included files:
-# Include /home/wosch/indexdata/irspy/web/conf/apache2.0/cfspy.conf
-#
-# When running on Ubuntu (and probably Debian), don't forget to
-# install libapache-request-perl as well as libhtml-mason-perl,
-# otherwise Mason will fail mysteriously.
-#
-# For Apache 2.x
-# sudo apt-get install libxml-libxslt-perl
-# sudo apt-get install libhtml-mason-perl
-# sudo apt-get install libapache2-request-perl
-
-#NameVirtualHost 192.168.1.75
-
-<VirtualHost *:80>
- ServerName cfspy.indexdata.com
-
- ErrorLog /var/log/apache2/cfspy-error.log
- CustomLog /var/log/apache2/cfspy-access.log combined
- DocumentRoot /home/wosch/indexdata/irspy/web/htdocs
- <FilesMatch "\.(html|css)$">
- SetHandler perl-script
- PerlHandler HTML::Mason::ApacheHandler
- </FilesMatch>
-
- PerlSetVar MasonArgsMethod mod_perl
-
- PerlAddVar MasonCompRoot "private => /home/wosch/indexdata/irspy/web/htdocs"
- PerlSetVar MasonDataDir /home/wosch/indexdata/irspy/web/data
- PerlSetVar IRSpyLibDir /home/wosch/indexdata/irspy/lib
- PerlSetEnv PERL5LIB /home/wosch/indexdata/irspy/lib
-
- # We need +Parent to make PerlSwitches -I work properly ... don't ask.
- PerlOptions +Parent
- PerlSwitches -I/home/wosch/indexdata/irspy/lib
-
- <Location /admin>
- AuthType Basic
- AuthName "IRSpy Administration"
- AuthUserFile /home/wosch/indexdata/irspy/web/conf/htpasswd
- Require user admin
- </Location>
-</VirtualHost>
-
--- /dev/null
+# $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
+# /usr/local/src/git/irspy
+#
+# This file can be included in the Apache configuration by adding a
+# line like this to apache.conf or one of its included files:
+# Include /usr/local/src/git/irspy/web/conf/apache2.0/irspy.conf
+#
+# For debian & unbuntu: please read irspy/README for a list of depending packages
+#
+
+<VirtualHost *:80>
+ ServerName irspy.indexdata.com
+ ServerAlias irspy2.indexdata.com irspy
+
+ ErrorLog /var/log/apache2/irspy-error.log
+ CustomLog /var/log/apache2/irspy-access.log combined
+ DocumentRoot /usr/local/src/git/irspy/web/htdocs
+ <FilesMatch "\.(html|css)$">
+ SetHandler perl-script
+ PerlHandler HTML::Mason::ApacheHandler
+ </FilesMatch>
+
+ PerlSetVar MasonArgsMethod mod_perl
+
+ PerlAddVar MasonCompRoot "private => /usr/local/src/git/irspy/web/htdocs"
+ PerlSetVar MasonDataDir /usr/local/src/git/irspy/web/data
+ PerlSetVar IRSpyLibDir /usr/local/src/git/irspy/lib
+ PerlSetEnv PERL5LIB /usr/local/src/git/irspy/lib
+
+ # We need +Parent to make PerlSwitches -I work properly ... don't ask.
+ PerlOptions +Parent
+ PerlSwitches -I/usr/local/src/git/irspy/lib
+
+ <Location /admin>
+ AuthType Basic
+ AuthName "IRSpy Administration"
+ AuthUserFile /usr/local/src/git/irspy/web/conf/htpasswd
+ Require user admin
+ </Location>
+</VirtualHost>
+
+++ /dev/null
-private+2fdetails+2fstats.mc
--- /dev/null
+private+2fdetails+2fstats.mc
+++ /dev/null
-*
-.__obj_create_marker
--- /dev/null
+*
+.__obj_create_marker
+++ /dev/null
-access.log
-error.log
--- /dev/null
+access.log
+error.log
<xsl:when test="$latest">
<xsl:copy-of select="$latest"/>
</xsl:when>
+ <!-- <xsl:when test="$i > 0 and $i < 200"> -->
<xsl:when test="$i > 0">
<xsl:call-template name="insert-latest-nodes">
<xsl:with-param name="what" select="$what"/>
-# $Id: Makefile,v 1.4 2007-09-13 12:19:58 mike Exp $
+
+IRSPY_ARCHIVE= records-2010-04-06
+IRSPY_ARCHIVE_EXT= .tar.gz
+DUMP_DIR= irspy-dump
+ZEBRA_DIR= db
+ZEBRAIDX= zebraidx-2.0
+ZEBRAIDX_TEST= zebraidx-2.0 -c zebra-test.cfg
+
+# debugging
+ZEBRA_TEST_DIR= db-test
+
+DATE:= $(shell date '+%Y-%m-%d')
+
+all: help
+
test:
xmllint --noout --schema zeerex-2.0.xsd zeerex.xml
sed -n 's/#.*//; s/[ ]*//; s/[ ][ ]*/ /g; /./p' $? > $@
newdb:
- tar xzf records-2007-05-01.tar.gz
- zebraidx-2.0 init
- zebraidx-2.0 update zeerex.xml
- zebraidx-2.0 update records-2007-05-01
- zebraidx-2.0 commit
+ tar xzf ${DUMP_DIR}/${IRSPY_ARCHIVE}${IRSPY_ARCHIVE_EXT}
+ mkdir -p ${ZEBRA_DIR}/lock ${ZEBRA_DIR}/register ${ZEBRA_DIR}/shadow ${ZEBRA_DIR}/tmp
+ ${ZEBRAIDX} init
+ ${ZEBRAIDX} update zeerex.xml
+ ${ZEBRAIDX} update ${IRSPY_ARCHIVE}
+ ${ZEBRAIDX} commit
+
+newdb-test:
+ tar xzf ${DUMP_DIR}/${IRSPY_ARCHIVE}${IRSPY_ARCHIVE_EXT}
+ mkdir -p ${ZEBRA_TEST_DIR}/lock ${ZEBRA_TEST_DIR}/register ${ZEBRA_TEST_DIR}/shadow ${ZEBRA_TEST_DIR}/tmp
+ ${ZEBRAIDX_TEST} init
+ ${ZEBRAIDX_TEST} update zeerex-test.xml
+ ${ZEBRAIDX_TEST} update ${IRSPY_ARCHIVE}
+ ${ZEBRAIDX_TEST} commit
+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} && ( 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
+
clean:
rm -f terse.properties
+distclean: clean
+ rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR}
+
+help:
+ @echo "make [ dump | test | newdb | newdb-test | clean | distclean ]"
+
To create the database:
+$ make newdb
+
+or:
+
tar xzf records-2007-04-18.tar.gz
zebraidx-2.0 init
zebraidx-2.0 update zeerex.xml
-#zebraidx-2.0 update records-2010-04-06
+zebraidx-2.0 update record-2010-04-06
zebraidx-2.0 commit
+
zebrasrv-2.0 -f yazserver.xml
#! /bin/sh
-# $Id: init-script,v 1.8 2009-04-15 18:16:46 wosch Exp $
#
# This is a startup/shutdown script for IRSpy's Zebra server, suitable
# for use in a SysV-style init directory such as /etc/init.d (on
pidfile=/var/run/irspy-zebra.pid
case "`hostname`" in
- xeno|rafa|test) IRSPYDIR=/usr/local/src/cvs/irspy/;;
+ nigiri | xeno | rafa | test) IRSPYDIR=/usr/local/src/git/irspy/;;
shawarma|kafta) IRSPYDIR=/home/mike/cvs/irspy/;;
- us2| us2.*)
- IRSPYDIR=/home/wosch/indexdata/irspy/
+ your-development-machine )
+ IRSPYDIR=/home/foobar/indexdata/irspy/
logfile=$IRSPYDIR/irspy-zebra
pidfile=$IRSPYDIR/irspy-zebra.pid
;;
echo "Usage: $0 start|stop|restart" >&2
;;
esac
+
--- /dev/null
+<?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">
+ <directory>./</directory>
+ <config>zebra-test.cfg</config>
+ <cql2rpn>pqf.properties</cql2rpn>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zeerex.xml">
+ <xi:fallback>
+ <explain xmlns="http://explain.z3950.org/dtd/2.0/">
+ <serverInfo>
+ <host>localhost</host>
+ <port>8019</port>
+ <database>IR-Explain---2</database>
+ </serverInfo>
+ </explain>
+ </xi:fallback>
+ </xi:include>
+ </server>
+</yazgfs>
--- /dev/null
+
+# Where to look for config files
+#profilePath: .:/usr/local/share/idzebra-2.0/tab:/usr/share/idzebra-2.0/tab
+profilePath: .:/usr/share/idzebra-2.0/tab
+
+# Where to look for loadable zebra modules. Both these path components
+# are necessary, since the former is used when installing from a Debian
+# package and the latter when installing from a CVS build.
+modulePath: /usr/lib/idzebra-2.0/modules
+#modulePath: /usr/local/lib/idzebra-2.0/modules
+
+# store records and record keys internally
+storeData: 1
+storeKeys: 1
+
+# Use the "alvis" filter with config file "filterconf.xml"
+recordtype: alvis.filterconf.xml
+
+database: IR-Explain---2
+#database: Default
+
+# where to put registers, and other var content, and how large they may be
+register: db-test/register:100G
+shadow: db-test/shadow:100G
+lockdir: db-test/lock
+keytmpdir: db-test/tmp
+
+# Permissions for update
+perm.anonymous: ra
+perm.admin: rw
+passwd.c: htpasswd
+
-# $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
+#profilePath: .:/usr/local/share/idzebra-2.0/tab:/usr/share/idzebra-2.0/tab
+profilePath: .:/usr/share/idzebra-2.0/tab
# Where to look for loadable zebra modules. Both these path components
# are necessary, since the former is used when installing from a Debian
perm.anonymous: ra
perm.admin: rw
passwd.c: htpasswd
+
--- /dev/null
+<?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">
+ <host>localhost</host>
+ <port>8019</port>
+ <database>IR-Explain---2</database>
+ </serverInfo>
+
+ <databaseInfo>
+ <title lang="en" primary="true">IRSpy database of ZeeRex records</title>
+ <description lang="en" primary="true">
+ This is a database of enhanced ZeeRex records, maintained by IRSpy,
+ containing information about a selection of Z39.50 and SRU/SRW
+ databases that are periodically probed. The ZeeRex records are
+ extended using the extension mechanism described at
+ http://explain.z3950.org/dtd/extensions.html
+ so that the results of the tests are included alongside the
+ protocol-level information that is the core of ZeeRex.
+ </description>
+ <author>Index Data Aps, http://www.indexdata.com/</author>
+ <contact>Mike Taylor, mike@indexdata.com</contact>
+ <history lang="en" primary="true">
+ The initial version of this database was populated using the set of
+ targets known in Index Data's Z39.50 Target Directory:
+ http://targettest.indexdata.com/
+ The records may have been substantially altered and extended since
+ then, and new records may have been added.
+ </history>
+ <implementation identifier="zebra" version="1.4">
+ <title lang="en" primary="true">
+ Index Data's Zebra information management system:
+ http://www.indexdata.dk/zebra
+ </title>
+ </implementation>
+ </databaseInfo>
+
+ <indexInfo>
+ <set name="cql" identifier="info:srw/cql-context-set/1/cql-v1.1">
+ <title>CQL</title>
+ </set>
+ <set name="rec" identifier="info:srw/cql-context-set/2/rec-1.1">
+ <title>Record Metadata</title>
+ </set>
+ <set name="net" identifier="info:srw/cql-context-set/2/net-1.0">
+ <title>Network Metadata</title>
+ </set>
+ <set name="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
+ <title>Dublin Core</title>
+ </set>
+ <set name="zeerex" identifier="info:srw/cql-context-set/2/zeerex-1.1">
+ <title>ZeeRex</title>
+ </set>
+ <set name="bib1" identifier="1.2.840.10003.3.1">
+ <title>BIB-1</title>
+ </set>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Server choice</title>
+ <map><name set="cql">serverChoice</name></map>
+ <map><name set="cql">anywhere</name></map>
+ <map><attr type="1" set="bib1">cql:all</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Record identifier</title>
+ <map><name set="rec">id</name></map>
+ <map><attr type="1" set="bib1">rec:id</attr>
+ <attr type="4" set="bib1">3</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Protocol</title>
+ <map><name set="net">protocol</name></map>
+ <map><attr type="1" set="bib1">net:protocol</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Protocol version</title>
+ <map><name set="net">version</name></map>
+ <map><attr type="1" set="bib1">net:version</attr>
+ <attr type="4" set="bib1">3</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Protocol method</title>
+ <map><name set="net">method</name></map>
+ <map><attr type="1" set="bib1">net:method</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Host</title>
+ <map><name set="net">host</name></map>
+ <map><attr type="1" set="bib1">net:host</attr>
+ <attr type="4" set="bib1">3</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Port</title>
+ <map><name set="net">port</name></map>
+ <map><attr type="1" set="bib1">net:port</attr>
+ <attr type="4" set="bib1">3</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Path</title>
+ <map><name set="net">path</name></map>
+ <map><attr type="1" set="bib1">net:path</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Title</title>
+ <map><name set="dc">title</name></map>
+ <map><attr type="1" set="bib1">dc:title</attr></map>
+ </index>
+
+ <index search="true" scan="true" sort="false">
+ <title lang="en">Creator</title>
+ <map><name set="dc">creator</name></map>
+ <map><attr type="1" set="bib1">dc:creator</attr></map>
+ </index>
+ </indexInfo>
+
+ <!--
+ <recordInfo> is not allowed in the same record as <schemaInfo>,
+ because standard ZeeRex assumes that the record is describing
+ _either_ a Z39.50 database _or_ an SRW/SRU database, but not both.
+ We want to override that restriction, which will entail making a new
+ schema. Yuck.
+ -->
+
+ <schemaInfo>
+ <schema name="zeerex" retrieve="true" sort="false"
+ identifier="http://explain.z3950.org/dtd/2.0/"
+ location="http://explain.z3950.org/dtd/zeerex-2.0.xsd">
+ <title>ZeeRex 2.0</title>
+ </schema>
+ <schema name="index" retrieve="true" sort="false"
+ identifier="http://indexdata.dk/zebra/xslt/1">
+ <title lang="en" primary="true">Zebra indexing recipe</title>
+ </schema>
+ <schema name="id" retrieve="true" sort="false"
+ identifier="http://indexdata.dk/zebra/id/1">
+ <title lang="en" primary="true">Record identifier</title>
+ </schema>
+ </schemaInfo>
+
+ <configInfo>
+ <supports type="relation" xmlns:foo="http://foo.com/explain/" foo:bib1equiv="2=3">=</supports>
+ <supports type="relationModifier">relevant</supports>
+ <supports type="relationModifier">fuzzy</supports>
+ <supports type="relationModifier">regexp</supports>
+ <supports type="maskingCharacter">*</supports>
+ <supports type="maskingCharacter">?</supports>
+ <default type="contextSet">net</default>
+ <default type="index">cql.anywhere</default>
+
+ <!-- ### Many more <default>s, <setting>s and <supports>s to be added -->
+ </configInfo>
+
+ <irspy:status xmlns:irspy="http://indexdata.com/irspy/1.0">
+ <irspy:implementationId>81</irspy:implementationId>
+ <irspy:implementationName>Zebra Information Server/GFS/YAZ</irspy:implementationName>
+ <irspy:implementationVersion>Zebra 2.0.1/1.98/2.1.30</irspy:implementationVersion>
+ <irspy:availability>
+ <irspy:probe ok="0">2006-07-10T11:45:06</irspy:probe>
+ <irspy:probe ok="1">2006-07-17T11:45:02</irspy:probe>
+ <!-- Leave it to applications to calculate averages, etc. -->
+ </irspy:availability>
+ </irspy:status>
+</explain>