[Zope3-checkins] CVS: zopeproducts/informixda - __init__.py:1.1 adapter.py:1.1 configure.zcml:1.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Aug 19 04:11:36 EDT 2003


Update of /cvs-repository/zopeproducts/informixda
In directory cvs.zope.org:/tmp/cvs-serv17486/informixda

Added Files:
	__init__.py adapter.py configure.zcml 
Log Message:
Updated all Database Adaptors.


=== Added File zopeproducts/informixda/__init__.py ===
# make this a python package



=== Added File zopeproducts/informixda/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.
#
##############################################################################
"""Informix database adapter.

$Id: adapter.py,v 1.1 2003/08/19 07:11:31 srichter Exp $
"""
import informixdb
from zope.app.rdb import ZopeDatabaseAdapter, parseDSN

class InformixAdapter(ZopeDatabaseAdapter):
    """A Informix adapter for Zope3"""

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


=== Added File zopeproducts/informixda/configure.zcml ===
<zopeConfigure
   xmlns="http://namespaces.zope.org/zope"
   xmlns:browser="http://namespaces.zope.org/browser"
   i18n_domain="informix">

  <content class=".adapter.InformixAdapter">
    <factory
        id="zope.da.informixDA"
        permission="zope.Public"/>
    <require 
        permission="zope.Public"
        interface="zope.app.interfaces.rdb.IZopeDatabaseAdapter"/>
  </content>

  <browser:addform
      name="AddInformixDA"
      schema="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
      label="Add Informix Database Adapter"
      content_factory=".adapter.InformixAdapter"
      arguments="dsn"
      fields="dsn"
      permission="zope.ManageContent" />

  <!-- Menu entry for "add component" menu -->
  <browser:menuItem 
      menu="add_component"
      for="zope.app.interfaces.container.IAdding"
      title="Informix DA" 
      description="An Informix Database Adapter"
      action="AddInformixDA" />

  <!-- Menu entry for "add utility" menu -->
  <browser:menuItem
      menu="add_utility"
      for="zope.app.interfaces.container.IAdding"
      title="Informix DA" 
      description="An Informix Database Adapter"
      action="AddInformixDA" />

  <!-- Menu entry for "add connection" menu -->
  <browser:menuItem
      menu="add_connection"
      for="zope.app.interfaces.container.IAdding"
      title="Informix DA" 
      description="An Informix Database Adapter"
      action="AddInformixDA" />


</zopeConfigure>




More information about the Zope3-Checkins mailing list