From e6ee7e792957eea99264853769b2ea83e1c54e14 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 26 Jul 2005 23:26:51 +0000 Subject: [PATCH] more install goodness, fixed some bugs, etc git-svn-id: svn://svn.open-ils.org/ILS/trunk@1520 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/Makefile | 4 ++++ Open-ILS/src/Makefile | 14 +++++++++++++- Open-ILS/src/extras/autogen.sh | 7 ++++++- Open-ILS/src/extras/org_tree_js.pl | 3 ++- .../src/perlmods/OpenILS/Application/Actor.pm | 9 ++++++++- .../perlmods/OpenILS/Application/Cat/Utils.pm | 8 ++++---- .../perlmods/OpenILS/Application/Storage/WORM.pm | 10 +++++++--- .../src/perlmods/OpenILS/Utils/ModsParser.pm | 16 +++++++++------- Open-ILS/src/perlmods/OpenILS/WWW/Method.pm | 14 +++++++------- Open-ILS/src/perlmods/OpenILS/WWW/Web.pm | 14 +++++++------- OpenSRF/src/gateway/mod_ils_gateway.c | 4 ++-- 11 files changed, 69 insertions(+), 34 deletions(-) diff --git a/Evergreen/Makefile b/Evergreen/Makefile index 2785235e48..c9f42dc7c5 100644 --- a/Evergreen/Makefile +++ b/Evergreen/Makefile @@ -41,6 +41,10 @@ images-install: ln -sf $(IMAGE)/open_book.gif $(IMAGE)/text.jpg ln -sf $(IMAGE)/book_icon.jpeg $(IMAGE)/"three dimensional object.jpg" +css-install: + mkdir -p $(WEBDIR) + cp -r css $(WEBDIR) + circ-install: mkdir -p $(CIRCRULESDIR) cp circ_rules/*.rules $(CIRCRULESDIR)/ diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 909417f38f..7e90a60d61 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -1,6 +1,9 @@ all: -install: perl-install javascript-install web-templates-install string-templates-install storage-bootstrap xsl-install +web-install: web-templates-install javascript-install autojs-install + +install: perl-install web-install string-templates-install storage-bootstrap xsl-install + JSDIR=$(WEBDIR)/js @@ -29,6 +32,12 @@ storage-bootstrap: cp -r cgi-bin/* $(CGIDIR) ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW) + +autojs-install: + cp extras/fieldmapper.pl $(BINDIR) + cp extras/org_tree_js.pl $(BINDIR) + cp extras/autogen.sh $(BINDIR) + web-templates-install: @echo "Installing web templates to $(TEMPLATEDIR)" mkdir -p $(TEMPLATEDIR) @@ -40,6 +49,9 @@ string-templates-install: mkdir -p $(TEMPLATEDIR) cp -r templates/strings $(TEMPLATEDIR) + + + xsl-install: @echo "Installing XSL files to $(XSLDIR)" mkdir -p $(XSLDIR) diff --git a/Open-ILS/src/extras/autogen.sh b/Open-ILS/src/extras/autogen.sh index 8d5de1c968..bdef6ed7ad 100755 --- a/Open-ILS/src/extras/autogen.sh +++ b/Open-ILS/src/extras/autogen.sh @@ -1,5 +1,10 @@ #!/bin/bash +CONFIG="$1"; + +[ -z "$CONFIG" ] && echo "usage: $0 " && exit; + + JSDIR="/openils/var/web/js/util"; echo "Updating fieldmapper"; @@ -9,7 +14,7 @@ echo "Updating web_fieldmapper"; perl fieldmapper.pl 1 > "$JSDIR/web_fieldmapper.js"; echo "Updating OrgTree"; -perl org_tree_js.pl | sed 's/null//g' > "$JSDIR/OrgTree.js"; +perl org_tree_js.pl "$CONFIG" | sed 's/null//g' > "$JSDIR/OrgTree.js"; echo "Done"; diff --git a/Open-ILS/src/extras/org_tree_js.pl b/Open-ILS/src/extras/org_tree_js.pl index 7d0be9e2b4..a541b8e488 100644 --- a/Open-ILS/src/extras/org_tree_js.pl +++ b/Open-ILS/src/extras/org_tree_js.pl @@ -4,7 +4,8 @@ use OpenSRF::AppSession; use OpenSRF::System; use JSON; -OpenSRF::System->bootstrap_client(config_file => "/pines/conf/client.conf"); +die "usage: perl org_tree_js.pl " unless $ARGV[0]; +OpenSRF::System->bootstrap_client(config_file => $ARGV[0]); my $ses = OpenSRF::AppSession->create("open-ils.actor"); my $req = $ses->request("open-ils.actor.org_tree.retrieve"); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 2b7c6a4363..4a819ff4be 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -14,9 +14,13 @@ use OpenILS::Utils::Fieldmapper; use OpenILS::Application::Search::Actor; use OpenILS::Utils::ModsParser; +use OpenSRF::Utils::Cache; + my $apputils = "OpenILS::Application::AppUtils"; + sub _d { warn "Patron:\n" . Dumper(shift()); } -my $cache_client = OpenSRF::Utils::Cache->new("global", 0); + +my $cache_client; __PACKAGE__->register_method( @@ -680,6 +684,9 @@ __PACKAGE__->register_method( sub get_org_tree { my( $self, $client) = @_; + if(!$cache_client) { + $cache_client = OpenSRF::Utils::Cache->new("global", 0); + } # see if it's in the cache warn "Getting ORG Tree\n"; my $tree = $cache_client->get_cache('orgtree'); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm index 7ad231e3cd..df3b0cf65a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm @@ -11,10 +11,10 @@ use OpenILS::Utils::ModsParser; my $mods_utils = OpenILS::Utils::ModsParser->new(); -my $parser = XML::LibXML->new(); -my $xslt = XML::LibXSLT->new(); -my $xslt_doc = $parser->parse_file( "/pines/cvs/ILS/Open-ILS/xsl/MARC21slim2MODS.xsl" ); -my $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); +#my $parser = XML::LibXML->new(); +#my $xslt = XML::LibXSLT->new(); +#my $xslt_doc = $parser->parse_file( "/pines/cvs/ILS/Open-ILS/xsl/MARC21slim2MODS.xsl" ); +#my $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); sub new { my($class) = @_; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm index 1cff1a58ed..fbf32169b8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm @@ -19,9 +19,7 @@ my $xml_util = OpenILS::Utils::FlatXML->new(); my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); -my $xslt_doc = $parser->parse_file( "/home/miker/cvs/OpenILS/app_server/stylesheets/MARC21slim2MODS.xsl" ); -#my $xslt_doc = $parser->parse_file( "/pines/cvs/ILS/Open-ILS/xsl/MARC21slim2MODS.xsl" ); -my $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); +my $mods_sheet; use open qw/:utf8/; @@ -299,6 +297,12 @@ sub wormize { # step -1: grab the doc from storage next unless ($entry); + if(!$mods_sheet) { + my $xslt_doc = $parser->parse_file( + OpenSRF::Utils::SettingsClient->new->config_value(dirs => 'xsl') . "/MARC21slim2MODS.xsl"); + $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); + } + my $xml = $entry->marc; my $docid = $entry->id; my $marcdoc = $parser->parse_string($xml); diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm index 061ef6aa1e..4a1f5e5754 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm @@ -11,13 +11,7 @@ use Data::Dumper; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); -my $xslt_doc = $parser->parse_file( - OpenSRF::Utils::SettingsClient - ->new - ->config_value(dirs => 'xsl') . "/MARC21slim2MODS3.xsl" -); - -my $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); +my $mods_sheet; # ---------------------------------------------------------------------------------------- # XPATH for extracting info from a MODS doc @@ -265,6 +259,14 @@ sub start_mods_batch { my( $self, $master_doc ) = @_; + + if(!$mods_sheet) { + my $xslt_doc = $parser->parse_file( + OpenSRF::Utils::SettingsClient->new->config_value(dirs => 'xsl') . "/MARC21slim2MODS3.xsl"); + $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); + } + + my $xmldoc = $parser->parse_string($master_doc); my $mods = $mods_sheet->transform($xmldoc); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm index 5d8678ab41..5e86d2b561 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Method.pm @@ -2,12 +2,12 @@ package OpenILS::WWW::Method; use strict; use warnings; use Apache2 (); -use Apache::Log; -use Apache::Const -compile => qw(OK REDIRECT :log); +use Apache2::Log; +use Apache2::Const -compile => qw(OK REDIRECT :log); use APR::Const -compile => qw(:error SUCCESS); -use Apache::RequestRec (); -use Apache::RequestIO (); -use Apache::RequestUtil; +use Apache2::RequestRec (); +use Apache2::RequestIO (); +use Apache2::RequestUtil; use JSON; @@ -48,7 +48,7 @@ sub handler { if($err) { print JSON->perl2JSON($err); - return Apache::OK; + return Apache2::Const::OK; } my @param_array; @@ -74,7 +74,7 @@ sub handler { perform_method($service, $method, %param_hash); } - return Apache::OK; + return Apache2::Const::OK; } sub child_init_handler { diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Web.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Web.pm index f483465fa5..8cb8b8bc27 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Web.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Web.pm @@ -2,14 +2,14 @@ package OpenILS::WWW::Web; use strict; use warnings; use Apache2 (); -use Apache::Log; -use Apache::Const -compile => qw(OK REDIRECT :log); +use Apache2::Log; +use Apache2::Const -compile => qw(OK REDIRECT :log); use APR::Const -compile => qw(:error SUCCESS); -use Apache::RequestRec (); -use Apache::RequestIO (); -use Apache::RequestUtil; +use Apache2::RequestRec (); +use Apache2::RequestIO (); +use Apache2::RequestUtil; -use CGI (); +#use CGI (); use Template qw(:template); use OpenSRF::EX qw(:try); @@ -42,7 +42,7 @@ sub handler { template => $main_ttk, pre_process => $init_ttk ); - return Apache::OK; + return Apache2::Const::OK; } sub child_init_handler { diff --git a/OpenSRF/src/gateway/mod_ils_gateway.c b/OpenSRF/src/gateway/mod_ils_gateway.c index f63771022b..a4ba81b2b7 100644 --- a/OpenSRF/src/gateway/mod_ils_gateway.c +++ b/OpenSRF/src/gateway/mod_ils_gateway.c @@ -139,8 +139,8 @@ static void add_session( char* service, osrf_app_session* session ) { */ static void mod_ils_gateway_child_init(apr_pool_t *p, server_rec *s) { - if( ! osrf_system_bootstrap_client( - "/pines/cvs/ILS/OpenSRF/src/gateway/gateway.xml") ) { /* config option */ + if( ! osrf_system_bootstrap_client( "/openils/conf/gateway.xml") ) { + fatal_handler("Unable to load gateway config file..."); } /* we don't want to waste time parsing json that we're not going to look at*/ -- 2.43.2