[Zope-CVS] CVS: Packages/Moztop/idesupport/xmlrpc - folder.py:1.4
Stephan Richter
srichter@cbu.edu
Thu, 16 Jan 2003 00:03:38 -0500
Update of /cvs-repository/Packages/Moztop/idesupport/xmlrpc
In directory cvs.zope.org:/tmp/cvs-serv17745/idesupport/xmlrpc
Modified Files:
folder.py
Log Message:
Rename and Delete Objects from the Explorer are now working.
=== Packages/Moztop/idesupport/xmlrpc/folder.py 1.3 => 1.4 ===
--- Packages/Moztop/idesupport/xmlrpc/folder.py:1.3 Wed Jan 15 21:06:30 2003
+++ Packages/Moztop/idesupport/xmlrpc/folder.py Thu Jan 16 00:03:05 2003
@@ -40,6 +40,20 @@
name = container.setObject(name, content)
return "A %s with name '%s' was successfully added!" %(type, name)
+ def renameObject(self, old_name, new_name):
+ """Delete object with the given name."""
+ container = getAdapter(self.context, IZopeContainer)
+ content = container[old_name]
+ container.__delitem__(old_name)
+ new_name = container.setObject(new_name, content)
+ return "Object '%s' was renamed to '%s'." %(old_name, new_name)
+
+ def deleteObject(self, name):
+ """Delete object with the given name."""
+ container = getAdapter(self.context, IZopeContainer)
+ container.__delitem__(name)
+ return "Object '%s' successfully deleted." %name
+
def getMetaData(self):
"""Return a dictionary of all meta data."""
dc = getAdapter(self.context, IZopeDublinCore)
@@ -67,5 +81,6 @@
dc.title = unicode(title)
dc.description = unicode(description)
dc.modified = datetime.datetime.now()
- return 1
+ return "Meta Data successfully changed."
+