xowiki::Page instproc render (public)

 <instance of xowiki::Page[i]> render \
    [ -update_references update_references ] [ -with_footer on|off ]

Defined in /var/www/openacs.org/packages/xowiki/tcl/xowiki-procs.tcl

Render a wiki page with some optional features, such as including a footer or updating references for this page.

Switches:
-update_references (optional, defaults to "unresolved")
might be "all", "unresolved" or "never"
-with_footer (optional, boolean, defaults to "true")
boolean value
Returns:
rendered HTML content.

Testcases:
xowiki_test_cases, link_tests
Source code:
#
# prepare language links
#
array set :lang_links {found "" undefined ""}
#
# prepare references management
#
:references clear
if {[info exists :__extra_references]} {
  #
  # xowiki content-flow uses extra references, e.g. to forms.
  # TODO: provide a better interface for providing these kind of
  # non-link references.
  #
  foreach ref ${:__extra_references} {
    :references resolved $ref
  }
  unset :__extra_references
}
#
# Get page content and care about reference management.
#
set content [:render_content]
#
# Clear old reference and record new ones in cases updating
# references is activated "always" or just for unresolved
# references.
#
set unresolved_references [:references get unresolved]

if {$update_references eq "all"
    || ($update_references eq "unresolved" && [llength $unresolved_references] > 0)
  } {
  :references_update  [lsort -unique [:references get resolved]]  [lsort -unique $unresolved_references]
}
#
#:log "Page ${:name} render with_footer $with_footer - [ns_conn isconnected] - [catch {ns_conn content}]"
#
# handle footer
#
if {$with_footer && [::xo::cc get_parameter content-type:graph text/html] eq "text/html"} {
  append content "<DIV class='content-chunk-footer'>"
  if {![info exists :__no_footer] && ![::xo::cc get_parameter __no_footer:boolean 0]} {
    append content [:footer]
  }
  append content "</DIV>\n"
}
return $content
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: