xotcl.wu-wien.ac.at
Begin main content
Search · Index
No registered users in community s5-xowiki-tutorial
in last 10 minutes

Package Specific Code and Per Request Hooks

In the file myapp-procs.tcl it is possible as usual to define the application specific classes, the own includelets, etc. Furthermore, it is possible to alter the standard behavior of xowiki on a per-request basis.

Whenever an package instance of the application type myapp is initialized (e.g. in a request), the initialize method of ::myapp::Package is called.

namepsace eval ::myapp {
  ...
  ::myapp::Package instproc initialize {} {
    # Per application type initialization.
    #
    # One can register here e.g. mixins extending/replacing
    # xowiki behavior. For example
    #     ::xowiki::Page instmixin add ::myapp::Page
    #
    next
  }
  ::myapp::Package instproc destroy {} {
    # remove the behavior added by initialize
    #     ::xowiki::Page instmixin delete ::myapp::Page
    next
  }
  ...
}