[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publication/zopepublication.py The presentation service is gone.

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 17 12:16:28 EDT 2004


Log message for revision 27592:
  
  The presentation service is gone.
  
  The default skin is now set in the `beforeTraversal()` hook of Zope
  Publication.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/publication/zopepublication.py


-=-
Modified: Zope3/trunk/src/zope/app/publication/zopepublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-09-17 16:16:21 UTC (rev 27591)
+++ Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-09-17 16:16:22 UTC (rev 27592)
@@ -28,9 +28,11 @@
 from zope.security.interfaces import Unauthorized
 from zope.component.exceptions import ComponentLookupError
 from zope.interface import implements, providedBy
+from zope.interface import directlyProvides, directlyProvidedBy
 from zope.publisher.publish import mapply
 from zope.publisher.interfaces import Retry, IExceptionSideEffects
 from zope.publisher.interfaces import IRequest, IPublication
+from zope.publisher.interfaces.browser import IDefaultSkin
 from zope.security.management import newInteraction, endInteraction
 from zope.security.checker import ProxyFactory
 from zope.security.proxy import removeSecurityProxy
@@ -76,6 +78,12 @@
             if p is None:
                 raise Unauthorized # If there's no default principal
 
+        # Set the default skin
+        adapters = zapi.getService(zapi.servicenames.Adapters)
+        skin = adapters.lookup((providedBy(request),), IDefaultSkin, '')
+        if skin is not None:
+            directlyProvides(request, directlyProvidedBy(request)+skin)
+
         request.setPrincipal(p)
         newInteraction(request)
         transaction.begin()



More information about the Zope3-Checkins mailing list