The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

DBIx::Web - Active Web Database Layer

SYNOPSIS

  use DBIx::Web;
  my $w =DBIx::Web->new(
         -serial=>2
        ,-debug=>2
        ,-index=>1
        ,-path=>'path to file store'
        ,-url=>'base URL of file store'
        ,-urf=>'filesystem URL to file store'
        );
  $w->set(-table=>{
  ...... see examples ......
        ,'version'=>$w->ddvRVV()
        ,'history'=>$w->ddvRHV()
        });
  $w->set(-form=>{
  ...... see examples ......
        ,'default'=>{-subst=>'default form or table name'}
        });
  $w->cgiRun();

DESCRIPTION

This is a database layer for Perl scripts, implementing triggers, record versioning, access control at the record level, file attachments to records, materialised views. There is a web user interface also.

Based on DBI and DB_File data engines. Based on CGI for user interface.

Currently implemented and tested on Win32 Apache and IIS (considering w32IISdpsn warnings).

CGI::Bus, the previous project, was: focused on CGI user interface to database tables, not database metaphor; too complex in record version control programming; too complex and surplus in architecture and setup.

WODA has a very interesting database metaphor, but not many features.

CONCEPTS

RELATIONAL DATABASES

Have several disadvantages:

Record Level Access Control

Many of relational databases have not explicit record level access control. It may be implemented via views and triggers, within another application code. Fields for readers and authors names are useful, further needs dependences between records.

Temporal Data Model

Many of relational databases have not temporal data model. It may be implemented via triggers and views, within another application code, but see R3 data model architecture...

But it may be useful recognize, who, when, what record edited. Further needs date-times of actuality of record.

Polymorph records

Can I query and view data not from concrete tables but from database? It may be implemented via materialized views metaphor, using triggers. Further needs uniform record identifiers, to point to any record from any record, or URL. Full-text queries are also useful.

Storage Size

Record types are implemented via database tables. Some tables due to generalization may grow. Very big tables may be difficult in repair or maintenance.

File Attachments

May be implemented via BLOBs. But how to attach several files to any record?

GROUPWARE DATABASES

Alike Lotus Domino, have several additional disadvantages:

Bad Development Capabilities

There are no triggers, transactions, joins...

WEB DATABASES

Have several disadvantages:

Triggers Implementation

All application codes are concentrated at the server. Why programmer needs to use different programming languages to implement triggers and stored procedures in the database and another procedures in the web server? Why user interface hooks may not be considered as a kind of triggers?

Should be interesting a separate 'triggers server'? Or this may be considered as a kind of application servers?

Database Engines

Why sole engine should be core? There may be many data sources and several engines.

WEB COLLABORATIVE TOOLS

Alike Wiki, have several disadvantages:

Forms, views and queries may be added without metaphor changes, but implementation changes may be great. And what about file attachments?

THIS DATABASE

The goal may to be conceptually better then Lotus Notes or to look alike some Wiki, but with remaining ability to implement any relational database and any data source interface.

Any case, this database has several disadvantages too:

Effectiveness

Triggers level implementation is not very efficient.

One of the problems is repeating cursor loops in recUpd (one for '0R' trigger and one inside dbiUpd) and recDel (for '0R' trigger and dbiDel or recUpd). The last loop is always effectively implemented inside DBI SQL databases, but for DB_Files it should be implemented implicitly inside dbiUpd or dbiDel. To implement '1R' triggers inside recUpd or recDel, and also for effectiveness of DB_Files, dbiUpd and dbiDel should not be oriented to the groups of rows, or there should be a fast additional single row oriented interface. Also recDel should use a fast single row oriented interface of recUpd. So, there should be two interfaces to recUpd, dbiUpd and dbiDel for effectiveness. But this is difficult in develop and test.

Restricted Database API

Database API implements restricted choice of SQL capabilities. SQL is comprehensive, but alien to any host language. It is too difficult to translate host programming to SQL, SQL to triggers implementation, triggers implementation to SQL towards database.

Restricted Database Implementations

It is too difficult for embedded Database Engines to support transactions and many SQL features. It is very difficult to implement transactions covering file attachments.

It is very difficult to implement real full-text search and full-text indexing both for database records and file attachments. Existed external indexing machine should understand data records and access rights. Embedded indexing machine should understand formats of files attached. Database may have it's own full-text implementation also.

Another

See version info. See marked with '!!!' comments in the source code.

CLASSIFICATION

Slots and Methods

Slots are available via set call or $self->{-name} syntax. See initialize source for preferred to be defined in new call slots. Table and Form description (-table, -form) slots, special data fields, and another keywords are denoted specially. The first value listed is the default.

Methods are used via $object->call() syntax.

Slot names begin with '-' sign.

Creation and Setup

new, initialize, class, set; start, end; setup, -setup

Error Processing

-die, -warn, -debug;

die, warn

Locale

-locale, -lang, -charset, -lng;

lng

Misc Data methods

max, min, dwnext, orarg, grep1; strpad, strquot; strdata, strdatah, datastr; dsdClone, dsdMk, dsdParse; strtime, timestr, timeadd; cptran; ishtml, htmlEscape, htmlUnescape, urlEscape, urlUnescape, urlCat, htlsTag; xmlEscape, xmlAttrEscape, xmlTagEscape, xmlUnescape, xmlsTag

File Store

-path, -url, -urf, -fswtr, -fsrdr;

pthForm; pthMk, pthGlob, pthGlobn, pthRm, pthCln, pthCp

Persistent Variables

-var, -serial;

varFile, varLoad, varLock, varStore

Logging

-log, -logm;

logOpen, logLock, logRec

SubObjects

-dbi, -dbiarg, -cgi, -output;

dbi, cgi; hfNew, dbmNew, dbmTable, ccbNew; osCmd; output, outhtm, outhtml, outxml

User Identification

-user, -unames, -ugroups, -AuthUserFile, -AuthGroupFile;

user, userln, uguest, unames, ugroups, ugnames, uglist; ugrexp, ugmember, uadmin; w32IISdpsn, w32agf

Database Options

-serial, -autocommit, -limit, -affect, -affected, -fetched, -limited, -host, -recInsID, -idsplit

Database Description

-title, -table and -form (Table/Form Description); -mdlTable, -mdeTable; Triggers

Table/Form Description
Table Description
Form Description

-table slot contains database tables descriptions. -form slot contains User Interface forms descriptions. Some slots (like -field, -wkey, Triggers, User Interface) are common to -table and -form. '-qXXX' and -limit slots are sufficient to describe queries or views or lists of records. Some slots may appear at database level also.

-field (Field Description); -key, -keycmp, -wkey; -ixcnd, -ixrec; -optrec; -dbd; Triggers; User Interface (-cgcXXX; -subst, -recXXX, -recRead, -qlist; -query, -qfilter, -qhref, -qhrcol, -qfetch, -limit; -cgvXXX)

Field Description

-field Table/Form Description slot contains array ref of field descriptions (hash refs) and formatting strings.

-fld, -expr, -lbl, -lblhtml, -cmt, -flg; -hide, -hidel, -edit, -null; -inp, -inphtml, -ddlb, -ddlbmult, -ddlbtgt; -colspan, -colwidth; -lsthtml

Record level Access Control

-rac; -racAdmin, -racReader, -racWriter; -racActor, -racPrincipal; -editable

Record level Version Control

-rvcInsBy, -rvcInsWhen, -rvcUpdBy, -rvcUpdWhen, -rvcActPtr, -rvcFinState, -rvcCkoState, -rvcDelState.

See also ddoRVC

Record File Attachments

-rfa, -rfdName; -file;

rfdPath, rfdEdmd, rfdGlobn, rfdRm; rfaUpload, rfaRm

See also ddfRFD

Materialised Views

-index, -ixcnd, -ixrec;

recIndex, recReindex

See also ddoRVC, ddvRVV, ddvRHV

Record ID References

-ridRef

See also ddvRRV, ddfRRE

Triggers

Triggers may be defined (in execution order) at database level, table level, form level. Common trigger sub{} arguments are ($self, {command}, {command field => value}, {database field => value}). Database values should be considered as old values in '0R' triggers, as new values in '1R' triggers and also in '1C' triggers of single-row operations.

-recNew0R, -recNew1C; -recForm1R, -recForm1C; -recIns0C, -recIns0R, -recInsID, -recIns1R, -recIns1C; -recUpd0C, -recUpd0R, -recUpd1C; -recDel0C, -recDel0R, -recDel1C; -recIndex0R; -recSel0C; -recRead0C, -recRead0R, -recRead1R, -recRead1C; -recJoint1R

Database Operation

start, end; recCommit, recRollback;

recNew, recForm, recIns, recUpd, recDel; recSel, recList, recRead, recQBF;

recFields, recValues, recData, recKey, recWKey.

See also Database Engines.

Data Record Special fields

Record's hash ref returned from Database Operation calls contains data fields and values. But some fields are specially computed to describe record:

-new, -file, -editable

User Interface

Start review with cgiRun.

Table/Form Description; -pcmd, -pdta, -pout; -form; -cgcXXX; -subst, -qlist; -recXXX (-recNew, -recForm, -recIns, -recUpd, -recDel, -recRead, -recList,...); -httpheader, -htmlstart; -logo, -icons, -menuchs, -menuchs1; -login; -cgvXXX;

cgiRun, cgiParse, cgiQuery; psParse, psEval; htmlStart, htmlHidden, htmlMenu, cgiForm (and also htmlField, cgiDDLB, ddfRVE, ddfRFD, ddfRRE), cgiList, cgiFooter.

See also Perl Script Pages.

Default Data Definitions

-ns, ns; ddoRVC; ddvAll, ddfAll; ddvRVV, ddfRVE; ddvRRV, ddfRRE; ddvRHV; ddfRFD; ddfShow, ddfHide; ddvIndex, ddvFTQuery

SLOTS

Slots

See Slots and Methods

-affect
        => not exists || 1

(Database Options) Number of rows to be affected by DML 'recUpd' or 'recDel' operation. Distinguish from -limit.

-affected

(Database Options) Number of rows really affected by DML 'recIns', 'recUpd', 'recDel' operation. See also -affect

-AuthUserFile
        => not exists || file path

(User Identification) Apache Users file, to be used in uglist method, optional

-AuthGroupFile
        => not exists || file path

(User Identification) Apache Groups file, to be used in ugroups and uglist methods, optional. See also w32agf.

-autocommit
        => 1 || false

(Database Options) Autocommit database mode

-c
        => {}

Internal cache for computed values

-cgcXXX
        => not exists || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) || 'filename.psp' || 'perl filename'
-cgcURL
        => URL to redirect to

(Table/Form Description - User Interface) Redirects cgiRun to execute full external implementation of request or screen alike recNew, recForm, recIns, recUpd, recDel, recRead, recList, recCall. See Perl Script Pages for '*.psp' files description. See -recXXX, -subst, -table for redirections of request to another form or table. See -cgvXXX for external implementation of presentation only.

-cgi
        => not exists || CGI object

(SubObjects) CGI object, if used, created and available via cgi call

-cgvXXX
        => not exists || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) || 'filename.psp' || 'perl filename'

(Table/Form Description - User Interface) Redirects cgiRun to execute presentation external implementation of request or screen alike recNew, recForm, recIns, recUpd, recDel, recRead, recList, recCall. See Perl Script Pages for '*.psp' files description. See -recXXX for redirections of request to another form or table. See -cgcXXX for full external implementation.

-charset
        => locale specific || '1252' || 'sharset code' || not exists

(Locale) Application's charset, see also -locale

-cmt
        => not exists || field comment

(Field Description) Text of field description to display to users. See also -lbl

-colspan
        => not exists || colspan html td element attribute

(Field Description) Number of form layout columns to be occupied by field. See also -colwidth

-colwidth
        => not exists || width html td element attribute

(Field Description) Width of form layout column to be occupied by field. See also -colspan

-debug
        => 0 || 1

(Error Processing) Debug mode switch, debug features level

-dbd
        => not exists || 'dbi' || 'dbm' || ...

(Table Description, Database Description) Database engine used for table or as default for database. See also Database Engines.

-dbi
        => not exists || DBI object

(SubObjects) DBI object, if used, created and available via dbi call, using -dbiarg to create

-dbiarg
        => not exists || 'arguments' || [arguments]

(SubObjects) DBI connection arguments string or array, used in dbi call

-ddlb
        => not exists || sub{}(self, {field}) -> ddlb || [value,...[value=>labels],...] || {value=>label,..., value=>[labels],...} || cursor

(Field Description) Drop-down list box with editable input and produced on button press selection list. See also -ddlbmult, -ddlbtgt

-ddlbmult
        => not exists || boolean

(Field Description) Drop down list box allowing multi value selection. Reserved. See -ddlb.

-ddlbtgt
        => not exists || field name || [field name,.. ? '<+field name',.. ? [field name => label, ? multi],..]

(Field Description) Drop down list box targets. '+' marks multivalue fields. 'multi' mark considered as boolean digit or values delimiter. Single field name will be represented with submit button, array will be represented with javascript buttons; default is current field. See -ddlb.

-die
        => \&croak, see source code

(Error Processing) Failure sub{}: die / croak / confess; using &{$s->{-die} }('error') inside. set(-die=>'core'||'perl'||'Module name') call sets also -warn.

-edit
        => not exists || sub{}({self},{field},edit,query,value) || boolean

(Field Description) Editable field condition. Otherways field will be readonly.

-editable
        => not exists || boolean

(Data Record Special fields, Record level Access Control) Editable record sign. Stamped by Database Operation calls. Useful for User Interface level.

-expr
        => not exists || database field name or formula

(Field Description) Field name as used inside SQL database engine, or SQL expression. Field name for application is explained as -fld

-fetched

(Database Options) Number of rows retrieved from the database query result set. May be -limited by -limit. Distinguish from -affected

-field
        => [{field},..., ''||"\t"||"\n"||"\f"||'text'||sub{},..., {field}]

        => {name => {attributes}} # deprecated

(Table/Form Description - Field Description) Array ref contains field descriptions as a hash refs. Another type entries are for screen formatting. Text or result of sub{} evaluation will be outputted. '' continues labels and fields output in the current row. "\t" skips one table cell. "\n" continues on the next row. "\f" finishes tabular form layout, passes to simple rows.

-file
        => not exists || record file attachments subdirectory

(Data Record Special fields, Record File Attachments) Record file attachments sign and place. Stamped by Database Operation calls. Use rfdPath to obtain absolute location.

-fld
        => field name

(Field Description) Name of the field as used by application. Database field name or expression may be explained by -expr.

-flg
        => not exists || 'akweuql'

(Field Description) Flags of the field:

'a'll operation below, except 'k'ey and 'w'key, default

'k'ey - primary key, -key preffered

'w'here key - optimistic locking key, -wkey preffered

'e'ditable, -edit preffered, see also -hide

'u'pdateable, may be inserted or saved into database

'q'uery form, may be used to form query condition

'l'istable, may be used in lists of records

-form
        => not exists || {form name => {form description} }

(Form Description, User Interface) User Interface forms descriptions.

-fsrdr
        => not exists || [users names]

(File Store) File Store Readers - users names

-fswtr
        => [$ENV{USERNAME} || $^O eq 'MSWin32' ? eval{Win32::LoginName} : `logname`]

(File Store) File Store Writers - users names

-ftext
        => not exists || [field names]

(Table/Form Description) Fields for full-text search. Default is all fields of record.

-hide
        => not exists || sub{}({self},{field},edit,query,value) || boolean

(Field Description) Hide field condition.

-hidel
        => not exists || sub{}({self},{field},edit,query,value) || boolean

(Field Description) Hide field condition with left shift of following layout.

-host
        => see source code

(Database Options) Host name to use in record unique IDs generated, see also -recInsID

-htmlstart
        => not exists || {}

(User Interface) CGI::start_html call parameters hash ref

-httpheader
        => not exists || {}

(User Interface) CGI::header call parameters hash ref

-icons
        => '/icons'

(User Interface) URL to Apache default icons

-idsplit
        => true || false || sub{}($self, {command}, key value)

(Database Options) Split complex record ID to table name and row ID, if record ID is so complex. Used within rmlIdSplit.

-index
        => not exists || boolean

(Materialised Views - Table Description or Database Description) Materialized views support switch, see -ixcnd, -ixrec

-inp
        => not exists || {L<CGI|CGI> widget parameters} || sub{}(C<htmlField> args) -> html

(Field Description) Widget description, mostly in terms of CGI, to which description will be passed. Type selection and additional meanings specified below. See also -ddlb, -ddlbtgt for editable list boxes. See also -inphtml, -lbl, -lblhtml

not exists # text field

-htmlopt=> boolean # html may be, determined via ishtml

-hrefs => boolean # hyperlinks, including 'urlh://' for host relative, 'urlr://' for script relative, 'urlf://' for record file attachments directory relative URLs

-cols => number # text area

-rows => number # text area

-arows => min # text area of variable height

-asize => min # text field of variable length

-labels => sub{}(self) ||{value=>label,...} # list box, see -ddlb for editable features

-values => sub{}(self) ||[value,...] # list box, optional if '-labels'

-rfd => boolean # record file attachments widget

otherwise # text field

-inphtml
        => not exists || html text || sub{}({self},{field},edit,query,value) -> html

(Field Description) HTML presentation of field entry, use it together with -inp. Sub{} will be evaluated to produce HTML string. '$_' in HTML will be replaced with -inp. See also -lblhtml

-ixcnd
        => not exists || boolean || sub{}(self, {command}, {record}) -> boolean

(Table/Form Description) Index table (Materialised Views) indication. Scalar 'true' value is used for indexes should be updated from -recIndex0R indexing trigger. Sub{} used as condition for inclusion of particular record from particular table into index. -ixrec used to obtain values for inclusion/exclusion

-ixrec
        => not exists || sub{}(self, {command}, {record}, '+'||'-') -> {record}||[{record},...]

(Table/Form Description) Index table (Materialised Views) records former. May directly create ('+') or delete ('-') index records, or return values of records to be included or excluded. See also -ixcnd

-key
        => [field name,...]

(Table Description) Key fields names of the table.

-keycmp
        => not exists || sub{}(self, [key a], [key b])

(Table Description) Key compare dbm sub{}. Generally not used. See 'compare' parameter of DB_File.

-lang
        => locale specific || 'en' || 'language abbreviation' || not exists

(Locale) Application's language, see also -locale

-lbl
        => not exists || field label

(Field Description) Label or external name of the field to be displayed to user. See also -lblhtml, -inp, -inphtml

-lblhtml
        => not exists || html text || sub{}({self},{field},edit,query,value) -> html

(Field Description) HTML presentation of field label, use it together with -lbl. Sub{} will be evaluated to produce HTML string. '$_' in HTML will be replaced with -lbl.

-limit
        => not exists (default 512 used) || number

(Database Options, Table/Form Description) Limit of rows to be retrieved from the database query result set. Distinguish from -affect. See also -fetched, -limited.

-limited

(Database Options) Number of rows limited by -limit during retrieve of query result set. Equals to -fetched if set. Distinguish from -affected

-lng
        => '' || not exists || 'language'

(Locale) User's language, about CGI::http('Accept_language'), see also -locale

-locale
        => POSIX::setlocale(&POSIX::LC_CTYPE())

(Locale) Application's locale, set(-locale=>...) call changes also -charset, -lang, -lng.

-log
        => 1 || undef || DBIx::Web::FileHandle object

(Logging) Log file switch / handle, opened with logOpen

-logm
        => 100

(Logging) Log strings list max size to be displayed

-login
        => '/cgi-bin/ntlm/'

(User Identification) Login URL part, where web server authentication is estimated.

        => not exists || HTML

(User Interface) Logotype to display in the button bar

-lsthtml
        => not exists || sub{}($self, cursor, [record]) -> HTML # local $_ =value

(Field Description) Conversion of field value to HTML in the list of records via cgiList. Value may be found in local $_.

-mdeTable
        => not exists || sub{}($self, table name) -> C<-table> changed

(Database Description) Table factory, called if datafile description is not found within -table. May add datafile metadata to -table and create datafile if needed. See also -mdlTable.

-mdlTable
        => not exists || sub{}($self) -> table list

(Database Description) List of datafiles within database. Some datafiles may not be described initially within -table, but may be listed using -mdlTable for recReindex. See also -mdeTable.

-menuchs
-menuchs1
        => not exists || [[form name => form label],...]

(User Interface) User Interface forms list. Default will be generated from -form or -table.

-new
        => not exists || boolean

(Data Record Special fields) New record sign, stamped in recNew, considered in recForm.

-ns
        => {default naming set}

(Default Data Definitions) Default naming set, also available via ns. This is an only place for hard coded default special names. See source code for default naming.

-null
        => null value

(Field Description) Field value to be converted to undef, used by cgiDBData.

-optrec
        => not exists || boolean

(Table Description)

Optional records switch. To allow recRead or recUpd records not really present in the database. -optrec may be used as recUpd keyword also.

-output
        => not exists || sub{}($self, arguments to be printed out)

(SubObjects) Output sub{} to be used instead of 'print' by output calls

-path
       => "$ENV{DOCUMENT_ROOT}/dbix-web" (see source code for more details)

(File Store) Path to File Store. Subdirectories inside File Store (see pthForm): 'var' - variables file 'var.pl' (see varLoad, varStore), 'usergroup' and 'authgroup' files ($^O eq 'MSWin32', w32agf); 'log' - log files (see logRec); 'tmp' - temporary files; 'dbm' - DB_File data files; 'rfa' - attached to records files. See also -url, -urf.

-pdta
        => not exists || {}

(User Interface) User data input parsed, see cgiRun, cgiParse

-pcmd
        => not exists || {}

(User Interface) User command input / output, see cgiRun, cgiParse

-pout
        => not exists || {}

(User Interface) User data output, see cgiRun, cgiParse

-qfetch
        => not exists || sub{}(self, cursor, [borders]) -> success

(Table/Form Description - User Interface) Sub{} to fetch and display next data row by cgiList. Default is formed using -qfilter, -qhref, -qhrcol, -limit

-qfilter
        => not exists || sub{}(self, 'form name', {metadata}, {command}, {record}) -> success

(Table/Form Description - User Interface) Sub{} to filter to user data records by cgiList. Record may be changed during filtering.

-qhrcol
        => not exists || 0...

(Table/Form Description - User Interface) Last column number to display -qhref hyperlink in cgiList. Default is 0 - the first column.

-qhref
        => not exists || {hyperlink spec} || sub{}(self, {record})

(Table/Form Description - User Interface) Specification of hyperlinks (URLs) to be displayed in each data row listed to user by cgiList. Keywords are: '-cmd' => not exists || 'command' || sub{}(self, {record}) - command to be specified in the URL, default is recRead; '-key' => not exists || ['field name',..., ['field name'=>number],...] || sub{}(self, {record}) - -key specification of record to be opened, default is obtained from table/form description; '-form' => not exists || 'form name' || sub{}(self, {record}) - constant name of the form to be opened via URL, default is current table/form name; '-formfld' => not exists || 'field name' - field name to store form name to open via URL.

-qlist
        => not exists || table or form name

(Table/Form Description - User Interface) Substitutes another object name to process recList request from recQBF screen in cgiRun. See also -recXXX, recForm, -subst redirections.

-query
        => not exists || {C<recSel> arguments}

(Table/Form Description - User Interface) Default specification of data records to be retrieved by cgiQuery and listed for user by cgiList.

-rac
        => 1 || boolean

(Database Description) Record level Access Control switch

-racAdmin
        => 'Administrators,root'

(Database Description) Users, can read or edit any record. Format of this value is alike containing list of user names string field. See also uadmin.

-racActor
        => not exists || ['field name',...]

(Database Description, Table/Form Description - Record level Access Control, Default Data Definitions) Field(s) to store names of user(s) to be considered as actors of record. Default is about -rvcUpdBy.

-racPrincipal
        => not exists || ['field name',...]

(Database Description, Table/Form Description - Record level Access Control, Default Data Definitions) Field(s) to store names of user(s) to be considered as principals of record. Default is about -rvcInsBy.

-racReader
        => not exists || [field names]

(Database Description, Table Description) Readers of record - fieldnames with usernames.

-racWriter
        => not exists || [field names]

(Database Description, Table Description) Writers of record - fieldnames with usernames.

-rfa
        => 1 || boolean

(Database Description, Table/Form Description) Record File Attachments switch

-rfdName
        => not exists || sub{}($self, key field name => field value,...)

(in database or table descriptions) Formula to convert record's key into directory name. Default behaviour exists, see rfdName source code

-ridRef
        => not exists || [field name,...]

(Database Description, Table/Form Description - Record ID References) Fields may contain references to another records. Scalar reference may be in form 'record id' or 'table//id'. Embedded into text references are considered as '_key=table//id' or '_key=id%3Dtable//id' URL parts. See also ddvRRV, ddfRRE.

-recDel
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recDel operation UI implementation

-recDel0C
-recDel0R
-recDel1C
        => not exists || sub{}($self, {command}, new {field => value}, database {field => value})

(Database Description, Table Description, Form Description; all executed) recDel triggers before command ('0C'), before each row ('0R'), after command ('1C'). Old values in command ('C') triggers are not available. New values will be surprise! When record versioning, update triggers will be executed too, within.

-recForm
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recForm operation UI implementation. Used also for recNew, recRead, recDel, recQBF operation. See also -subst redirection for all operations, -qlist to redirect from recQBF to recList transition, -recXXX for particular redirections.

-recForm1R
-recForm1C
        => not exists || sub{}($self, {command}, source {field => value}, result {field => value})

(Database Description, Table Description, Form Description; all executed) recForm triggers after each row ('1R') and after command ('1C'). recRead triggers will be executed before, to produce result values.

-recIndex0R
        => not exists || sub{}($self, {command}, new {field => value}, old {field => value})

(Table Description, in table description only) Indexing trigger, may be used instead of -ixcnd and -ixrec. New values hash will be undefined in recDel. Old values hash will be undefined in recIns.

-recIns
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recIns operation UI implementation

-recIns0C
-recIns0R
-recIns1R
-recIns1C
        => not exists || sub{}($self, {command}, source {field => value}, result {field => value})

(Database Description, Table Description, Form Description; all executed) recIns triggers before command ('0C'), before each row ('0R'), after each row ('1R'), after command ('1C'). Result values are not available in '0R' and 'C' triggers. -recForm1R will be executed before -recIns0R; -recInsID - after.

-recInsID
        => not exists || sub{}($self, {command}, {field => value})

(Database Description, Table Description; nearest executed) recIns row ID generation trigger. Default operation exists in Database Description.

-recJoint1R
        => not exists || sub{}($self, {command}, source {field => value}, result {field => value})

(Database Description, Table Description, Form Description; all executed) Executed after any single-record operation '1R' trigger, in recNew, recForm, recIns, recUpd, recRead. May be used to add some calculated fields to record's hash ref will be returned. Distinguish from -recRead UI implementation hash ref form.

-recList
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recList operation UI implementation

-recNew
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recNew operation UI implementation

-recNew0R
        => not exists || sub{}($self, {command}, record {field => value}, sample {field => value})
-recNew1C
        => not exists || sub{}($self, {command})

(Database Description, Table Description, Form Description; all executed) recNew triggers before each row ('0R'), after command ('1C'). Newly created record's hash ref is available in '0R' trigger, which may add some sample field values.

-recRead
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta})  -> $s->{-pout} || {'recRead' args}

(Table/Form Description - User Interface) recRead operation UI implementation. Distinguish hash ref form, will be executed in cgiRun after any single-record User Interface operation, from -recJoint1R trigger inside Database Operation.

-recRead0C
-recRead0R
-recRead1R
-recRead1C
        => not exists || sub{}($self, {command}, source {field => value}, result {field => value})

(Database Description, Table Description, Form Description; all executed) recRead triggers before command ('0C'), before each row ('0R'), after each row ('1R'), after command ('1C'). Result values are not available in '0R' and 'C' triggers. Source values should be ignored.

-recSel0C
        => not exists || sub{}($self, {command}, undef, undef)

(Database Description, Table Description, Form Description; all executed) recSel before command trigger.

-recUpd
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta}) -> $s->{-pout}

(Table/Form Description - User Interface) recUpd operation UI implementation

-recUpd0C
-recUpd0R
-recUpd1C
        => not exists || sub{}($self, {command}, new {field => value}, old {field => value})

(Database Description, Table Description, Form Description; all executed) recUpd triggers before command ('0C'), before each row ('0R'), after command ('1C'). Old values are not available in 'C' triggers.

-recXXX
        => not exists || 'form name' || sub{}($self, 'name', {metadata}, $s->{-pcmd}, $s->{-pdta})  -> $s->{-pout} || {'recXXX' args}

(Table/Form Description - User Interface) -recNew, -recForm, -recIns, -recUpd, -recDel, -recRead, -recList, -recQBF operation UI implementation. See also -subst redirection for all operations and -qlist to redirect from recQBF to recList transition.

-rvcActPtr
        => not exists || 'field name'

(Database Description, Table/Form Description - Record level Version Control) Field to store ID of the actual version of this record. If this field is empty, the record is the last version, actual. If this field is not empty, the record is an old version or is checked-out.

-rvcCkoState
        => not exists || [field name => state]

(Database Description, Table/Form Description - Record level Version Control) Check-out state of record: Field name and state value. If record is check out, old version will not be created at record update. And file attachments may be edited. Check-out record may be checked-in -rvcActPtr record. Distinguish from -rvcFinState, which could not be checked-in.

-rvcDelState
        => not exists || [field name => state]

(Database Description, Table/Form Description - Record level Version Control) Deleted state of record: Field name and state value.

-rvcFinState
        => not exists || [field name => state,...]      

(Database Description, Table/Form Description - Record level Version Control) Field name to store record's state and list of the final state values. When record is not in final state, old version will not be created at record update. And file attachments may be edited. Distinguish from -rvcCkoState, which may be checked-in.

-rvcInsBy
        => not exists || 'field name'

(Database Description, Table/Form Description - Record level Version Control) Field to store name of user record inserted.

-rvcInsWhen
        => not exists || 'field name'   

(Database Description, Table/Form Description - Record level Version Control) Field for time record inserted when

-rvcUpdBy
        => not exists || 'field name'

(Database Description, Table/Form Description - Record level Version Control) Field to store name of user record updated.

-rvcUpdWhen
        => not exists || 'field name'   

(Database Description, Table/Form Description - Record level Version Control) Field for time record updated when

-serial
        => 1 || 0 || 2 || 3

(Database Options) Serialisation level of database operation: 0 - none, 1 - updates, 2 - reads and updates, 3 - everything (exclusive).

-setup
        => not exists || boolean

(Creation and Setup) Allows automatic setup when main::DATA last modify time later varStored

-subst
        => not exists || table or form name

(Table/Form Description - User Interface) Substitutes another object name to process request in cgiRun. See also -recXXX, -recForm, -qlist redirections for particular operations.

-table
        => {table name=>{table description}}

        => form's basic table name

(Database Description) Data records files (database tables) descriptions.

(Table/Form Description) Name of the basic table of the form.

-title
        => ''

(Database Description) Application's title

-ugroups
        => not exists || sub{} || [group names]

(User Identification) User groups sub{} or [] value. See ugroups.

-unames
        => not exists || sub{} || [user name variants]

(User Identification) User name variants sub{} or [] value. See unames.

-urf
        => "file://{-path}/dbix-web"

(File Store) Filesystem URL to File Store, see also -path, -url

-url
        => '/dbix-web'

(File Store) URL to File Store, see also -path, -urf

-user
        => sub{$ENV{REMOTE_USER}||$ENV{USERNAME}||$GUEST}

(User Identification) User name sub{} or value

-var
        => not exists || {variable name => variable value}

(Persistent Variables) Variables hash ref, handled via varLoad and varStore calls.

-warn
       => \&carp, see source code

(Error Processing) Warning sub{}: warn / carp / cluck; using &{$s->{-warn}}('warning') inside. See also -die

-wkey
        => not exists || [field name,...]

(Table/Form Description) Table's fields used for optimistic record locking during edit operation (User Interface recUpd or recDel). -key used if not defined.

METHODS

Methods

See Slots and Methods

ccbNew (condition string) -> new condition code block object

SubObjects. Creates and returns new condition code block object (DBIx::Web::ccbHandle).

cgi () -> CGI object

SubObjects. Returns CGI object, creates it if not exists in -cgi.

cgiDDLB ({-field metadata})

User Interface. Performs drop-down list box via output. Uses -ddlb, -ddlbtgt, -ddlbmult. Used by cgiForm.

cgiFooter ()

User Interface. Outputs cgiRun screen footer with operation and debug messages via output. Uses -fetched, -limited, -affected, -logm, -debug.

cgiForm (table / form name, {table / form metadata}, ? {command}||-pcmd, ? {data}||-pout)

User Interface. Outputs record's form via output, used by cgiRun for record and QBF operations (see -recXXX). See Table/Form Description for form specifications and -field for formatting considerations. See htmlField for independent widgets. Use ddfRFD or -inp for file attachments. Use cgiList and -field for embedded views.

cgiList (?'-!h', table / form name, {table / form metadata}, ? {command} ||-pcmd, ? cursor ||{query} ||[data rows] ||sub{fetch row} ||-query, ? [row and column delimiters] || '<select...' || row delimiter || [default table])

User Interface. Lists data rows via output, used by cgiRun for cgiQuery results. '!h' option turns off table header. See Table/Form Description for query and list specifications.

cgiParse ()

User Interface. Parses CGI input parameters: command, parameters, keywords into -pcmd; data into -pdta. Used internally by cgiRun.

cgiQuery (table / form name, {table / form metadata}, ? {command}||-pcmd) -> cursor

User Interface. Forms and starts query using recSel. Returns cursor. Used by cgiRun, with cgiList follows. See Table/Form Description for query and list specifications.

cgiRun () -> success

User Interface. CGI server response implementation. Sets error handlers. Starts and ends session with start and end. Accepts and parses input parameters with cgiParse into -pcmd and -pdta. Logins if needed (cgi redirection to -login). Determines required action, form and table using -cgcXXX, -subst, -qlist, -recXXX, -table. If external implementation found, invokes it and returns. Invokes action required (stores result in -pout): Database Operation or cgiQuery or embedded implementation. Reassigns -form if found inside -pout. Determines external presentation implementation via -cgvXXX and invokes it. Or outputs http and html headers (htmlStart), hidden fields (htmlHidden), menu bar (htmlMenu), record's form (cgiForm) or list of records (cgiList), screen footer (cgiFooter), form and html footers.

Also implements '-reindex' (run recReindex(1)) and '-setup' (run setup) service command line options.

class () -> class name

Creation and Setup. Returns class name of the object.

cptran (fromCP, toCP, string) -> translated string

Misc Data methods. Translates strings between cyrillic codepages.

datastr (stringified data structure) -> data structure

Misc Data methods. Restores data structure from stringified format of strdata result.

dbi () -> DBI connection object

SubObjects. Returns DBI connection object, creates it if not exists using -dbiarg and -autocommit

dbmNew (file name) -> new isam data file object
dbmNew (-option=>value,...) -> new isam data file object

SubObjects. Creates and returns new isam data file object (DBIx::Web::dbmHandle).

dbmTable (table name) -> new isam datafile object

SubObjects. Returns isam data file object with table name given, creates and opens it if needed using dbmNew(-name=>pthForm('dbm', table name)).

ddfAll () -> (All predefined Fields default definitions)

Default Data Definitions. Default definitions for all possible predefined form fields, may be added to the end of -field layout. See source code.

ddfHide (?'button name') -> -hide definition

Default Data Definitions. -hide/-hidel feature default definition to be used with ddfShow. See source code.

ddfRFD (-option=>value,...) -> {record file directory default field declaration}

User Interface. Returns list may be used as -field description for Record File Attachments. See source code.

ddfRRE (?'version') -> {Record References View default field definition}

Default Data Definitions. Default definition for field with embedded 'reference' view. See source code. See also ddvRRV

ddfRVE (?'reference') -> {Record Versions View default field definition}

Default Data Definitions. Default definition for field with embedded 'version' view. See source code. See also ddvRVV

ddfShow (?'button name', ?[detail fields], ?'html pattern') -> -lblhtml definition

Default Data Definitions. Show empty details default feature (button) definition for -lblhtml. See source code. See also ddfHide

ddoRVC (-option=>value,...) -> (Record Version Control default options definition)

Default Data Definitions. Default table description slots and values for record version control. See source code.

ddvAll () -> (All predefined Views default definitions)

Default Data Definitions. Default definitions for all predefined materialized views. See source code.

ddvFTQuery () -> (Full-text search default view definition)

Default Data Definitions. Default definition for Full-text search page. See inplementation for limitations and details.

ddvIndex () -> (Index page default view definition)

Default Data Definitions. Default definition for Index page enumerating all -menuchs entries.

ddvRHV (?[fields definitions] ||undef, -option=>value,...) -> {Record History View default view definition}

Default Data Definitions. Default definition for 'history' materialized view. See source code.

ddvRRV (?[fields definitions] ||undef, -option=>value,...) -> {Record References View default view definition}

Default Data Definitions. Default definition for 'reference' materialized view. See source code.

ddvRVV (?[fields definitions] ||undef, -option=>value,...) -> {Record Versions View default view definition}

Default Data Definitions. Default definition for 'version' materialized view. See source code.

die (message string) -> failure exception

Error Processing. Raises failure exception like CORE::die or croak. Executes &{$_[0]->{-die}}(@_[1..$#_]). See also -die, -warn, warn

dsdClone (data structure) -> copy of data structure

Misc Data methods. Copies data structure recursively.

dsdMk (data structure) -> stringified data structure

Misc Data methods. Stringifies any data structure with Data::Dumper Use dsdParse to restore data structure from stringified form. Alike strdata.

dsdParse (stringified data structure) -> data structure

Misc Data methods. Restores data structure from stringified format of dsdMk result. Uses Data::Dumper. Alike datastr.

dwnext (string, ? min length) -> next alphanumeric string value

Misc Data methods. Returns the next value of ([0-9]|[a-z]) string left padded to min length. For record IDs generation.

end () -> self object

Creation and Setup. Ends (commits) and cleans operation session or transaction started.

grep1 (list) -> first non-empty value
grep1 (sub{}(), list) -> first non-empty result

Misc Data methods. Returns the first non-empty value or true evaluation result. Alike grep, but differs.

hfNew () -> new file handle object
hfNew (?mode, file name) -> new file handle object

SubObjects. Creates and returns new file handle object (DBIx::Web::FileHandle). File will be opened if file name given.

htlsTag (name, attribute=>value,..., ''=>[content]) -> list
htlsTag (name, attribute=>value,..., '0') -> <name atrr="val"...>
htlsTag (name, attribute=>value,...) -> <name atrr="val"... />
htlsTag ({-tag=>name, attribute=>value,...})
htlsTag ([[name,...],...{-tag=>name,...}],...)
htlsTag (..., "\n")

Misc Data methods. Converts parameters given to the list to print HTML tag with 'name', 'attributes' and optional 'content' tags inside. Leading '-' signs in attribute names are ignored. Values are escaped. Newlines string may be the last parameter to format output. The list structure will not be documented. See also xmlsTag, outhtm

htmlEscape (strings) -> escaped
htmlUnescape (string) -> unecaped

Misc Data methods. Escapes and unescapes to and from HTML text. See also urlEscape.

htmlField (name, title, {-inp metadata}, value) -> html field string

User Interface. Generates HTML field, used by cgiForm. Empty name means readonly. See -inp for metadata.

htmlHidden () -> hidden fields html string

User Interface. Generates hidden fields HTML to output by cgiRun Uses -pcmd.

htmlMenu () -> screen menu bar html string

User Interface. Generates menu bar HTML to output by cgiRun Uses -pcmd, -pdta, -pout.

htmlStart () -> http and html headers string

User Interface. Generates http and html headers using -httpheader, -htmlstart, start_multipart_form to output by cgiRun

initialize (-option=>value,...) -> initiated as DBIx::Web object

Creation and Setup. Initiates new DBIx::Web object. Used internally, by new(). See initialize and set sources for defaults.

ishtml (string) -> alike HTML?

Misc Data methods. Looks string given like HTML code?

lng (index, 'string', ?additional values) -> user language specific string

Locale. Returns user language specific variant of string given, short (index=0) or long (index=1). See language translations in '$LNG' hash ref in the source code.

logOpen () -> -log

Logging. Opens Log file. This does start call.

logLock (lock level) -> success

Logging. Locks Log file. This is not needed.

logRec (data list) -> success

Logging. Add record to Log file.

max (number, number) -> maximum

Misc Data methods. Maximum of two numbers given.

min (number, number) -> minimum

Misc Data methods. Minimum of two numbers given.

new ('class', -option=>value,...) -> new DBIx::Web object

Creation and Setup. Creates new DBIx::Web object. Calls initialize(-option=>value,...).

ns () -> {default naming set}
ns (metaname) -> default name

Default Data Definitions. Default naming set (-ns) interface.

orarg (-X, argument,...) -> first succeeded argument
orarg (sub{}(), argument,...) -> first succeeded argument

Misc Data methods. The value of the first succeeded argument. Alike grep1, but differs.

osCmd (?opt, command, arguments) -> success

SubObjects. Invokes operating system command given. Options: '-i'gnore return code, '-h'ide output.

output (strings list) -> success
outhtm (HTML tag data structure) -> success
outhtml (HTML tag data structure) -> success
outxml (XML tag data structure) -> success

SubObjects. Outputs data given via -output sub{} call or print. htlsTag or xmlsTag called to stringify tag data structure.

psEval (? '-e', filename, ? base URL)

User Interface. Evaluates perl script file using psParse. 'e'mbeddable option prevents output of HTTP and HTML headers. Relative filename will be based on '-path/psp/' with -url as default base URL. See Perl Script Pages.

psParse (? '-e', perl script source string, ? base URL) -> perl source string

User Interface. Converts HTML with embedded perl into perl source with output calls. 'e'mbeddable html option prevents generation output of html headers. Perl code markers are: '<% perl formula %>', '<script> perl script </script>', '<script language=PerlScript|Perl runat=Server>'. '@_' considered to contain application object, options, filename, base URL, additional args. See Perl Script Pages.

pthCln (path) -> success

File Store. Removes path if empty. Recourses bottom-up. Empty path may contain '.htaccess' files.

pthCp (source, target) -> success

File Store. Copies source path to target using operating system copy command via osCmd. Options: '-d'irectory target hint, '-f'ile target hint, '-r'ecurse subdirectories, '-i'gnore errors.

pthGlob (path mask) -> entries paths list

File Store. Lists directory's contents by mask. Full path names will be returned

pthGlobn (path mask) -> entries names list

File Store. Lists directory's contents by mask. Relative names will be returned

pthForm (type, name,...) -> filesystem path string

File Store. Forms filesystem path for 'tmp'||'log'||'var'||'dbm'||'rfa' type. Creates type directory if needed.

pthMk (path) -> success

File Store. Creates directory if needed. Returns 1 if directory exists, 2 if directory was created.

pthRm (?opt, path) -> success

File Store. Removes path if needed. Options: '-r'ecurse subdirectories, '-i'gnore errors.

recCommit () -> self

Database Operation. Commits changes to database. Called from end. See also recRollback

recData ({-keyword ||fieldname => value,...}) -> {fieldname=>value,...}

Database Operation. Obtains data field names and values from record manipulation hash ref. See also recFields, recValues, recKey

recDel (? -table => name, ? -form => name, ? -key => {original recKey}, ? -where => 'condition') -> successful {command}

Database Operation. Deletes record(s) into database, under '-key' or '-where' conditions. When Record level Version Control, operation will be passed to recUpd. But recDel triggers (-recDel0C, -recDel0R, -recDel1C) will be executed anyway. Returns command hash ref or the result of recUpd.

recFields ({-keyword ||fieldname => value,...}) -> field names

Database Operation. Lists field names from record manipulation hash ref. See also recValues

recForm (? -table => name, ? -form => name, ? (-data => {fieldname => value,..}) || (fieldname => value,..), ? -key => {original recKey}) -> formed {field => value,...}

Database Operation. Recalculates record, new or existing in database. Original field values will be obtained via recRead(-table=>name, -key=>{original recKey}) and added to new data given if not exists. -recForm1R, -recForm1C triggers will be executed.

recIndex (index table name, key {field=>value}, ? data {field=>value})

Materialised Views. Update index entry with key given. Index entry will be deleted if undefined reference to hash of data values. Useful for -recIndex0R trigger.

recIns (? -table => name, ? -form => name, ? (-data => {fieldname => value,..}) || (fieldname => value,..), ? -key => {prototype recKey}) -> successfully inserted {field => value,...}
recIns (...? -from => recSel cursor) -> successful {command}

Database Operation. Inserts record(s) into database. Data to be inserted may be given from prototype record via recRead(-table=>name, -key=>{original recKey}), or recSel cursor. Then, given field values will be applied; -rvcInsBy -rvcUpdBy, -rvcInsWhen, -rvcUpdWhen filled; -recForm1R, -recIns0R, -recInsID executed; record inserted into database; <-recIns1R>, -recJoint1R, -recIns1C executed. Returns record inserted, or command hash ref when insertion from cursor. See also recNew and recForm, but they are not required to prepare data to be inserted.

recKey (table name, {fieldname => value,...}) -> {keyfield => value,...}

Database Operation. Obtains Key fields names and values from record's data hash ref using -key. See also recData, recWKey

recList () -> recSel(@_)

Database Operation. Lists records from database. Passes all work to recSel now, may be redesigned.

recNew (? -table => name, ? -form => name, ? (-data => {fieldname => value,..}) || (fieldname => value,..), ? -key => {prototype recKey}) -> successfully new {field => value,...}

Database Operation. Creates a new data record to be inserted into database. Prototype's field values obtained via recRead(-table=>name, -key=>{prototype recKey}), but not used instead of -recNew0R. Given field values used to initiate new record's hash ref, -recNew0R executed, -rvcInsBy -rvcUpdBy, -rvcInsWhen, -rvcUpdWhen filled, -recNew1R, -recJoint1R, -recNew1C executed. The following calls may be recForm and recIns.

recQBF

Database Operation - User Interface. This is not method, only User Interface query condition command and screen behaviour, implemented within cgiRun and cgiForm

recRead (? -table => 'table name', ? -form => name ? -key => {field name=>value,...}, ? -where => 'condition', ? -optrec => false || true, ? -version => false || true ) -> successfully read {fieldname => value,...}

Database Operation. Reads single record from database using recSel, returns this record as a hash ref (with -file, -editable slots if applicable). Executes -recRead1R, -recJoint1R, -recRead1C.

recReindex (clear?, ?index names) -> success

Materialised Views. Reindexes database. List of selected indexes to rebuild may be provided. Indexes will be truncated before reindexing if 'clear'.

recRollback () -> self

Database Operation. Rollbacks changes to database. Should be called from $SIG{__DIE__}, see set source for example. See also recCommit.

recSel ( -table => 'from clause' || [table name, [table, alias], [table, alias, join],...], ? -data => [field, [field => alias], {-fld => alias, -expr => formula,..},...], ? -key => {field name => value,...}, ? -where => 'where clause' || ['where clause',...], ? -urole => 'author'||'authors'||'actors'||'principals', ? -uname => 'role username' ? -ftext => 'full-text search string', ? -version => false ||true, ? -order => string || [field, [field => order],...], ? -keyord => -(a|f|d|b)(all|eq|ge|gt|le|lt), ? -filter=> sub{}(cursor, undef, {field=>value,...}) ) -> cursor

Database Operation. Retrieves records from database. Cursor's slot -rec with hash ref {field alias || name => value,...} is bound as field variables. Cursor's slot -rfr contains array ref with references to values in -rec in order of -data list. At least fetch, fetchrow_arrayref, fetchrow_hashref, finish, close methods are supported by cursor. See also -recSel0C, recList, recRead.

recUpd (? -table => name, ? -form => name, ? (-data => {fieldname => value,..}) || (fieldname => value,..), ? -key => {original recKey}, ? -where => 'condition', ? -optrec => false ||true) -> successfully updated {field => value,...} || successful {command}

Database Operation. Updates record(s) into database, under '-key' or '-where' conditions. With '-optrec', record will be inserted if not present. Returns record updated if one only, or command hash ref if zero or more then one record updated. See also -recUpd0C, -recUpd0R, -recJoint1R, -recUpd1C.

recValues ({-keyword ||fieldname => value,...}) -> field values

Database Operation. Lists field values from record manipulation hash ref in corresponding to recFields order

recWKey (table name, {fieldname => value,...}) -> {keyfield => value,...}

Database Operation. Alike recKey, but using -wkey and providing optimistic locking.

rfaRm ({rec data} ||(table name, {rec data}), attachment name || [list of attachments names])

Record File Attachments. Removes file attachments listed (alike rfdGlobn output). Record should be -editable with -file, which are Data Record Special fields provided by Database Operation.

rfaUpload ({rec data} ||(table name, {rec data}), CGI filefield)

Record File Attachments. Adds record's file attachment from CGI::upload. Record should be -editable with -file, which are Data Record Special fields provided by Database Operation.

rfdEdmd (table name ||{command}, {rec data}) -> attachments edit allowed?

Record File Attachments. Record's state (-rvcFinState) permits editing of file attachments

rfdGlobn ({rec data} ||(table name, {rec data}), ?subdirectory,...) -> list of file attachments

Record File Attachments. Returns list of record's file attachments names, relative to rfdPath.

rfdPath (-path ||-url ||-urf => ({rec data} ||(table name, {rec data})), ?subdirectory,...) -> path to file attachments

Record File Attachments. Returns path to record's file attachments. This may be absolute filesystem path (-path), URL (-url), or filesystem URL (-urf). Database Operation provides -file, one of Data Record Special fields, if file attachments present.

rfdRm ({rec data} ||(table name, {rec data})) -> path removed

Record File Attachments. Removes record's file attachments directory and cleans the path bottom-up. Record should be -editable with -file, which are Data Record Special fields provided by Database Operation.

set () -> (slot names of the object)
set (-option) -> value of the option given
set (-option=>value,...) -> self object

Creation and Setup. Retrieves and sets values of the SLOTS. $s->{-option} direct access may be used also, but set smartly processes some options.

setup ()

Creation and Setup. Reads and executes setup script from main::DATA file handle. See examples source for details.

start (-option=>value,...) -> self object

Creation and Setup. Starts operation session or transaction. Cleans previous session or transaction state. Uses set to assign options. end ends (commits) and cleans session or transaction started.

strdata (data structure) -> stringified

Misc Data methods. Stringifies any data structure. Special strdatah form is for optimization needs. Use datastr to restore data structure from string.

strdatah (key=>value,...) -> stringified hash

Misc Data methods. Stringifies hash, see strdata also.

strpad (string, ?pad char, ?min length) -> left padded string

Misc Data methods. Default pad char is '0', default min length is $NLEN, string will not be trimmed.

strquot (value) -> quoted and escaped

Misc Data methods. Escapes and quotes value given if needed.

strtime (?mask, time ||localtime ||gmtime) -> stringified

Misc Data methods. Stringifies time value by mask. Default mask is 'yyyy-mm-dd hh:mm:ss' (ISO). POSIX::strftime uses different mask agreement. See also timestr.

timeadd (seconds, add seconds, ?minutes, ?hours, ?days, ?months, ?years) -> seconds incremented

Misc Data methods.

Add values given to time given. Calculation via POSIX::mktime.

timestr (?mask, stringified time) -> seconds

Misc Data methods. Converts stringified with strtime time string to seconds form with POSIX::mktime

uadmin () -> is current user an admin?

User Identification. Returns true if current user is a member of -racAdmin, just ugmember(-racAdmin).

uglist (? '-ug', ? [] || {}) -> [user and group names]

User Identification. Returns user ('-u') and group ('-g') names in array ([]) or hash ({}) ref. Default is both ('-ug') in array ref ([]). Uses -AuthUserFile and -AuthGroupFile, or Win32API::Net.

ugmember (group name strings or array refs) -> is current user a member?

User Identification. Returns true if current user is a member of one of the groups given. Argument may be a group name, a string with the list of group names, a reference to array of variants above.

ugnames () -> [current user and group names]

User Identification. Returns reference to array with names of current user (unames) and groups current user belongs to (ugroups).

ugrexp () -> sub{}('user,user,...') matching ugnames

User Identification. Returns sub{} to match string with user names list against ugnames

ugroups () -> [current user group names]

User Identification. Returns reference to array with names of groups current user belongs to. Uses -ugroups sub{} or value. Default is using -AuthGroupFile or w32agf generated files.

uguest () -> is current user a guest?

User Identification. Returns true if current user is not logged in.

unames () -> [current user name variants]

User Identification. Returns reference to array with variants of current user name. Uses -unames sub{} or value. Default is [user] with userln and 'domain\\user' form added if applicable and not met.

urlCat (url, name=>value,...) -> escaped URL
urlEscape (strings) -> escaped
urlUnescape (string) -> unecaped

Misc Data methods. Escapes and unescapes to and from URL format. See also htmlEscape.

user () -> current user name

User Identification. Returns name of the current user. Uses -user sub{} or value. Translates 'domain\\user' form to 'user@domain'.

userln () -> current user local name

User Identification. Returns local name of the current user, or user. User name domain component (after '@') is discarded if it equals to host name domain component (Windows or DNS).

varFile () -> variables store filename

Persistent Variables. Returns file name to store values of variables.

varLoad (?lock) -> self object

Persistent Variables. Loads variables into -var. Default lock level is LOCK_SH. File will be locked until end call.

varLock (?lock) -> success

Persistent Variables. Locks variables file. Default is LOCK_EX. File will be locked until end call.

varStore () -> self

Persistent Variables. Stores -var into variables file. LOCK_EX is used. File will be locked until end call.

w32agf () -> success

User Identification. Creates or periodically updates user group files using Microsoft Windows system catalogue. pthForm('var','usergroup') file is useful for ugroups. pthForm('var','authgroup') file may be used as Apache's 'AuthGroupFile'. -AuthGroupFile should not be set to pthForm('var','authgroup'), it should be set only to externally controlled file!

w32IISdpsn () -> success

User Identification. Deimpersonation of authenticated user session on Microsoft IIS. See source for details and warnings!

warn (message string) -> warning raise

Error Processing. Raises warning like CORE::warn or carp. Executes &{$_[0]->{-warn}}(@_[1..$#_]). See also -die, -warn, die.

xmlEscape (strings) -> escaped
xmlAttrEscape (strings) -> escaped as xmlEscape
xmlTagEscape (strings) -> escaped
xmlUnescape (string) -> unecaped

Misc Data methods. Escapes and unescapes to and from XML text. See also htmlEscape.

xmlsTag (name, attribute=>value,..., ''=>[content]) -> list
xmlsTag (name, attribute=>value,..., '0') -> <name atrr="val"...>
xmlsTag (name, attribute=>value,...) -> <name atrr="val"... />
xmlsTag ({-tag=>name, attribute=>value,...})
xmlsTag ([[name,...],...{-tag=>name,...}],...)
xmlsTag (..., "\n")

Misc Data methods. Converts parameters given to the list to print XML tag with 'name', 'attributes' and optional 'content' tags inside. Leading '-' signs in attribute names are ignored. Values are escaped. Newlines string may be the last parameter to format output. The list structure will not be documented. See also htlsTag, outxml

Database Engines

Database Engines

Logical database functionality is implemented in recXXX methods. Corresponding 'Physical' database interfaces are implemented in dbiXXX methods. See source for details.

DBI engine

-dbd eq 'dbi'. See DBI, -dbi, -dbiarg, dbi.

DB_File engine

-dbd eq 'dbm'. See DB_File, dbmTable.

XML record files engine

-dbd eq 'xmr'. May be in future?

Inbox items engine

May be in future?

Perl Script Pages

Perl Script Pages

This is HTML (may be XML?) files with embedded Perl code. This may be CGI scripts with HTML following '__END__'. There is simplest and shortest implementation.

psParse method translates perl script string into perl source; '@_' will contain application object, options, filename, base URL, additional args. psEval method executes perl script file by parsing, compiling into sub{}, evaluating.

VERSION

2004-06-13 - Development Version 0.52

ddvFTQuery created. Log more readable. Some corrections. This should not be used yet...

2004-06-06 - Development Version 0.51

CSS support. ddvIndex created. Some error corrections. This should not be used yet...

2004-05-16 - Publication of Version 0.50

This should not be used yet, only looked at, may not work at all.

ToDo

See beginning of source code

2004-03-16 - Paused

http://makarov.arkhangelsk.ru/index-anton.htm

2004-01-29 - Preview Release

This should not be used yet, only looked at, may not work at all.

2004-01-26 - Size Analysis

The biggest are User Interface (43.7 Kb), Database Options (39.5 Kb), tools (30 Kb, Misc Data methods and SubObjects). Details, in kilobytes:

Creation and Setup 12

Misc Data methods 9.6

SubObjects 3 + 20.7 of internal objects

File Store 5.6

Persistent Variables 1

Logging 1.2

User Identification 10.4

Database Options 39.5

User Interface 43.7

Default Data Definitions 3.4

2003-09-16 - 2004-01-25 - Initial Implementation and Documentation.

ToDo
  - see Web.pm

LICENSE

This is free software; you can use redistribute it and/or modify it under the same terms as Perl itself.

Without specially written agreement prohibited using completely, partially or in ideas for impairing nature, wood and timber, mining, cosmic industries in Archangel region; Russian kgbists, bureaucracy and vertical functionary structures.

AUTHOR

Andrew V Makarow <makarow@mail.com> with aid of Anton Uemlyanin

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 2759:

You forgot a '=back' before '=head2'

Around line 2779:

'=item' outside of any '=over'

Around line 2784:

You forgot a '=back' before '=head2'

Around line 2825:

'=item' outside of any '=over'