X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=28f46dbcd772b4e3864206bdcc21dc9a7415be75;hb=a3469316429c0585c2ca3439ca023c74106bb2a0;hp=c3ed2245e04a01a7ee6afd9aae8e55e9f68881fb;hpb=eab6d13888c7950df57196f9efe918471ddc7fd5;p=irspy-moved-to-github.git
diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc
index c3ed224..28f46db 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.11 2006-11-15 17:56:23 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/form.mc", id => undef, conn => $conn,
+ rec => '
The record has been updated.
\n" if defined $update; - -% }