From a5120e0827303aa4e92d0432203514dad5841b7c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 15 Sep 2006 16:51:50 +0000 Subject: [PATCH] New --- web/htdocs/all.html | 3 ++ web/htdocs/details/all.mc | 17 +++++++++ web/htdocs/details/find.mc | 78 ++++++++++++++++++++++++++++++++++++++++++ web/htdocs/details/found.mc | 72 ++++++++++++++++++++++++++++++++++++++ web/htdocs/find.html | 3 ++ web/htdocs/valid-xhtml10.png | Bin 0 -> 2414 bytes web/htdocs/vcss.png | Bin 0 -> 942 bytes 7 files changed, 173 insertions(+) create mode 100644 web/htdocs/all.html create mode 100644 web/htdocs/details/all.mc create mode 100644 web/htdocs/details/find.mc create mode 100644 web/htdocs/details/found.mc create mode 100644 web/htdocs/find.html create mode 100644 web/htdocs/valid-xhtml10.png create mode 100644 web/htdocs/vcss.png 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 0000000000000000000000000000000000000000..2275ee6ea17da3a4c67a5d90c2f2105bc0d6c5a0 GIT binary patch literal 2414 zcmbVNX;2f{7H-8QAWIODU~n`nVqipj2Gj;bX`?`kfGr|4qYzsVCn7@Qf~~j^Hfd)> zn-Mi2E>Q=K8%9xVQNW<`XaTj|FfKSoRA>apxQ%(Kd9SAC*VLg_1e7?aP$)DM%n^`I zg_w9A$8lBxvN)(w;HXlopcx24R9a3Y0CWn43IKF!jMlPRNCZKU8kLGf0-A(K925x! zGy#Di$fyvFM5x#60gz;9L?{3#1qet}A{3}pA|x=-#3^7qv_CIi8!Fd<575s6SJWLQ1J zFc6^@AQXxskU}jG2v7u(m=m;Gy%q;xCB1R#LGv!&%S0pQ{$~nPfoWNo$&~qD@1Mc? zuW;61?EfSS{-F-|TTEaw$^Pd44>UcfED-<(GGVgd=rs>YVu})m&2SmjRP#nY^TC#i zIRoMfEMK{Kdzfkq@ z<=3+8?`u|{6TNTco7rwQ+gMZkaZ0kSBk{(5+SN0p>)Si@M!zT1ug0B9qEFh-bQcXi zxo3XCfDZdh;@_j}Dtpw|V&2Tm^i(@iVE=UyCq!br;TflQw2%$PgTVHmx}UN`Cmh4P>C+b$TT>%9`kEIZNJu1_`{p73S$s^MM6&4OFC*OOzFXH#e2A1Vrx z-8=0f+Or%|e0h$2w}Oz!JGZ;wF3FW+a>6LNzkT%SU!N4E6B$!}+saw^MlS!CO|0G5 z@Vs^0?Snr$oi7z%yDHCUUv~kAx{549x_MKqnpn)x;?yU~q zcEv5k#WytJtY7z*-NDvVYS%O@vWHGyZWWF4+Lsx4I^j2(OyVxS56@>aXAVI61sLC06LqmCfTT^sdd; z39l!Khb39WchxuF$g^0Q+q~o&(iEU-XR3}JKXEMm?2^Ni{DbF2uFdEXJ8%Brus8AN zoJr+T^1Je)l<|FRUb@wj-8peFGoe+*&a|vMG@0TyR_0d>Km2$rzUA z-!N{_*{i3|ywA38AWmk818OsE1p(70jl8R$+D;v@wtIQ2A?>iZZoOUHJU{;J^nrp6 zf?n@b+8=Nb1r2>Om+v)xF=c z*&`?HVk-h~T~-LX8Z*9wKW_SwrX*`4#pAxVgI0gU+yq}XrN-IVq?bSG%k1Go3O!FO z9N)%ywo}-IISUHv)xu{X^|9>qqT%Oux9q1EFDMNk>eIRFN!`4}r1kJgrH(v)W$jw@ z7<19pTLen(o>ZiJpE@+Q)FaMub9_sZPy6n?s0UKoCAKiHx3~9-UO8X}tTQap7I1ILGop zxuz!TapO_#@ms@Z&0<=gAkc zaC^GD<7O~+W>MH8@vCP+FPy#7ZnWl>>@j~N~=^S=R$XZ5)N literal 0 HcmV?d00001 diff --git a/web/htdocs/vcss.png b/web/htdocs/vcss.png new file mode 100644 index 0000000000000000000000000000000000000000..fb0576feaef58d1a4b6f48e4555a5cf85744edf6 GIT binary patch literal 942 zcmV;f15x~mP)fQkzw3*RX+Yg=Y2(!Z6!}9X(-o@?tNDliQu)L?P>@0zcoU2(-|i^xBJta^Nwh&?s-O%m>d-#d;|+HDFOJ`$MI zjE@%A9;cyLw>i#p4CcgNpF literal 0 HcmV?d00001 -- 1.7.10.4