X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffull.mc;h=8819d4598d6b8b5de152f4ba8f56a0cb8095a7dd;hb=e891d0b90fe44f4b8f7b2d59289c35f352f701de;hp=8cb48632547c8cd3c4f93f1d2067e70a57fadb75;hpb=e8a3ce9f6d7d213621575e8923ed07dfab35885b;p=irspy-moved-to-github.git
diff --git a/web/htdocs/details/full.mc b/web/htdocs/details/full.mc
index 8cb4863..8819d45 100644
--- a/web/htdocs/details/full.mc
+++ b/web/htdocs/details/full.mc
@@ -1,4 +1,4 @@
-%# $Id: full.mc,v 1.21 2007-01-24 09:28:02 mike Exp $
+%# $Id: full.mc,v 1.24 2007-04-16 12:23:46 mike Exp $
<%args>
$id
%args>
@@ -54,8 +54,9 @@ if ($n == 0) {
[ "Record syntaxes" => \&calc_recsyn, $xc ],
[ "Explain" => \&calc_explain, $xc ],
);
+ my $title = $xc->find("e:databaseInfo/e:title");
%perl>
-
<% xml_encode($xc->find("e:databaseInfo/e:title"), "") %>
+ <% xml_encode($title, "") %>
<%perl>
foreach my $ref (@fields) {
@@ -75,6 +76,15 @@ if ($n == 0) {
% }
% }
+
+ ">Search this target.
+
% }
<%perl>
@@ -107,28 +117,23 @@ sub calc_init_options {
sub calc_ap {
my($xc, $set) = @_;
- my $expr = 'e:indexInfo/e:index/e:map/e:attr[
- @set = "'.$set.'" and @type = "1"]';
- my @bib1nodes = $xc->findnodes($expr);
- my $nbib1 = @bib1nodes;
- return "[none]" if $nbib1 == 0;
+ my @aps = list_ap($xc, $set);
+ my $n = @aps;
+ return "[none]" if $n == 0;
my $res = "";
my($first, $last);
- @bib1nodes = sort { $a->findvalue(".") <=> $b->findvalue(".") } @bib1nodes;
- foreach my $node (@bib1nodes) {
- my $ap .= $node->findvalue(".");
+ foreach my $ap (@aps) {
if (!defined $first) {
- $first = $ap;
- } elsif (!defined $last || $last == $ap-1) {
- $last = $ap;
+ $first = $last = $ap;
+ } elsif ($ap == $last+1) {
+ $last++;
} else {
# Got a complete range
$res .= ", " if $res ne "";
$res .= "$first";
- $res .= "-$last" if defined $last;
- $first = $ap;
- $last = undef;
+ $res .= "-$last" if $last > $first;
+ $first = $last = $ap;
}
}
@@ -136,10 +141,19 @@ sub calc_ap {
if (defined $first) {
$res .= ", " if $res ne "";
$res .= "$first";
- $res .= "-$last" if defined $last;
+ $res .= "-$last" if $last > $first;
}
- return "$nbib1 access points: $res";
+ return "$n access points: $res";
+}
+
+sub list_ap {
+ my($xc, $set) = @_;
+
+ my $expr = 'e:indexInfo/e:index[@search = "true"]/e:map/e:attr[
+ @set = "'.$set.'" and @type = "1"]';
+ my @nodes = $xc->findnodes($expr);
+ return sort { $a <=> $b } map { $_->findvalue(".") } @nodes;
}
sub calc_boolean {
@@ -162,10 +176,11 @@ sub calc_nrs {
}
sub calc_recsyn {
- my($xc) = @_;
+ my($xc, $sep) = @_;
+ $sep = ", " if !defined $sep;
my @nodes = $xc->findnodes('e:recordInfo/e:recordSyntax');
- my $res = join(", ", map { $_->findvalue('@name') } @nodes);
+ my $res = join($sep, map { $_->findvalue('@name') } @nodes);
$res = "[none]" if $res eq "";
return $res;
}
@@ -178,5 +193,4 @@ sub calc_explain {
$res = "[none]" if $res eq "";
return $res;
}
-
%perl>