incubator-bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Koželj <pe...@digiverse.si>
Subject Re: [Whitelabeling] Quick assessment of (current) whitelabelling implementation .
Date Wed, 02 Jan 2013 10:03:13 GMT
On 21 December 2012 18:37, Olemis Lang <olemis@gmail.com> wrote:

> On 12/21/12, Peter Koželj <peter@digiverse.si> wrote:
> > On 19 December 2012 18:04, Olemis Lang <olemis@gmail.com> wrote:
> >> On 12/19/12, Peter Koželj <peter@digiverse.si> wrote:
> >>
> [...]
> >>
> >> If so neither chrome nor data (and related complications) would be
> >> needed . Instance methods would be more than enough . What do you
> >> think ?
> >>
> >
> > Actually adding labels to req.chrome in lazy manner is a bit messy but
> not
> > that difficult at all. What I tried and works is:
> >
> > {{{
> >
> >          if 'chrome' in req.__dict__:
> >             req.chrome['labels'] = self._get_whitelabelling()
> >         else:
> >             original_chrome_callback = req.callbacks['chrome']
> >
> >             def chrome_with_labels_callback(req):
> >                 chrome = original_chrome_callback(req)
> >                 chrome['labels'] = self._get_whitelabelling()
> >                 return chrome
> >
> >             req.callbacks['chrome'] = chrome_with_labels_callback
> >
> > }}}
> >
>
> that's looking better ;)
>
> > Unfortunately this doesn't make any difference at all as req.chrome is
> > evaluated at a few other places like:
> >  - multiple places in bloodhound_theme and (this should be easily fixable
> > if we know how to distinguish RPC from UI templates calls)
>
> easy , for RPC calls and alike template = data = None
> ;)
>
> >  - multiple places in TracThemeEngine (this is not fixable without
> changes
> > to the plugin or maybe Trac or even both)
> >
> > Apparently the scope of this issue is bigger then whitelabeling and
> should
> > be approached with all aspects of request handling in mind.
> > Optimally the RPC requests should probably not include BloodhoundTheme
>
> jftr , RPC doesn't do such a thing . BhT is actively watching and
> post-processing all requests even if theme is not active (i.e.
> theme.theme config coption != bloodhound) , even if no template is
> rendered (i.e. template = data = None) , ... That's why I've always
> insisted on the fact that it's important to limit the impact of theme
> post processing to theme component enabled + theme active + we really
> care
> ;)
>
> --
> Regards,
>
> Olemis.
>
> I have opened https://issues.apache.org/bloodhound/ticket/330 for this,
so it is not forgotten.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message