1 package OpenILS::Application;
2 use OpenSRF::Application;
3 use UNIVERSAL::require;
4 use base qw/OpenSRF::Application/;
7 # version format is "x-y-z", for example "2-0-0" for Evergreen 2.0.0
8 # For branches, format is "x-y"
12 __PACKAGE__->register_method(
13 api_name => 'opensrf.open-ils.system.ils_version',
15 method => 'ils_version',
18 __PACKAGE__->register_method(
19 api_name => 'opensrf.open-ils.fetch_idl.file',
21 method => 'get_idl_file',
24 use OpenSRF::Utils::SettingsClient;
25 return OpenSRF::Utils::SettingsClient->new->config_value('IDL');
33 $class = ref($class) || $class;
35 $args{package} ||= $class;
36 __PACKAGE__->SUPER::register_method( %args );
38 if (exists($dup_args{authoritative}) and $dup_args{authoritative}) {
39 (my $name = $dup_args{api_name}) =~ s/$/.authoritative/o;
40 if ($name ne $dup_args{api_name}) {
41 $dup_args{real_api_name} = $dup_args{api_name};
42 $dup_args{method} = 'authoritative_wrapper';
43 $dup_args{api_name} = $name;
44 $dup_args{package} = __PACKAGE__;
45 __PACKAGE__->SUPER::register_method( %dup_args );
50 sub authoritative_wrapper {
52 if (!$OpenILS::Utils::CStoreEditor::_loaded) {
53 die "Couldn't load OpenILS::Utils::CStoreEditor!" unless 'OpenILS::Utils::CStoreEditor'->use;
60 my $method = $self->method_lookup($self->{real_api_name});
63 local $OpenILS::Utils::CStoreEditor::always_xact = 1;
65 $client->respond( $_ ) for ( $method->run(@args) );
67 OpenILS::Utils::CStoreEditor->flush_forced_xacts();