[open-ils-commits] r18714 - in trunk/Open-ILS: examples examples/apache src/perlmods/OpenILS/WWW (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 12 13:36:23 EST 2010


Author: erickson
Date: 2010-11-12 13:36:19 -0500 (Fri, 12 Nov 2010)
New Revision: 18714

Modified:
   trunk/Open-ILS/examples/apache/startup.pl
   trunk/Open-ILS/examples/opensrf.xml.example
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm
Log:
read XSL file and path from opensrf.xml

Modified: trunk/Open-ILS/examples/apache/startup.pl
===================================================================
--- trunk/Open-ILS/examples/apache/startup.pl	2010-11-12 18:00:08 UTC (rev 18713)
+++ trunk/Open-ILS/examples/apache/startup.pl	2010-11-12 18:36:19 UTC (rev 18714)
@@ -8,7 +8,7 @@
 use OpenILS::WWW::TemplateBatchBibUpdate qw( /openils/conf/opensrf_core.xml );
 use OpenILS::WWW::EGWeb ('/openils/conf/oils_web.xml');
 use OpenILS::WWW::PasswordReset ('/openils/conf/opensrf_core.xml');
-use OpenILS::WWW::IDL2js ('/openils/conf/opensrf_core.xml', '/openils/var/xsl/fm_IDL2js.xsl');
+use OpenILS::WWW::IDL2js ('/openils/conf/opensrf_core.xml');
 
 # - Uncoment the following 2 lines to make use of the IP redirection code
 # - The IP file should to contain a map with the following format:

Modified: trunk/Open-ILS/examples/opensrf.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf.xml.example	2010-11-12 18:00:08 UTC (rev 18713)
+++ trunk/Open-ILS/examples/opensrf.xml.example	2010-11-12 18:36:19 UTC (rev 18714)
@@ -31,7 +31,9 @@
         </share>
 
         <IDL>SYSCONFDIR/fm_IDL.xml</IDL> <!-- top level IDL file -->
+        <IDL2js>fm_IDL2js.xsl</IDL2js> <!-- IDL JS XSLT -->
 
+
         <server_type>prefork</server_type> <!-- net::server type -->
 
         <ils_events>LOCALSTATEDIR/data/ils_events.xml</ils_events> <!-- ILS events description file -->

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm	2010-11-12 18:00:08 UTC (rev 18713)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm	2010-11-12 18:36:19 UTC (rev 18714)
@@ -16,8 +16,26 @@
 sub import {
     my $self = shift;
     $bs_config = shift;
-    my $xsl_file = shift;
+}
 
+# parse the IDL, loaded from the network
+my $__initted = 0;
+sub child_init {
+    $__initted = 1;
+
+    OpenSRF::System->bootstrap_client(config_file => $bs_config);
+    my $sclient = OpenSRF::Utils::SettingsClient->new();
+
+    my $xsl_file = $sclient->config_value('IDL2js');
+
+    unless($xsl_file) {
+        warn "XSL2js XSL file required for IDL2js Apache module\n";
+        return;
+    }
+
+    $xsl_file = $sclient->config_value(dirs => 'xsl')."/$xsl_file";
+    my $idl_file = $sclient->config_value("IDL");
+
     my $xslt = XML::LibXSLT->new();
 
     try {
@@ -29,15 +47,7 @@
         my $e = shift;
         warn "Invalid XSL File: $xsl_file: $e\n";
     };
-}
 
-# parse the IDL, loaded from the network
-my $__initted = 0;
-sub child_init {
-    $__initted = 1;
-    OpenSRF::System->bootstrap_client(config_file => $bs_config);
-    my $sclient	= OpenSRF::Utils::SettingsClient->new();
-    my $idl_file = $sclient->config_value("IDL");
     $idl_doc = XML::LibXML->load_xml(location => $idl_file);
 }
 



More information about the open-ils-commits mailing list