New
authorMike Taylor <mike@indexdata.com>
Tue, 2 Jan 2007 17:26:53 +0000 (17:26 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 2 Jan 2007 17:26:53 +0000 (17:26 +0000)
web/htdocs/delete.html [new file with mode: 0644]
web/htdocs/details/delete.mc [new file with mode: 0644]

diff --git a/web/htdocs/delete.html b/web/htdocs/delete.html
new file mode 100644 (file)
index 0000000..7485e71
--- /dev/null
@@ -0,0 +1,7 @@
+%# $Id: delete.html,v 1.1 2007-01-02 17:26:53 mike Exp $
+<%args>
+$id => undef
+</%args>
+<& /chrome/layout.mc, %ARGS,
+    title => "Delete target record",
+    component => "/details/delete.mc" &>
diff --git a/web/htdocs/details/delete.mc b/web/htdocs/details/delete.mc
new file mode 100644 (file)
index 0000000..5a75bbf
--- /dev/null
@@ -0,0 +1,36 @@
+%# $Id: delete.mc,v 1.1 2007-01-02 17:27:08 mike Exp $
+<%args>
+$id
+$really => 0
+</%args>
+% if (!$really) {
+     <h2>Warning</h2>
+     <p class="error">
+      Are you sure you want to delete the target
+      <% xml_encode($id) %>?
+     </p>
+     <p>
+      <a href="?really=1&amp;id=<% xml_encode(uri_escape($id)) %>">Yes</a><br/>
+      <a href="/">No</a><br/>
+     </p>
+% } else {
+<%perl>
+    my $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1", 0,
+                                   user => "admin", password => "fruitbat",
+                                   elementSetName => "zeerex");
+    # I am thinking that ZOOM should provide delete(), update(), etc.
+    my $p = $conn->package();
+    $p->option(action => "recordDelete");
+    $p->option(recordIdOpaque => $id);
+    $p->send("update");
+    $p->destroy();
+
+    $p = $conn->package();
+    $p->send("commit");
+    $p->destroy();
+</%perl>
+     <p>
+      Deleted record
+      <% xml_encode($id) %>
+     </p>
+% }