[open-ils-commits] r14072 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Search (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Sep 21 11:10:57 EDT 2009
Author: miker
Date: 2009-09-21 11:10:55 -0400 (Mon, 21 Sep 2009)
New Revision: 14072
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
Log:
properly populate %services hash of configured Z servers
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm 2009-09-21 14:57:17 UTC (rev 14071)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm 2009-09-21 15:10:55 UTC (rev 14072)
@@ -86,9 +86,19 @@
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('REMOTE_Z3950_QUERY');
+ return fetch_service_defs();
+}
+
+# -------------------------------------------------------------------
+# What services do we have config info for?
+# -------------------------------------------------------------------
+sub fetch_service_defs {
+
+ $sclient = OpenSRF::Utils::SettingsClient->new();
my $hash = $sclient->config_value('z3950', 'services');
# overlay config file values with in-db values
+ my $e = new_editor();
if($e->can('search_config_z3950_source')) {
my $sources = $e->search_config_z3950_source(
@@ -139,6 +149,7 @@
}
};
+ %services = %$hash; # cache these internally so we can actually use the db-configured sources
return $hash;
}
@@ -147,11 +158,9 @@
# -------------------------------------------------------------------
# Load the pre-defined Z server configs
# -------------------------------------------------------------------
-sub initialize {
- $sclient = OpenSRF::Utils::SettingsClient->new();
- $default_service = $sclient->config_value("z3950", "default" );
- my $servs = $sclient->config_value("z3950", "services" );
- $services{$_} = $$servs{$_} for keys %$servs;
+sub child_init {
+ fetch_service_defs();
+ $default_service = $sclient->config_value("z3950", "default" );
}
More information about the open-ils-commits
mailing list