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

Anthony Baxter anthony at interlink.com.au
Mon Aug 11 05:43:47 EDT 2003


Update of /cvs-repository/zopeproducts/oracleda
In directory cvs.zope.org:/tmp/cvs-serv1811

Added Files:
	README __init__.py adapter.py browser.py configure.zcml 
Log Message:
OracleDA joins the land of the lower-case.


=== Added File zopeproducts/oracleda/README ===
Depends on DCOracle2


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



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

$Id: adapter.py,v 1.1 2003/08/11 08:43:41 anthony Exp $
"""

import DCOracle2
from zope.app.rdb import ZopeDatabaseAdapter, parseDSN

class oracleAdapter(ZopeDatabaseAdapter):
    """An oracle adapter for Zope3"""

    def _connection_factory(self):
        """Create an oracle DBI connection based on the DSN"""
        conn_info = parseDSN(self.dsn)
        return DCOracle2.connect(user=conn_info['username'],
                                 password=conn_info['password'],
                                 database=conn_info['dbname'])



=== Added File zopeproducts/oracleda/browser.py ===
from zope.app.browser.rdb.rdb import AdapterAdd

class AddView(AdapterAdd):
      """Provide a user interface for adding an oracle DA"""
      _adapter_factory_id = "oracleda"


=== Added File zopeproducts/oracleda/configure.zcml ===
<configure
    xmlns='http://namespaces.zope.org/zope'
    xmlns:browser='http://namespaces.zope.org/browser'
    i18n_domain="zopeproducts.oracleda">

    <content class=".adapter.oracleAdapter">
        <implements 
	    interface="zope.app.interfaces.annotation.IAttributeAnnotatable"/>
        <factory id="oracleda" 
		 permission="zope.Public" />
        <require permission="zope.Public"
                 interface="zope.app.interfaces.rdb.IZopeDatabaseAdapter" />
    </content>

    <browser:view
        name="zopeproducts.oracleda"
        for="zope.app.interfaces.container.IAdding"
        class=".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="Oracle DA" 
        action="zopeproducts.oracleda"
        description="An Oracle Database Adapter"/>

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


</configure>




More information about the Zope3-Checkins mailing list