1 %# $Id: delete.mc,v 1.6 2007-04-25 13:28:42 mike Exp $
9 Are you sure you want to delete the target
10 <% xml_encode($id) %>?
13 <a href="?really=1&id=<% xml_encode(uri_escape($id)) %>">Yes</a><br/>
14 <a href="/full.html?id=<% xml_encode(uri_escape($id)) %>">No</a><br/>
18 # We can't delete records using recordIdOpaque, since character
19 # sets are handled differently here in extended services from how
20 # they are used in the Alvis filter's record-parsing, and so
21 # non-ASCII characters come out differently in the two contexts.
22 # Instead, we must send a record whose contents indicate the ID of
23 # that which we wish to delete. There are two ways, both
24 # unsatisfactory: we could either fetch the actual record them
25 # resubmit it in the deletion request (which wastes a search and a
26 # fetch) or we could build a record by hand from the parsed-out
27 # components (which is error-prone and which I am not 100% certain
28 # will work since the other contents of the record will be
29 # different). The former evil seems to be the lesser.
30 my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1", 0,
31 user => "admin", password => "fruitbat",
32 elementSetName => "zeerex");
33 my $rs = $conn->search(new ZOOM::Query::CQL(cql_target($id)));
34 if ($rs->size() == 0) {
35 $m->comp("/details/error.mc",
36 title => "Error", message => "No such ID '$id'");
39 my $rec = $rs->record(0);
40 my $xml = $rec->render();
42 my $p = $conn->package();
43 $p->option(action => "recordDelete");
44 $p->option(record => $xml);
48 $p = $conn->package();