[open-ils-commits] r12294 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 24 22:36:10 EST 2009
Author: erickson
Date: 2009-02-24 22:36:08 -0500 (Tue, 24 Feb 2009)
New Revision: 12294
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
Log:
basic TT processor
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm 2009-02-25 03:23:05 UTC (rev 12293)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm 2009-02-25 03:36:08 UTC (rev 12294)
@@ -1,5 +1,25 @@
package OpenILS::Application::Trigger::Reactor;
+use Template;
+use OpenSRF::Utils::Logger qw(:logger);
+
sub fourty_two { return 42 }
sub NOOP_True { return 1 }
sub NOOP_False { return 0 }
+
+
+# processes templates. Returns template output on success, undef on error
+sub run_TT {
+ my $self = shift;
+ my $env = shift;
+ return '' unless $env->{template};
+
+ my $output = '';
+ my $tt = Template->new;
+
+ $tt->process($env->{template}, $env, \$output) or
+ $logger->error("Error processing Trigger template: " . $tt->error);
+
+ return $output;
+}
+
1;
More information about the open-ils-commits
mailing list