]> git.evergreen-ils.org Git - working/NCIPServer.git/blob - lib/NCIP/Handler/LookupVersion.pm
Fix lookupuser problem reporting in Evergreen driver.
[working/NCIPServer.git] / lib / NCIP / Handler / LookupVersion.pm
1 # ---------------------------------------------------------------
2 # Copyright © 2014 Jason J.A. Stephenson <jason@sigio.com>
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 # ---------------------------------------------------------------
14 package NCIP::Handler::LookupVersion;
15
16 =head1
17
18   NCIP::Handler::LookupVersion
19
20 =head1 SYNOPSIS
21
22     Not to be called directly, NCIP::Handler will pick the appropriate Handler
23     object, given a message type
24
25 =head1 FUNCTIONS
26
27 =cut
28
29 use Modern::Perl;
30
31 use NCIP::Handler;
32 use NCIP::Const;
33
34 our @ISA = qw(NCIP::Handler);
35
36 sub handle {
37     my $self = shift;
38     my $xmldoc = shift;
39     if ($xmldoc) {
40         my $vars;
41         my ($from,$to) = $self->get_agencies($xmldoc);
42         $vars->{'fromagency'} = $to;
43         $vars->{'toagency'} = $from;
44         $vars->{'messagetype'} = 'LookupVersionResponse';
45         $vars->{'versions'} = [ NCIP::Const::SUPPORTED_VERSIONS ];
46         my $output = $self->render_output('response.tt', $vars);
47         return $output;
48     }
49 }
50
51 1;