use OpenILS::WWW::Proxy ('@sysconfdir@/opensrf_core.xml');
use OpenILS::WWW::Vandelay qw( @sysconfdir@/opensrf_core.xml );
use OpenILS::WWW::TemplateBatchBibUpdate qw( @sysconfdir@/opensrf_core.xml );
-use OpenILS::WWW::EGWeb;
+use OpenILS::WWW::EGWeb ('@sysconfdir@/opensrf_core.xml', 'OpenILS::WWW::EGCatLoader', 'en-US');;
use OpenILS::WWW::IDL2js ('@sysconfdir@/opensrf_core.xml');
use OpenILS::WWW::FlatFielder;
use OpenILS::WWW::PhoneList ('@sysconfdir@/opensrf_core.xml');
PerlChildInitHandler OpenILS::WWW::AddedContent::child_init
PerlChildInitHandler OpenILS::WWW::AutoSuggest::child_init
PerlChildInitHandler OpenILS::WWW::PhoneList::child_init
+PerlChildInitHandler OpenILS::WWW::EGWeb::child_init
# ----------------------------------------------------------------------------------
# Set some defaults for our working directories
authority_fields => {en_us => {}}
);
+sub child_init {
+ my $class = shift;
+ my $e = shift;
+ my @locales = @_;
+
+ # create a stub object with just enough in place
+ # to call init_ro_object_cache()
+ my $stub = bless({}, ref($class) || $class);
+ my $ctx = {};
+ $stub->editor($e);
+ $stub->ctx($ctx);
+
+ $stub->init_ro_object_cache();
+ foreach my $locale (@locales) {
+ $ctx->{locale} = $locale;
+ OpenSRF::AppSession->default_locale($locale);
+
+ # pre-cache various sets of objects
+ # known to be time-consuming to retrieve
+ # the first go around
+ $ro_object_subs->{aou_tree}();
+ $ro_object_subs->{aouct_tree}();
+ $ro_object_subs->{get_ccvm}();
+ $ro_object_subs->{get_authority_fields}(1);
+ }
+}
+
sub init_ro_object_cache {
my $self = shift;
my $e = $self->editor;
# cache template processors by vhost
my %vhost_processor_cache;
+my $bootstrap_config;
+my @context_loaders_to_preinit = ();
+my @locales_to_preinit = ();
+
+sub import {
+ my ($self, $bootstrap_config, $loaders, $locales) = @_;
+ @context_loaders_to_preinit = split /\s+/, $loaders, -1 if defined($loaders);
+ @locales_to_preinit = split /\s+/, $locales, -1 if defined($locales);
+}
+
+sub child_init {
+ OpenSRF::System->bootstrap_client(config_file => $bootstrap_config);
+ my $idl = OpenSRF::Utils::SettingsClient->new->config_value("IDL");
+ Fieldmapper->import(IDL => $idl);
+ OpenILS::Utils::CStoreEditor->init;
+ my $e = new_editor();
+ foreach my $loader (@context_loaders_to_preinit) {
+ eval {
+ $loader->use;
+ $loader->child_init($e, @locales_to_preinit);
+ };
+ }
+ return Apache2::Const::OK;
+}
+
sub handler {
my $r = shift;
my $stat = handler_guts($r);