_acs-templating__ad_dimensional (private)
_acs-templating__ad_dimensional
Defined in packages/acs-templating/tcl/test/dimensional-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ aa_section ad_dimensional set dimensional_list { { show_methods "Methods:" 1 { { 2 "All Methods" } { 1 "Documented Methods" } { 0 "Hide Methods" } } } { show_source "Source:" 0 { { 1 "Display Source" } { 0 "Hide Source" } } } { show_variables "Variables:" 0 { { 1 "Show Variables" } { 0 "Hide Variables" } } } } # # ad_dimensional can only be invoked in the context of an # adp_template # set template [template::adp_compile -string { <% set d [ad_dimensional $dimensional_list] %> @d;noquote@ }] set dimensional_slider [template::adp_eval template] aa_true "The slider is HTML" [ad_looks_like_html_p $dimensional_slider] foreach e $dimensional_list { lassign $e v t d spec aa_true "Slider contains the title '$t'" {[string first $t $dimensional_slider] >= 0} foreach s $spec { lassign $s spec_v spec_l aa_true "Slider contains the label '$spec_l'" {[string first $spec_l $dimensional_slider] >= 0} if {$spec_v != $d} { # # There is no link for the default value of a filter # aa_true "Slider contains '$v=$spec_v'" {[string first $v=$spec_v $dimensional_slider] >= 0} } } } aa_section ad_dimensional_sql set options_set [ns_set create] ns_set put $options_set show_variables 1 ns_set put $options_set show_methods 2 ns_set put $options_set bogus irrelevant set sql_filters [ad_dimensional_sql $dimensional_list where and $options_set] aa_equals "The dimensional_list has no where clauses, the result must be empty" $sql_filters "" aa_log "Create new dimensional_list with clauses" set dimensional_list { { show_methods "Methods:" 1 { { 2 "All Methods" {where "one"}} { 1 "Documented Methods" {where "two"}} { 0 "Hide Methods" {where "three"}} } } { show_source "Source:" 0 { { 1 "Display Source" {where "a"}} { 0 "Hide Source" {where "b"}} } } { show_variables "Variables:" 0 { { 1 "Show Variables" {where "1"}} { 0 "Hide Variables" {where "2"}} } } } set sql_filters [ad_dimensional_sql $dimensional_list where and $options_set] aa_equals "The dimensional_list has the expected value" $sql_filters " and one and b and 1" set sql_filters [ad_dimensional_sql $dimensional_list where the_separator $options_set] aa_equals "The dimensional_list has the expected value" $sql_filters " the_separator one the_separator b the_separator 1" }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "ad_dimensional (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle