[Zope3-checkins] CVS: zopeproducts/db2DA - adapter.py:1.1 browser.py:1.1 configure.zcml:1.3 Adapter.py:NONE

Philipp von Weitershausen philikon@philikon.de
Wed, 30 Jul 2003 01:06:11 -0400


Update of /cvs-repository/zopeproducts/db2DA
In directory cvs.zope.org:/tmp/cvs-serv5943

Modified Files:
	configure.zcml 
Added Files:
	adapter.py browser.py 
Removed Files:
	Adapter.py 
Log Message:
Bring yet another database adapter to the 'otherside' (meaning namegeddon
which we had back in, uhh, December 2002?). Ah well, it was kind of
nostalgic seeing all these references to the Zope.App.OFS package again...


=== Added File zopeproducts/db2DA/adapter.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""DB2 database adapter.

$Id: adapter.py,v 1.1 2003/07/30 05:05:37 philikon Exp $
"""

import DB2

from zope.app.rdb import ZopeDatabaseAdapter, parseDSN

class db2Adapter(ZopeDatabaseAdapter):
    """A DB2 adapter for Zope3"""

    def _connection_factory(self):
        """Create a DB2 DBI connection based on the DSN"""
        conn_info = parseDSN(self.dsn)
        return DB2.connect(uid=conn_info['username'],
                           pwd=conn_info['password'],
                           dsn=conn_info['dbname'])




=== Added File zopeproducts/db2DA/browser.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""DB2 database adapter.

$Id: browser.py,v 1.1 2003/07/30 05:05:37 philikon Exp $
"""

from zope.app.browser.rdb.rdb import AdapterAdd

class AddView(AdapterAdd):
      """Provide a user interface for adding a DB2 DA"""
      _adapter_factory_id = "db2DA"


=== zopeproducts/db2DA/configure.zcml 1.2 => 1.3 ===
--- zopeproducts/db2DA/configure.zcml:1.2	Fri Dec 13 14:51:25 2002
+++ zopeproducts/db2DA/configure.zcml	Wed Jul 30 01:05:37 2003
@@ -1,14 +1,40 @@
 <zopeConfigure
-    xmlns='http://namespaces.zope.org/zope'>
+  xmlns='http://namespaces.zope.org/zope'
+  xmlns:browser='http://namespaces.zope.org/browser'>
 
-    <content class=".Adapter.db2Adapter">
-        <implements 
-           interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
-        <factory id="db2DA"
-                permission="Zope.Public" />
-        <require permission="Zope.Public"
-                interface="Zope.App.RDB.IZopeDatabaseAdapter." />
-    </content>
+  <content class=".adapter.db2Adapter">
 
- <include package=".browser" />
- </zopeConfigure>
+    <require
+       permission="zope.Public"
+       interface="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
+       />
+
+    <factory id="db2DA"
+       permission="zope.Public"
+       />
+
+    <implements
+       interface="zope.app.interfaces.annotation.IAttributeAnnotatable"
+       />
+
+  </content>
+
+  <browser:view
+     name="zopeproducts.db2DA"
+     for="zope.app.interfaces.container.IAdding"
+     factory=".browser.AddView"
+     permission="zope.ManageServices">
+
+    <browser:page name="+" attribute="add" />
+    <browser:page name="action.html" attribute="action" />
+
+  </browser:view>
+
+  <browser:menuItem menu="add_component"
+     for="zope.app.interfaces.container.IAdding"
+     title="DB2 DA"
+     action="zopeproducts.db2DA"
+     description="A DB2 Database Adapter"
+     />
+
+</zopeConfigure>

=== Removed File zopeproducts/db2DA/Adapter.py ===