commiting the format handling code in copy counts info
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Template / Plugin / WebSession.pm
1 package OpenILS::Template::Plugin::WebSession;
2 use strict; use warnings;
3 use OpenILS::Utils::Fieldmapper;
4
5 use Template::Plugin;
6 use base qw/Template::Plugin/;
7 use OpenSRF::AppSession;
8 use OpenSRF::System;
9
10 sub new {
11         my ($class) = @_;
12         $class = ref($class) || $class;
13         my $self = {};
14         return bless($self,$class);
15 }
16         
17 my $bootstrapped = 0;
18 sub bootstrap_client {
19         my( $self, $config_file ) = @_;
20         if(!$bootstrapped) {
21                 OpenSRF::System->bootstrap_client( config_file => $config_file );
22                 $bootstrapped = 1;
23         }
24 }
25
26 sub init_app_session {
27         my($self, $service) = @_;
28         return undef unless $service;
29         return OpenSRF::AppSession->create($service);
30 }
31
32
33
34 1;