template::adp_include (public)

 template::adp_include [ -uplevel uplevel ] src varlist

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

return the output of a Tcl/ADP pair as a string. adp_level is set to the calling procedure so that pass by reference works. and example of using this is in the search indexer for various content types:

    bookshelf::book::get -book_id $book_id -array bookdata
    set body [template::adp_include /packages/bookshelf/lib/one-book  [list &book "bookdata" base $base style feed]]
    
The [list &book "bookdata" ...] tells adp_include to pass the book array by reference to the adp include, where it is referred to via @book.field@.

Switches:
-uplevel (optional, defaults to "1")
how far up the stack should the adp_level be set to (default is the calling procedures level)
Parameters:
src (required)
should be the path to the Tcl/ADP pair relative to the server root, as with the src attribute to the include tag.
varlist (required)
a list of {key value key value ... } varlist can also be &var foo for things passed by reference (arrays and multirows)
Returns:
the string generated by the Tcl/ADP pair.
Author:
Jeff Davis davis@xarg.net
Created:
2004-06-02
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_page_contracts page_contracts (test acs-tcl) template::adp_include template::adp_include test_page_contracts->template::adp_include test_templates_and_scripts templates_and_scripts (test acs-templating) test_templates_and_scripts->template::adp_include template::adp_parse template::adp_parse (public) template::adp_include->template::adp_parse template::util::lpop template::util::lpop (public) template::adp_include->template::util::lpop template::util::url_to_file template::util::url_to_file (public) template::adp_include->template::util::url_to_file ad_dimensional ad_dimensional (public) ad_dimensional->template::adp_include apm_build_repository apm_build_repository (private) apm_build_repository->template::adp_include apm_git_build_repository apm_git_build_repository (private) apm_git_build_repository->template::adp_include bug_tracker::search::bug::datasource bug_tracker::search::bug::datasource (private) bug_tracker::search::bug::datasource->template::adp_include callback::user::workspace::impl::acs-subsite callback::user::workspace::impl::acs-subsite (private) callback::user::workspace::impl::acs-subsite->template::adp_include

Testcases:
page_contracts, templates_and_scripts
Source code:
    # set the stack frame at which the template is being parsed so that
    # other procedures can reference variables cleanly
    lappend ::template::parse_level [expr {[info level] - $uplevel}]

    set __adp_out [template::adp_parse [template::util::url_to_file $src$varlist]

    # pop off parse level
    template::util::lpop ::template::parse_level

    return $__adp_out
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: