[Zope3-checkins] SVN: Zope3/branches/srichter-blow-services/ Got
Zope to start up again. I had to add a bunch of XXX to view
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Jan 10 11:06:39 EST 2005
Log message for revision 28775:
Got Zope to start up again. I had to add a bunch of XXX to view
registrations, but that's okay. Now I can at least concentrate on
developing the new Site Management screens.
Changed:
D Zope3/branches/srichter-blow-services/package-includes/bundle-configure.zcml
U Zope3/branches/srichter-blow-services/package-includes/zope.app.registration.fssync-configure.zcml
U Zope3/branches/srichter-blow-services/package-includes/zope.app.site.fssync-configure.zcml
U Zope3/branches/srichter-blow-services/package-includes/zope.app.utility.fssync-configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/browser.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/cache/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/component/browser/configure.zcml
A Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py
A Zope3/branches/srichter-blow-services/src/zope/app/component/browser/utility.py
U Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py
U Zope3/branches/srichter-blow-services/src/zope/app/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/content/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/folder/filerepresentation.py
U Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py
U Zope3/branches/srichter-blow-services/src/zope/app/fssync/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/i18n/browser/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/i18n/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/pau/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/publisher/browser/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/rdb/browser/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/browser/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/security/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/browser/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/sqlscript/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/tree/configure.zcml
U Zope3/branches/srichter-blow-services/src/zope/app/undo/__init__.py
U Zope3/branches/srichter-blow-services/src/zope/app/workflow/browser/definition.py
-=-
Deleted: Zope3/branches/srichter-blow-services/package-includes/bundle-configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/package-includes/bundle-configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/package-includes/bundle-configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1 +0,0 @@
-<include package="zope.app.bundle"/>
Modified: Zope3/branches/srichter-blow-services/package-includes/zope.app.registration.fssync-configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/package-includes/zope.app.registration.fssync-configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/package-includes/zope.app.registration.fssync-configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1 +1,3 @@
-<include package="zope.app.registration.fssync" />
+<configure>
+<!-- XXX: include package="zope.app.registration.fssync" / -->
+</configure>
Modified: Zope3/branches/srichter-blow-services/package-includes/zope.app.site.fssync-configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/package-includes/zope.app.site.fssync-configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/package-includes/zope.app.site.fssync-configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1 +1,3 @@
-<include package="zope.app.site.fssync" />
+<configure>
+<!-- XXX: include package="zope.app.site.fssync" / -->
+</configure>
Modified: Zope3/branches/srichter-blow-services/package-includes/zope.app.utility.fssync-configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/package-includes/zope.app.utility.fssync-configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/package-includes/zope.app.utility.fssync-configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1 +1,3 @@
-<include package="zope.app.utility.fssync" />
+<configure>
+<!-- XXX: include package="zope.app.utility.fssync" /-->
+</configure>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/browser.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/browser.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/browser.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -10,10 +10,8 @@
<include package="zope.app.security.browser" />
<include package="zope.app.container.browser" />
- <include package="zope.app.registration.browser" />
<include package="zope.app.form.browser" />
- <include package="zope.app.utility.browser" />
- <include package="zope.app.site.browser" />
+ <include package="zope.app.component.browser" />
</configure>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/cache/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/cache/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/cache/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -25,7 +25,7 @@
<vocabulary
name="Cache Names"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.cache.interfaces.ICache"
nameOnly="True" />
Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -5,180 +5,135 @@
<!-- SiteManagementFolder -->
<addMenuItem
- class="zope.app.site.folder.SiteManagementFolder"
- permission="zope.ManageServices"
+ class="zope.app.component.site.SiteManagementFolder"
+ permission="zope.ManageSite"
title="Site-Management Folder"
/>
<page
- for="zope.app.site.interfaces.ISiteManagementFolder"
- permission="zope.ManageServices"
- class="zope.app.container.browser.contents.JustContents"
- name="index.html" attribute="index" />
+ for="zope.app.component.interfaces.ISiteManagementFolder"
+ permission="zope.ManageSite"
+ class="zope.app.container.browser.contents.JustContents"
+ name="index.html" attribute="index"
+ />
<page
- name="contents.html"
- for="zope.app.site.interfaces.ISiteManagementFolder"
- menu="zmi_views" title="Contents"
- permission="zope.ManageServices"
- class="zope.app.container.browser.contents.Contents"
- attribute="contents" />
+ name="contents.html"
+ for="zope.app.component.interfaces.ISiteManagementFolder"
+ menu="zmi_views" title="Contents"
+ permission="zope.ManageSite"
+ class="zope.app.container.browser.contents.Contents"
+ attribute="contents"
+ />
<view
- name="+"
- menu="zmi_actions" title="Add"
- for="zope.app.site.interfaces.ISiteManagementFolder"
- permission="zope.ManageServices"
- class="zope.app.site.browser.ComponentAdding">
-
+ name="+"
+ menu="zmi_actions" title="Add"
+ for="zope.app.component.interfaces.ISiteManagementFolder"
+ permission="zope.ManageSite"
+ class="zope.app.component.browser.ComponentAdding"
+ >
<page name="index.html" attribute="index" />
<page name="action.html" attribute="action" />
-
</view>
-<!-- For services, just treat @@manage as @@index.html by default -->
+<!-- Site Manager navigation action -->
- <!-- Get first accessable item from zmi_views menu -->
<page
- for="zope.app.site.interfaces.ILocalService"
- name="index.html"
- permission="zope.ManageServices"
- class="zope.app.publisher.browser.managementviewselector.ManagementViewSelector"
- allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
- />
-
-<!-- Service Manager navigation action -->
-
- <page
- for="zope.app.site.interfaces.IPossibleSite"
- name="addServiceManager.html"
- permission="zope.ManageServices"
+ for="zope.app.component.interfaces.IPossibleSite"
+ name="addSiteManager.html"
+ permission="zope.ManageSite"
class=".MakeSite"
attribute="addSiteManager"
/>
<menuItem
menu="zmi_actions" title="Make a site"
- for="zope.app.site.interfaces.IPossibleSite"
- action="addServiceManager.html"
+ for="zope.app.component.interfaces.IPossibleSite"
+ action="addSiteManager.html"
filter="python:
- not modules['zope.app.site.interfaces'].ISite.providedBy(context)"
- permission="zope.ManageServices"
+ not modules['zope.app.component.interfaces'].ISite.providedBy(context)"
+ permission="zope.ManageSite"
/>
<menuItem
menu="zmi_actions"
title="Manage Site"
- for="zope.app.site.interfaces.ISite"
+ for="zope.app.component.interfaces.ISite"
action="++etc++site/@@SelectedManagementView.html"
- permission="zope.ManageServices"
+ permission="zope.ManageSite"
/>
-<!-- ServiceManager -->
+<!-- SiteManager -->
- <page
- for="zope.app.site.interfaces.ISiteManager"
+ <!--XXX: page
+ for="zope.app.component.interfaces.ILocalSiteManager"
name="tasks.html"
menu="zmi_views" title="Tasks"
template="tasks.pt"
- permission="zope.ManageServices" />
+ permission="zope.ManageSite" /-->
-
- <page
- for="zope.app.site.interfaces.ISiteManager"
- name="services.html"
- menu="zmi_views" title="Services"
- template="services.pt"
- class=".ServiceSummary"
- permission="zope.ManageServices" />
-
- <page
- for="zope.app.site.interfaces.ISiteManager"
- name="serviceActivation.html"
- template="serviceactivation.pt"
- class=".ServiceActivation"
- permission="zope.ManageServices" />
-
-
- <page
- for="zope.app.site.interfaces.ISiteManager"
+ <!-- XXX: page
+ for="zope.app.component.interfaces.ILocalSiteManager"
name="interfacebrowse.html"
template="interfacebrowse.pt"
class=".Interfaces"
permission="zope.ManageServices"
menu="zmi_views" title="Interface Browse"
- />
+ /-->
- <page
- for="zope.app.site.interfaces.ISiteManager"
+ <!-- XXX: page
+ for="zope.app.component.interfaces.ILocalSiteManager"
name="interfacedetail.html"
template="interfacedetail.pt"
class=".Detail"
permission="zope.ManageServices"
- />
+ /-->
- <page
- for="zope.app.site.interfaces.ISiteManager"
+ <!-- page
+ for="zope.app.component.interfaces.ILocalSiteManager"
name="interfacemethoddetail.html"
template="interfacemethoddetail.pt"
class=".MethodDetail"
permission="zope.ManageServices"
- />
+ /-->
-
- <icon
- name="zmi_icon"
- for="zope.app.site.interfaces.ISiteManager"
- file="service_manager.gif" />
-
<menuItems
menu="zmi_actions"
- for="zope.app.site.interfaces.ISiteManager">
+ for="zope.app.component.interfaces.ILocalSiteManager">
<menuItem
title="Visit default folder"
action="default/@@SelectedManagementView.html"
- permission="zope.ManageServices" />
- <menuItem
- title="Add service"
- action="default/AddService"
- permission="zope.ManageServices" />
-
- <!-- Does not work -->
- <!--menuItem
- title="Add utility"
- action="default/AddUtility"
- permission="zope.ManageServices" /-->
-
+ permission="zope.ManageSite"
+ />
</menuItems>
<page
name="contents.html"
- for="zope.app.site.interfaces.ISiteManager"
+ for="zope.app.component.interfaces.ILocalSiteManager"
menu="zmi_views" title="Software"
- permission="zope.ManageServices"
+ permission="zope.ManageSite"
class="zope.app.container.browser.contents.Contents"
attribute="contents" />
<view
name="+"
menu="zmi_actions" title="Add Site Management Folder"
- for="zope.app.site.interfaces.ISiteManager"
- permission="zope.ManageServices"
+ for="zope.app.component.interfaces.ILocalSiteManager"
+ permission="zope.ManageSite"
class="zope.app.container.browser.adding.Adding"
>
-
<page name="index.html" attribute="index"/>
<page name="action.html" attribute="action"/>
</view>
<pages
- for="zope.app.site.interfaces.ISiteManager"
- permission="zope.ManageServices"
- class="zope.app.container.browser.contents.JustContents">
-
+ for="zope.app.component.interfaces.ILocalSiteManager"
+ permission="zope.ManageSite"
+ class="zope.app.container.browser.contents.JustContents"
+ >
<page name="index.html" attribute="index" />
-
</pages>
<!-- Adapter Registration -->
@@ -188,32 +143,27 @@
name="index.html"
menu="zmi_views"
label="Change adapter"
- permission="zope.ManageServices"
+ permission="zope.ManageSite"
/>
- <addform
+ <!-- XXX: addform
schema="..interfaces.IAdapterRegistration"
name="AdapterRegistration"
content_factory="..site.AdapterRegistration"
- arguments="provided factoryName"
- keyword_arguments="required name permission"
+ arguments="required provided factoryName"
+ keyword_arguments="name permission"
label="Register an adapter"
permission="zope.ManageServices"
fields="required provided name permission factoryName"
menu="add_registration" title="Adapter Registration"
- />
+ /-->
<!-- Tools Views -->
- <servicetool
- title="Service Tools"
- description="Service tool management."
- />
-
<page
name="tools.html"
- for="zope.app.site.interfaces.ISiteManager"
- permission="zope.ManageContent"
+ for="zope.app.component.interfaces.ILocalSiteManager"
+ permission="zope.ManageSite"
template="tools.pt"
menu="zmi_views" title="Tools"
class=".tools.ToolsOverview"
@@ -221,20 +171,11 @@
<page
name="tools.html"
- for="zope.app.utility.interfaces.ILocalUtility"
- permission="zope.ManageContent"
+ for="zope.app.component.interfaces.ILocalUtility"
+ permission="zope.ManageSite"
class=".tools.ToolsBacklink"
attribute="getLink"
menu="zmi_actions" title="Tools"
/>
- <page
- name="tools.html"
- for="zope.app.site.interfaces.ILocalService"
- permission="zope.ManageContent"
- class=".tools.ToolsBacklink"
- attribute="getLink"
- menu="zmi_actions" title="Tools"
- />
-
</zope:configure>
Copied: Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py (from rev 28772, Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration/browser/__init__.py)
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration/browser/__init__.py 2005-01-09 18:18:04 UTC (rev 28772)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -0,0 +1,379 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""General registry-related views
+
+$Id$
+"""
+import warnings
+
+from zope.interface import implements
+from zope.security.proxy import removeSecurityProxy
+
+from zope.app import zapi
+from zope.app.container.browser.adding import Adding
+from zope.app.container.interfaces import INameChooser
+from zope.app.form.browser.widget import SimpleInputWidget
+from zope.app.i18n import ZopeMessageIDFactory as _
+from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
+from zope.app.publisher.browser import BrowserView
+from zope.app.component.interfaces.registration import ActiveStatus
+from zope.app.component.interfaces.registration import IRegistered
+from zope.app.component.interfaces.registration import IRegistration
+
+class RegistrationView(BrowserView):
+ """View for registerable objects that have at most one registration.
+
+ If the object has more than one registration, this performs a
+ redirection to the 'registrations.html' view.
+
+ """
+
+ def __init__(self, context, request):
+ super(RegistrationView, self).__init__(context, request)
+ useconfig = IRegistered(self.context)
+ self.registrations = useconfig.registrations()
+
+ def update(self):
+ """Make changes based on the form submission."""
+ if len(self.registrations) > 1:
+ self.request.response.redirect("registrations.html")
+ return
+ if "deactivate" in self.request:
+ self.registrations[0].status = RegisteredStatus
+ elif "activate" in self.request:
+ if not self.registrations:
+ # create a registration:
+ self.request.response.redirect("addRegistration.html")
+ return
+ self.registrations[0].status = ActiveStatus
+
+ def active(self):
+ return self.registrations[0].status == ActiveStatus
+
+ def registered(self):
+ return bool(self.registrations)
+
+ def registration(self):
+ """Return the first registration.
+
+ If there are no registrations, raises an error.
+ """
+ return self.registrations[0]
+
+
+class Registered(object):
+ """View for registerable objects that more than one registration."""
+
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def uses(self):
+ component = self.context
+ useconfig = IRegistered(component)
+ result = []
+ for path in useconfig.usages():
+ config = zapi.traverse(component, path)
+ description = config.usageSummary()
+ url = zapi.getView(config, 'absolute_url', self.request)
+ result.append({'path': path,
+ 'url': url(),
+ 'status': config.status,
+ 'description': description,
+ })
+ return result
+
+
+class ChangeRegistrations(BrowserView):
+
+ _prefix = 'registrations'
+ name = _prefix + ".active"
+ message = ''
+ configBase = ''
+
+ def setPrefix(self, prefix):
+ self._prefix = prefix
+ self.name = prefix + ".active"
+
+ def applyUpdates(self):
+ message = ''
+ if 'submit_update' in self.request.form:
+ id = self.request.form.get(self.name)
+ if id == "disable":
+ active = self.context.active()
+ if active is not None:
+ self.context.activate(None)
+ message = _("Disabled")
+ else:
+ for info in self.context.info():
+ infoid = zapi.getPath(info['registration'])
+ if infoid == id and not info['active']:
+ self.context.activate(info['registration'])
+ message = _("Updated")
+ break
+
+ return message
+
+ def update(self):
+
+ message = self.applyUpdates()
+
+ self.configBase = str(zapi.getView(zapi.getServices(), 'absolute_url',
+ self.request))
+
+ registrations = self.context.info()
+
+ # This is OK because registrations is just a list of dicts
+ registrations = removeSecurityProxy(registrations)
+
+ inactive = 1
+ for info in registrations:
+ if info['active']:
+ inactive = None
+ else:
+ info['active'] = False
+
+ reg = info['registration']
+ info['summary'] = reg.implementationSummary()
+ info['id'] = zapi.getPath(reg)
+
+ # Add a dummy registration since the stack removes trailing None.
+ registrations.append({"active": False,
+ "id": "disable",
+ "summary": ""})
+
+ self.inactive = inactive
+ self.registrations = registrations
+
+ self.message = message
+
+
+#############################################################################
+# BBB: Only for backward compatibility. 12/07/2004
+class ComponentPathWidget(SimpleInputWidget):
+ """Widget for displaying component paths
+
+ The widget doesn't actually allow editing. Rather it gets the
+ value by inspecting its field's context. If the context is an
+ IComponentRegistration, then it just gets its value from the
+ component using the field's name. Otherwise, it uses the path to
+ the context.
+ """
+
+ def __init__(self, *args, **kw):
+ warnings.warn(
+ "Use of `ComponentPathWidget` deprecated, since the "
+ "registration code now uses the component directly instead "
+ "of using the component's path.",
+ DeprecationWarning, stacklevel=2,
+ )
+ super(ComponentPathWidget, self).__init__(*args, **kw)
+
+ def __call__(self):
+ """See zope.app.browser.interfaces.form.IBrowserWidget"""
+ # Render as a link to the component
+ field = self.context
+ context = field.context
+ if IRegistration.providedBy(context):
+ # It's a registration object. Just get the corresponding attr
+ path = getattr(context, field.__name__)
+ # The path may be relative; then interpret relative to ../..
+ if not path.startswith("/"):
+ context = zapi.traverse(context, "../..")
+ component = zapi.traverse(context, path)
+ else:
+ # It must be a component that is about to be configured.
+ component = context
+ # Always use a relative path (just the component name)
+ path = zapi.name(context)
+
+ url = zapi.getView(component, 'absolute_url', self.request)
+
+ return ('<a href="%s/@@SelectedManagementView.html">%s</a>'
+ % (url, path))
+
+ def hidden(self):
+ """See zope.app.browser.interfaces.form.IBrowserWidget"""
+ return ''
+
+ def hasInput(self):
+ """See zope.app.form.interfaces.IWidget"""
+ return 1
+
+ def getInputValue(self):
+ """See zope.app.form.interfaces.IWidget"""
+ field = self.context
+ context = field.context
+ if IRegistration.providedBy(context):
+ # It's a registration object. Just get the corresponding attr
+ path = getattr(context, field.getName())
+ else:
+ # It must be a component that is about to be configured.
+ # Always return a relative path (just the component name)
+ path = zapi.name(context)
+
+ return path
+#############################################################################
+
+
+class ComponentWidget(SimpleInputWidget):
+ """Widget for displaying/entering component paths that point to components.
+
+ The widget doesn't actually allow editing. Rather it gets the
+ value by inspecting its field's context. If the context is an
+ IComponentRegistration, then it just gets its value from the
+ component using the field's name. Otherwise, it uses the path to
+ the context.
+ """
+
+ def __call__(self):
+ """See zope.app.browser.interfaces.form.IBrowserWidget"""
+ # Render as a link to the component
+ field = self.context
+ context = field.context
+ if IRegistration.providedBy(context):
+ # It's a registration object. Just get the corresponding attr
+ component = getattr(context, field.__name__)
+ path = zapi.getPath(component)
+ else:
+ # It must be a component that is about to be configured.
+ component = context
+ # Always use a relative path (just the component name)
+ path = zapi.name(context)
+
+ url = zapi.getView(component, 'absolute_url', self.request)
+
+ return ('<a href="%s/@@SelectedManagementView.html">%s</a>'
+ % (url, path))
+
+ def hidden(self):
+ """See zope.app.browser.interfaces.form.IBrowserWidget"""
+ return ''
+
+ def hasInput(self):
+ """See zope.app.form.interfaces.IWidget"""
+ return 1
+
+ def getInputValue(self):
+ """See zope.app.form.interfaces.IWidget"""
+ field = self.context
+ context = field.context
+ if IRegistration.providedBy(context):
+ # It's a registration object. Just get the corresponding attr
+ return getattr(context, field.getName())
+
+ # It must be a component that is about to be configured.
+ return context
+
+
+class AddComponentRegistration(BrowserView):
+ """View for adding component registrations
+
+ This class is used to define registration add forms. It provides
+ the ``add`` and ``nextURL`` methods needed when creating add forms
+ for non-IAdding objects. We need this here because registration
+ add forms are views of the component being configured.
+ """
+
+ def add(self, registration):
+ """Add a registration
+
+ We are going to add the registration to the local
+ registration manager. We don't want to hard code the name of
+ this, so we'll simply scan the containing folder and add the
+ registration to the first registration manager we find.
+
+ """
+
+ component = self.context
+
+ # Get the registration manager for this folder
+ folder = component.__parent__
+ rm = folder.getRegistrationManager()
+
+ name = INameChooser(rm).chooseName('', registration)
+ rm[name] = registration
+ return registration
+
+ def nextURL(self):
+ return "@@SelectedManagementView.html"
+
+
+class RegistrationAdding(Adding):
+ """Adding subclass for adding registrations."""
+
+ menu_id = "add_registration"
+
+ def nextURL(self):
+ return str(zapi.getView(self.context, "absolute_url", self.request))
+
+
+class EditRegistration(BrowserView):
+ """A view on a registration manager, used by registrations.pt."""
+
+ def __init__(self, context, request):
+ self.request = request
+ self.context = context
+
+ def update(self):
+ """Perform actions depending on user input."""
+
+ if 'keys' in self.request:
+ k = self.request['keys']
+ else:
+ k = []
+
+ msg = 'You must select at least one item to use this action'
+
+ if 'remove_submit' in self.request:
+ if not k: return msg
+ self.remove_objects(k)
+ elif 'top_submit' in self.request:
+ if not k: return msg
+ self.context.moveTop(k)
+ elif 'bottom_submit' in self.request:
+ if not k: return msg
+ self.context.moveBottom(k)
+ elif 'up_submit' in self.request:
+ if not k: return msg
+ self.context.moveUp(k)
+ elif 'down_submit' in self.request:
+ if not k: return msg
+ self.context.moveDown(k)
+ elif 'refresh_submit' in self.request:
+ pass # Nothing to do
+
+ return ''
+
+ def remove_objects(self, key_list):
+ """Remove the directives from the container."""
+ container = self.context
+ for name in key_list:
+ del container[name]
+
+ def configInfo(self):
+ """Render View for each directives."""
+ result = []
+ for name, configobj in self.context.items():
+ url = str(zapi.getView(configobj, 'absolute_url', self.request))
+ active = configobj.status == ActiveStatus
+ summary1 = getattr(configobj, "usageSummary", None)
+ summary2 = getattr(configobj, "implementationSummary", None)
+ item = {'name': name, 'url': url, 'active': active}
+ if summary1:
+ item['line1'] = summary1()
+ if summary2:
+ item['line2'] = summary2()
+ result.append(item)
+ return result
Copied: Zope3/branches/srichter-blow-services/src/zope/app/component/browser/utility.py (from rev 28772, Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/utility/browser/__init__.py)
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/utility/browser/__init__.py 2005-01-09 18:18:04 UTC (rev 28772)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/browser/utility.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -0,0 +1,179 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Use-Registration view for utilities.
+
+$Id$
+"""
+from zope.interface import providedBy
+from zope.security.proxy import removeSecurityProxy
+
+from zope.app import zapi
+from zope.app.component.browser.registration import AddComponentRegistration
+from zope.app.component.interfaces.registration import ActiveStatus
+from zope.app.introspector import interfaceToName
+
+from zope.app.i18n import ZopeMessageIDFactory as _
+
+
+class AddRegistration(AddComponentRegistration):
+ """View for adding a utility registration.
+
+ We could just use AddComponentRegistration, except that we need a
+ custom interface widget.
+
+ This is a view on a local utility, configured by an <addform>
+ directive.
+ """
+ def add(self, registration):
+ reg = super(AddRegistration, self).add(registration)
+ reg.status = ActiveStatus
+ return reg
+
+
+class Utilities(object):
+ # self.context is the local utility service
+
+ def update(self):
+ """Possibly delete one or more utilities.
+
+ In that case, issue a message.
+ """
+ selected = self.request.get("selected")
+ doActivate = self.request.get("Activate")
+ doDeactivate = self.request.get("Deactivate")
+ doDelete = self.request.get("Delete")
+ if not selected:
+ if doActivate or doDeactivate or doDelete:
+ return _("Please select at least one checkbox")
+ return None
+ folder = zapi.getParent(self.context)
+ todo = []
+ for key in selected:
+ name, ifacename = key.split(":", 1)
+ iface = folder.resolve(ifacename)
+ todo.append((key, name, iface))
+ if doActivate:
+ return self._activate(todo)
+ if doDeactivate:
+ return self._deactivate(todo)
+ if doDelete:
+ return self._delete(todo)
+
+ def _activate(self, todo):
+ done = []
+ for key, name, iface in todo:
+ registry = self.context.queryRegistrations(name, iface)
+ obj = registry.active()
+ if obj is None:
+ # Activate the first registered registration
+ obj = registry.info()[0]['registration']
+ obj.status = ActiveStatus
+ done.append(obj.usageSummary())
+ if done:
+ s = _("Activated: ${activated_utilities}")
+ s.mapping = {'activated_utilities': ", ".join(done)}
+ return s
+ else:
+ return _("All of the checked utilities were already active")
+
+ def _deactivate(self, todo):
+ done = []
+ for key, name, iface in todo:
+ registry = self.context.queryRegistrations(name, iface)
+ obj = registry.active()
+ if obj is not None:
+ obj.status = RegisteredStatus
+ done.append(obj.usageSummary())
+ if done:
+ s = _("Deactivated: ${deactivated_utilities}")
+ s.mapping = {'deactivated_utilities': ", ".join(done)}
+ return s
+ else:
+ return _("None of the checked utilities were active")
+
+ def _delete(self, todo):
+ errors = []
+ for key, name, iface in todo:
+ registry = self.context.queryRegistrations(name, iface)
+ assert registry
+ obj = registry.active()
+ if obj is not None:
+ errors.append(obj.usageSummary())
+ continue
+ if errors:
+ s = _("Can't delete active utility/utilites: ${utility_names}; "
+ "use the Deactivate button to deactivate")
+ s.mapping = {'utility_names': ", ".join(errors)}
+ return s
+
+ # 1) Delete the registrations
+ services = {}
+ done = []
+ for key, name, iface in todo:
+ registry = self.context.queryRegistrations(name, iface)
+ assert registry
+ assert registry.active() is None # Phase error
+ first = True
+ for info in registry.info():
+ conf = info['registration']
+ obj = conf.component
+ done.append(conf.usageSummary())
+ path = zapi.getPath(obj)
+ services[path] = obj
+ conf.status = UnregisteredStatus
+ parent = zapi.getParent(conf)
+ name = zapi.getName(conf)
+ del parent[name]
+
+ # 2) Delete the service objects
+ for path, obj in services.items():
+ parent = zapi.getParent(obj)
+ name = zapi.getName(obj)
+ del parent[name]
+
+ s = _("Deleted: ${utility_names}")
+ s.mapping = {'utility_names': ", ".join(done)}
+ return s
+
+ def getConfigs(self):
+ utils = self.context
+ L = []
+ for registration in utils.registrations(localOnly=True):
+ ifname = interfaceToName(self.context, registration.provided)
+ d = {"interface": ifname,
+ "name": registration.name,
+ "url": "",
+ "summary": registration.usageSummary(),
+ "configurl": ("@@configureutility.html?interface=%s&name=%s"
+ % (ifname, registration.name)),
+ }
+ stack = utils.queryRegistrationsFor(registration)
+ if stack.active():
+ d["url"] = str(zapi.getView(registration.component,
+ "absolute_url", self.request))
+ L.append((ifname, registration.name, d))
+ L.sort()
+ return [d for ifname, name, d in L]
+
+
+class ConfigureUtility(object):
+ def update(self):
+ folder = zapi.getParent(self.context)
+ iface = folder.resolve(self.request['interface'])
+ name = self.request['name']
+ iface = removeSecurityProxy(iface)
+ regstack = self.context.queryRegistrations(name, iface)
+ form = zapi.getView(regstack, "ChangeRegistrations", self.request)
+ form.update()
+ return form
Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1,27 +1,149 @@
<configure xmlns="http://namespaces.zope.org/zope">
- <vocabulary
- name="Interfaces"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
- interface="zope.interface.interfaces.IInterface" />
-
<interface interface="zope.interface.Interface" />
+
+ <!-- Registration Framework -->
+
+ <content class=".registration.RegistrationManager">
+ <factory
+ id="zope.app.component.RegistrationManager"
+ title="Registration Manager" />
+ <implements
+ interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
+ />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.app.container.interfaces.IReadContainer" />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.app.container.interfaces.IWriteContainer
+ zope.app.container.interfaces.INameChooser"
+ />
+ </content>
+
+ <class class=".registration.Registered">
+ <allow attributes="registrations" />
+ </class>
+
<adapter
- factory=".localservice.serviceServiceAdapter"
- provides="zope.component.IServiceService"
- for="zope.interface.Interface" />
+ for=".interfaces.registration.IRegisterable"
+ provides=".interfaces.registration.IRegistered"
+ factory=".registration.Registered"
+ trusted="true"
+ />
<subscriber
- factory=".localservice.threadSiteSubscriber"
+ factory=".registration.ComponentRegistrationRemoveSubscriber"
+ for=".interfaces.registration.IComponentRegistration
+ zope.app.container.interfaces.IObjectRemovedEvent"
+ />
+
+ <subscriber
+ for=".interfaces.registration.IComponentRegistration
+ zope.app.container.interfaces.IObjectAddedEvent"
+ factory=".registration.ComponentRegistrationAddSubscriber"
+ />
+
+ <subscriber
+ for=".interfaces.registration.IRegisterable
+ zope.app.container.interfaces.IObjectMovedEvent"
+ factory=".registration.RegisterableMoveSubscriber"
+ />
+
+
+ <!-- Site and Site Manager Framework -->
+
+ <module module=".interfaces">
+ <allow attributes="ISite" />
+ </module>
+
+ <content class=".site.LocalSiteManager">
+ <implements
+ interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.app.container.interfaces.IReadContainer" />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.component.interfaces.ISiteManager
+ zope.app.container.interfaces.IWriteContainer" />
+ </content>
+
+ <!-- XXX: We allow these attributes to be changed. We need some subscriber
+ that updated the registries once attributes change. -->
+ <content class=".site.AdapterRegistration">
+ <require
+ permission="zope.ManageSite"
+ interface=".interfaces.IAdapterRegistration"
+ set_schema=".interfaces.IAdapterRegistration"
+ />
+ </content>
+
+ <content class=".site.UtilityRegistration">
+ <require
+ permission="zope.ManageSite"
+ interface=".interfaces.IUtilityRegistration"
+ set_schema=".interfaces.IUtilityRegistration"
+ />
+ </content>
+
+ <content class=".site.SiteManagementFolder">
+ <factory />
+ <implements
+ interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
+ />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.app.container.interfaces.IReadContainer" />
+ <require
+ permission="zope.ManageSite"
+ interface="zope.app.container.interfaces.IWriteContainer"
+ attributes="registrationManager"
+ />
+ </content>
+
+ <adapter
+ for="zope.component.interfaces.ISiteManager"
+ provides="zope.app.filerepresentation.interfaces.IDirectoryFactory"
+ factory=".site.SMFolderFactory"
+ permission="zope.ManageContent"
+ />
+
+ <adapter
+ for="zope.interface.Interface"
+ provides="zope.component.interfaces.ISiteManager"
+ factory=".site.SiteManagerAdapter"
+ />
+
+ <subscriber
for="zope.app.publication.interfaces.IBeforeTraverseEvent"
+ factory=".site.threadSiteSubscriber"
/>
<subscriber
- factory=".localservice.clearThreadSiteSubscriber"
for="zope.app.publication.interfaces.IEndRequestEvent"
+ factory=".site.clearThreadSiteSubscriber"
/>
+ <subscriber
+ for=".interfaces.ISite
+ zope.app.container.interfaces.IObjectMovedEvent"
+ factory=".site.changeSiteConfigurationAfterMove"
+ />
+
+
+ <!-- Vocabularies -->
+
+ <vocabulary
+ name="Interfaces"
+ factory=".vocabulary.UtilityVocabulary"
+ interface="zope.interface.interfaces.IInterface" />
+
+ <vocabulary
+ name="Utility Component Interfaces"
+ factory=".vocabulary.UtilityComponentInterfacesVocabulary" />
+
</configure>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -147,7 +147,14 @@
required=False,
)
+ # XXX: for now
+ factoryName = zope.schema.TextLine(
+ title=_(u"Factory Name"),
+ readonly=True,
+ required=False,
+ )
+
class IUtilityRegistration(IAdapterRegistration):
"""Utility registration object.
Modified: Zope3/branches/srichter-blow-services/src/zope/app/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -43,20 +43,12 @@
<include package="zope.app.i18n" />
-
- <!-- Local Component Registration -->
- <include package="zope.app.registration" />
-
-
<!-- Database boostrapping and maintanance -->
<include package=".appsetup" />
<include package=".zopeappgenerations" />
<!-- Services -->
- <include package="zope.app.pluggableauth" />
- <include package="zope.app.site" />
- <include package="zope.app.adapter" />
- <include package="zope.app.utility" />
+ <!-- XXX: include package="zope.app.pluggableauth" /-->
<include package="zope.app.principalannotation" />
<!-- Utilities -->
@@ -66,9 +58,7 @@
<include package="zope.app.keyreference" />
<!-- Misc. Service Manager objects -->
- <!-- XXX: temporarily deactivated
- <include package="zope.app.module" />
- -->
+ <!-- XXX: include package="zope.app.module" /-->
<!-- Broken-object support -->
<include package="zope.app.broken" />
Modified: Zope3/branches/srichter-blow-services/src/zope/app/content/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/content/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/content/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -6,7 +6,7 @@
<vocabulary
name="Content Types"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.content.interfaces.IContentType" />
</configure>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/folder/filerepresentation.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/folder/filerepresentation.py 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/folder/filerepresentation.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -17,7 +17,7 @@
"""
__docformat__ = 'restructuredtext'
-from zope.app.site.interfaces import ISite
+from zope.app.component.interfaces import ISite
class RootDirectoryFactory(object):
Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -92,5 +92,5 @@
if layer is None:
layer = IDefaultBrowserLayer
- s = zapi.getGlobalService(zapi.servicenames.Adapters)
- s.register((for_, layer), Interface, name, class_)
+ sm = zapi.getGlobalSiteManager()
+ sm.provideAdapter((for_, layer), Interface, name, class_)
Modified: Zope3/branches/srichter-blow-services/src/zope/app/fssync/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/fssync/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/fssync/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1,10 +1,10 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:fssync='http://namespaces.zope.org/fssync'
+ xmlns:fssync="http://namespaces.zope.org/fssync"
>
<utility
- interface="zope.app.fssync.interfaces.IGlobalFSSyncUtility"
+ provides="zope.app.fssync.interfaces.IGlobalFSSyncUtility"
component="zope.app.fssync.fsregistry.fsRegistry"
/>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/i18n/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/i18n/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/i18n/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -65,19 +65,6 @@
permission="zope.ManageServices"
/>
- <!-- Custom Domain registration screen -->
- <addform
- label="New Translation Domain Registration"
- for="zope.app.i18n.interfaces.ILocalTranslationDomain"
- name="addRegistration.html"
- schema="zope.app.utility.interfaces.IUtilityRegistration"
- class="zope.app.utility.browser.AddRegistration"
- permission="zope.ManageServices"
- content_factory="zope.app.i18n.translationdomain.DomainRegistration"
- arguments="name interface componentPath"
- set_after_add="status"
- fields="name interface componentPath permission status" />
-
<icon
name="zmi_icon"
for="zope.i18n.interfaces.ITranslationDomain"
Modified: Zope3/branches/srichter-blow-services/src/zope/app/i18n/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/i18n/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/i18n/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -21,28 +21,28 @@
<!-- Register the Translation Domain as a content object -->
<localUtility class=".translationdomain.TranslationDomain">
<factory
- id="zope.app.TranslationService"
+ id="zope.app.i18n.TranslationDomain"
/>
<allow interface="zope.i18n.interfaces.ITranslationDomain"
/>
- <require permission="zope.ManageServices"
+ <require permission="zope.ManageSite"
interface="zope.app.container.interfaces.IContainer"
/>
- <require permission="zope.ManageServices"
+ <require permission="zope.ManageSite"
interface=".interfaces.IWriteTranslationDomain"
/>
- <require permission="zope.ManageServices"
+ <require permission="zope.ManageSite"
interface=".interfaces.ISyncTranslationDomain"
/>
</localUtility>
<subscriber
- for="..registration.interfaces.IRegistrationActivatedEvent"
+ for="..component.interfaces.registration.IRegistrationActivatedEvent"
factory=".translationdomain.setDomainOnActivation"
/>
<subscriber
- for="..registration.interfaces.IRegistrationDeactivatedEvent"
+ for="..component.interfaces.registration.IRegistrationDeactivatedEvent"
factory=".translationdomain.unsetDomainOnDeactivation"
/>
@@ -54,7 +54,7 @@
<require permission="zope.View"
interface="zope.i18n.interfaces.IMessageCatalog" />
- <require permission="zope.ManageServices"
+ <require permission="zope.ManageSite"
attributes="setMessage getMessageIds" />
</content>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/pau/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/pau/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/pau/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -32,35 +32,35 @@
<vocabulary
name="ExtractionPlugins"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.pau.interfaces.IExtractionPlugin"
nameOnly="True"
/>
<vocabulary
name="AuthenticationPlugins"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.pau.interfaces.IAuthenticationPlugin"
nameOnly="True"
/>
<vocabulary
name="ChallengePlugins"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.pau.interfaces.IChallengePlugin"
nameOnly="True"
/>
<vocabulary
name="PrincipalFactoryPlugins"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.pau.interfaces.IPrincipalFactoryPlugin"
nameOnly="True"
/>
<vocabulary
name="PrincipalSearchPlugins"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.pau.interfaces.IPrincipalSearchPlugin"
nameOnly="True"
/>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/publisher/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/publisher/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/publisher/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -55,7 +55,7 @@
<browser:page
name=""
- for="zope.app.site.interfaces.ISite"
+ for="zope.app.component.interfaces.ISite"
class="zope.app.publisher.browser.resources.Resources"
permission="zope.Public"
allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
Modified: Zope3/branches/srichter-blow-services/src/zope/app/rdb/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/rdb/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/rdb/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -46,18 +46,6 @@
for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
name="editForm.html" />
- <addform
- label="Add Database Connection Registration"
- for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
- name="addRegistration.html"
- schema="zope.app.utility.interfaces.IUtilityRegistration"
- class="zope.app.utility.browser.AddRegistration"
- permission="zope.ManageServices"
- content_factory="zope.app.utility.UtilityRegistration"
- arguments="name interface componentPath"
- set_after_add="status"
- fields="name interface componentPath permission status" />
-
<zope:include file="gadflyda.zcml" />
</zope:configure>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -11,18 +11,18 @@
<!-- Content Component Definition -->
- <addform
+ <!-- XXX: addform
label="Content Component Definition Registration"
for= "zope.app.schemacontent.interfaces.IContentComponentDefinition"
name="addRegistration.html"
- schema="zope.app.utility.interfaces.IUtilityRegistration"
- class="zope.app.utility.browser.AddRegistration"
+ schema="zope.app.component.interfaces.IUtilityRegistration"
+ class="zope.app.component.browser.registration.AddRegistration"
permission="zope.ManageServices"
content_factory="
zope.app.schemacontent.content.ContentComponentDefinitionRegistration"
arguments="name interface componentPath"
set_after_add="status"
- fields="name interface componentPath permission status" />
+ fields="name interface componentPath permission status" /-->
<!-- Menu entry for "add component" menu -->
Modified: Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/schemacontent/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -22,8 +22,8 @@
<content class=".content.ContentComponentDefinitionRegistration">
<require
permission="zope.ManageServices"
- interface="zope.app.utility.interfaces.IUtilityRegistration"
- set_schema="zope.app.utility.interfaces.IUtilityRegistration"
+ interface="zope.app.component.interfaces.IUtilityRegistration"
+ set_schema="zope.app.component.interfaces.IUtilityRegistration"
/>
</content>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/security/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/security/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/security/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -96,6 +96,11 @@
title="[manage-services-permission] Manage Services"
/>
+ <permission
+ id="zope.ManageSite"
+ title="[manage-site-permission] Manage Site"
+ />
+
<permission
id="zope.ManagePrincipals"
title="[manage-principal-permission] Manage Principals"
Modified: Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/browser/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/browser/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/browser/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -47,7 +47,7 @@
<!-- The role-permission mapping is really the domain of programmers -->
<pages
- for="zope.app.site.interfaces.ISiteManager"
+ for="zope.app.component.interfaces.ILocalSiteManager"
permission="zope.Security"
class=".rolepermissionview.RolePermissionView">
<page
Modified: Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -69,12 +69,12 @@
</localUtility>
<subscriber
- for="..registration.interfaces.IRegistrationActivatedEvent"
+ for="..component.interfaces.registration.IRegistrationActivatedEvent"
factory=".role.setIdOnActivation"
/>
<subscriber
- for="..registration.interfaces.IRegistrationDeactivatedEvent"
+ for="..component.interfaces.registration.IRegistrationDeactivatedEvent"
factory=".role.unsetIdOnDeactivation"
/>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/sqlscript/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/sqlscript/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/sqlscript/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -1,11 +1,11 @@
<configure
- xmlns='http://namespaces.zope.org/zope'
- i18n_domain='zope'
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
>
<vocabulary
name="Connection Names"
- factory="zope.app.utility.vocabulary.UtilityVocabulary"
+ factory="zope.app.component.vocabulary.UtilityVocabulary"
interface="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
nameOnly="True" />
Modified: Zope3/branches/srichter-blow-services/src/zope/app/tree/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/tree/configure.zcml 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/tree/configure.zcml 2005-01-10 16:06:39 UTC (rev 28775)
@@ -42,7 +42,7 @@
<adapter
provides=".interfaces.IChildObjects"
- for="zope.app.site.interfaces.ISite"
+ for="zope.app.component.interfaces.ISite"
factory=".adapters.ContainerSiteChildObjects"
/>
Modified: Zope3/branches/srichter-blow-services/src/zope/app/undo/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/undo/__init__.py 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/undo/__init__.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -21,7 +21,6 @@
from zope.app import zapi
from zope.app.undo.interfaces import IUndoManager, UndoError
-from zope.app.servicenames import Utilities
from zope.app.traversing.interfaces import IPhysicallyLocatable
from zope.app.security.principalregistry import principalRegistry
from zope.app.security.interfaces import IPrincipal
@@ -32,8 +31,8 @@
def undoSetup(event):
# setup undo functionality
- svc = zapi.getGlobalService(Utilities)
- svc.provideUtility(IUndoManager, ZODBUndoManager(event.database))
+ sm = zapi.getGlobalSiteManager()
+ sm.provideUtility(IUndoManager, ZODBUndoManager(event.database))
class Prefix(str):
"""A prefix is equal to any string it is a prefix of.
Modified: Zope3/branches/srichter-blow-services/src/zope/app/workflow/browser/definition.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/workflow/browser/definition.py 2005-01-10 14:16:41 UTC (rev 28774)
+++ Zope3/branches/srichter-blow-services/src/zope/app/workflow/browser/definition.py 2005-01-10 16:06:39 UTC (rev 28775)
@@ -15,9 +15,8 @@
$Id$
"""
-
from zope.app.traversing.api import traverse
-from zope.app.registration.interfaces import IRegistered
+from zope.app.component.interfaces.registration import IRegistered
from zope.app.workflow.interfaces import IProcessDefinitionImportHandler
from zope.app.workflow.interfaces import IProcessDefinitionExportHandler
More information about the Zope3-Checkins
mailing list