doc_serve_document

one of the documented procedures in this installation of the ACS
Usage:
doc_serve_document
What it does:
Serves the document currently in the environment.
Defined in: /web/philip/packages/acs-core/document-procs.tcl

Source code:


    if { ![doc_exists_p] } {
	error "No document has been built."
    }

    set mime_type [doc_get_property mime_type]
    if { [empty_string_p $mime_type] } {
	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 { [empty_string_p $template_path] } {
		ns_returnerror 500 "Unable to find master template"
	    }
	    doc_serve_template $template_path
	}
	default {
	    # Return a complete document.
	    ns_return 200 $mime_type [doc_get_property body]
	}
    }


philg@mit.edu