template::adp_prepare (private)

 template::adp_prepare

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

Executes the code to prepare the data sources for a template. The code is executed in the stack frame of the calling procedure (adp_parse) so that variables are accessible when the compiled template code is executed. If the preparation code executes the set_file command, the procedure will recurse and execute the code for the next template as well.

Returns:
boolean (0 or 1): whether the (ultimate) script was found.

Partial Call Graph (max 5 caller/called nodes):
%3 template::adp_parse template::adp_parse (public) template::adp_prepare template::adp_prepare template::adp_parse->template::adp_prepare template::frm_page_handler template::frm_page_handler (public) template::frm_page_handler->template::adp_prepare ad_script_abort ad_script_abort (public) template::adp_prepare->ad_script_abort template::adp_init template::adp_init (public) template::adp_prepare->template::adp_init

Testcases:
No testcase defined.
Source code:
    uplevel {

        if { [file exists $__adp_stub.tcl] } {

            # Remember the file_stub in case the procedure changes it
            set __adp_remember_stub $__adp_stub

            # Ensure that data source preparation procedure exists and
            # is up-to-date and execute it.
            [adp_init tcl $__adp_stub]

            # propagate aborting
            if {[info exists ::request_aborted]} {
                ns_log warning "propagating abortion from $__adp_remember_stub.tcl"  "(status [lindex $::request_aborted 0]:" "'[lindex $::request_aborted 1]'"
                unset ::request_aborted
                ad_script_abort
                #adp_abort
                return 0
            }

            # if the file has changed then prepare again
            if { $__adp_stub ne $__adp_remember_stub } {
                adp_prepare          ;# propagate result up
            } { return 1 }
        }
        return 0
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: