From: Bill Erickson Date: Mon, 4 Aug 2014 15:44:33 +0000 (-0400) Subject: LP#1347774 IDL path from public API X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fmiker%2Flp-1347774-anon_pcrud_mode;p=working%2FEvergreen.git LP#1347774 IDL path from public API Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index d6f616e136..9c926799e6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -2191,5 +2191,15 @@ sub check_open_xact { return undef; } +# Returns the path to the IDL file. Useful for public-only +# clients, like Apache clients. +sub get_idl_path { + my $class = shift; + my $service = shift || 'open-ils.actor'; # generally a safe bet + return $class->simplereq( + $service, 'opensrf.open-ils.fetch_idl.file'); +} + + 1; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/IDL2js.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/IDL2js.pm index 497b0dbc16..c7a67ecd5b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/IDL2js.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/IDL2js.pm @@ -11,6 +11,7 @@ use APR::Bucket; use Error qw/:try/; use OpenSRF::System; use OpenSRF::Utils::SettingsClient; +use OpenILS::Application::AppUtils; use CGI; my $bs_config; @@ -38,7 +39,7 @@ sub child_init { } $xsl_file = $sclient->config_value(dirs => 'xsl')."/$xsl_file"; - my $idl_file = $sclient->config_value("IDL"); + my $idl_file = OpenILS::Application::AppUtils->get_idl_path; my $xslt = XML::LibXSLT->new(); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PhoneList.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PhoneList.pm index 6e6c9fd7b1..3651b75d1b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PhoneList.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PhoneList.pm @@ -29,7 +29,6 @@ use Apache2::RequestUtil; use CGI; use OpenSRF::System; -use OpenSRF::Utils::SettingsClient; use OpenSRF::Utils::Logger qw/$logger/; use OpenILS::Utils::Fieldmapper; use OpenILS::Application::AppUtils; @@ -51,7 +50,7 @@ sub import { sub child_init { OpenSRF::System->bootstrap_client(config_file => $bootstrap); - my $idl = OpenSRF::Utils::SettingsClient->new->config_value("IDL"); + my $idl = $U->get_idl_path; Fieldmapper->import(IDL => $idl); OpenILS::Utils::CStoreEditor->init; return Apache2::Const::OK; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index 873b956498..88b74b6cf7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -148,7 +148,7 @@ sub import { sub child_init { OpenSRF::System->bootstrap_client( config_file => $bootstrap ); - my $idl = OpenSRF::Utils::SettingsClient->new->config_value("IDL"); + my $idl = $U->get_idl_path; Fieldmapper->import(IDL => $idl); $supercat = OpenSRF::AppSession->create('open-ils.supercat'); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm index 5f46799545..3780f14e5e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm @@ -27,6 +27,7 @@ use Encode; use Unicode::Normalize; use OpenILS::Utils::Fieldmapper; use OpenSRF::Utils::Logger qw/$logger/; +use OpenILS::Application::AppUtils; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'UTF-8' ); @@ -47,7 +48,7 @@ sub import { sub child_init { OpenSRF::System->bootstrap_client( config_file => $bootstrap ); - Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL")); + Fieldmapper->import(IDL => OpenILS::Application::AppUtils->get_idl_path); return Apache2::Const::OK; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm index 43e99e4a61..a1452ce553 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm @@ -17,6 +17,7 @@ use OpenSRF::System; use OpenSRF::Utils::Cache; use OpenSRF::Utils::Logger qw/$logger/; use OpenSRF::Utils::SettingsClient; +use OpenILS::Application::AppUtils; use RPC::XML qw/smart_encode/; use RPC::XML::Parser; @@ -41,7 +42,7 @@ sub child_init { OpenSRF::AppSession->ingress('xmlrpc'); OpenSRF::System->bootstrap_client( config_file => $bs_config ); my $sclient = OpenSRF::Utils::SettingsClient->new(); - my $idl = $sclient->config_value("IDL"); + my $idl = OpenILS::Application::AppUtils->get_idl_path; $services = $sclient->config_value("xml-rpc", "allowed_services", "service"); $services = ref $services ? $services : [ $services ]; $logger->debug("XML-RPC: allowed services @$services");