From: Mike Taylor Date: Fri, 15 Sep 2006 16:51:50 +0000 (+0000) Subject: New X-Git-Tag: CPAN-v1.02~54^2~1065 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=d13b3c4a81cd7d20ed47d48d773739d8427c41f4;ds=sidebyside New --- diff --git a/web/htdocs/all.html b/web/htdocs/all.html new file mode 100644 index 0000000..b510693 --- /dev/null +++ b/web/htdocs/all.html @@ -0,0 +1,3 @@ +%# $Id: all.html,v 1.1 2006-09-15 16:51:50 mike Exp $ +<& /chrome/layout.mc, %ARGS, title => "Test all databases", + component => "/details/all.mc" &> diff --git a/web/htdocs/details/all.mc b/web/htdocs/details/all.mc new file mode 100644 index 0000000..4ec2d82 --- /dev/null +++ b/web/htdocs/details/all.mc @@ -0,0 +1,17 @@ +%# $Id: all.mc,v 1.1 2006-09-15 16:51:51 mike Exp $ +<%perl> +print "IRSpy version $ZOOM::IRSpy::VERSION
\n"; +my $spy = new ZOOM::IRSpy("localhost:1313/IR-Explain---1"); +if (1) { + # Testing all databases would take much too long for testing + my @targets = qw(bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager); + $spy->targets(join(" ", @targets)); +} +$spy->initialise(); +my $res = $spy->check(); +if ($res == 0) { + print "All tests were run\n"; +} else { + print "Some tests were skipped\n"; +} + diff --git a/web/htdocs/details/find.mc b/web/htdocs/details/find.mc new file mode 100644 index 0000000..56b8310 --- /dev/null +++ b/web/htdocs/details/find.mc @@ -0,0 +1,78 @@ +%# $Id: find.mc,v 1.1 2006-09-15 16:51:51 mike Exp $ +% if ($r->param("_search")) { +% $m->comp("found.mc"); +% } else { +

+ Choose one or more critera by which to search for registered + databases, then press the Search button. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
(Anywhere)
 
Protocol + +
Version
Method + +
 
Host
Port
Database
 
Title
Creator
 
+
+

+ + Show + + records, skipping the first + + +

+
+% } diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc new file mode 100644 index 0000000..2d690a9 --- /dev/null +++ b/web/htdocs/details/found.mc @@ -0,0 +1,72 @@ +%# $Id: found.mc,v 1.1 2006-09-15 16:51:51 mike Exp $ +<%once> +use XML::LibXML; +use XML::LibXML::XPathContext; + +<%perl> +my $query = ""; +foreach my $key ($r->param()) { + next if $key =~ /^_/; + my $val = $r->param($key); + next if $val eq ""; + $query .= " and " if $query ne ""; + $query .= "$key = ($val)"; +} + +### We can think about keeping the Connection object open to re-use +# for multiple requests, but that may not get us much. Same applies +# for the XML parser. +my $conn = new ZOOM::Connection("localhost:1313/IR-Explain---1"); +$conn->option(elementSetName => "zeerex"); +my $parser = new XML::LibXML(); + +my $rs = $conn->search(new ZOOM::Query::CQL($query)); +my $n = $rs->size(); + +my $skip = $r->param("_skip") || 0; +my $count = $r->param("_count") || 10; + +my $first = $skip+1; +my $last = $first+$count-1; +$last = $n if $last > $n; + +

+ <% $query %> +
+% if ($n == 0) { + No matches +% } elsif ($first > $n) { + Past end of <% $n %> records +% } else { + Records <% $first %> to <% $last %> of <% $n %> +% } +

+% if ($n > 0 && $first <= $n) { + + + + + + + +% foreach my $i ($first .. $last) { +<%perl> +my $rec = $rs->record($i-1); +my $xml = $rec->render(); +my $doc = $parser->parse_string($xml); +my $root = $doc->getDocumentElement(); +my $xc = XML::LibXML::XPathContext->new($root); +$xc->registerNs(e => 'http://explain.z3950.org/dtd/2.0/'); +my $host = $xc->find("e:serverInfo/e:host"); +my $port = $xc->find("e:serverInfo/e:port"); +my $db = $xc->find("e:serverInfo/e:database"); + + + + + + + +%} +
#HostPortDB
<% $i %><% $host %><% $port %><% $db %>
+% } diff --git a/web/htdocs/find.html b/web/htdocs/find.html new file mode 100644 index 0000000..e8e940a --- /dev/null +++ b/web/htdocs/find.html @@ -0,0 +1,3 @@ +%# $Id: find.html,v 1.1 2006-09-15 16:51:50 mike Exp $ +<& /chrome/layout.mc, %ARGS, title => "Find a database", + component => "/details/find.mc" &> diff --git a/web/htdocs/valid-xhtml10.png b/web/htdocs/valid-xhtml10.png new file mode 100644 index 0000000..2275ee6 Binary files /dev/null and b/web/htdocs/valid-xhtml10.png differ diff --git a/web/htdocs/vcss.png b/web/htdocs/vcss.png new file mode 100644 index 0000000..fb0576f Binary files /dev/null and b/web/htdocs/vcss.png differ