[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS - SQLScriptAdd.py:1.1 SQLScriptView.py:1.1 __init__.py:1.1 configure.zcml:1.1

Stephan Richter srichter@cbu.edu
Fri, 20 Dec 2002 05:31:49 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS
In directory cvs.zope.org:/tmp/cvs-serv7739/Zope/App/OFS/Content/SQLScript/Views/VFS

Added Files:
	SQLScriptAdd.py SQLScriptView.py __init__.py configure.zcml 
Log Message:
Big oops. I fogot to checkin the added files. This is the rest of the VFS/FTP fix and revamp checkin.


=== Added File Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS/SQLScriptAdd.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.
#
##############################################################################
"""VFS SQLScript Add View

$Id: SQLScriptAdd.py,v 1.1 2002/12/20 10:31:48 srichter Exp $
"""
from Zope.Publisher.VFS.VFSView import VFSView

from Zope.Event import publish
from Zope.Event.ObjectEvent import ObjectCreatedEvent

from Zope.App.OFS.Container.IAdding import IAdding
from Zope.App.OFS.Content.SQLScript.SQLScript import SQLScript


class SQLScriptAdd(VFSView):
    "Provide a user interface for adding a SQLScript content object"

    __used_for__ = IAdding

    def __call__(self, mode, instream, start):
        content = SQLScript()
        try:
            instream.seek(start)
        except:
            pass
        content.setSource(instream.read())
        
        publish(self.context, ObjectCreatedEvent(content))
        return self.context.add(content)



=== Added File Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS/SQLScriptView.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
#
##############################################################################
"""VFS-View for ISQLScript

VFS-view implementation for a ZPT Page. 

$Id: SQLScriptView.py,v 1.1 2002/12/20 10:31:48 srichter Exp $
"""
from Zope.Publisher.VFS.VFSFileView import VFSFileView

class SQLScriptView(VFSFileView):

    def _setData(self, data):
        self.context.setSource(data)

    def _getData(self):
        return self.context.getSource()


=== Added File Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS/__init__.py ===
##############################################################################
#
# Copyright (c) 2001, 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.
# 
##############################################################################
"""

$Id: __init__.py,v 1.1 2002/12/20 10:31:48 srichter Exp $
"""


=== Added File Zope3/lib/python/Zope/App/OFS/Content/SQLScript/Views/VFS/configure.zcml ===
<zopeConfigure
   xmlns="http://namespaces.zope.org/zope"
   xmlns:vfs="http://namespaces.zope.org/vfs">

  <vfs:view name="vfs" 
       for="Zope.App.OFS.Content.SQLScript.SQLScript.ISQLScript"
       permission="Zope.View" 
       allowed_interface="Zope.Publisher.VFS.IVFSFilePublisher."
       factory=".SQLScriptView." />

  <vfs:view
      name=".sql"
      for="Zope.App.OFS.Container.IAdding."
      factory=".SQLScriptAdd."
      permission="Zope.ManageContent" />

  <vfs:view
      name=".zsql"
      for="Zope.App.OFS.Container.IAdding."
      factory=".SQLScriptAdd."
      permission="Zope.ManageContent" />

</zopeConfigure>