From: Wolfram Schneider Date: Wed, 14 Apr 2010 13:49:41 +0000 (+0000) Subject: read database name from config X-Git-Tag: CPAN-v1.02~135 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=0ab30e7e20933507512444aed53bcb4ba84003b1 read database name from config --- 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();