[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser - AddConnectionConfiguration.py:1.2.2.1 Connections.pt:1.1.2.1 add_config.pt:1.1.2.1 configure.zcml:1.8.2.1 ConnectionConfigEdit.pt:NONE ConnectionConfigEditPart.pt:NONE ConnectionConfigSummary.pt:NONE ConnectionConfigURL.py:NONE Connections.py:NONE
Marius Gedminas
mgedmin@codeworks.lt
Tue, 10 Dec 2002 14:16:32 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv28246/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser
Modified Files:
Tag: named-component-configuration-branch
AddConnectionConfiguration.py Connections.pt add_config.pt
configure.zcml
Removed Files:
Tag: named-component-configuration-branch
ConnectionConfigEdit.pt ConnectionConfigEditPart.pt
ConnectionConfigSummary.pt ConnectionConfigURL.py
Connections.py
Log Message:
Refactoring of configuration views:
- new interfaces INamedComponentConfiguration, INameConfigurable,
implemented in NamedComponentConfiguration, NameConfigurable, simplify
the case where configurations are identified by a name (service types,
connections, caches, queries, etc)
- common views for INamedComponentConfiguration, INameConfigurable
- refactored ServiceManager and ConnectionService to take advantage of the
new infrastructure
- incidentally wrote several unit tests for configuration classes
- removed caching from ComponentConnection.getComponent; this exposed a bug
in LocalEventService tests
=== Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py 1.2 => 1.2.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py:1.2 Mon Dec 9 11:32:58 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py Tue Dec 10 14:16:00 2002
@@ -2,18 +2,16 @@
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
-#
+#
##############################################################################
-"""XXX short summary goes here.
-
-XXX longer description goes here.
+"""Connection configuration adding view
$Id$
"""
@@ -41,10 +39,10 @@
paths.sort()
return paths
- def action(self, component_path):
- connection_name = self.connectionName.getData()
+ def action(self, connection_name, component_path):
+ if not connection_name:
+ raise ValueError, 'You must specify a connection name'
cd = ConnectionConfiguration(connection_name, component_path)
cd = self.context.add(cd)
- getWidgetsDataForContent(self, IConnectionConfiguration, content=cd,
- required=True)
+ getWidgetsDataForContent(self, IConnectionConfiguration, content=cd)
self.request.response.redirect(self.context.nextURL())
=== Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/Connections.pt 1.1 => 1.1.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/Connections.pt:1.1 Mon Dec 9 10:26:42 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/Connections.pt Tue Dec 10 14:16:00 2002
@@ -3,53 +3,53 @@
<h2>Connections configured in this connection service.</h2>
- <p tal:condition="not:connections">
- No connections have been configured
- </p>
-
- <div tal:condition="connections">
-
- <p>For each connection, the connection name is given and all of the
- components registered to provide the connection are shown. You
- may select the component to provide the connection or disable the
- connection.
- </p>
-
- <p>Select a connection name or a component name to visit the connection
- or component. </p>
-
- <form action="." method="post"
- tal:attributes="action request/URL">
-
- <table width="100%">
-
- <tr tal:repeat="connection connections">
- <td valign="top" align="right">
- <a href="Roles"
- tal:content="connection/name"
- tal:attributes="href connection/name"
- tal:condition="connection/active"
- >Roles</a>
- <span tal:replace="connection/name"
- tal:condition="connection/inactive" />
- </td>
- <td tal:content="structure connection/view">
- </td>
- </tr>
-
- </table>
-
- <input type=submit name="submit_update" value="Update"><br>
-
- </form>
-
- </div>
-
- <p>To configure a connection, add a database adapter component to a
- <em>package</em> in <a href="../../../Packages">Packages</a> or to
- the <a href="../../../Packages/default">default package</a>. After the
- component is added, add a connection configuration that configures the
- component to provide a connection.
+ <p tal:condition="not:connections">
+ No connections have been configured
+ </p>
+
+ <div tal:condition="connections">
+
+ <p>For each connection, the connection name is given and all of the
+ components registered to provide the connection are shown. You
+ may select the component to provide the connection or disable the
+ connection.
+ </p>
+
+ <p>Select a connection name or a component name to visit the connection
+ or component. </p>
+
+ <form action="." method="post"
+ tal:attributes="action request/URL">
+
+ <table width="100%">
+
+ <tr tal:repeat="connection connections">
+ <td valign="top" align="right">
+ <a href="Roles"
+ tal:content="connection/name"
+ tal:attributes="href connection/url"
+ tal:condition="connection/active"
+ >Roles</a>
+ <span tal:replace="connection/name"
+ tal:condition="connection/inactive" />
+ </td>
+ <td tal:content="structure connection/view">
+ </td>
+ </tr>
+
+ </table>
+
+ <input type=submit name="submit_update" value="Update"><br>
+
+ </form>
+
+ </div>
+
+ <p>To configure a connection, add a database adapter component to a
+ <em>package</em> in <a href="../../../Packages">Packages</a> or to
+ the <a href="../../../Packages/default">default package</a>. After the
+ component is added, add a connection configuration that configures the
+ component to provide a connection.
</p>
</body>
=== Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/add_config.pt 1.1 => 1.1.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/add_config.pt:1.1 Mon Dec 9 10:26:42 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/add_config.pt Tue Dec 10 14:16:00 2002
@@ -7,7 +7,7 @@
<table>
<tr>
<td>Connection Name</td>
- <td tal:content="structure view/connectionName"><input type="text"></td>
+ <td><input type="text" name="connection_name" /></td>
</tr>
<tr>
<td>Component</td>
=== Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/configure.zcml 1.8 => 1.8.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/configure.zcml:1.8 Mon Dec 9 11:16:51 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/configure.zcml Tue Dec 10 14:16:00 2002
@@ -6,7 +6,7 @@
<!-- ConnectionService -->
- <browser:defaultView
+ <browser:defaultView
for=".IConnectionManager."
name="index.html" />
@@ -14,11 +14,11 @@
<browser:menuItem title="Edit" action="index.html"/>
</browser:menuItems>
- <browser:view
+ <browser:view
for=".IConnectionManager."
name="index.html"
template="Views/Browser/Connections.pt"
- class=".Views.Browser.Connections."
+ class="Zope.App.OFS.Services.Browser.NameConfigurableView."
permission="Zope.ManageServices" />
<browser:menuItem
@@ -31,43 +31,7 @@
<!-- ConnectionConfiguration -->
- <browser:defaultView
- for=".IConnectionConfiguration."
- name="index.html" />
-
- <browser:menuItems menu="zmi_views" for=".IConnectionConfiguration.">
- <browser:menuItem title="Edit" action="index.html"/>
- </browser:menuItems>
-
- <form:edit
- for=".IConnectionConfiguration."
- name="index.html"
- schema="Zope.App.OFS.Services.ConfigurationInterfaces.IConfiguration."
- label="Connection Configuration"
- permission="Zope.ManageServices"
- template="Views/Browser/ConnectionConfigEdit.pt"
- />
-
- <form:edit
- for=".IConnectionConfiguration."
- name="ItemEdit"
- schema=
- "Zope.App.OFS.Services.ConfigurationInterfaces.IConfigurationSummary."
- label="Service Configuration"
- template="Views/Browser/ConnectionConfigEditPart.pt"
- class=".Views.Browser.ConnectionConfigURL."
- permission = "Zope.ManageServices"
- />
-
<browser:view
- for=".IConnectionConfiguration."
- name="ConfigurationSummary"
- template="Views/Browser/ConnectionConfigSummary.pt"
- class=".Views.Browser.ConnectionConfigURL."
- permission="Zope.ManageServices"
- />
-
- <browser:view
for="Zope.App.OFS.Container.IAdding."
name="ConnectionConfiguration"
factory=".Views.Browser.AddConnectionConfiguration."
@@ -88,14 +52,14 @@
<!-- ZopeDatabaseAdapter default views -->
- <browser:defaultView for="Zope.App.RDB.IZopeDatabaseAdapter."
+ <browser:defaultView for="Zope.App.RDB.IZopeDatabaseAdapter."
name="editForm.html" />
<browser:view
for="Zope.App.RDB.IZopeDatabaseAdapter."
permission="Zope.View"
factory=".Views.Browser.Connection.">
- <browser:page name="editForm.html"
+ <browser:page name="editForm.html"
template="Views/Browser/connection.pt" />
<browser:page name="edit.html" attribute="edit" />
<browser:page name="connect.html" attribute="connect" />
=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/ConnectionConfigEdit.pt ===
=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/ConnectionConfigEditPart.pt ===
=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/ConnectionConfigSummary.pt ===
=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/ConnectionConfigURL.py ===
=== Removed File Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/Connections.py ===