From: erickson Date: Fri, 12 Nov 2010 18:36:19 +0000 (+0000) Subject: read XSL file and path from opensrf.xml X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=572b2751fa05bf6fab4d08f4ceba59c2daa3f137;p=evergreen%2Ftadl.git read XSL file and path from opensrf.xml git-svn-id: svn://svn.open-ils.org/ILS/trunk@18714 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/apache/startup.pl b/Open-ILS/examples/apache/startup.pl index da7a4c4a1a..f82844717f 100755 --- a/Open-ILS/examples/apache/startup.pl +++ b/Open-ILS/examples/apache/startup.pl @@ -8,7 +8,7 @@ use OpenILS::WWW::Vandelay qw( /openils/conf/opensrf_core.xml ); 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: diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index f7576aa30e..429f1f160a 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -31,6 +31,8 @@ vim:et:ts=4:sw=4: SYSCONFDIR/fm_IDL.xml + fm_IDL2js.xsl + prefork diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm b/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm index ea0f238362..ee5b2ef255 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/IDL2js.pm @@ -16,7 +16,25 @@ my $idl_doc; 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(); @@ -29,15 +47,7 @@ sub import { 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); }