ARSObject

 view release on metacpan or  search on metacpan

lib/ARSObject.pod  view on Meta::CPAN

Insert new record into ARS using ARS::ars_CreateEntry().
Field names are translated to ids using C<-metadn>/C<-meta>.
Field values are translated with C<strIn> when C<-strFields>.

Specially for 'HPD:Help Desk': 'Incident Number' value will be generated if it is 1.

Parameters:

-form | -into | -schema => schema or form name

-echo=>1 # output command to STDOUT

field === internalId | fieldName



=item entryNew (-form=>form, field=>value,...) -> {field=>value,...}

(C<ARS methods>)
Form field => value hash for a new ARS record using values given and default values in C<-meta>.
This may be not needed, C<entryIns> may be sufficient.
Field names are translated to ids using C<-metadn>/C<-meta>.
Field values are translated with C<strOut> when C<-strFields>.

Specially for 'HPD:Help Desk': 'Incident Number' value will be generated if it is 1.




=item entryUpd (-form=>form, -id=>entryId, ?-echo=>1, field=>value,...) -> id

(C<ARS methods>)
Update record into ARS using ARS::ars_SetEntry().
Field names are translated to ids using C<-metadn>/C<-meta>.
Field values are translated with C<strIn> when C<-strFields>.
Parameters:

-form | -into | -schema => schema or form name

-id=>entryId

-echo=>1 # output command to STDOUT

field === internalId | fieldName



=item fdirls (?-opt, path, ? filter sub{}(self, path, $_ =entry)) -> (entry,...)

=item fdirls (..., []) -> [entry,...]

(C<Utility Methods>)
List directory contents.



=item fload (?-opt, filename) -> content

(C<Utility Methods>)
Load data from file.
Options: '-b' - L<binmode|perlfunc>.
See also C<fstore>.



=item fopen (?-opt, filename) -> IO::File object

(C<Utility Methods>)
Open file with L<IO::File|IO/File> object.
Options: '-b' - L<binmode|perlfunc>.
See also C<fload>, C<fstore>.



=item fstore (?-opt, filename, string,...) -> success

(C<Utility Methods>)
Store strings to file.
Options: '-b' - L<binmode|perlfunc>.
Filename may be started with '>>' to add data to file.
See also C<fload>.




=item lsflds (additional field properties) -> list of field descriptions

(C<Metadata>)
List field descriptions from C<-meta>.
May be useful when scripting.
Or set C<-storable> => 0 and view C<vfname>(C<-meta>) file.



=item new (param => value,...) -> ARSObject

(C<Creation and Configuration>)
Create ARSObject.



=item query (-form => schema name, -where => condition,...) -> list of records

=item query (..., -for => sub(self, form, id|string, ?{record}){die "last\n", die "next\n"}) -> self

(C<ARS methods>)
Query records from ARS.

Field names are translated to ids using C<-metadn>/C<-meta>.

Result set values are translated with C<strOut> when C<-strFields>.

Values in the query condition should be converted to ARS representation explicitly:
strings should be quoted with C<arsquot>(), dates - converted with C<timestr>().

Field names or ids in the query condition should be enclosed in ' single quotes.

Parameters:

-form | -from | -schema => schema or form name

-fields =>undef
# if '-fields' parameter omited, list of record IDs will be returned as a result set.

-fields => [{fieldId=>1, columnWidth=>number, separator=>"\t"} | {fieldName=>name, width=>number} | {field=>name|id, width=>number},...]
# result set is strings up to 128 bytes, ARS::ars_GetListEntry() used.

-fields => [fieldId | fieldName,...]
# result set is hash refs for each record, ARS::ars_GetListEntryWithFields() used.

-fields => '*' | '*-$' | 1, -xfields=>sub{}(self, field) || [fieldName| fieldId,...]
# result set is hash refs for each record, ARS::ars_GetListEntryWithFields() used.
# use '*-$' to excude currency and attachment fields.
# use '*-f' to excude attachment fields.

-fetch => '*' | 1 | [fieldId|fieldName,...]
# result set is hash refs for each record, ars_GetEntry() used for each row, this is slow.

-where | -query => search condition string



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