[Zope-CVS] CVS: Packages/Moztop/idesupport/xmlrpc - __init__.py:1.1 configure.zcml:1.1 folder.py:1.1
Stephan Richter
srichter@cbu.edu
Tue, 14 Jan 2003 15:42:29 -0500
Update of /cvs-repository/Packages/Moztop/idesupport/xmlrpc
In directory cvs.zope.org:/tmp/cvs-serv30006/idesupport/xmlrpc
Added Files:
__init__.py configure.zcml folder.py
Log Message:
ok, adding any type of object using XML-RPC works now.
=== Added File Packages/Moztop/idesupport/xmlrpc/__init__.py ===
##############################################################################
#
# Copyright (c) 2002, 2003 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.
#
##############################################################################
"""Moztop Extension Product
$Id: __init__.py,v 1.1 2003/01/14 20:42:26 srichter Exp $
"""
=== Added File Packages/Moztop/idesupport/xmlrpc/configure.zcml ===
<zopeConfigure
xmlns="http://namespaces.zope.org/zope"
xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc">
<xmlrpc:view
name="methods"
for="zope.app.interfaces.container.IContentContainer"
factory=".folder.Methods"
permission="Zope.Manage"
allowed_methods="objectIds, createAndAdd"/>
</zopeConfigure>
=== Added File Packages/Moztop/idesupport/xmlrpc/folder.py ===
##############################################################################
#
# Copyright (c) 2002, 2003 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: folder.py,v 1.1 2003/01/14 20:42:26 srichter Exp $
"""
from zope.component import createObject, getAdapter
from zope.publisher.xmlrpc import MethodPublisher
from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
from zope.app.interfaces.container import IZopeContainer
class Methods(MethodPublisher):
""" """
def objectIds(self):
'''Get object ids.'''
return tuple(self.context.keys())
def createAndAdd(self, type, name):
"""Create and add an object to the folder."""
content = createObject(self, type)
container = getAdapter(self.context, IZopeContainer)
name = container.setObject(name, content)
return 1