NAME

ATMConfig - manage ApTest Manager configuration files

AUTHOR

Shane P. McCarron <shane@aptest.com>

COPYRIGHT

Copyright 2001-2011 Applied Testing and Technology, Inc. All Rights Reserved.

SYNOPSIS

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.

DATA STRUCTURE

lock

a handle to the lock that is set for the object

writeable

a boolean that indicates whether the session is open read/write

usingDBM

a boolean to indicate if the file is from a DBM source

param->
userName

a hash of information about each user defined in the suite {userName}->{email, fullname, phoneNumber, password}

acl

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}

report

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}

METHODS

new - open up the configuration file

$cfg = new ATMConfig(read/write [, timeout]);

Creates a new configuration object.

read/write

boolean set to True if the existing session needs to be writeable. Defaults to readOnly.

timeout

the number of seconds to wait for a lock. Defaults to 60 seconds.

returns a reference to the ATMConfig object.

dump - dump out all the parameters and their calues

$output = $cfg->dump() ;

Returns a newline separated list of properties and values.

path - get the path to the config database

returns a path to the config database file

print - print the contents of the configuration file

$cfg->print();
    $cfg->print(user);

returns the string-ified version of the entire session, or just the contents of test testNum, if specified.

numParams - accessor for the number of parameters

$count = $cfg->numParams();

returns the number of options in the configuration system

plist - return a complete list of parameter names

@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.

param - get/set parameter values

$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.

priority - get the priority for a field

$val = $cfg->priority(name);

returns a priority for a field

sortOrder - get the sort order position for a field

$val = $cfg->sortOrder(name);

returns a sort order position for a field.

Return undef if no sort order has been specified.

atmpro - get the atmpro flag for a field

$val = $cfg->atmpro(name);

returns the atmpro flag for a field

prompt - get the prompt for a field

$val = $cfg->prompt(name);

returns a prompt for a field

size - get the size for the 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.

style - get the style for the field

$val = $cfg->style(name);

Returns a style for a field. If there is no style specified, the default is plain.

descs - return a array of descriptions for an enum

@descs = $cfg->descs(name);

returns an array of descriptions, or undef if no descriptions are defined.

values - return a array of values for an enum

@values = $cfg->values(name);

returns an array of values, or undef if no values are defined.

type - get the type for the field

$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.

func - get the transformation function for a field

$val = $cfg->func(name);

returns a func value for a field.

uifunc - get the change handler 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.

default - get the default value for a field

$val = $cfg->default(name);

returns a default value for a field.

format - format a field for presentation or editing

$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.