ATMConfig - manage ApTest Manager configuration files
Shane P. McCarron <shane@aptest.com>
Copyright 2001-2011 Applied Testing and Technology, Inc. All Rights Reserved.
use ATMConfig; # open up the configuration database for writing my $cfg = new ATMConfig(1); # get/set a parameter my $value = $cfg->param('name'); $cfg->param('name', 'value'); # save the config information $cfg->save(); # release the config information $cfg->release();
The ATMConfig object allows examining and managing the ATM configuration parameters.
a handle to the lock that is set for the object
a boolean that indicates whether the session is open read/write
a boolean to indicate if the file is from a DBM source
a hash of information about each user defined in the suite {userName}->{email, fullname, phoneNumber, password}
a hash access control list for the features and test suites {acl}->{account, execute, browse, edit, manage}. Also sub-hashes for test suites in {acl}->{suiteName}
a hash containing report preferences, including a sub-hash containing report customizations on a per test suite/per report basis
{report}->{pref1, pref2}, {report}->{custom}->{suiteName}->{pref1, pref2}
$cfg = new ATMConfig(read/write [, timeout]);
Creates a new configuration object.
boolean set to True if the existing session needs to be writeable. Defaults to readOnly.
the number of seconds to wait for a lock. Defaults to 60 seconds.
returns a reference to the ATMConfig object.
$output = $cfg->dump() ;
Returns a newline separated list of properties and values.
returns a path to the config database file
$cfg->print(); $cfg->print(user);
returns the string-ified version of the entire session, or just the contents of test testNum, if specified.
$count = $cfg->numParams();
returns the number of options in the configuration system
@list = $cfg->plist();
returns a sorted array of the names of the defined configuration parameters.
Names are sorted by priority, then whether they're a header or not, then by "sort order" (if they have one), then by parameter name.
$val = $cfg->param(name); $cfg->param(name, value);
returns the value of a parameter, setting it if specified. If name is not specified, a pointer to all of the parameter data is returned.
$val = $cfg->priority(name);
returns a priority for a field
$val = $cfg->sortOrder(name);
returns a sort order position for a field.
Return undef if no sort order has been specified.
$val = $cfg->atmpro(name);
returns the atmpro flag for a field
$val = $cfg->prompt(name);
returns a prompt for a field
$val = $cfg->size(name);
returns a size for a field. This is field type dependent. If it is a text area field, it is the number of rows tall. If it is a text field, it is the maximum number of characters permitted in the field. For a boolean, it doesn't matter.
$val = $cfg->style(name);
Returns a style for a field. If there is no style specified, the default is plain.
@descs = $cfg->descs(name);
returns an array of descriptions, or undef if no descriptions are defined.
@values = $cfg->values(name);
returns an array of values, or undef if no values are defined.
$val = $cfg->type(name);
returns a type for a field, where legal types are textarea, text, and boolean. If the type is not defined, the default is text.
$val = $cfg->func(name);
returns a func value for a field.
$val = $cfg->uifunc( name );
Returns a string to be used in an onclick (boolean) or onchange (text, textarea, select) handler, or undef if there is no field called "name", or the field has no uifunc parameter defined.
$val = $cfg->default(name);
returns a default value for a field.
$output = $self->format(name, edit, value);
name - the name of the field
edit - a boolean indicating whether to present an input field or just the output.
value - the value to present. If not defined, uses the value from the current data structure.
returns the output in a form ready for inclusion in an HTML page.
Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.