ad_page_contract_filter_proc_object_id (public)

 ad_page_contract_filter_proc_object_id name value_varname

Defined in packages/acs-tcl/tcl/tcl-documentation-procs.tcl

Checks whether the value is a valid object_id, i.e. in the range defined for the SQL datatype "integer", which is the same for Oracle and PostgreSQL. In case, object_types are altered in future versions of OpenACS to e.g. "longinteger", this function has to be adjusted as well. The function is essentially the same as ad_page_contract_filter "integer", but with the additional value range check.

Parameters:
name
value_varname
Author:
Gustaf Neumann
Created:
May 23, 2021

Partial Call Graph (max 5 caller/called nodes):
%3 test_ad_page_contract_filters ad_page_contract_filters (test acs-tcl) ad_page_contract_filter_proc_object_id ad_page_contract_filter_proc_object_id test_ad_page_contract_filters->ad_page_contract_filter_proc_object_id _ _ (public) ad_page_contract_filter_proc_object_id->_ ad_complain ad_complain (public) ad_page_contract_filter_proc_object_id->ad_complain util::trim_leading_zeros util::trim_leading_zeros (public) ad_page_contract_filter_proc_object_id->util::trim_leading_zeros ad_page_contract_filter_proc_object_type ad_page_contract_filter_proc_object_type (public) ad_page_contract_filter_proc_object_type->ad_page_contract_filter_proc_object_id

Testcases:
ad_page_contract_filters
Source code:
upvar $value_varname value

    if { [regexp {^(-)?(\d+)$} $value _ sign rest] } {
        set value $sign[util::trim_leading_zeros $rest]
        if {[string is integer -strict $value]
            && $value >= -2147483648
            && $value <= 2147483647 } {
            return 1
        }
    }
    ad_complain [_ acs-tcl.lt_name_is_not_an_oid]
    return 0
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: