Package trac :: Package wiki :: Module api :: Class IWikiPageManipulator

Class IWikiPageManipulator

source code

    object --+    
             |    
core.Interface --+
                 |
                IWikiPageManipulator

Components that need to do specific pre- and post- processing of wiki page changes have to implement this interface.

Unlike change listeners, a manipulator can reject changes being committed to the database.

Instance Methods
 
prepare_wiki_page(req, page, fields)
Validate a wiki page before rendering it.
source code
 
validate_wiki_page(req, page)
Validate a wiki page after it's been populated from user input.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

prepare_wiki_page(req, page, fields)

source code 
Validate a wiki page before rendering it.
Parameters:
  • page - is the WikiPage being viewed.
  • fields - is a dictionary which contains the wiki text of the page, initially identical to page.text but it can eventually be transformed in place before being used as input to the formatter.

validate_wiki_page(req, page)

source code 
Validate a wiki page after it's been populated from user input.
Parameters:
Returns:
a list of (field, message) tuples, one for each problem detected. field can be None to indicate an overall problem with the page. Therefore, a return value of [] means everything is OK.