[Zope3-checkins] CVS: Zope3/src/zope/app/services - configure.zcml:1.12 viewpackage.py:1.3

Jim Fulton jim@zope.com
Mon, 3 Feb 2003 12:29:42 -0500


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

Modified Files:
	configure.zcml viewpackage.py 
Log Message:

Updated view packages to reflect recent page configuration changes:

- The presentation type is now fixed to IBrowserPresentation.

- Now specify a permission

I also made the contents view conditional on the package being
configured. This makes it easier to remember to do the configuration
before creating pages.

I'll need something similar to prevent adding pages through FTP/PUT.



=== Zope3/src/zope/app/services/configure.zcml 1.11 => 1.12 ===
--- Zope3/src/zope/app/services/configure.zcml:1.11	Wed Jan 22 05:57:03 2003
+++ Zope3/src/zope/app/services/configure.zcml	Mon Feb  3 12:29:09 2003
@@ -300,6 +300,7 @@
     <require
         permission="zope.ManageServices"
         interface="zope.app.interfaces.services.service.IViewPackageInfo"
+        attributes="configured"
         />
     <implements
         interface="zope.app.interfaces.annotation.IAttributeAnnotatable" />


=== Zope3/src/zope/app/services/viewpackage.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/viewpackage.py:1.2	Wed Dec 25 09:13:19 2002
+++ Zope3/src/zope/app/services/viewpackage.py	Mon Feb  3 12:29:09 2003
@@ -35,11 +35,11 @@
 
     __implements__ = IViewPackage
 
-
     presentationType = IBrowserPresentation
     layer = "default"
     description = ''
     title = ''
+    factoryName = None
 
     def __init__(self):
         super(ViewPackage, self).__init__()
@@ -56,7 +56,7 @@
         template = getItem(self, name)
         template = getPhysicalPathString(template)
         config = PageConfiguration(self.forInterface, name,
-                                   self.presentationType,
+                                   self.permission,
                                    self.factoryName, template,
                                    self.layer)
         configure = traverse(self, 'configure')
@@ -66,6 +66,11 @@
         return name
 
     setObject = ContextMethod(setObject)
+
+    def configured(self):
+        return (hasattr(self, 'permission')
+                and hasattr(self, 'forInterface')
+                )
 
     def activated(self):
         "See IConfiguration"