-%# $Id: edit.mc,v 1.29 2007-03-29 16:19:39 mike Exp $
+%# $Id: edit.mc,v 1.31 2007-04-27 14:32:09 mike Exp $
<%args>
$op
$id => undef
} else {
# No ID supplied -- this is a brand new record
+ my $protocol = $r->param("protocol");
my $host = $r->param("host");
my $port = $r->param("port");
my $dbname = $r->param("dbname");
- if (!defined $host || $host eq "" ||
+ if (!defined $protocol || $protocol eq "" ||
+ !defined $host || $host eq "" ||
!defined $port || $port eq "" ||
!defined $dbname || $dbname eq "") {
print qq[<p class="error">
-You must specify host, port and database name.</p>\n] if $update;
+You must specify protocol, host, port and database name.</p>\n] if $update;
undef $update;
} else {
- my $query = cql_target($host, $port, $dbname);
+ ### Should use a utility function for this
+ my $query = cql_target($protocol, $host, $port, $dbname);
my $rs = $conn->search(new ZOOM::Query::CQL($query));
if ($rs->size() > 0) {
- my $fakeid = xml_encode(uri_escape("$host:$port/$dbname"));
+ my $fakeid =
+ xml_encode(uri_escape(irspy_make_identifier($protocol, $host,
+ $port, $dbname)));
print qq[<p class="error">
There is already
<a href='?op=edit&id=$fakeid'>a record</a>
qw() ],
[ country => $m->comp("country-list.mc"),
"Country", "i:status/i:country" ],
- [ protocol => [ qw(Z39.50 SRW SRU SRW/U) ],
+ [ protocol => [ qw(Z39.50 SRW SRU) ],
"Protocol", "e:serverInfo/\@protocol" ],
[ host => 0, "Host", "e:serverInfo/e:host" ],
[ port => 0, "Port", "e:serverInfo/e:port" ],