X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=d6503f58cf28a65550ee8884934a88d0c0a2d851;hb=4acbaca13cccb53c6c8f972bebcfc7f8b3147e58;hp=c3ed2245e04a01a7ee6afd9aae8e55e9f68881fb;hpb=ae0b54d2d61c60d5a397c58e067e5177ee04f65a;p=irspy-moved-to-github.git
diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc
index c3ed224..d6503f5 100644
--- a/web/htdocs/details/edit.mc
+++ b/web/htdocs/details/edit.mc
@@ -1,6 +1,6 @@
-%# $Id: edit.mc,v 1.4 2006-10-27 17:16:20 mike Exp $
+%# $Id: edit.mc,v 1.10 2006-11-14 14:54:41 mike Exp $
<%args>
-$id
+$id => undef
%args>
<%once>
use ZOOM;
@@ -8,96 +8,22 @@ use ZOOM;
<%perl>
my $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1", 0,
user => "admin", password => "fruitbat");
-$conn->option(elementSetName => "zeerex");
-my $qid = $id;
-$qid =~ s/"/\\"/g;
-my $query = qq[rec.id="$qid"];
-my $rs = $conn->search(new ZOOM::Query::CQL($query));
-my $n = $rs->size();
-if ($n == 0) {
- $m->comp("/details/error.mc",
- title => "Error", message => "No such ID '$id'");
+if (!defined $id || $id eq "") {
+ $m->comp("/details/form.mc", id => undef, conn => $conn,
+ rec => '
\n";
- } elsif ($node->isa("XML::LibXML::Element")) {
- my $child = $node->firstChild();
- die "element child $child is not text"
- if !ref $child || !$child->isa("XML::LibXML::Text");
- $child->setData($value);
- print "Elem $key <- '$value' ($xpath)
\n";
- } else {
- warn "unexpected node type $node";
- }
- } else {
- print "$key='$value' ($xpath) no nodes
\n";
- ### Make new node ... heaven knows how ...
- }
- }
- ZOOM::IRSpy::_really_rewrite_record($conn, $xc->getContextNode());
+ $conn->option(elementSetName => "zeerex");
+ my $qid = $id;
+ $qid =~ s/"/\\"/g;
+ my $query = qq[rec.id="$qid"];
+ my $rs = $conn->search(new ZOOM::Query::CQL($query));
+ my $n = $rs->size();
+ if ($n == 0) {
+ $m->comp("/details/error.mc",
+ title => "Error", message => "No such ID '$id'");
+ } else {
+ my $rec = $rs->record(0);
+ $m->comp("/details/form.mc", id => $id, conn => $conn, rec => $rec);
}
+}
%perl>
-
The record has been updated.
\n" if defined $update; - -% }