ARSObject

 view release on metacpan or  search on metacpan

lib/ARSObject.pod  view on Meta::CPAN

	=> undef || ARS control struct

(C<Connection>)
ARS control struct from ARS::ars_Login()



=item -dbi

	=> undef || DBI object

=item -dbiconnect

	=> undef || connection string || [connect args]

(C<Utility Objects>)
L<DBI|DBI> utility object and connect specification to create it.
See also C<dbi> and C<dbiconnect> methods.



=item -die

	=> undef || sub{}

	=> set(-die => 'Carp' || 'CGI::Carp' || 'CGI::Carp qw(fatalsToBrowser warningsToBrowser)' || 'CGI::Die')

(C<Error Processing and Echo>)
Error die sub{}.
The most C<Methods> dies when error.
Call C<set>(C<-die> => 'Carp') to use L<Carp|Carp> module.
Call C<set>(C<-die> => 'CGI::Carp fatalsToBrowser') to use L<CGI::Carp|CGI/Carp> module.

See also C<-diemsg>, C<-warn>, C<-cpcon>


=item -diemsg

	=> undef || sub{}(string)

Message for C<-die>, alike L<CGI::Carp|CGI/Carp>::set_message()



=item -echo

	=> 0 | 1

(C<Error Processing and Echo>)
Echo printout switch.
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>)
Field value error evaluator
See also C<-warn>.



=item -fpl

	=> [-formdb=>'...',-record=>'...'
	, {action field},.. {view/edit field},.., {button field},..}]

=item -fphc

	=> {'cgi field name' => {field definition},..}

=item -fphd

	=> {'db field name' => {field definition},..}

(C<CGI Form Presenter>)
Definitions of fields:
list of field in order to be evaluated,
field definitions by cgi names,
field definitions by ARS names.



=item -formdb

	=> 'db form name'

(C<CGI Form Presenter - Field Definitions>)
db form name, may be defined as a 
special C<-fpl> entry before field definitions.


=item -key

	=> => not exists || boolean

(C<CGI Form Presenter - Field Definitions>)
Key database field?


=item -labels

	=> not exists || {value=>label,..} || {value=>{{-label=>label, field=>value,..},..}
	|| sub{}({self},{field},$_=value) -> {value=>label,..}

(C<CGI Form Presenter - Field Definitions>)
Labels for the drop-down list box field.

lib/ARSObject.pod  view on Meta::CPAN

Data translation sub{}s may be specified as

'strOut'|'strIn' => sub(self,form,{field},$_=value){} -> translated value.

This sub{}s may use C<strOut>() and C<strIn> methods.


=item -metax 

	=> ['displayInstanceList','permissions']

(C<Metadata>)
Field parameters to exclude from C<-meta> to decrease memory usage.


=item -meta-min

(C<Metadata>)

Used by C<arsmetamin> internally.


=item -meta-sql

	=> undef || {SQL Data Store metadata}

(C<Metadata>, C<SQL Data Store Methods>, C<Variable files>)
SQL Data Store metadata loaded or refreshed by C<arsmetasql>()/C<sqlname>():

{tableName}->{-cols}->{sqlName}=>{fieldName, sqlName,...}

{tableName}->{-fields}->{fieldName}=>sqlName

{tableName}->{-ids}->{fieldId}=>sqlName

{-forms}->{formName}->{tableName}


=item -preact

	=> not exists
	|| sub{}({self}, action, '-preact'
		, {key field}, $_= key value, key pv
		, {field db name=>value,..})
		-> success || {field db name => value}
	|| 'vfentry' || 'vfhash' || 'entry' || 'entryNew'

(C<CGI Form Presenter - Field Definitions>)
Action to execute before the form performance,
should be at the top of the form, before C<-key> fields.
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.


=item -reset

	=> not exists || 'field name' || ['field name',..] || sub{}({self}, {field})

(C<CGI Form Presenter - Field Definitions>)
Condition to reset field value.
If C<-values> and field value unfound, it will be reset also.


=item -schema

	=> undef || [form name, form name...]

(C<Metadata>)
ARS forms or schemas to use.
Metadata will be loaded to C<-meta> and may be cached with C<vfname>(C<-meta>)
if C<-schgen>.


=item -schfdo

	=> 0 || 1

(C<Metadata>)
Include display only fields (AR_FIELD_OPTION_DISPLAY) into schema.



=item C<-schgen> 

	=> 1 || 0 
	|| 2 || 3 || [schema,...]

(C<Metadata>)
Cache metadata from ARS server using C<vfname>(C<-meta>)?
Or each session get metadata from ARS server.

	0 - get metadata from server, do not use cache file.
	1 - generate cache file if not exists, else load this file.
	2 - renew schema definitions using timestamps.
	3 - renew schema always.
	[schema,...] - list of schemas to renew.


=item -smtp

	=> undef || Net::SMTP object

lib/ARSObject.pod  view on Meta::CPAN


=item <-vfname>-storable

	=> 1 || 0

(C<Variable files>)
Use L<Storable|Storable> module for variable files, metadata file, or another particular file?
Or L<Data::Dumper|Data/Dumper> will be used.
See also C<vstore>().



=item -srv

	=> undef || 'ARS server name'

(C<Connection>)
ARS server name to connect


=item -strFields

	=> 1 || 0 || 2

(C<ARS methods>)
Translate ARS field values using metadata and conversion sub{}s.
1 - using 'enumLimits' and C<strtime>/C<timestr>('yyyy-mm-dd hh:mm:ss'), 
2 - using at first localisation metadata for enum fields ('fieldLbvl').



=item -undef

	=> not exists || value 

(C<CGI Form Presenter - Field Definitions>)
Field value to be treated as undef or null for database.
See also C<-value>.



=item -used

	=> not exists == 1 || boolean || 'field name' || ['field name',..] 
	|| sub{}({self}, {field})

=item -unused

	=> not exists == 0 || boolean || 'field name' || ['field name',..]
	|| sub{}({self}, {field})

(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>.



=item -values

	=> not exists || [value,..] || [{-name=>name, field=>value,..},..]
	|| sub{}({self},{field},$_=value) -> [value,..]

(C<CGI Form Presenter - Field Definitions>)
Values for the drop-down list box field
Special {-name=>name, field=>value,..} form is to define C<-change>.
See also C<-labels>.



=item -vfbase

	=> 'script file path name-' || 'base file path name' || 'directory path/'

(C<Variable files>)
Variable files base path name, used by C<vfstore>(), C<vfload>(), C<vfname>().
Default is formed from script file name without extensions and with '-' added.


=item -vfname 

	=> not exists || '-slotName'

=item -vfrenew

	=> not exists || boolean

=item -vfedit

	=> not exists || boolean

=item -vftran

	=> not exists || boolean

(C<CGI Form Presenter - Field Definitions>)
Short name of the C<Variable File>
to read record from with C<-action>=>'vfentry' or C<-action>=>'vfhash';
or to renew or update after C<-action>=>'entryIns' || 'entryUpd' || 'entryDel'
May be used with C<-action> or C<-key> field.

C<-vfrenew> - renew variable file after 'entryIns' || 'entryUpd' || 'entryDel'

C<-vfedit> - update variable file after 'entryIns' || 'entryUpd' || 'entryDel'

lib/ARSObject.pod  view on Meta::CPAN


-echo => 1
# output query and details to STDOUT



=item schema () -> {schemaName => {metadata},...}

=item schema (schema name) -> {schema metadata} || undef

=item schfld (schema) -> {fieldName=>{field metadata},...}

=item schfld (schema, field name | meta) -> {field metadata} || undef

=item schid (schema, field '-metaid' | id) -> {fieldName=>'name', FieldId=>id}

=item schdn (schema, field '-metadn' | name) -> {fieldName=>'name', FieldId=>id}

=item schvals (schema, field name | id | meta) -> [itemNumber,...] || undef

=item schlbls (schema, field name | id | meta) -> {itemNumber => itemName,...} || undef

=item schlblsl (schema, field name | id | meta) -> {itemNumber => localised itemName,...} || undef

(C<Metadata>)
Access to ARS metadata loaded by C<connect>, C<arsmeta>, C<arsmetamin>.

 

=item set (param => value,...) -> self

=item set (param) -> value

(C<Creation and Configuration>)
Configure ARSObject.



=item smtp() -> Net::SMTP object

(C<Utility Objects>)
Access to L<Net::SMTP|Net/SMTP> object. 
C<smtpconnect> will be used if empty C<-smtp>.



=item smtpconnect (?-smtphost=> name) -> Net::SMTP object

(C<Utility Objects>)
Connect to L<Net::SMTP|Net/SMTP> host using C<-smtphost>.



=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

(C<Metadata>, C<SQL Data Store Methods>)

Get SQL Data Store table or column name converted from ARS form and field name.
Used by C<arsmetasql>().
Uses C<-sqlname>, C<-sqlntbl>, C<-sqlncol>, C<-sqlninc> settings.



=item strIn (schema, fieldId | fieldName | field metadata, value) -> converted

(C<ARS methods>)
Convert value for ARS internal field value representation.
Called automatically when C<-strFields>. 
Should be called explicitly from C<strIn> sub{} in C<-metadn>/C<-metaid>.
May need to be called explicitly forming C<query> condition.
See also C<strOut>, C<-strFields>.



=item strOut (schema, fieldId | fieldName | field metadata, fieldValue) -> converted

(C<ARS methods>)
Convert ARS field value for external representation.
Called automatically when C<-strFields>. 
Should be called explicitly from C<strOut> sub{} in C<-metadn>/C<-metaid>
and when parsing strings result from C<query>.
See also C<strIn>, C<-strFields>.



=item strquot (string) -> escaped and quoted with ''

=item strquot2 (string) -> escaped and quoted with ""

(C<Utility Methods>)
Quote and escape string.
See also C<arsquot>



=item strtime (?mask, L<time|perlfunc> ||L<localtime|perlfunc> ||L<gmtime|perlfunc>) -> stringified

(C<Utility Methods>)
Stringify time value by mask.
Default mask is 'yyyy-mm-dd hh:mm:ss' (ISO).
L<POSIX::strftime|POSIX> uses different mask agreement.
See also C<timestr>.




( run in 0.752 second using v1.01-cache-2.11-cpan-39bf76dae61 )