[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - configure.zcml:1.70 connection.py:1.16 connection.zcml:1.11 service.py:1.37

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Aug 19 10:15:24 EDT 2003


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

Modified Files:
	configure.zcml connection.py connection.zcml service.py 
Log Message:
Removed all 'add_component' entries of SQL DAs, since this is just clumsy.
Instead, similar to Services, there is now a 'SQL Connection' menu item 
which brings you to a special screen for adding SQL Connections.


=== Zope3/src/zope/app/browser/services/configure.zcml 1.69 => 1.70 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.69	Tue Aug 19 03:09:37 2003
+++ Zope3/src/zope/app/browser/services/configure.zcml	Tue Aug 19 09:14:47 2003
@@ -435,7 +435,7 @@
      name="AddService"
      for="zope.app.interfaces.services.folder.ISiteManagementFolder"
      permission="zope.ManageServices"
-     class="zope.app.browser.services.service.ServiceAdding">
+     class=".service.ServiceAdding">
 
     <page name="index.html"  attribute="index"  />
     <page name="action.html" attribute="action" />


=== Zope3/src/zope/app/browser/services/connection.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/browser/services/connection.py:1.15	Tue Aug 19 03:09:38 2003
+++ Zope3/src/zope/app/browser/services/connection.py	Tue Aug 19 09:14:47 2003
@@ -58,3 +58,9 @@
 class ConnectionAdding(ComponentAdding):
 
     menu_id = "add_connection"
+
+    def add(self, content):
+        if not IZopeDatabaseAdapter.isImplementedBy(content):
+            raise TypeError("%s is not a zope database adapter" % content)
+
+        return zapi.ContextSuper(ConnectionAdding, self).add(content)


=== Zope3/src/zope/app/browser/services/connection.zcml 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/services/connection.zcml:1.10	Tue Aug 19 03:09:38 2003
+++ Zope3/src/zope/app/browser/services/connection.zcml	Tue Aug 19 09:14:47 2003
@@ -2,14 +2,21 @@
 
 <!-- Browser directives for the connection service -->
 
+  <menuItem
+    menu="add_component"
+    for="zope.app.interfaces.container.IAdding"
+    action="../AddSQLConnection"
+    title="SQL Connection"
+    description="Takes you to a menu of SQL Connections to add"
+    permission="zope.ManageServices" />
+
   <view
       for="zope.app.interfaces.services.folder.ISiteManagementFolder"
       name="AddSQLConnection"
       class=".connection.ConnectionAdding"
-      permission="zope.ManageContent"
-      allowed_attributes="addingInfo">
+      permission="zope.ManageContent">
       
-    <page name="index.html"  attribute="index" />
+    <page name="index.html"  attribute="index"/>
     <page name="action.html" attribute="action" />
       
   </view>


=== Zope3/src/zope/app/browser/services/service.py 1.36 => 1.37 ===
--- Zope3/src/zope/app/browser/services/service.py:1.36	Tue Aug 19 03:09:38 2003
+++ Zope3/src/zope/app/browser/services/service.py	Tue Aug 19 09:14:47 2003
@@ -48,7 +48,9 @@
         return zapi.ContextSuper(ComponentAdding, self).nextURL()
 
     def action(self, type_name, id):
-        if type_name == "../AddService":
+        # For special case of that we want to redirect to another adding view
+        # (usually another menu such as AddService)
+        if type_name.startswith("../"):
             # Special case
             url = type_name
             if id:




More information about the Zope3-Checkins mailing list