template::list::orderby::set_property (public)

 template::list::orderby::set_property -list_name list_name \
    -orderby_name orderby_name -property property -value value \
    [ -ulevel ulevel ]

Defined in packages/acs-templating/tcl/list-procs.tcl

Set a property for an orderby filter in the given list template.

Switches:
-list_name (required)
-orderby_name (required)
-property (required)
-value (required)
-ulevel (optional, defaults to "1")

Partial Call Graph (max 5 caller/called nodes):
%3 template::list::orderby::set_properties template::list::orderby::set_properties (public) template::list::orderby::set_property template::list::orderby::set_property template::list::orderby::set_properties->template::list::orderby::set_property template::list::get_reference template::list::get_reference (public) template::list::orderby::set_property->template::list::get_reference template::list::orderby::get_reference template::list::orderby::get_reference (public) template::list::orderby::set_property->template::list::orderby::get_reference

Testcases:
No testcase defined.
Source code:
    # Get an upvar'd reference to list_properties
    template::list::get_reference -name $list_name

    get_reference  -list_name $list_name  -orderby_name $orderby_name

    switch -- $property {
        orderby {
            set value [uplevel $ulevel [list subst $value]]
            set orderby_properties($property$value
            set orderby_properties(orderby_asc) "$value asc"
            set orderby_properties(orderby_desc) "$value desc"
        }
        orderby_asc_name {
            set orderby_properties($property$value
            set value [uplevel $ulevel [list db_map $value]]
            set orderby_properties(orderby_asc) $value
        }
        orderby_desc_name {
            set orderby_properties($property$value
            set value [uplevel $ulevel [list db_map $value]]
            set orderby_properties(orderby_desc) $value
        }
        orderby_name {
            set orderby_properties($property$value
            set value [uplevel $ulevel [list db_map $value]]
            set orderby_properties(orderby_asc) "$value asc"
            set orderby_properties(orderby_desc) "$value desc"
        }
        default {
            # We require all properties to be initialized to the empty
            # string in the array, otherwise they're illegal.
            if { ![info exists orderby_properties($property)] } {
                error "Unknown orderby property '$property' for column '$orderby_name' in list '$list_name'. Allowed properties are [join [array names orderby_properties] ""]."
            }

            # All other vars, do an uplevel subst on the value now
            set orderby_properties($property) [uplevel $ulevel [list subst $value]]
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: