[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - configuration.py:1.9 folder.py:1.4 pagefolder.py:1.2

Jim Fulton jim@zope.com
Sun, 23 Mar 2003 14:25:16 -0500


Update of /cvs-repository/Zope3/src/zope/app/interfaces/services
In directory cvs.zope.org:/tmp/cvs-serv23262/src/zope/app/interfaces/services

Modified Files:
	configuration.py folder.py pagefolder.py 
Log Message:
Refactored support for managing configuration managers by factoring
into separate interfaces and classes so that both site-management
folders and page folders can provide the same bahavior.


=== Zope3/src/zope/app/interfaces/services/configuration.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/services/configuration.py:1.8	Fri Mar 21 16:04:12 2003
+++ Zope3/src/zope/app/interfaces/services/configuration.py	Sun Mar 23 14:24:45 2003
@@ -18,7 +18,7 @@
 
 from zope.app.interfaces.annotation import IAnnotatable
 from zope.app.interfaces.annotation import IAttributeAnnotatable
-from zope.app.interfaces.container  import IContainerNamesContainer
+from zope.app.interfaces.container  import IContainerNamesContainer, IContainer
 from zope.app.security.permission import PermissionField
 from zope.interface import Interface, Attribute
 from zope.schema import Text, TextLine
@@ -338,3 +338,43 @@
 class IConfigurationManager(IContainerNamesContainer, IOrderedContainer):
     """Manage Configurations
     """
+
+class INoConfigurationManagerError(Interface):
+    """No configuration manager error
+    """
+    
+
+class NoConfigurationManagerError(Exception):
+    """No configuration manager
+
+    There is no configuration manager in a site-management folder, or
+    an operation would result in no configuration manager in a
+    site-management folder.
+
+    """
+
+    __implements__ = INoConfigurationManagerError
+
+class IConfigurationManagerContainer(IContainer):
+    """Containers with configuration managers
+
+    The container provides clients to access the configuration manager
+    without knowing it's name.
+
+    The container prevents deletion of the last configuration manager.
+    The container may allow more than one configuration manager. If it
+    has more than one, the one returned from an unnamed access is
+    undefined.
+
+    """
+
+    def getConfigurationManager():
+        """get a configuration manager
+
+        Find a configuration manager.  Clients can get the
+        configuration manager without knowing it's name. Normally,
+        folders have one configuration manager. If there is more than
+        one, this method willl return one; which one is undefined.
+
+        An error is raised if no configuration manager can be found.
+        """


=== Zope3/src/zope/app/interfaces/services/folder.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/interfaces/services/folder.py:1.3	Sun Mar 23 13:04:26 2003
+++ Zope3/src/zope/app/interfaces/services/folder.py	Sun Mar 23 14:24:45 2003
@@ -18,27 +18,13 @@
 
 from zope.app.interfaces.container import IAdding, IContainer
 from zope.app.interfaces.services.service import IComponentManager
-from zope.interface import Interface
+from zope.app.interfaces.services.configuration \
+     import IConfigurationManagerContainer
 
-class INoConfigurationManagerError(Interface):
-    """No configuration manager error
-    """
-    
-
-class NoConfigurationManagerError(Exception):
-    """No configuration manager
-
-    There is no configuration manager in a site-management folder, or
-    an operation would result in no configuration manager in a
-    site-management folder.
-
-    """
-
-    __implements__ = INoConfigurationManagerError
-
-class ISiteManagementFolder(IContainer):
+class ISiteManagementFolder(IContainer, IConfigurationManagerContainer):
     """Component and component configuration containers."""
 
+
 class ISiteManagementFolders(IContainer, IComponentManager):
     """A collection of ISiteManagementFolder objects.
 
@@ -46,17 +32,6 @@
     well as package query and lookup.
     
     """
-
-    def getConfigurationManager():
-        """get a configuration manager
-
-        Find a configuration manager.  Clients can get the
-        configuration manager without knowing it's name. Normally,
-        folders have one configuration manager. If there is more than
-        one, this method willl return one; which one is undefined.
-
-        An error is raised if no configuration manager can be found.
-        """
 
 class ISiteManagementFolderAdding(IAdding):
     """A special package that is not content but is similar to a folder.


=== Zope3/src/zope/app/interfaces/services/pagefolder.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/interfaces/services/pagefolder.py:1.1	Sun Mar 23 11:45:44 2003
+++ Zope3/src/zope/app/interfaces/services/pagefolder.py	Sun Mar 23 14:24:45 2003
@@ -22,6 +22,8 @@
 from zope.schema import BytesLine
 from zope.app.interfaces.container import IContainer
 from zope.app.security.permission import PermissionField
+from zope.app.interfaces.services.configuration \
+     import IConfigurationManagerContainer
 from zope.interface import Interface
 
 class IPageFolderInfo(Interface):
@@ -55,6 +57,8 @@
         required = True,
         )
     
-class IPageFolder(IPageFolderInfo,  IContainer):
+class IPageFolder(IPageFolderInfo,
+                  IContainer,
+                  IConfigurationManagerContainer):
     """Sub-packages that contain templates that are registered as page views
     """