ad_include_contract (public)

 ad_include_contract docstring [ args... ]

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

Define an interface between a page and an ADP <include> similar to the page_contract. This is a light-weight implementation based on the ad_page_contract. It allows one to check the passed arguments (types, optionality) and can be used for setting defaults the usual way. Using ad_include_contracts helps to improve documentation of included content.

Parameters:
docstring - documentation of the include
Author:
gustaf neumann <neumann@wu-wien.ac.at>
Created:
Sept 2015
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_page_contracts page_contracts (test acs-tcl) ad_include_contract ad_include_contract test_page_contracts->ad_include_contract ad_page_contract ad_page_contract (public) ad_include_contract->ad_page_contract packages/acs-admin/lib/developer-services.tcl packages/acs-admin/ lib/developer-services.tcl packages/acs-admin/lib/developer-services.tcl->ad_include_contract packages/acs-admin/lib/password-update.tcl packages/acs-admin/ lib/password-update.tcl packages/acs-admin/lib/password-update.tcl->ad_include_contract packages/acs-admin/lib/service-parameters.tcl packages/acs-admin/ lib/service-parameters.tcl packages/acs-admin/lib/service-parameters.tcl->ad_include_contract packages/acs-admin/lib/site-wide-services.tcl packages/acs-admin/ lib/site-wide-services.tcl packages/acs-admin/lib/site-wide-services.tcl->ad_include_contract packages/acs-api-browser/lib/search.tcl packages/acs-api-browser/ lib/search.tcl packages/acs-api-browser/lib/search.tcl->ad_include_contract

Testcases:
page_contracts
Source code:
    set __cmd {ns_set create include}
    foreach __v [uplevel {info vars}] {
        if {[string match __* $__v]
            || [regexp {[a-zA-Z]:[a-z0-9]} $__v]
            || ![uplevel [list info exists $__v]]
        } {
            #
            # Don't add internal variables (starting with __*),
            # multirow variables, or vars without values into the
            # ns_set used for checking
            #
            continue
        }
        if {[uplevel [list array exists $__v]]} {
            #
            # For the time being, do nothing with arrays
            #
            # ns_log notice "$__v is an array"
            # if {[string match *:* $__v] || [uplevel [list info exists $__v:rowcount]]} {
            #     #
            #     # don't try to pass multirows
            #     #
            # } else {
            #     #lappend __cmd $__v [uplevel [list array get $__v]]
            # }
            continue
        }

        #ns_log notice "V=$__v exists: [uplevel [list info exists $__v]]"
        lappend __cmd $__v [uplevel [list set $__v]]
    }

    #ns_log notice "final command: $__cmd"

    if {[uplevel {info exists __adp_remember_stub}]} {
        set __path [string range [uplevel {set __adp_remember_stub}] [string length $::acs::rootdir]+1 end]
        set __context "include $__path"
    } else {
        set __context ""
    }

    ad_page_contract -warn -level 2 -context $__context -form [{*}$__cmd$docstring {*}$args
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: