doc_serve_document (public, deprecated)

 doc_serve_document

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

Deprecated. Invoking this procedure generates a warning.

Serves the document currently in the environment.

Partial Call Graph (max 5 caller/called nodes):
rp_handle_adp_request rp_handle_adp_request (private, deprecated) doc_serve_document doc_serve_document rp_handle_adp_request->doc_serve_document ad_conn ad_conn (public) doc_serve_document->ad_conn ad_log_deprecated ad_log_deprecated (public) doc_serve_document->ad_log_deprecated doc_exists_p doc_exists_p (public, deprecated) doc_serve_document->doc_exists_p doc_find_template doc_find_template (public, deprecated) doc_serve_document->doc_find_template doc_get_property doc_get_property (public, deprecated) doc_serve_document->doc_get_property

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc doc_serve_document
    if { ![doc_exists_p] } {
        error "No document has been built."
    }

    set mime_type [doc_get_property mime_type]
    if { $mime_type eq "" } {
        if { [doc_property_exists_p title] } {
            set mime_type "text/html;content-pane"
        } else {
            set mime_type "text/html"
        }
    }

    switch -- $mime_type {
        text/html;content-pane - text/x-html-content-pane {
            # It's a content pane. Find the appropriate template.
            set template_path [doc_find_template [ad_conn file]]
            if { $template_path eq "" } {
                ns_returnerror 500 "Unable to find master template"
                ns_log error  "Unable to find master template for file '[ad_conn file]'"
            } else {
                doc_serve_template $template_path
            }
        }
        default {
            # Return a complete document.
            ns_return 200 $mime_type [doc_get_property body]
        }
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/deprecated-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: