[Zope3-checkins] CVS: Zope3/src/zope/app/component - meta.zcml:1.11
metaconfigure.py:1.20 metadirectives.py:1.6
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:11:30 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv31610/src/zope/app/component
Modified Files:
meta.zcml metaconfigure.py metadirectives.py
Log Message:
Added defaultSkin and layer directives. Layers must now be defined
before they are used. You can now define the default skin by naming an
existing one. It is no-longer necessary to redefine a skin as the
defaule, repeating the layers.
M src/zope/app/component/nextservice.py
Index: src/zope/app/component/tests/test_nextservice.py
Service managers now maintain between-service-manager references.
=== Zope3/src/zope/app/component/meta.zcml 1.10 => 1.11 ===
--- Zope3/src/zope/app/component/meta.zcml:1.10 Sat Aug 2 22:13:08 2003
+++ Zope3/src/zope/app/component/meta.zcml Fri Nov 21 12:11:29 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.20 ===
--- Zope3/src/zope/app/component/metaconfigure.py:1.19 Sun Sep 21 13:31:24 2003
+++ Zope3/src/zope/app/component/metaconfigure.py Fri Nov 21 12:11:29 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.6 ===
--- Zope3/src/zope/app/component/metadirectives.py:1.5 Sun Aug 17 02:06:15 2003
+++ Zope3/src/zope/app/component/metadirectives.py Fri Nov 21 12:11:29 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