1 %# $Id: edit.mc,v 1.2 2006-10-27 00:47:24 mike Exp $
9 my $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1");
10 $conn->option(elementSetName => "zeerex");
13 my $query = qq[rec.id="$qid"];
14 my $rs = $conn->search(new ZOOM::Query::CQL($query));
17 $m->comp("/details/error.mc",
18 title => "Error", message => "No such ID '$id'");
20 my $rec = $rs->record(0);
21 my $xc = irspy_xpath_context($rec);
24 [ protocol => 0, "Protocol", "e:serverInfo/\@protocol" ],
25 [ host => 0, "Host", "e:serverInfo/e:host" ],
26 [ port => 0, "Port", "e:serverInfo/e:port" ],
27 [ dbname => 0, "Database Name", "e:serverInfo/e:database" ],
28 [ username => 0, "Username (if needed)", "e:serverInfo/e:authentication/e:user" ],
29 [ password => 0, "Password (if needed)", "e:serverInfo/e:authentication/e:password" ],
30 [ title => 0, "title", "e:databaseInfo/e:title", lang => "en", primary => "true" ],
31 [ description => 5, "Description", "e:databaseInfo/e:description", lang => "en", primary => "true" ],
32 [ author => 0, "Author", "e:databaseInfo/e:author" ],
33 [ contact => 0, "Contact", "e:databaseInfo/e:contact" ],
34 [ extent => 3, "Extent", "e:databaseInfo/e:extent" ],
35 [ history => 5, "History", "e:databaseInfo/e:history" ],
36 [ language => 0, "Language of Records", "e:databaseInfo/e:langUsage" ],
37 [ restrictions => 2, "Restrictions", "e:databaseInfo/e:restrictions" ],
38 [ subjects => 2, "Subjects", "e:databaseInfo/e:subjects" ],
39 ### Remember to set e:metaInfo/e:dateModified
42 <h2><% xml_encode($id) %></h2>
43 <form method="get" action="">
44 <table class="fullrecord" border="1" cellspacing="0" cellpadding="5" width="100%">
46 foreach my $ref (@fields) {
47 my($name, $nlines, $caption, $xpath, %attrs) = @$ref;
50 <th><% $caption %></th>
52 % my $data = xml_encode($xc->find($xpath));
54 <textarea name="<% $name %>" rows="<% $nlines %>" cols="61"><% $data %></textarea>
56 <input name="<% $name %>" type="text" size="60" value="<% $data %>">
64 <input type="submit" name="update" value="Update"/>
65 <input type="hidden" name="id" value="<% xml_encode($id) %>"/>