ARSObject

 view release on metacpan or  search on metacpan

lib/ARSObject.pm  view on Meta::CPAN

846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
eval('use ARS');       # (-param=>value,...) -> self
 my $s =shift;          # -srv, -usr, -pswd, -lang
 $s->set(@_);
 $s->set(-die=>'Carp') if !$s->{-die};
 local $s->{-cmd} ="connect()";
 return($s) if $s->{-ctrl};
 print $s->cpcon("connect()\n") if $s->{-echo};
 return($s) if $s->{-ctrl} && ARS::ars_VerifyUser($s->{-ctrl});
 $s->{-ctrl} =ARS::ars_Login(
                $s->{-srv}, $s->{-usr}, $s->{-pswd}, $s->{-lang}
                , '' # , join('-', ($ENV{COMPUTERNAME} ||$ENV{HOSTNAME} ||eval('use Sys::Hostname;hostname') ||'localhost'), getlogin() || $> || '', $$, $^T, time())
                , 0, 0)
        || return(&{$s->{-die}}($s->efmt($ARS::ars_errstr,$s->{-cmd},undef,'ars_Login', map {$_=>$s->{$_}} qw(-srv -usr -lang))));
 $s->{-ctrl} && ARS::ars_SetSessionConfiguration($s->{-ctrl}, &ARS::AR_SESS_OVERRIDE_PREV_IP, 1);
 $s->arsmeta();
 $s
}
 
 
sub disconnect {        # Disconnect data servers
 my $s =shift;

lib/ARSObject.pm  view on Meta::CPAN

3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
                .(ref($a{-recipient}) ? join(', ', (map { !$_ ? () : /<\s*([^<>]+)\s*>/ ? $1 : $_ } @{$a{-recipient}})) : $a{-recipient}) ."' -> " .($s->smtp->message()||'?')));
 $s->smtp->data($a{-data})
        ||return(&{$s->{-die}}("SMTP data '" .$a{-data} ."' -> " .($s->smtp->message()||'?')));
 my $r =$s->smtp->dataend()
        ||return(&{$s->{-die}}("SMTP dataend -> " .($s->smtp->message()||'?')));
 $r ||1;
}
 
 
sub soon {      # Periodical execution of this script
                # (minutes ||sub{}, ?log file, ?run command, ?soon command)
                # minutes: undef - clear sched, run once || sub{} -> number
                # log file: empty || full file name || var file name
                # run  command: empty || 'command line' || [command line] || sub{}
                # soon command: empty || 'command line' || [command line] || []
                # empty run command - only soon command will be scheduled
                # empty soon command - sleep(minutes*60) will be used
                # !defined(minutes) - soon command will be deleted from schedule
                #       and run command will be executed once
                # [soon command,... [arg,...],...] - schedule cleaning hint:
                #       join(' ',@{[soon,...arg]}) used to clean schedule
                #       join('', @{[arg,...]}) used in soon command
 my ($s, $mm, $lf, $cr, $cs) =@_;

lib/ARSObject.pod  view on Meta::CPAN

363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
Temporarilly may be used as an argument for specific methods.
alike C<query> and C<entryIns>.
 
 
 
=item -entryNo
 
        => entryIns()
 
(C<ARS methods>)
The logical number of the entry inserted by C<entryIns>().
 
 
 
=item -error
 
        => not exists
        || sub{}({self}, {field}, $_ =field value, previous value) -> 'error text'
        || 'error text for empty field'
 
(C<CGI Form Presenter - Field Definitions>)

lib/ARSObject.pod  view on Meta::CPAN

596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
May be several actions with the same C<-namecgi>.
Alternative key field name may be passed as L<CGI|CGI>->param(action-name).
See alco C<-action>.
 
 
=item -pswd
 
        => undef || ''
 
(C<Connection>)
ARS password string to login with
 
 
=item -record
 
        => 'record name' || 'nameRowNumber'
 
(C<CGI Form Presenter - Field Definitions>)
Record name, if several records in screen,
may be defined as a special C<-fpl> entry after C<-formdb> entry.
Record name may be followed by row number.

lib/ARSObject.pod  view on Meta::CPAN

778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
(C<CGI Form Presenter - Field Definitions>)
Condition to use or unuse field in the screen and actions.
 
 
=item -usr
 
        => undef || 'ARS user name'
 
(C<Connection>)
ARS user name to login under
 
 
 
=item -value
 
        => not exists || value || [field name] || sub{}({self},{field}) -> value
 
(C<CGI Form Presenter - Field Definitions>)
Default field value or field value evaluator.
See also C<-computed>.

lib/ARSObject.pod  view on Meta::CPAN

1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
 
 
=item smtpsend (-from || -sender => name, -to || -recipient => [name,...], -data => smtp data || (-subject => string, -text || -html => text)) -> Net::SMTP::dataend
 
(C<Utility Objects>)
Send L<Net::SMTP|Net/SMTP> e-mail using C<smtp>.
 
 
 
=item soon (minutes number || sub{}, logfile ||'', run command || [command line] || sub{}, soon command || [command line] || [])
 
=item soon (minutes number || sub{}, logfile ||'', run command || [command line] || sub{})
 
=item soon (minutes number || sub{}, logfile ||'', '', soon command || [command line])
 
Execute the script periodically, run command immediately, soon command after delay specified.
Log file name may be full file name, else C<vfname>(file name) will be used.
If run command is empty, soon command will be scheduled.
If soon command is empty, sleep(minutes*60) will be used, otherwise 'at' MSWin32 scheduling command.
If !defined(minutes), soon command will be deleted from schedule and run command will be executed once.
 
 
 
=item sqlname (formName, ?fieldName, ?forceMetaUpd) -> sql name



( run in 1.079 second using v1.01-cache-2.11-cpan-49f99fa48dc )