[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - adapter.py:1.10 bundle.pt:1.8 bundle.py:1.9 cache.py:1.11 cache.zcml:1.5 configure.zcml:1.54 connection.py:1.13 connection.zcml:1.7 service.py:1.32 view.py:1.20 view.zcml:1.4
Jim Fulton
jim@zope.com
Sat, 21 Jun 2003 17:22:31 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv2745/src/zope/app/browser/services
Modified Files:
adapter.py bundle.pt bundle.py cache.py cache.zcml
configure.zcml connection.py connection.zcml service.py
view.py view.zcml
Log Message:
Major refactoring to reflect change in terminology from
"configuration" to "registration" to refer to the configuration of how
objects are used (as opposed to their internal configuration).
=== Zope3/src/zope/app/browser/services/adapter.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/services/adapter.py:1.9 Sun Jun 1 11:59:27 2003
+++ Zope3/src/zope/app/browser/services/adapter.py Sat Jun 21 17:21:59 2003
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Views for local adapter configuration.
+"""Views for local adapter registration.
AdapterSeviceView -- it's a bit different from other services, as it
has a lot of things in it, so we provide a search interface:
@@ -19,7 +19,7 @@
search page
browsing page
- AdapterConfigurationAdd
+ AdapterRegistrationAdd
$Id$
"""
@@ -33,14 +33,14 @@
from zope.publisher.browser import BrowserView
from zope.app.context import ContextWrapper
-from zope.app.interfaces.services.adapter import IAdapterConfiguration
-from zope.app.interfaces.services.adapter import IAdapterConfigurationInfo
-from zope.app.interfaces.services.configuration import IConfiguration
+from zope.app.interfaces.services.adapter import IAdapterRegistration
+from zope.app.interfaces.services.adapter import IAdapterRegistrationInfo
+from zope.app.interfaces.services.registration import IRegistration
from zope.app.form.utility import setUpWidgets, getWidgetsData
from zope.app.form.utility import getWidgetsDataForContent
from zope.app.event import publish
from zope.app.event.objectevent import ObjectCreatedEvent
-from zope.app.services.adapter import AdapterConfiguration
+from zope.app.services.adapter import AdapterRegistration
from zope.app.component.interfacefield import InterfaceField
class IAdapterSearch(Interface):
@@ -74,7 +74,7 @@
providedInterface.__module__ +"."+ providedInterface.__name__)
registry = ContextWrapper(registry, self.context)
- view = getView(registry, "ChangeConfigurations", self.request)
+ view = getView(registry, "ChangeRegistrations", self.request)
prefix = md5.new('%s %s' %
(forInterface, providedInterface)).hexdigest()
view.setPrefix(prefix)
@@ -88,19 +88,19 @@
return result
-class AdapterConfigurationAdd(BrowserView):
+class AdapterRegistrationAdd(BrowserView):
def __init__(self, *args):
- super(AdapterConfigurationAdd, self).__init__(*args)
- setUpWidgets(self, IAdapterConfiguration)
+ super(AdapterRegistrationAdd, self).__init__(*args)
+ setUpWidgets(self, IAdapterRegistration)
def refresh(self):
if "FINISH" in self.request:
- data = getWidgetsData(self, IAdapterConfigurationInfo, strict=True)
- configuration = AdapterConfiguration(**data)
- publish(self.context.context, ObjectCreatedEvent(configuration))
- configuration = self.context.add(configuration)
- getWidgetsDataForContent(self, IConfiguration, configuration,
+ data = getWidgetsData(self, IAdapterRegistrationInfo, strict=True)
+ registration = AdapterRegistration(**data)
+ publish(self.context.context, ObjectCreatedEvent(registration))
+ registration = self.context.add(registration)
+ getWidgetsDataForContent(self, IRegistration, registration,
strict=False)
self.request.response.redirect(self.context.nextURL())
return False
@@ -109,8 +109,8 @@
def getWidgets(self):
return ([getattr(self, name)
- for name in getFieldNamesInOrder(IAdapterConfigurationInfo)]
+ for name in getFieldNamesInOrder(IAdapterRegistrationInfo)]
+
[getattr(self, name)
- for name in getFieldNamesInOrder(IConfiguration)]
+ for name in getFieldNamesInOrder(IRegistration)]
)
=== Zope3/src/zope/app/browser/services/bundle.pt 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/services/bundle.pt:1.7 Thu Jun 19 17:33:01 2003
+++ Zope3/src/zope/app/browser/services/bundle.pt Sat Jun 21 17:21:59 2003
@@ -91,7 +91,7 @@
<form action="@@bundle.html" method="GET">
- <p>Click "Deactivate bundle" to unregister all configurations in
+ <p>Click "Deactivate bundle" to unregister all registrations in
this bundle.</p>
<p><input type="submit" value="Deactivate bundle" /></p>
=== Zope3/src/zope/app/browser/services/bundle.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/services/bundle.py:1.8 Thu Jun 19 17:55:45 2003
+++ Zope3/src/zope/app/browser/services/bundle.py Sat Jun 21 17:21:59 2003
@@ -21,11 +21,11 @@
Eventually, bundles will be read-only, and the only thing you can do
with bundles is install and uninstall them. At installation time, a
bundle's dependencies and are analized and satisfied, and the
-configurations in the bundle are activated, unless they conflict with
-existing configurations. This is an interactive process.
+registrations in the bundle are activated, unless they conflict with
+existing registrations. This is an interactive process.
XXX This interim code is much less ambitious: it just provides a view
-on a (site-management) folder that displays all configurations in a
+on a (site-management) folder that displays all registrations in a
bundle and lets the user activate them.
$Id$
@@ -35,12 +35,13 @@
from transaction import get_transaction
from zope.app import zapi
from zope.app.interfaces.container import IReadContainer
-from zope.app.interfaces.services.configuration import IConfiguration
-from zope.app.interfaces.services.configuration import IConfigurationManager
-from zope.app.interfaces.services.configuration import Active, Registered
-from zope.app.interfaces.services.configuration import Unregistered
+from zope.app.interfaces.services.registration import IRegistration
+from zope.app.interfaces.services.registration import IRegistrationManager
+from zope.app.interfaces.services.registration import RegisteredStatus
+from zope.app.interfaces.services.registration import ActiveStatus
+from zope.app.interfaces.services.registration import UnregisteredStatus
from zope.app.interfaces.services.folder import ISiteManagementFolder
-from zope.app.interfaces.services.service import IServiceConfiguration
+from zope.app.interfaces.services.service import IServiceRegistration
from zope.component import ComponentLookupError
from zope.proxy import removeAllProxies
from zope.publisher.browser import BrowserView
@@ -61,8 +62,8 @@
else:
sitepath = ""
self.sitepath = sitepath
- self.configurations = self.findConfigurations(self.context, "")
- self.configurations.sort(self.compareConfigurations)
+ self.registrations = self.findRegistrations(self.context, "")
+ self.registrations.sort(self.compareRegistrations)
self.services = self.findServices()
# Methods called from the page template (bundle.pt)
@@ -79,34 +80,34 @@
return "ERROR: Won't change the default folder"
if "allclear" in self.request:
count = 0
- for path, obj in self.configurations:
- if obj.status != Unregistered:
- obj.status = Unregistered
+ for path, obj in self.registrations:
+ if obj.status != UnregisteredStatus:
+ obj.status = UnregisteredStatus
count += 1
if count:
get_transaction().note("deactivate bundle")
- return "unregistered %d configurations" % count
+ return "unregistered %d registrations" % count
activated = []
registered = []
for key, value in self.request.form.items():
- if value not in (Active, Registered):
+ if value not in (ActiveStatus, RegisteredStatus):
continue
- for path, obj in self.configurations:
+ for path, obj in self.registrations:
if key == path:
break
else:
raise ComponentLookupError(key)
- for path, obj in self.configurations:
+ for path, obj in self.registrations:
value = self.request.form.get(path)
- if value not in (Active, Registered):
+ if value not in (ActiveStatus, RegisteredStatus):
continue
if obj.status != value:
- if value == Active:
+ if value == ActiveStatus:
activated.append(path)
- obj.status = Active
+ obj.status = ActiveStatus
else:
registered.append(path)
- obj.status = Registered
+ obj.status = RegisteredStatus
s = ""
if activated:
s += "Activated: %s.\n" % (", ".join(activated))
@@ -127,9 +128,9 @@
infos.append(d)
return infos
- def listConfigurations(self):
+ def listRegistrations(self):
infos = []
- for path, obj in self.configurations:
+ for path, obj in self.registrations:
name, advice, conflict = self.getAdvice(obj)
d = {"path": path,
"service": name,
@@ -158,23 +159,23 @@
else:
insite = (path == self.sitepath or
path.startswith(self.sitepath + "/"))
- inbundle = self.findServiceConfiguration(name)
+ inbundle = self.findServiceRegistration(name)
return path, insite, inbundle
def getAdvice(self, obj):
name = self.getServiceName(obj)
- advice = Active
+ advice = ActiveStatus
conflict = ""
sm = zapi.getServiceManager(obj)
service = sm.queryLocalService(name)
if service:
- registry = service.queryConfigurationsFor(obj)
+ registry = service.queryRegistrationsFor(obj)
if registry:
active = registry.active()
if active and active != obj:
conflict = zapi.getPath(active)
if not self.inOlderVersion(active):
- advice = Registered
+ advice = RegisteredStatus
return name, advice, conflict
def inOlderVersion(self, obj):
@@ -244,23 +245,23 @@
parts.append(last)
return parts
- def findServiceConfiguration(self, name):
- for path, obj in self.configurations:
- if IServiceConfiguration.isImplementedBy(obj):
+ def findServiceRegistration(self, name):
+ for path, obj in self.registrations:
+ if IServiceRegistration.isImplementedBy(obj):
if obj.name == name:
return path
return None
- def findConfigurations(self, f, prefix):
+ def findRegistrations(self, f, prefix):
alist = []
for name, obj in f.items():
- if IConfiguration.isImplementedBy(obj):
+ if IRegistration.isImplementedBy(obj):
alist.append((prefix+name, obj))
elif IReadContainer.isImplementedBy(obj):
- alist.extend(self.findConfigurations(obj, prefix+name+"/"))
+ alist.extend(self.findRegistrations(obj, prefix+name+"/"))
return alist
- def compareConfigurations(self, c1, c2):
+ def compareRegistrations(self, c1, c2):
path1, obj1 = c1
path2, obj2 = c2
t1 = (self.getAdjustedServiceName(obj1),
@@ -273,7 +274,7 @@
def findServices(self):
sd = {}
- for path, obj in self.configurations:
+ for path, obj in self.registrations:
sd[self.getServiceName(obj)] = 1
services = sd.keys()
services.sort(self.compareServiceNames)
@@ -282,8 +283,8 @@
def compareServiceNames(self, n1, n2):
return cmp(self.adjustServiceName(n1), self.adjustServiceName(n2))
- def getAdjustedServiceName(self, configuration):
- name = self.getServiceName(configuration)
+ def getAdjustedServiceName(self, registration):
+ name = self.getServiceName(registration)
return self.adjustServiceName(name)
def adjustServiceName(self, name):
@@ -293,6 +294,6 @@
else:
return name
- def getServiceName(self, configuration):
- # Return the service associated with a configuration.
- return configuration.serviceType
+ def getServiceName(self, registration):
+ # Return the service associated with a registration.
+ return registration.serviceType
=== Zope3/src/zope/app/browser/services/cache.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/services/cache.py:1.10 Fri Jun 13 13:41:13 2003
+++ Zope3/src/zope/app/browser/services/cache.py Sat Jun 21 17:21:59 2003
@@ -11,18 +11,19 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Cache configuration support classes.
+"""Cache registry support classes.
$Id$
"""
-from zope.app.browser.services.configuration import AddComponentConfiguration
+from zope.app.browser.services.registration import AddComponentRegistration
from zope.app.interfaces.container import IZopeContainer
-from zope.app.interfaces.services.configuration import IUseConfiguration
+from zope.app.interfaces.services.registration import IRegistered
from zope.component import getAdapter, getView
from zope.publisher.browser import BrowserView
-from zope.app.interfaces.services.configuration \
- import Unregistered, Registered, Active
+from zope.app.interfaces.services.registration import ActiveStatus
+from zope.app.interfaces.services.registration import RegisteredStatus
+from zope.app.interfaces.services.registration import UnregisteredStatus
from zope.app.traversing import traverse, getPath, getParent, getName
class Caches(BrowserView):
@@ -52,12 +53,12 @@
def _activate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is None:
- # Activate the first registered configuration
- obj = registry.info()[0]['configuration']
- obj.status = Active
+ # Activate the first registered registration
+ obj = registry.info()[0]['registration']
+ obj.status = ActiveStatus
done.append(name)
if done:
return "Activated: " + ", ".join(done)
@@ -67,10 +68,10 @@
def _deactivate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is not None:
- obj.status = Registered
+ obj.status = RegisteredStatus
done.append(name)
if done:
return "Deactivated: " + ", ".join(done)
@@ -80,7 +81,7 @@
def _delete(self, todo):
errors = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
if registry.active() is not None:
errors.append(name)
@@ -93,15 +94,15 @@
# 1) Delete the registrations
caches = {}
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
assert registry.active() is None # Phase error
for info in registry.info():
- conf = info['configuration']
+ conf = info['registration']
obj = conf.getComponent()
path = getPath(obj)
caches[path] = obj
- conf.status = Unregistered
+ conf.status = UnregisteredStatus
parent = getParent(conf)
name = getName(conf)
container = getAdapter(parent, IZopeContainer)
@@ -118,8 +119,8 @@
def getConfigs(self):
L = []
- for name in self.context.listConfigurationNames():
- cr = self.context.queryConfigurations(name)
+ for name in self.context.listRegistrationNames():
+ cr = self.context.queryRegistrations(name)
active = cr.active()
d = {"name": name,
"url": "",
@@ -136,19 +137,19 @@
class ConfigureCache(BrowserView):
def update(self):
- cr = self.context.queryConfigurations(self.request['name'])
- form = getView(cr, "ChangeConfigurations", self.request)
+ cr = self.context.queryRegistrations(self.request['name'])
+ form = getView(cr, "ChangeRegistrations", self.request)
form.update()
return form
-class UseConfiguration(BrowserView):
+class Registered(BrowserView):
- """View for displaying the configurations for a cache."""
+ """View for displaying the registrations for a cache."""
def uses(self):
- """Get a sequence of configuration summaries."""
+ """Get a sequence of registration summaries."""
component = self.context
- useconfig = getAdapter(component, IUseConfiguration)
+ useconfig = getAdapter(component, IRegistered)
result = []
for path in useconfig.usages():
config = traverse(component, path)
@@ -160,6 +161,6 @@
})
return result
-class AddCacheConfiguration(AddComponentConfiguration):
+class AddCacheRegistration(AddComponentRegistration):
pass
=== Zope3/src/zope/app/browser/services/cache.zcml 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/services/cache.zcml:1.4 Mon Apr 28 11:54:10 2003
+++ Zope3/src/zope/app/browser/services/cache.zcml Sat Jun 21 17:21:59 2003
@@ -28,9 +28,9 @@
<!-- Configuration page for cache objects. You get here by
clicking on the (configure) link for a particular cache
in the "Caches" tab of the cache service. It shows
- a menu of different configurations, at most one of which
- is active. You can activate a different configuration, or
- click on an individual configuration to edit it.
+ a menu of different registrations, at most one of which
+ is active. You can activate a different registration, or
+ click on an individual registration to edit it.
(Note that this page doesn't really apply to a single cache,
it applies to a single cache name. -->
<page
@@ -46,13 +46,13 @@
an interface, a permission, and a registration status
(Unregistered, Registered or Active). -->
<addform
- label="New Cache Configuration"
+ label="New Cache Registration"
for="zope.app.interfaces.cache.cache.ICache"
- name="addConfiguration.html"
- schema="zope.app.interfaces.services.cache.ICacheConfiguration"
- class=".cache.AddCacheConfiguration"
+ name="addRegistration.html"
+ schema="zope.app.interfaces.services.cache.ICacheRegistration"
+ class=".cache.AddCacheRegistration"
permission="zope.ManageServices"
- content_factory="zope.app.services.cache.CacheConfiguration"
+ content_factory="zope.app.services.cache.CacheRegistration"
arguments="name componentPath"
set_after_add="status"
fields="name componentPath permission status"
=== Zope3/src/zope/app/browser/services/configure.zcml 1.53 => 1.54 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.53 Mon Jun 16 12:00:37 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml Sat Jun 21 17:21:59 2003
@@ -11,7 +11,7 @@
allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
/>
-<!-- General configuration views --> <include package=".configuration" />
+<!-- General registration views --> <include package=".registration" />
<!--Error Logging Service -->
@@ -196,7 +196,7 @@
<!-- Adapters -->
<editform
- schema="zope.app.interfaces.services.adapter.IAdapterConfiguration"
+ schema="zope.app.interfaces.services.adapter.IAdapterRegistration"
name="index.html"
menu="zmi_views"
label="Change adapter"
@@ -213,9 +213,9 @@
<view
for = "zope.app.interfaces.container.IAdding"
- name="AdapterConfiguration"
+ name="AdapterRegistration"
permission="zope.ManageServices"
- class="zope.app.browser.services.adapter.AdapterConfigurationAdd"
+ class="zope.app.browser.services.adapter.AdapterRegistrationAdd"
>
<page
name="index.html"
@@ -225,8 +225,8 @@
<menuItem
for="zope.app.interfaces.container.IAdding"
- menu="add_configuration"
- action="AdapterConfiguration"
+ menu="add_registration"
+ action="AdapterRegistration"
title="Adapter"
/>
@@ -392,21 +392,21 @@
<!-- Generic page for objects that keep track of their registrations -->
<page
- for="zope.app.interfaces.services.configuration.IUseConfigurable"
+ for="zope.app.interfaces.services.registration.IRegisterable"
name="registrations.html"
- template="configuration/useconfiguration.pt"
- class=".configuration.NameUseConfiguration"
+ template="registration/registered.pt"
+ class=".registration.NameRegistered"
permission="zope.ManageServices"
menu="zmi_views" title="Registrations"
/>
-<!-- ServiceConfiguration -->
+<!-- ServiceRegistration -->
<page
- name="addConfiguration.html"
+ name="addRegistration.html"
for="zope.app.interfaces.services.service.ILocalService"
template="add_svc_config.pt"
- class=".service.AddServiceConfiguration"
+ class=".service.AddServiceRegistration"
permission="zope.ManageServices"
/>
@@ -414,7 +414,7 @@
name="add_svc_config.html"
for="zope.app.interfaces.services.service.ILocalService"
attribute="action"
- class=".service.AddServiceConfiguration"
+ class=".service.AddServiceRegistration"
permission="zope.ManageServices"
/>
@@ -467,10 +467,10 @@
<editform
schema="zope.app.interfaces.services.pagefolder.IPageFolderInfo."
- name="DefaultConfiguration.html"
- menu="zmi_views" title="Default Configuration"
+ name="DefaultRegistration.html"
+ menu="zmi_views" title="Default Registration"
permission="zope.ManageServices"
- label="Default configuration parameters"
+ label="Default registration parameters"
/>
=== Zope3/src/zope/app/browser/services/connection.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/browser/services/connection.py:1.12 Fri Jun 13 13:41:13 2003
+++ Zope3/src/zope/app/browser/services/connection.py Sat Jun 21 17:21:59 2003
@@ -11,18 +11,19 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Connection configuration support classes.
+"""Connection registry support classes.
$Id$
"""
-from zope.app.browser.services.configuration import AddComponentConfiguration
+from zope.app.browser.services.registration import AddComponentRegistration
from zope.app.interfaces.container import IZopeContainer
-from zope.app.interfaces.services.configuration import IUseConfiguration
+from zope.app.interfaces.services.registration import IRegistered
from zope.component import getAdapter, getView
from zope.publisher.browser import BrowserView
-from zope.app.interfaces.services.configuration \
- import Unregistered, Registered, Active
+from zope.app.interfaces.services.registration import ActiveStatus
+from zope.app.interfaces.services.registration import RegisteredStatus
+from zope.app.interfaces.services.registration import UnregisteredStatus
from zope.app.traversing import traverse, getPath, getParent, getName
class Connections(BrowserView):
@@ -52,12 +53,12 @@
def _activate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is None:
- # Activate the first registered configuration
- obj = registry.info()[0]['configuration']
- obj.status = Active
+ # Activate the first registered registration
+ obj = registry.info()[0]['registration']
+ obj.status = ActiveStatus
done.append(name)
if done:
return "Activated: " + ", ".join(done)
@@ -67,10 +68,10 @@
def _deactivate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is not None:
- obj.status = Registered
+ obj.status = RegisteredStatus
done.append(name)
if done:
return "Deactivated: " + ", ".join(done)
@@ -80,7 +81,7 @@
def _delete(self, todo):
errors = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
if registry.active() is not None:
errors.append(name)
@@ -93,15 +94,15 @@
# 1) Delete the registrations
connections = {}
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
assert registry.active() is None # Phase error
for info in registry.info():
- conf = info['configuration']
+ conf = info['registration']
obj = conf.getComponent()
path = getPath(obj)
connections[path] = obj
- conf.status = Unregistered
+ conf.status = UnregisteredStatus
parent = getParent(conf)
name = getName(conf)
container = getAdapter(parent, IZopeContainer)
@@ -118,8 +119,8 @@
def getConfigs(self):
L = []
- for name in self.context.listConfigurationNames():
- cr = self.context.queryConfigurations(name)
+ for name in self.context.listRegistrationNames():
+ cr = self.context.queryRegistrations(name)
active = cr.active()
d = {"name": name,
"url": "",
@@ -136,19 +137,19 @@
class ConfigureConnection(BrowserView):
def update(self):
- cr = self.context.queryConfigurations(self.request['name'])
- form = getView(cr, "ChangeConfigurations", self.request)
+ cr = self.context.queryRegistrations(self.request['name'])
+ form = getView(cr, "ChangeRegistrations", self.request)
form.update()
return form
-class UseConfiguration(BrowserView):
+class Registered(BrowserView):
- """View for displaying the configurations for a connection."""
+ """View for displaying the registrations for a connection."""
def uses(self):
- """Get a sequence of configuration summaries."""
+ """Get a sequence of registration summaries."""
component = self.context
- useconfig = getAdapter(component, IUseConfiguration)
+ useconfig = getAdapter(component, IRegistered)
result = []
for path in useconfig.usages():
config = traverse(component, path)
@@ -160,6 +161,6 @@
})
return result
-class AddConnectionConfiguration(AddComponentConfiguration):
+class AddConnectionRegistration(AddComponentRegistration):
pass
=== Zope3/src/zope/app/browser/services/connection.zcml 1.6 => 1.7 ===
--- Zope3/src/zope/app/browser/services/connection.zcml:1.6 Wed Apr 30 15:16:27 2003
+++ Zope3/src/zope/app/browser/services/connection.zcml Sat Jun 21 17:21:59 2003
@@ -48,11 +48,11 @@
<addform
label="New Connection Registration"
for="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
- name="addConfiguration.html"
- schema="zope.app.interfaces.services.connection.IConnectionConfiguration"
- class=".connection.AddConnectionConfiguration"
+ name="addRegistration.html"
+ schema="zope.app.interfaces.services.connection.IConnectionRegistration"
+ class=".connection.AddConnectionRegistration"
permission="zope.ManageServices"
- content_factory="zope.app.services.connection.ConnectionConfiguration"
+ content_factory="zope.app.services.connection.ConnectionRegistration"
arguments="name componentPath"
set_after_add="status"
fields="name componentPath permission status"
@@ -66,7 +66,7 @@
menu="zmi_views" title="Edit"
label="Edit Connection Registration"
name="index.html"
- schema="zope.app.interfaces.services.connection.IConnectionConfiguration"
+ schema="zope.app.interfaces.services.connection.IConnectionRegistration"
permission="zope.ManageServices"
fields="name componentPath permission status"
/>
=== Zope3/src/zope/app/browser/services/service.py 1.31 => 1.32 ===
--- Zope3/src/zope/app/browser/services/service.py:1.31 Wed Jun 18 16:12:10 2003
+++ Zope3/src/zope/app/browser/services/service.py Sat Jun 21 17:21:59 2003
@@ -19,18 +19,19 @@
from zope.app.browser.container.adding import Adding
from zope.app.browser.container.contents import Contents
from zope.app.interfaces.container import IZopeContainer
-from zope.app.interfaces.services.configuration import Registered, Active
-from zope.app.interfaces.services.configuration import Unregistered
+from zope.app.interfaces.services.registration import ActiveStatus
+from zope.app.interfaces.services.registration import RegisteredStatus
+from zope.app.interfaces.services.registration import UnregisteredStatus
from zope.app.interfaces.services.service import ILocalService
from zope.app.interfaces.services.service import IServiceManager
from zope.app.interfaces.services.utility import ILocalUtility
from zope.app.pagetemplate import ViewPageTemplateFile
from zope.app.services.folder import SiteManagementFolder
-from zope.app.services.service import ServiceConfiguration
+from zope.app.services.service import ServiceRegistration
from zope.publisher.browser import BrowserView
class ComponentAdding(Adding):
- """Adding subclass used for configurable components."""
+ """Adding subclass used for registerable components."""
menu_id = "add_component"
@@ -42,11 +43,11 @@
def nextURL(self):
v = zapi.queryView(
- self.added_object, "addConfiguration.html", self.request)
+ self.added_object, "addRegistration.html", self.request)
if v is not None:
url = str(
zapi.getView(self.added_object, 'absolute_url', self.request))
- return url + "/@@addConfiguration.html"
+ return url + "/@@addRegistration.html"
return zapi.ContextSuper(ComponentAdding, self).nextURL()
@@ -113,7 +114,7 @@
menu_id = "add_cache"
-class AddServiceConfiguration(BrowserView):
+class AddServiceRegistration(BrowserView):
"""A view on a service implementation, used by add_svc_config.py."""
def listServiceTypes(self):
@@ -123,7 +124,7 @@
lst = []
for servicename, interface in sm.getServiceDefinitions():
if interface.isImplementedBy(self.context):
- registry = sm.queryConfigurations(servicename)
+ registry = sm.queryRegistrations(servicename)
checked = True
if registry and registry.active():
checked = False
@@ -134,17 +135,17 @@
def action(self, name=[], active=[]):
path = zapi.name(self.context)
configure = zapi.getWrapperContainer(
- self.context).getConfigurationManager()
+ self.context).getRegistrationManager()
container = zapi.getAdapter(configure, IZopeContainer)
for nm in name:
- sc = ServiceConfiguration(nm, path, self.context)
+ sc = ServiceRegistration(nm, path, self.context)
name = container.setObject("", sc)
sc = container[name]
if nm in active:
- sc.status = Active
+ sc.status = ActiveStatus
else:
- sc.status = Registered
+ sc.status = RegisteredStatus
self.request.response.redirect("@@SelectedManagementView.html")
@@ -175,12 +176,12 @@
def _activate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is None:
- # Activate the first registered configuration
- obj = registry.info()[0]['configuration']
- obj.status = Active
+ # Activate the first registered registration
+ obj = registry.info()[0]['registration']
+ obj.status = ActiveStatus
done.append(name)
if done:
return "Activated: " + ", ".join(done)
@@ -190,10 +191,10 @@
def _deactivate(self, todo):
done = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
obj = registry.active()
if obj is not None:
- obj.status = Registered
+ obj.status = RegisteredStatus
done.append(name)
if done:
return "Deactivated: " + ", ".join(done)
@@ -203,7 +204,7 @@
def _delete(self, todo):
errors = []
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
if registry.active() is not None:
errors.append(name)
@@ -216,15 +217,15 @@
# 1) Delete the registrations
services = {}
for name in todo:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
assert registry.active() is None # Phase error
for info in registry.info():
- conf = info['configuration']
+ conf = info['registration']
obj = conf.getComponent()
path = zapi.getPath(obj)
services[path] = obj
- conf.status = Unregistered
+ conf.status = UnregisteredStatus
parent = zapi.getParent(conf)
name = zapi.name(conf)
container = zapi.getAdapter(parent, IZopeContainer)
@@ -247,16 +248,16 @@
return "Deleted: %s" % ", ".join(todo)
def listConfiguredServices(self):
- names = list(self.context.listConfigurationNames())
+ names = list(self.context.listRegistrationNames())
names.sort()
items = []
for name in names:
- registry = self.context.queryConfigurations(name)
+ registry = self.context.queryRegistrations(name)
assert registry
infos = [info for info in registry.info() if info['active']]
if infos:
- configobj = infos[0]['configuration']
+ configobj = infos[0]['registration']
component = configobj.getComponent()
url = str(
zapi.getView(component, 'absolute_url', self.request))
@@ -270,19 +271,19 @@
class ServiceActivation(BrowserView):
"""A view on the service manager, used by serviceactivation.pt.
- This really wants to be a view on a configuration registry
- containing service configurations, but registries don't have names,
+ This really wants to be a view on a registration registry
+ containing service registrations, but registries don't have names,
so we make it a view on the service manager; the request parameter
'type' determines which service is to be configured."""
def isDisabled(self):
sm = zapi.getServiceManager(self.context)
- registry = sm.queryConfigurations(self.request.get('type'))
+ registry = sm.queryRegistrations(self.request.get('type'))
return not (registry and registry.active())
def listRegistry(self):
sm = zapi.getServiceManager(self.context)
- registry = sm.queryConfigurations(self.request.get('type'))
+ registry = sm.queryRegistrations(self.request.get('type'))
if not registry:
return []
@@ -290,13 +291,13 @@
result = []
dummy = {'id': 'None',
'active': False,
- 'configuration': None,
+ 'registration': None,
'name': '',
'url': '',
'config': '',
}
for info in registry.info(True):
- configobj = info['configuration']
+ configobj = info['registration']
if configobj is None:
info = dummy
dummy = None
@@ -322,7 +323,7 @@
return ""
sm = zapi.getServiceManager(self.context)
- registry = sm.queryConfigurations(self.request.get('type'))
+ registry = sm.queryRegistrations(self.request.get('type'))
if not registry:
return "Invalid service type specified"
old_active = registry.active()
@@ -337,6 +338,6 @@
registry.activate(None)
return "Service deactivated"
else:
- new_active.status = Active
+ new_active.status = ActiveStatus
return active + " activated"
=== Zope3/src/zope/app/browser/services/view.py 1.19 => 1.20 ===
--- Zope3/src/zope/app/browser/services/view.py:1.19 Fri Jun 13 13:41:13 2003
+++ Zope3/src/zope/app/browser/services/view.py Sat Jun 21 17:21:59 2003
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Helper classes for local view configuration.
+"""Helper classes for local view registry.
$Id$
"""
@@ -29,8 +29,9 @@
from zope.app.component.interfacefield import InterfaceField
from zope.app.form.utility import setUpWidgets
from zope.app.interfaces.container import IZopeContainer
-from zope.app.interfaces.services.configuration import \
- Unregistered, Registered, Active
+from zope.app.interfaces.services.registration import ActiveStatus
+from zope.app.interfaces.services.registration import RegisteredStatus
+from zope.app.interfaces.services.registration import UnregisteredStatus
from zope.app.traversing import getPath, getParent, getName
class IViewSearch(Interface):
@@ -78,9 +79,9 @@
def _getSummaryFromRegistry(self, registry):
assert registry
- # Return the summary of the first configuration in the registry
+ # Return the summary of the first registration in the registry
for info in registry.info():
- return info['configuration'].usageSummary()
+ return info['registration'].usageSummary()
assert 0
@@ -93,7 +94,7 @@
setUpWidgets(self, IViewSearch)
def update(self):
- """Possibly deactivate or delete one or more page configurations.
+ """Possibly deactivate or delete one or more page registrations.
In that case, issue a message.
"""
@@ -118,9 +119,9 @@
registry = self._getRegistryFromKey(key)
obj = registry.active()
if obj is None:
- # Activate the first registered configuration
- obj = registry.info()[0]['configuration']
- obj.status = Active
+ # Activate the first registered registration
+ obj = registry.info()[0]['registration']
+ obj.status = ActiveStatus
done.append(self._getSummaryFromRegistry(registry))
if done:
return "Activated: " + ", ".join(done)
@@ -133,7 +134,7 @@
registry = self._getRegistryFromKey(key)
obj = registry.active()
if obj is not None:
- obj.status = Registered
+ obj.status = RegisteredStatus
done.append(self._getSummaryFromRegistry(registry))
if done:
return "Deactivated: " + ", ".join(done)
@@ -163,8 +164,8 @@
assert registry.active() is None # Phase error
done.append(self._getSummaryFromRegistry(registry))
for info in registry.info():
- conf = info['configuration']
- conf.status = Unregistered
+ conf = info['registration']
+ conf.status = UnregisteredStatus
parent = getParent(conf)
name = getName(conf)
container = getAdapter(parent, IZopeContainer)
@@ -199,7 +200,7 @@
presentationType.__module__ +"."+ presentationType.__name__)
registry = ContextWrapper(registry, self.context)
- view = getView(registry, "ChangeConfigurations", self.request)
+ view = getView(registry, "ChangeRegistrations", self.request)
# XXX Why are we setting this unique prefix?
prefix = md5.new('%s %s' %
(forInterface, presentationType)).hexdigest()
@@ -235,12 +236,12 @@
return result
-class PageConfigurationView(BrowserView):
+class PageRegistrationView(BrowserView):
"""Helper class for the page edit form."""
def update(self):
- super(PageConfigurationView, self).update()
+ super(PageRegistrationView, self).update()
if "UPDATE_SUBMIT" in self.request:
self.context.validate()
@@ -249,7 +250,7 @@
def update(self):
key = self.request['key']
registry = self._getRegistryFromKey(key)
- form = getView(registry, "ChangeConfigurations", self.request)
+ form = getView(registry, "ChangeRegistrations", self.request)
form.update()
return form
=== Zope3/src/zope/app/browser/services/view.zcml 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/services/view.zcml:1.3 Tue Jun 3 18:46:17 2003
+++ Zope3/src/zope/app/browser/services/view.zcml Sat Jun 21 17:21:59 2003
@@ -29,18 +29,18 @@
/>
<editform
- schema="zope.app.interfaces.services.view.IPageConfiguration"
+ schema="zope.app.interfaces.services.view.IPageRegistration"
name="index.html"
- class=".view.PageConfigurationView"
+ class=".view.PageRegistrationView"
menu="zmi_views"
label="Change page"
permission="zope.ManageServices"
/>
<addform
- schema="zope.app.interfaces.services.view.IPageConfiguration"
- name="PageConfiguration"
- content_factory="zope.app.services.view.PageConfiguration"
+ schema="zope.app.interfaces.services.view.IPageRegistration"
+ name="PageRegistration"
+ content_factory="zope.app.services.view.PageRegistration"
keyword_arguments="forInterface class_ viewName permission layer"
set_before_add="template"
label="Register a view page"
@@ -53,11 +53,11 @@
So I'm commenting it out for now.
<defaultView
- for="zope.app.interfaces.services.view.IViewConfiguration"
+ for="zope.app.interfaces.services.view.IViewRegistration"
name="edit.html" />
<editform
- schema="zope.app.interfaces.services.view.IViewConfiguration"
+ schema="zope.app.interfaces.services.view.IViewRegistration"
name="edit.html"
menu="zmi_views"
label="Change view"
@@ -65,9 +65,9 @@
/>
<addform
- schema="zope.app.interfaces.services.view.IViewConfiguration"
- name="ViewConfiguration"
- content_factory=".view.ViewConfiguration"
+ schema="zope.app.interfaces.services.view.IViewRegistration"
+ name="ViewRegistration"
+ content_factory=".view.ViewRegistration"
keyword_arguments="forInterface presentationType class_
viewName permission"
set_before_add="layer"
@@ -79,8 +79,8 @@
<menuItem
for="zope.app.interfaces.container.IAdding"
- menu="add_configuration"
- action="ViewConfiguration"
+ menu="add_registration"
+ action="ViewRegistration"
title="View"
/>