Edgewall Software

Changes between Version 4 and Version 5 of WikiContext


Ignore:
Timestamp:
May 15, 2007, 9:28:20 PM (17 years ago)
Author:
Christian Boos
Comment:

Update to the current status as some features that were previously only on the security branch are now in trunk

Legend:

Unmodified
Added
Removed
Modified
  • WikiContext

    v4 v5  
    1 [[PageOutline(3-6,inline)]]
     1[[PageOutline(3-6)]]
    22= Wiki Rendering Context =
     3
     4 '''`trac.context.Context`''' ''(current [milestone:0.11])''
    35 
    4  '''`trac.wiki.api.Context`''' ''(current [milestone:0.11]dev, r4451)''
    5 
    66 '''`trac.resource.Context`''' ''(see [#FutureDirections])''
    77
     
    1111 - Identify the resource to which the wiki text belongs (`.env`, `.realm`, `.id`)
    1212 - Access to parent context, if there's one (`.parent`) [[br]]
    13    By extension, this enables one to unwind the stack of context embedding
     13   By following that link, this enables one to unwind the stack of context embedding
    1414 - Knows about how the rendered Wiki text is being accessed (`.req`, `.abs_urls`)
    1515   so that the proper links can be generated:
    1616   - `.href`: the appropriate Href instance for generating any kind of links
    17    - `.self_href`: a link targeting the current Wiki context itself [[br]]
    18      ''renamed to `.resource_href` in the security branch''
    19  - ''Allow easy access to the corresponding resource itself (`.resource`) - security branch only''
     17   - `.resource_href`: a link targeting the current Wiki context itself
     18 - Provide access to the corresponding resource itself (`.resource`)
    2019
    21 Besides, it keeps a handle to a database connection (`.db`) the way the `Formatter` objects used to do.
     20''Besides, it keeps a handle to a database connection (`.db`) the way the `Formatter` objects used to do.'' -- will probably change in milestone:0.12''
    2221
    23 Such a context can be used for generating wiki texts in different flavors, using the `.wiki_to_...` methods. ''Note: this is susceptible to change''
     22The `wiki_to_xyz(ctx, wiki)` template functions currently expect a Context for the first argument, and the wiki text as the second argument. ''Note: this is susceptible to change''
    2423
    2524It's very easy to manipulate contexts, or create sub-contexts. Here are some examples:
     
    5453== API Changes ==
    5554
    56 Besides the new trac.wiki.api.Context class, a few existing interfaces have been modified:
     55Besides the new trac.context.Context class, a few existing interfaces have been modified:
    5756 - `IWikiMacroProvider.render_macro` still takes a `req` as its first argument (#4139),
    5857   but it's now deprecated and `IWikiMacroProvider.expand_macro` should be preferred,
     
    6160   (`formatter.context`).
    6261 - `IHTMLPreviewRenderer.render` takes a `context` instead of a `req` as its first argument
    63  - `TimelineEvent.set_context` takes a `context` first argument and a `wikitext` second argument. That wiki text can now be retrieved in the `.wikitext` property instead of the `.message` one.
     62 - `TimelineEvent.set_context` takes a `context` first argument and a `wikitext` second argument. That wiki text can now be retrieved in the `.wikitext` property instead of the `.message` one. ''Note: this is still subject to change''
    6463
    6564
     
    6867=== Fine-grained Permission Checking ===
    6968
    70 The source:sandbox/security branch already contains a much empowered version of the Context class.
    71 
    7269As a context can describe precisely ''which'' resource is accessed and at the same time ''how'' it is accessed (and more specifically ''who'' accesses it), it is also a perfect fit for the fine-grained PermissionPolicy (see also the [PermissionPolicy@16 design document]).
    7370
    74 In order to be used as a lightweight descriptor of a resource, Context can also be subclassed. The user of a context doesn't need to have to think about this, as the correct subclass is always used, based on the `.realm` information.
     71In order to be used as a lightweight descriptor of a resource, Context can also be sub-classed. The user of a context doesn't need to have to think about this, as the correct subclass is always used, based on the `.realm` information.
    7572
    7673=== Multiple Project Support ===