[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - cache.zcml:1.1 cache.py:1.4 configure.zcml:1.43
Guido van Rossum
guido@python.org
Thu, 24 Apr 2003 16:28:51 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv26222
Modified Files:
cache.py configure.zcml
Added Files:
cache.zcml
Log Message:
Move cache-related configuration to cache.zcml.
Use a new-style add form for adding and configuring a cache in one
fell swoop.
=== Added File Zope3/src/zope/app/browser/services/cache.zcml ===
<zopeConfigure xmlns='http://namespaces.zope.org/browser'>
<menuItems
menu="zmi_views"
for="zope.app.services.cache.ILocalCachingService">
<menuItem title="Caches" action="index.html"/>
</menuItems>
<page
for="zope.app.services.cache.ILocalCachingService"
name="index.html"
template="caches.pt"
class=".configuration.NameComponentConfigurableView"
permission="zope.ManageServices"
/>
<menuItem
menu="add_service"
for="zope.app.interfaces.container.IAdding"
action="CachingService"
title="Caching Service"
description="A Persistent Caching Service for TTW development"
/>
<!-- When creating a new cache object, you are taken to this
form to configure it. The form lets you choose a name,
an interface, a permission, and a registration status
(Unregistered, Registered or Active). -->
<addform
label="New Cache Configuration"
for="zope.app.interfaces.cache.cache.ICache"
name="addConfiguration.html"
schema="zope.app.interfaces.services.cache.ICacheConfiguration"
class=".cache.AddCacheConfiguration"
permission="zope.ManageServices"
content_factory="zope.app.services.cache.CacheConfiguration"
arguments="name componentPath"
set_after_add="status"
fields="name componentPath permission status"
/>
</zopeConfigure>
=== Zope3/src/zope/app/browser/services/cache.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/services/cache.py:1.3 Fri Feb 21 09:53:34 2003
+++ Zope3/src/zope/app/browser/services/cache.py Thu Apr 24 16:28:50 2003
@@ -11,38 +11,13 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Cache configuration adding view
+"""Cache configuration support classes.
$Id$
"""
-__metaclass__ = type
-from zope.component import getServiceManager
-from zope.publisher.browser import BrowserView
-from zope.app.form.utility import setUpWidgets, getWidgetsDataForContent
-from zope.app.interfaces.services.cache \
- import ICacheConfiguration
-from zope.app.services.cache \
- import CacheConfiguration
-from zope.app.interfaces.cache.cache import ICache
+from zope.app.browser.services.configuration import AddComponentConfiguration
-class AddCacheConfiguration(BrowserView):
+class AddCacheConfiguration(AddComponentConfiguration):
- def __init__(self, *args):
- super(AddCacheConfiguration, self).__init__(*args)
- setUpWidgets(self, ICacheConfiguration)
-
- def components(self):
- service = getServiceManager(self.context.context)
- paths = [info['path'] for info in service.queryComponent(type=ICache)]
- paths.sort()
- return paths
-
- def action(self, cache_name, component_path):
- if not cache_name:
- raise ValueError, 'You must specify a cache name'
- cd = CacheConfiguration(cache_name, component_path)
- cd = self.context.add(cd)
- getWidgetsDataForContent(self, ICacheConfiguration, content=cd,
- strict=False)
- self.request.response.redirect(self.context.nextURL())
+ pass
=== Zope3/src/zope/app/browser/services/configure.zcml 1.42 => 1.43 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.42 Tue Apr 22 18:17:38 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml Thu Apr 24 16:28:50 2003
@@ -46,50 +46,7 @@
action="index.html"
/>
-<!-- CachingService -->
-
- <menuItems
- menu="zmi_views"
- for="zope.app.services.cache.ILocalCachingService">
- <menuItem title="Caches" action="index.html"/>
- </menuItems>
-
- <page
- for="zope.app.services.cache.ILocalCachingService"
- name="index.html"
- template="caches.pt"
- class=".configuration.NameComponentConfigurableView"
- permission="zope.ManageServices"
- />
-
- <menuItem
- menu="add_service"
- for="zope.app.interfaces.container.IAdding"
- action="CachingService"
- title="Caching Service"
- description="A Persistent Caching Service for TTW development"
- />
-
- <!-- CacheConfiguration -->
-
- <view
- for="zope.app.interfaces.container.IAdding"
- name="CacheConfiguration"
- class="zope.app.browser.services.cache.AddCacheConfiguration"
- permission="zope.ManageServices">
-
- <page name="add.html" template="add_cache.pt" />
- <page name="finish.html" attribute="action" />
-
- </view>
-
- <menuItem
- menu="add_configuration"
- for="zope.app.interfaces.container.IAdding"
- action="CacheConfiguration"
- title="Cache"
- description="Named Cache"
- />
+<!-- CachingService --> <include file="cache.zcml" />
<!-- Event Service -->