From 972eca24396c60c078b458c6873b757780482227 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 14 Apr 2010 13:49:41 +0000 Subject: [PATCH] read database name from config --- web/htdocs/details/ap.mc | 3 ++- web/htdocs/details/check.mc | 3 ++- web/htdocs/details/delete.mc | 3 ++- web/htdocs/details/edit.mc | 3 ++- web/htdocs/details/found.mc | 3 ++- web/htdocs/details/full.mc | 3 ++- web/htdocs/details/stats.mc | 3 ++- web/htdocs/details/upload.mc | 3 ++- web/htdocs/raw.html | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/web/htdocs/details/ap.mc b/web/htdocs/details/ap.mc index abec956..51ba3ea 100644 --- a/web/htdocs/details/ap.mc +++ b/web/htdocs/details/ap.mc @@ -4,7 +4,8 @@ $id $set <%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)); diff --git a/web/htdocs/details/check.mc b/web/htdocs/details/check.mc index 1c23f7a..7d22a03 100644 --- a/web/htdocs/details/check.mc +++ b/web/htdocs/details/check.mc @@ -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; diff --git a/web/htdocs/details/delete.mc b/web/htdocs/details/delete.mc index 2b7effd..981f8b2 100644 --- a/web/htdocs/details/delete.mc +++ b/web/htdocs/details/delete.mc @@ -15,7 +15,8 @@ $really => 0

% } 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); diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index e0403a4..3ee62b4 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -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"); diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 0f44196..443181e 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -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); } diff --git a/web/htdocs/details/full.mc b/web/htdocs/details/full.mc index 73836a1..baec260 100644 --- a/web/htdocs/details/full.mc +++ b/web/htdocs/details/full.mc @@ -3,7 +3,8 @@ $id <%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)); diff --git a/web/htdocs/details/stats.mc b/web/htdocs/details/stats.mc index c01c302..f44c349 100644 --- a/web/htdocs/details/stats.mc +++ b/web/htdocs/details/stats.mc @@ -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"); } diff --git a/web/htdocs/details/upload.mc b/web/htdocs/details/upload.mc index 3809292..c32df58 100644 --- a/web/htdocs/details/upload.mc +++ b/web/htdocs/details/upload.mc @@ -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()); diff --git a/web/htdocs/raw.html b/web/htdocs/raw.html index a198880..f279843 100644 --- a/web/htdocs/raw.html +++ b/web/htdocs/raw.html @@ -7,7 +7,8 @@ use ZOOM; use ZOOM::IRSpy::Utils qw(cql_target); <%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(); -- 1.7.10.4