[Repoze-dev] Keeping pages out of deliverance's hands

Paul Everitt paul at agendaless.com
Sun Apr 13 09:32:46 EDT 2008


On Apr 12, 2008, at 7:10 PM, Chris McDonough wrote:

> Tom Lazar wrote:
>> On 2008-04-12 22:42:22 +0200, Martin Aspeli
>> <optilude at gmx.net> said:
>>
>>> Reinout van Rees wrote:
>>>> Hi all,
>>>>
>>>> One thing that's not clear to me: how to keep certain pages out of
>>>> deliverance's hands? The zmi pages (/manage, /manage_main, etc.)  
>>>> are the
>>>> ones I'm most interested in at the moment.
>>>>
>>>> If I tickle my brain I come up with some irc messages and some  
>>>> emails,
>>>> but I'm missing the bigger picture, especially after the latest  
>>>> changes.
>>>>
>>>> Can someone give me a quick pointer?
>>> I use a paste composite app where / is a pipeline with deliverance  
>>> in it
>>> and /admin is a pipeline with plain repoze. It's not perfect for  
>>> all use
>>> cases, but pretty easy to set up.
>>>
>>> I'd like the repoze app to be on /, but have some declarative
>>> configuration to say e.g.
>>>
>>> deliverance.ignore = /manage/.*
>>> deliverance.ignore = /foo.*
>>>
>>> i.e. a regular expression based thing where deliverance would be  
>>> told to
>>> ignore certain incoming url patterns.
>>
>> that sounds like something i'd like to have in the webserver config,
>> i.e. apache or nginx where i would set some sort of headers (just  
>> like
>> in the vhm example)
>>
>> i'm new to this, but my gut feeling would be to keep all this sort of
>> fancy, regex-based rewriting stuff in one place (i.e. the webserver
>> config) and to use 'straightforward' tests for defined flags or  
>> headers
>> within the wsgi pipeline.
>
> I think the only sane way to do this is to let the application  
> (Plone, or Zope)
> choose the theme on the way out rather than allowing anything to  
> choose the
> theme on the way in, as the regexes will get absolutely crazy if you  
> need to do
> the choosing this way.  IOW, there would be no theme specified in  
> middleware or
> in the webserver config, but Zope would return a header for each  
> response that
> should be themed a certain way.

I don't think it has to be binary.  I can think of plenty of cases  
where, as you've described, putting that decision in the hands of the  
application would be great.  I can also think of many cases (from  
personal usage) where there is (or could be) plenty enough information  
in the response to let the themer make a decision.

I like the latter, as don't want to rely on convincing all interesting  
WSGI apps to embrace Deliverance theme support.  The task that we're  
signed up for from the Plone summit, though, does as you've said --  
change Plone to embrace the idea of choosing multiple (or no)  
"sitethemes".

Note that I don't think what's being asked for is to "choose the theme  
on the way in".  I think it is to choose the theme on the way out,  
based on information available in the environment, including the HTML.

--Paul


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.repoze.org/pipermail/repoze-dev/attachments/20080413/d7309c93/attachment-0001.htm 


More information about the Repoze-dev mailing list