osimons wrote:
> On Aug 27, 2:52 am, osimons <[EMAIL PROTECTED]> wrote:
>   
>> The issue was to figure out how to render arbitrary wiki markup
>> without a request object - which was no problem with 0.10 wiki_to_...
>> () methods. Now with the context and the new security branch, calling
>> the formatter (via format_to_html()) it will somewhere deep down say
>> that there is no req.perm to use when rendering links.
>>     
>
> Actually, as macros have always received the req object, I suppose it
> never really has been safe to render wiki markup outside a request
> context...
>   

Well, that's historical. I think it's a perfectly valid use case to 
render wiki markup outside of the realm of a web request, e.g. off-line 
wiki-to-html or wiki-to-xyz batch conversion, data mining, etc.

In Trac 0.10, a Request object was used to carry the template data 
(req.hdf), the user information (req.authname) for basic permission 
checks, and the req.path_info was extensively used to identify the 
resource being processed. In addition, the req was and is still used to 
convey the chrome data and probably a few more things.
I tried to move some of those to the WikiContext object, with a bit more 
formalism at the level of how a resource was identified (the stack of 
realm/id pairs, plus the version info), but again this ended in a mix of 
different concerns as the rendering details were grafted on.

So now I'd like to split the Context into a ResourceDescriptor and a 
RenderingContext.

The ResourceDescriptor is solely used to identify versioned information 
"resources" and must be cheap to build, as opposed to the full-fledged 
data model which requires one or several database lookups.

The RenderingContext still takes several responsibilities: who accesses 
the information (therefore allowing to filter out the non authorized 
bits of information), what is the expected output (mime-type) and other 
rendering details specific to the renderer used, most notably which href 
to use as a basis when creating URLs.

-- Christian




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to