NAME
oEdtk::trackEdtk - production tracking: configuration, environment and insert
SYNOPSIS
use oEdtk::trackEdtk qw(init_Tracking track_Obj);
init_Tracking($mod_ed, $job_evt, $job_user, @keys);
# ... run the job ...
track_Obj($count, $job_evt, @key_values);
DESCRIPTION
Legacy production-tracking helper. It locates and loads the site configuration into %ENV, then records tracking events either in a database (DB), in a per-process SQLite file (FDB) or in flat log files (LOG), following EDTK_TRACK_MODE. oEdtk::Tracking is its object-oriented successor; this library is meant to be taken over by it.
FUNCTIONS
ini_Edtk_Conf
my $ini = ini_Edtk_Conf();
Locate and return the valid configuration file, following the iniEdtk chain declared in the hostname section, and set $ENV{EDTK_INIEDTK}.
conf_To_Env
conf_To_Env($confIni, $section);
Load a section of the configuration file into %ENV, with the hostname section overriding the section values when it exists.
env_Var_Completion
env_Var_Completion(\$script);
Expand the environment variables nested inside $script, level by level, until none remains.
init_Tracking
my $single_id = init_Tracking($mod_ed, $job_evt, $job_user, @keys);
Initialise the tracking environment: define the edition mode, the job event and the user, then the optional keys, and return the single identifier of the run.
track_Obj
track_Obj($count, $job_evt, @key_values);
Record one tracked object with the current settings. $count defaults to one, and the optional key values follow the order given to "init_Tracking".
define_Mod_Ed
my $code = define_Mod_Ed($value);
Set the edition mode (Undef, Batch, Tp, Web or Mail) and return its one-letter code (U by default).
define_Job_Evt
my $code = define_Job_Evt($value);
Set the job event (Job, Spool, Document, Line, Warning, Error, Halt or Reject) and return its one-letter code (J by default).
define_Track_Key
my $name = define_Track_Key($value, $index);
Define the column name of the $index-th optional tracking key. The name is truncated to five characters and upper-cased without accents, and refused when the index exceeds EDTK_MAX_USER_KEY.
edit_Track_Table
edit_Track_Table($request);
Run a SELECT against the tracking table and display the resulting rows.
create_Track_Table
create_Track_Table();
Create the tracking table for the current DSN, with one name/value column pair per configured user key.
prepare_Tracking_Env
prepare_Tracking_Env();
Load the tracking configuration and normalise the tracking mode.
drop_Track_Table
drop_Track_Table();
Drop the tracking table for the current DSN, if it exists.
The following subs are internal helpers and are not part of the public API: open_Tracking_Env, open_DBI, define_Job_User, subInsert_Log, subInsert_DB, noSub, test_exist_table, fetchall_DBI, edit_All_rTab and subClose_DB.
AUTHOR
The oEdtk team.