New
authorMike Taylor <mike@indexdata.com>
Thu, 28 Jun 2007 12:19:28 +0000 (12:19 +0000)
committerMike Taylor <mike@indexdata.com>
Thu, 28 Jun 2007 12:19:28 +0000 (12:19 +0000)
web/htdocs/ap.html [new file with mode: 0644]
web/htdocs/details/ap.mc [new file with mode: 0644]

diff --git a/web/htdocs/ap.html b/web/htdocs/ap.html
new file mode 100644 (file)
index 0000000..05401aa
--- /dev/null
@@ -0,0 +1,6 @@
+%# $Id: ap.html,v 1.1 2007-06-28 12:19:28 mike Exp $
+<%args>
+$set
+</%args>
+<& /chrome/layout.mc, %ARGS, title => uc($set) . " access points",
+    component => "/details/ap.mc" &>
diff --git a/web/htdocs/details/ap.mc b/web/htdocs/details/ap.mc
new file mode 100644 (file)
index 0000000..abec956
--- /dev/null
@@ -0,0 +1,43 @@
+%# $Id: ap.mc,v 1.1 2007-06-28 12:19:37 mike Exp $
+<%args>
+$id
+$set
+</%args>
+<%perl>
+my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1");
+$conn->option(elementSetName => "zeerex");
+my $query = cql_target($id);
+my $rs = $conn->search(new ZOOM::Query::CQL($query));
+my $n = $rs->size();
+if ($n == 0) {
+    return $m->comp("/details/error.mc",
+                   title => "Error", message => "No such ID '$id'");
+}
+
+my $xc = irspy_xpath_context($rs->record(0));
+my $title = $xc->find("e:databaseInfo/e:title");
+</%perl>
+     <h2><% xml_encode($title, "") %></h2>
+<%perl>
+my $expr = 'e:indexInfo/e:index[@search = "true"]/e:map/e:attr[
+       @set = "'.$set.'" and @type = "1"]';
+my @nodes = $xc->findnodes($expr);
+my @aps = sort { $a <=> $b } map { $_->findvalue(".") } @nodes;
+
+$n = @aps;
+if ($n == 0) {
+    print "     [none]\n";
+    return;
+}
+</%perl>
+     <table class="fullrecord" border="1" cellspacing="0" cellpadding="5" width="100%">
+% foreach my $ap (@aps) {
+% my $name = "[unknown]";
+% $name = bib1_access_point($ap) if $set eq "bib-1";
+% ### Should support translation of other attribute sets' access points
+      <tr>
+       <th><% $ap %></th>
+       <td><% xml_encode($name) %></td>
+      </tr>
+% }
+     </table>