ARSObject
view release on metacpan or search on metacpan
lib/ARSObject.pm view on Meta::CPAN
846847848849850851852853854855856857858859860861862863864865866eval
(
'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};
$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
32813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303
.(
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
363364365366367368369370371372373374375376377378379380381382383Temporarilly 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
596597598599600601602603604605606607608609610611612613614615616May 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
778779780781782783784785786787788789790791792793794795796797798(C<CGI Form Presenter - Field Definitions>)
=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
1576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600=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 )