read database name from config
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 14 Apr 2010 13:49:41 +0000 (13:49 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 14 Apr 2010 13:49:41 +0000 (13:49 +0000)
web/htdocs/details/ap.mc
web/htdocs/details/check.mc
web/htdocs/details/delete.mc
web/htdocs/details/edit.mc
web/htdocs/details/found.mc
web/htdocs/details/full.mc
web/htdocs/details/stats.mc
web/htdocs/details/upload.mc
web/htdocs/raw.html

index abec956..51ba3ea 100644 (file)
@@ -4,7 +4,8 @@ $id
 $set
 </%args>
 <%perl>
-my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1");
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $conn = new ZOOM::Connection($db);
 $conn->option(elementSetName => "zeerex");
 my $query = cql_target($id);
 my $rs = $conn->search(new ZOOM::Query::CQL($query));
index 1c23f7a..7d22a03 100644 (file)
@@ -33,7 +33,8 @@ $m->flush_buffer();
 # on in the HTTP configuration, so we don't even try -- instead,
 # having ZOOM::IRSpy::Web::log() explicitly calling $m->flush_buffer()
 
-my $spy = new ZOOM::IRSpy::Web("localhost:8018/IR-Explain---1",
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $spy = new ZOOM::IRSpy::Web($db,
                               admin => "fruitbat");
 $spy->log_init_level($YAZ_LOG);
 $spy->targets(@id) if !$allTargets;
index 2b7effd..981f8b2 100644 (file)
@@ -15,7 +15,8 @@ $really => 0
      </p>
 % } else {
 <%perl>
-    my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1", 0,
+    my $db = ZOOM::IRSpy::connect_to_registry();
+    my $conn = new ZOOM::Connection($db, 0,
                                    user => "admin", password => "fruitbat",
                                    elementSetName => "zeerex");
     ZOOM::IRSpy::_delete_record($conn, $id);
index e0403a4..3ee62b4 100644 (file)
@@ -32,7 +32,8 @@ duplicate ID.
 die "op = new but id defined" if $op eq "new" && defined $id;
 die "op != new but id undefined" if $op ne "new" && !defined $id;
 
-my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1", 0,
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $conn = new ZOOM::Connection($db, 0,
                                user => "admin", password => "fruitbat",
                                elementSetName => "zeerex");
 
index 0f44196..443181e 100644 (file)
@@ -54,7 +54,8 @@ if ($sort) {
 my $tried_to_open = 0;
 if (!defined $conn) {
   OPEN:
-    $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1");
+    my $db = ZOOM::IRSpy::connect_to_registry();
+    $conn = new ZOOM::Connection($db);
     $conn->option(elementSetName => "zeerex");
     $conn->option(count => 20);
 }
index 73836a1..baec260 100644 (file)
@@ -3,7 +3,8 @@
 $id
 </%args>
 <%perl>
-my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1");
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $conn = new ZOOM::Connection($db);
 $conn->option(elementSetName => "zeerex");
 my $query = cql_target($id);
 my $rs = $conn->search(new ZOOM::Query::CQL($query));
index c01c302..f44c349 100644 (file)
@@ -27,7 +27,8 @@ my $from_cache = 1;
 my $stats = $m->cache->get($key);
 if (!defined $stats || $reload) {
     $from_cache = 0;
-    $stats = new ZOOM::IRSpy::Stats("localhost:8018/IR-Explain---1", $query);
+    my $db = ZOOM::IRSpy::connect_to_registry();
+    $stats = new ZOOM::IRSpy::Stats($db, $query);
     $m->cache->set($key, $stats, "1 day");
 }
 </%perl>
index 3809292..c32df58 100644 (file)
@@ -48,7 +48,8 @@ if (!defined $fin) {
 my $xml = join("", <$fin>);
 my $xc = irspy_xpath_context($xml);
 my $id = irspy_record2identifier($xc);
-my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1", 0,
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $conn = new ZOOM::Connection($db, 0,
                                user => "admin", password => "fruitbat",
                                elementSetName => "zeerex");
 ZOOM::IRSpy::_rewrite_zeerex_record($conn, $xc->getContextNode());
index a198880..f279843 100644 (file)
@@ -7,7 +7,8 @@ use ZOOM;
 use ZOOM::IRSpy::Utils qw(cql_target);
 </%once>
 <%perl>
-my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1");
+my $db = ZOOM::IRSpy::connect_to_registry();
+my $conn = new ZOOM::Connection($db);
 $conn->option(elementSetName => "zeerexNoAuth");
 my $rs = $conn->search(new ZOOM::Query::CQL(cql_target($id)));
 my $n = $rs->size();