Notes on Page.send_page and the like
Page.send_page gets called from many locations in the code. To factor out the code into reusable parts i will keep an overview over common flows through it's code here. I take on the actions first, beginning every entry with a table of used parameters and where they originate from in this context.
paramter |
value |
origin |
|
|
|
Action 'show' (default action)
paramter |
value |
origin |
emit_headers |
1 |
constant |
content_only |
0 |
constant |
omit_footnotes |
0 |
constant |
content_id |
'content' |
constant |
do_cache |
1 |
constant |
send_missing_page |
0 |
constant |
print_mode |
0 |
constant |
page.hilite_re |
form['highlight'] |
request |
count_hit |
1 |
constant |
'redirect' |
page.pi['redirect'] |
page |
page.formatter |
'text/html' |
constant |
'deprecated' |
page.pi['deprecated'] |
page |
lang |
page.pi['language'] or cfg-default |
page or cfg |
- 'VIEWPAGE' is logged to the eventlog
- handle 'redirect'
no explicit 'show' action and not already redirected? => http-redirect, END HERE
- instantiate 'text/html' formatter
- replace request.formatter, remember old
- handle 'deprecated'
- add deprecation message
- append old page-body to current
- set the content language for the request
- set http cache headers
- emit headers
- handle (old) revision requested
- add message with revision info
- handle 'redirect' (again!)
- if has been redirected, set redirected-from message
- if is redirecting page, set redirects-to message
- get user-trail
- send theme title
- handle several cases mutually exclusive
- handle page not exist
- call .send_page recursively (content_only=1, send_missing_page=1)
- handle user-ACL mismatch
- just emit a "you are not allowed ..." message
- standard case (existant page, matching ACLs)
- output page content via formatter
- emit footnotes
- handle page not exist
- send theme footer
- send theme closing html
- handle page exist
- create pagelinks cache
- restore request.formatter