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)/
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
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)
mkdir -p $(TEMPLATEDIR)
cp -r templates/strings $(TEMPLATEDIR)
+
+
+
xsl-install:
@echo "Installing XSL files to $(XSLDIR)"
mkdir -p $(XSLDIR)
#!/bin/bash
+CONFIG="$1";
+
+[ -z "$CONFIG" ] && echo "usage: $0 <bootstrap_config>" && exit;
+
+
JSDIR="/openils/var/web/js/util";
echo "Updating 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";
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 <bootstrap_config>" 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");
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(
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');
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) = @_;
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/;
# 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);
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
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);
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;
if($err) {
print JSON->perl2JSON($err);
- return Apache::OK;
+ return Apache2::Const::OK;
}
my @param_array;
perform_method($service, $method, %param_hash);
}
- return Apache::OK;
+ return Apache2::Const::OK;
}
sub child_init_handler {
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);
template => $main_ttk,
pre_process => $init_ttk );
- return Apache::OK;
+ return Apache2::Const::OK;
}
sub child_init_handler {
*/
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*/