[Zope3-checkins] CVS: Zope3/src/zope/app/component - configure.zcml:1.9.6.1 hooks.py:1.12.6.1 meta.zcml:1.10.16.1 metaconfigure.py:1.19.6.1 metadirectives.py:1.5.12.1

Jim Fulton cvs-admin at zope.org
Sun Nov 9 11:08:45 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/component

Modified Files:
      Tag: adaptergeddon-branch
	configure.zcml hooks.py meta.zcml metaconfigure.py 
	metadirectives.py 
Log Message:
Created a global presentation service that replaces the 
global view, resource, and skin services.

Now look up presentation components by adapting from a request type,
rather than adapting to a presentation type.





=== Zope3/src/zope/app/component/configure.zcml 1.9 => 1.9.6.1 ===
--- Zope3/src/zope/app/component/configure.zcml:1.9	Sun Sep 21 13:31:23 2003
+++ Zope3/src/zope/app/component/configure.zcml	Sun Nov  9 11:08:14 2003
@@ -22,23 +22,11 @@
          permission='zope.Public'
          component='zope.component.factory.factoryService' />
 
-<serviceType id='Skins'
-             interface='zope.component.interfaces.ISkinService' />
-<service serviceType='Skins'
+<serviceType id='Presentation'
+             interface='zope.component.interfaces.IPresentationService' />
+<service serviceType='Presentation'
          permission='zope.Public'
-         component='zope.component.skin.skinService' />
-
-<serviceType id='Views'
-             interface='zope.component.interfaces.IViewService' />
-<service serviceType='Views'
-         permission='zope.Public'
-         component='zope.component.view.viewService' />
-
-<serviceType id='Resources'
-             interface='zope.component.interfaces.IResourceService' />
-<service serviceType='Resources'
-         permission='zope.Public'
-         component='zope.component.resource.resourceService' />
+         factory='zope.component.presentation.GlobalPresentationService' />
 
 <hook module="zope.component"
       name="getServiceManager"


=== Zope3/src/zope/app/component/hooks.py 1.12 => 1.12.6.1 ===
--- Zope3/src/zope/app/component/hooks.py:1.12	Sun Sep 21 13:31:23 2003
+++ Zope3/src/zope/app/component/hooks.py	Sun Nov  9 11:08:14 2003
@@ -27,6 +27,7 @@
 from zope.app.traversing import IContainmentRoot
 from zope.app.interfaces.location import ILocation
 from zope.app.location import locate
+from zope.component.servicenames import Presentation
 
 def getServiceManager_hook(context, local=False, recurse=False):
 
@@ -64,8 +65,8 @@
 def queryView(object, name, request, default=None, context=None):
     if context is None:
         context = object
-    views = getService(context, 'Views')
-    view = views.queryView(object, name, request, default)
+    views = getService(context, Presentation)
+    view = views.queryView(object, name, request, default=default)
     if ILocation.isImplementedBy(view):
         locate(view, object, name)
 


=== Zope3/src/zope/app/component/meta.zcml 1.10 => 1.10.16.1 ===
--- Zope3/src/zope/app/component/meta.zcml:1.10	Sat Aug  2 22:13:08 2003
+++ Zope3/src/zope/app/component/meta.zcml	Sun Nov  9 11:08:14 2003
@@ -53,6 +53,18 @@
         />
 
     <meta:directive
+        name="defaultSkin"
+        schema=".metadirectives.IDefaultSkinDirective"
+        handler="zope.app.component.metaconfigure.defaultSkin"
+        />
+
+    <meta:directive
+        name="layer"
+        schema=".metadirectives.ILayerDirective"
+        handler="zope.app.component.metaconfigure.layer"
+        />
+
+    <meta:directive
         name="serviceType"
         schema=".metadirectives.IServiceTypeDirective"
         handler="zope.app.component.metaconfigure.serviceType"


=== Zope3/src/zope/app/component/metaconfigure.py 1.19 => 1.19.6.1 ===
--- Zope3/src/zope/app/component/metaconfigure.py:1.19	Sun Sep 21 13:31:24 2003
+++ Zope3/src/zope/app/component/metaconfigure.py	Sun Nov  9 11:08:14 2003
@@ -18,8 +18,8 @@
 from zope.configuration.exceptions import ConfigurationError
 from zope.security.proxy import Proxy, ProxyFactory
 from zope.component import getService, getServiceManager
-from zope.app.services.servicenames import Adapters, Interfaces, Skins
-from zope.app.services.servicenames import Views, Resources, Factories
+from zope.app.services.servicenames import Adapters, Interfaces
+from zope.app.services.servicenames import Factories, Presentation
 from zope.app.component.globalinterfaceservice import interfaceService
 from zope.security.checker import InterfaceChecker, CheckerPublic, \
      Checker, NamesChecker
@@ -197,7 +197,7 @@
     _context.action(
         discriminator = ('resource', name, type, layer),
         callable = checkingHandler,
-        args = (permission, Resources,'provideResource',
+        args = (permission, Presentation, 'provideResource',
                 name, type, factory, layer),
         )
     _context.action(
@@ -236,7 +236,7 @@
     _context.action(
         discriminator = ('view', for_, name, type, layer),
         callable = checkingHandler,
-        args = (permission, Views,'provideView', for_, name,
+        args = (permission, Presentation, 'provideView', for_, name,
                 type, factory, layer),
         )
     _context.action(
@@ -266,7 +266,7 @@
     _context.action(
         discriminator = ('defaultViewName', for_, type, name),
         callable = handler,
-        args = (Views,'setDefaultViewName', for_, type, name),
+        args = (Presentation, 'setDefaultViewName', for_, type, name),
         )
     _context.action(
         discriminator = None,
@@ -336,21 +336,29 @@
         args = (serviceType, component, permission),
         )
 
-def skin(_context, name, layers, type):
+def layer(_context, name):
+
+    _context.action(
+        discriminator = ('layer', name),
+        callable = handler,
+        args = (Presentation, 'defineLayer', name)
+        )
+
+def skin(_context, name, layers):
     if ',' in layers:
         raise TypeError("Commas are not allowed in layer names.")
 
     _context.action(
-        discriminator = ('skin', name, type),
+        discriminator = ('skin', name),
         callable = handler,
-        args = (Skins,'defineSkin',name, type, layers)
+        args = (Presentation, 'defineSkin', name, layers)
         )
 
+def defaultSkin(_context, name):
     _context.action(
-        discriminator = None,
+        discriminator = 'defaultSkin',
         callable = handler,
-        args = (Interfaces, 'provideInterface',
-                type.__module__+'.'+type.getName(), type)
+        args = (Presentation, 'setDefaultSkin', name)
         )
 
 #XXX you will be terminated soon


=== Zope3/src/zope/app/component/metadirectives.py 1.5 => 1.5.12.1 ===
--- Zope3/src/zope/app/component/metadirectives.py:1.5	Sun Aug 17 02:06:15 2003
+++ Zope3/src/zope/app/component/metadirectives.py	Sun Nov  9 11:08:14 2003
@@ -222,15 +222,43 @@
         value_type=PythonIdentifier()
         )
 
-class ISkinDirective(IBasicResourceInformation):
+class ILayerDirective(Interface):
+    """
+    Register a layer
+    """
+
+    name = TextLine(
+        title=u"Layer name",
+        description=u"Layer name",
+        required=True
+        )
+
+class ISkinDirective(Interface):
     """
     Register a skin
     """
 
+    name = TextLine(
+        title=u"Skin name",
+        description=u"Skin name",
+        required=True
+        )
+
     layers = Tokens(
         title=u"The layers it consists of.",
         required=True,
         value_type=TextLine()
+        )
+
+class IDefaultSkinDirective(Interface):
+    """
+    Register a skin
+    """
+
+    name = TextLine(
+        title=u"Default skin name",
+        description=u"Default skin name",
+        required=True
         )
 
 class IServiceTypeDirective(Interface):




More information about the Zope3-Checkins mailing list