LP#1347774 IDL path from public API collab/miker/lp-1347774-anon_pcrud_mode
authorBill Erickson <berick@esilibrary.com>
Mon, 4 Aug 2014 15:44:33 +0000 (11:44 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 4 Aug 2014 15:44:33 +0000 (11:44 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/IDL2js.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/PhoneList.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/TemplateBatchBibUpdate.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm

index d6f616e..9c92679 100644 (file)
@@ -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;
 
index 497b0db..c7a67ec 100644 (file)
@@ -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();
 
index 6e6c9fd..3651b75 100644 (file)
@@ -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;
index 873b956..88b74b6 100644 (file)
@@ -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');
index 5f46799..3780f14 100644 (file)
@@ -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;
 }
 
index 43e99e4..a1452ce 100644 (file)
@@ -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");