ApTest::Base::Fields - base class for generic field methods
Shane P. McCarron <firstname.lastname@example.org>
Copyright 2001-2013 Applied Testing and Technology, Inc. All Rights Reserved.
use ApTest::Base::Fields ; use base qw( ApTest::Base::Fields ) ;
$output = $field->asHtml($value [, $oval] ) ;
value is the value to render.
oval is a supporting value that will be used as a URL when interpreting atm_prid fields.
Returns the content, annotated according to its style.
$res = $field->compare(val1, val2) ;
val1 and val2 are values from the field.
This function behaves differently depending upon the field type. For text fields, the style determines whether the contents are compared as numbers or strings.
For menu fields, the "ordered" flag and the field's style work together to determine how the comparison is done. If the field has the "ordered" flag set, then the comparison is done by comparing the ordinals of the values' positions in the list of field values. Otherwise, if the style of the field is plain the comparison is done as text. If the style of the field is numeric, the comparison is done as numbers.
Returns the results of the comparison (-1 if val1 < val2, 0 if they are equal, and +1 if val1 > val2).
$default = $field->default();
my $bool = $field->editable() ;
Returns true all the time - override in the real class if there are fields that cannot be edited in the graphical field editor.
Returns true if the value is tagged as obsolete.
returns true if the ordered flag is set for this field.
$pRef = $field->parent() ; $field->parent( $self ) ;
Returns a reference to the parent object (the object that owns this field. Returns NULL if the parent is not defined.
@oList = $field->obsolete( val1, val2...) ;
vals passed are captured as obsolete values.
$ord = $field->ordinal($val) ;
val is a legal value for the field. The field is typically a list field that has a collection of user-defined values. The field may also be the "id" field, in which case the val is assumed to be the path of a folder or file, and the cooresponding ordinal is discovered by querying the underlying database.
my $string = $self->serialize() ;
Returns a stringified version of this object suitable for inclusion in the SCHEMA file. Values are emitted in the order
NAME TYPE STYPE SIZE LABEL FLAGS VALUES
@vals = $field->visibleValues( curRef )
curRef is a reference to a list of currently selected values for the field.
Returns the list of values representing the following:
FieldValues - ( obsoleteValues XOR @$curRef )
If curRef is not defined, or the target of the reference is an empty list, then all values marked as obsolete will be removed from the list of available values.
$format = $field->xlsFormat( workbook ) ;
workbook is a reference to a worksheet object.
Creates a new format within the worksheet that supports the data in the field. Returns a reference to the format so that it can be used to set the format for a field or a column.
$fmtHash = $field->xlsDataValidation() ;
Returns a reference to a hash of excel data validation constructs or undef if the field requires no validation.
my $tName = $field->SQL_fieldTable( ) ;
Returns the name of the SQL table in which the field is stored.
my $clause = $field->SQL_searchClause( selectorRef [, usingGlobal] ) ;
selectorRef is a reference to a hash with the selection pattern.
usingGlobal is a boolean - if true, a global search is underway
Returns a SQL-compatible WHERE clause that implements that pattern.
Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.