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

  1. 'VIEWPAGE' is logged to the eventlog
  2. handle 'redirect'
    1. no explicit 'show' action and not already redirected? => http-redirect, END HERE

  3. instantiate 'text/html' formatter
  4. replace request.formatter, remember old
  5. handle 'deprecated'
    1. add deprecation message
    2. append old page-body to current
  6. set the content language for the request
  7. set http cache headers
  8. emit headers
  9. handle (old) revision requested
    1. add message with revision info
  10. handle 'redirect' (again!)
    1. if has been redirected, set redirected-from message
    2. if is redirecting page, set redirects-to message
  11. get user-trail
  12. send theme title
  13. handle several cases mutually exclusive
    1. handle page not exist
      1. get MissingPage/MissingHomePage

      2. call .send_page recursively (content_only=1, send_missing_page=1)
    2. handle user-ACL mismatch
      1. just emit a "you are not allowed ..." message
    3. standard case (existant page, matching ACLs)
      1. output page content via formatter
      2. emit footnotes
  14. send theme footer
  15. send theme closing html
  16. handle page exist
    1. create pagelinks cache
  17. restore request.formatter

MoinMoin: FlorianKrupicka/SendPageAnalysis (last edited 2007-10-29 19:20:42 by localhost)