/usr/share/perl5/AAT/Application.pm is in octopussy 1.0.6-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | # $HeadURL$
# $Revision: 442 $
# $Date: 2011-02-11 00:53:02 +0000 (Fri, 11 Feb 2011) $
# $Author: sebthebert $
=head1 NAME
AAT::Application - AAT Application module
=cut
package AAT::Application;
use strict;
use warnings;
use AAT::Utils qw( ARRAY );
use AAT::XML;
my $AAT_CONF_FILE = '/etc/aat/aat.xml';
=head1 FUNCTIONS
=head2 Set_Config_File($file)
=cut
sub Set_Config_File
{
my $file = shift;
$AAT_CONF_FILE = $file;
}
=head2 Info($appli)
Returns Application Information
=cut
sub Info
{
my $appli = shift;
my $conf = AAT::XML::Read($AAT_CONF_FILE);
foreach my $a (ARRAY($conf->{application}))
{
return ($a) if ($a->{name} eq $appli);
}
return (undef);
}
=head2 Directory($appli, $name)
Returns Directory for Application '$appli' Name '$name'
=cut
sub Directory
{
my ($appli, $name) = @_;
my $conf = AAT::XML::Read($AAT_CONF_FILE);
foreach my $a (ARRAY($conf->{application}))
{
if ($a->{name} eq $appli)
{
foreach my $d (ARRAY($a->{directory}))
{
return ($d->{value}) if ($d->{name} eq $name);
}
}
}
return (undef);
}
=head2 File($appli, $name)
Returns File for Application '$appli' Name '$name'
=cut
sub File
{
my ($appli, $name) = @_;
my $conf = AAT::XML::Read($AAT_CONF_FILE);
foreach my $a (ARRAY($conf->{application}))
{
if ($a->{name} eq $appli)
{
foreach my $f (ARRAY($a->{file}))
{
return ($f->{value}) if ($f->{name} eq $name);
}
}
}
return (undef);
}
=head2 Parameter($appli, $param)
Returns Parameter Default Value for Application '$appli' Parameter '$param'
=cut
sub Parameter
{
my ($appli, $param) = @_;
my $conf = AAT::XML::Read($AAT_CONF_FILE);
foreach my $a (ARRAY($conf->{application}))
{
if ($a->{name} eq $appli)
{
foreach my $p (ARRAY($a->{parameter}))
{
return ($p->{value}) if ($p->{name} eq $param);
}
}
}
return (undef);
}
1;
=head1 SEE ALSO
AAT(3), AAT::DB(3), AAT::Syslog(3), AAT::Theme(3), AAT::Translation(3), AAT::User(3)
=head1 AUTHOR
Sebastien Thebert <octo.devel@gmail.com>
=cut
|