2 use strict; use warnings;
6 use Apache::Const -compile => qw(OK REDIRECT :log);
7 use APR::Const -compile => qw(:error SUCCESS);
8 use Apache::RequestRec ();
9 use Apache::RequestIO ();
10 use Apache::RequestUtil;
13 use Template qw(:template);
15 use OpenSRF::EX qw(:try);
18 my $child_init_ttk = "opensearch.ttk";
20 my $includes = [ '/pines/cvs/ILS/Open-ILS/src/extras' ];
22 my $plugin_base = 'OpenILS::Template::Plugin';
27 print "Content-type: text/xml; charset=utf-8\n\n";
31 template => 'opensearch.ttk',
37 sub child_init_handler {
38 _process_template( template => $child_init_ttk );
41 sub _process_template {
44 my $ttk = $params{template} || return undef;
45 my $apache = $params{apache} || undef;
46 my $pre_process = $params{pre_process} || undef;
47 my $param_hash = $params{params} || {};
51 $template = Template->new( {
55 PLUGIN_BASE => $plugin_base,
56 PRE_PROCESS => $pre_process,
57 INCLUDE_PATH => $includes,
65 if( ! $template->process( $ttk, $param_hash ) ) {
66 warn "Error Occured: " . $template->error();
67 my $err = $template->error();
68 $err =~ s/\n/\<br\/\>/g;
69 warn "Error processing template $ttk\n";
70 print "<br><b>Unable to process template:<br/><br/> " . $err . "!!!</b>";
75 warn "Error processing template $ttk: $e - $@ \n";
76 print "<center><br/><br/><b>Error<br/><br/> $e <br/><br/> $@ </b><br/></center>";