attribute::translate_datatype (public)

 attribute::translate_datatype datatype

Defined in packages/acs-subsite/tcl/attribute-procs.tcl

translates the datatype into one that can be validated. Default datatype is text (when no validator is found)

Parameters:
datatype
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_attribute_datatypes acs_subsite_attribute_datatypes (test acs-subsite) attribute::translate_datatype attribute::translate_datatype test_acs_subsite_attribute_datatypes->attribute::translate_datatype attribute::datatype_validator_exists_p attribute::datatype_validator_exists_p (public) attribute::translate_datatype->attribute::datatype_validator_exists_p attribute::add_form_elements attribute::add_form_elements (public) attribute::add_form_elements->attribute::translate_datatype

Testcases:
acs_subsite_attribute_datatypes
Source code:
        if { [datatype_validator_exists_p $datatype] } {
            return $datatype
        }
        switch -- $datatype {
            boolean { set datatype "text" }
            keyword { set datatype "text" }
            money { set datatype "integer" }
            number { set datatype "integer" }
            string { set datatype "text" }
        }
        if { [datatype_validator_exists_p $datatype] } {
            return $datatype
        }
        # No validator exists... return text as default
        return "text"
Generic XQL file:
packages/acs-subsite/tcl/attribute-procs.xql

PostgreSQL XQL file:
packages/acs-subsite/tcl/attribute-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/attribute-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: