CGI-AppBuilder-MapDisp2
view release on metacpan or search on metacpan
CGI-AppBuilder-MapDisp2-0.12.readme view on Meta::CPAN
my $sec = CGI::AppBuilder::MapDisp2->new();
my ($sta, $msg) = $sec->exe_sql($ar);
DESCRIPTION
This class provides methods for reading and parsing configuration files.
new (ifn => 'file.cfg', opt => 'hvS:')
This is a inherited method from CGI::AppBuilder. See the same method in
CGI::AppBuilder for more details.
upload_sas_script($q,$ar)
Input variables:
$q - CGI class
$ar - array ref containing the following variables:
Variables used or routines called:
None
How to use:
MapDisp2.pm view on Meta::CPAN
use File::Copy;
use File::Basename;
use Archive::Tar;
use IO::File;
use Net::Rexec 'rexec';
our $VERSION = 0.12;
require Exporter;
our @ISA = qw(Exporter CGI::AppBuilder);
our @EXPORT = qw();
our @EXPORT_OK = qw(upload_sas_script
get_scrnames
backup_file mk_dir
);
our %EXPORT_TAGS = (
sas_scr => [qw(upload_sas_script)],
all => [@EXPORT_OK]
);
=head1 NAME
CGI::AppBuilder::MapDisp2 - Display tasks
=head1 SYNOPSIS
use CGI::AppBuilder::MapDisp2;
MapDisp2.pm view on Meta::CPAN
This is a inherited method from CGI::AppBuilder. See the same method
in CGI::AppBuilder for more details.
=cut
sub new {
my ($s, %args) = @_;
return $s->SUPER::new(%args);
}
=head2 upload_sas_script($q,$ar)
Input variables:
$q - CGI class
$ar - array ref containing the following variables:
Variables used or routines called:
None
How to use:
Return: None
=cut
sub upload_sas_script {
my ($s, $q, $ar) = @_;
my @c0 = caller(0); my @c1 = caller(1);
my $cls = (exists $c1[3]) ? $c1[3] : '';
my $prg = "$cls [$c0[2]] -> $c0[3]";
$s->disp_header($q,$ar,1);
# get parameters
my $vs = 'task,file_name,app_user,dir_sep,sel_sn1';
my ($tsk,$sfn,$apu,$ds,$svr) = $s->get_params($vs, $ar);
$ds = ($ds) ? $ds : '/';
if (! $svr) {
$s->echo_msg("ERR: ($prg) sever name has not been defined.",0);
return;
}
if (! $sfn) {
$s->echo_msg("ERR: ($prg) no upload file is specified.",0);
return;
}
my $adr = eval $s->set_param('all_dir', $ar);
my $sdr = (exists $adr->{$svr}{sas}) ? $adr->{$svr}{sas} : '';
if (! $sdr) {
$s->echo_msg("ERR: ($prg) target folder has not been defined.",0);
return;
}
if (! $apu) {
$s->echo_msg("ERR: ($prg) no application user name is specified/available.",0);
return;
}
my $udr = join $ds, $sdr, $apu;
$ar->{upload_dir} = $udr;
$s->mk_dir($sdr);
$s->mk_dir($udr);
$s->upload_file($q, $ar);
$s->echo_msg("INFO: ($prg) File - $sfn is uploaded to $sdr.", 1);
return;
}
sub get_scrnames {
my ($s, $ar) = @_;
my @c0 = caller(0); my @c1 = caller(1);
my $cls = (exists $c1[3]) ? $c1[3] : '';
my $sec = CGI::AppBuilder::MapDisp2->new();
my ($sta, $msg) = $sec->exe_sql($ar);
DESCRIPTION
This class provides methods for reading and parsing configuration files.
new (ifn => 'file.cfg', opt => 'hvS:')
This is a inherited method from CGI::AppBuilder. See the same method in
CGI::AppBuilder for more details.
upload_sas_script($q,$ar)
Input variables:
$q - CGI class
$ar - array ref containing the following variables:
Variables used or routines called:
None
How to use:
( run in 2.823 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )