ARSObject
view release on metacpan or search on metacpan
lib/ARSObject.pod view on Meta::CPAN
=head1 DESCRIPTION
This module is intended for capable scripts above L<ARS|ARS> module
(L<../../ARSPerl/index.html>).
It caches metadata alike L<Remedy::ARSTools|Remedy/ARSTools>,
but uses L<Data::Dumper|Data/Dumper> or L<Storable|Storable> module.
And metadata model is directly given from ARS::ars_GetFieldTable()/ARS::ars_GetField(),
unlike L<ARSOOForm|ARSOOForm> and L<Remedy::ARSTools|Remedy/ARSTools>.
And additional description level (C<-metadn>/C<-metaid>) added to unify field names
and extend conversion capabilities of field values.
Field names and values are translated (C<-strFields>/C<strIn>/C<strOut>)
as possible.
C<query>() method supports iterator sub{} and uses ARS::ars_GetListEntry(),
ARS::ars_GetListEntryWithFields(), ARS::ars_GetEntry() calls
as appropriate with parameters given.
C<entry>(), C<entryIns>(), C<entryUpd>(), C<entryDel>() methods
are usual to manipulate records.
C<entryNew>() method may be used to form new record hash with default values for C<entryIns>().
C<entryDif>() method may be used to minimise data for C<entryUpd>().
C<AUTOLOAD>() method is to call 'ARS::ars_XXX' functions as methods.
Special processing added for 'HPD:Help Desk' ITSM Suite form.
C<Variable files> may be used to cache any data.
Misc C<Utility Methods> intended for strings, dates, data structures.
C<Utility Objects> added to simplify and unify access to
L<DBI|DBI>, L<CGI|CGI>, L<Net::SMTP|Net/SMTP> modules.
=back
=head1 CLASSIFICATION
=over
=item Creation and Configuration
C<new>, C<set>, C<Slots>
=item Error Processing and Echo
C<-die>, C<-warn>, C<-echo>, C<-cpcon>/C<cpcon>;
C<ars_errstr>, C<dbierrstr>
=item Connection
C<connect>(C<-srv> => server, C<-usr> => name, C<-pswd> => password, C<-lang> => language);
C<-ctrl>
C<dbiconnect>(C<-dbiconnect>); C<-dbi>
=item Metadata
C<connect>; C<arsmeta>, C<arsmetamin>; C<schema>,...; C<lsflds>;
C<-schema>, C<-meta>/C<-meta-min>/C<-meta-sql>, C<-metax>, C<-metadn>, C<-metaid>, C<-schgen>, C<-schfdo>, C<-strFields>;
C<Variable files>
=item Variable files
C<-vfbase>, C<-storable>;
C<vfname>, C<vfload>, C<vfstore>, C<vfclear>, C<vfdata>, C<vfhash>, C<vfdistinct>
=item ARS methods
C<connect>, C<query>, C<entry>, C<entryNew>, C<entryIns>, C<entryUpd>, C<entryDel>, C<entryBLOB>, C<AUTOLOAD>;
C<-strFields>, C<strIn>, C<strOut>;
C<arsquot>;
C<-maxRetrieve>
=item Utility Methods
C<strquot>, C<strquot2>, C<arsquot>;
C<cptran>, C<cpcon>;
C<strtime>, C<timestr>, C<timeadd>;
C<dsquot>, C<dsquot1>;
C<dsdump>, C<dsparse>, C<dscmp>, C<dsmerge>, C<dsunique>;
C<fopen>, C<fload>, C<fstore>, C<fdirls>;
C<soon>
=item Utility Objects
C<dbi>, C<-dbi>, C<dbiconnect>, C<-dbiconnect>;
C<dbiquery>, C<dbido>; C<dbierrstr>
C<cgi>, C<-cgi>, C<cgiconnect>;
C<cgipar>, C<cgiesc>, C<cgitfrm>, C<cgitext>, C<cgistring>, C<cgiselect>, C<cgiddlb>
C<smtp>, C<-smtp>, C<smtpconnect>, C<-smtphost>; C<smtpsend>
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
( run in 1.066 second using v1.01-cache-2.11-cpan-e1769b4cff6 )