Documentation issues ... cloning folders into instances
<frustration> I'm finding myself again trying to figure out how things work in Zope, just to find out at the end that it is MUCH simpler that I thought -- but totally undocumented! Or maybe I just haven't looked for it enough ... Isn't there somewhere a list of all method calls I can use from DTML (like manage_addXYZ)? It can't all be just trial and error or "read the code". -- Yes it can, but I don't want to be that pessimistic ;-) O.k., my current problem is that I have a folder with icons and images in a ZClass that should be copied to all new instances of the class. There seems to be a "manage_clone" call for that (just read about it in a posting), but how does it work and where do I find any documentation on it? As all those methods are in the namespace, isn't there at least a trick to get a list of all names to print out? That would be a first start. I mean, I had to figure out every single call like manage_addDTMLDocument or manage_changeProperties by trial and error. That makes Zope so much less efficient that it could be ... </frustration> Joachim Werner.
Joachim Werner wrote:
<frustration>
I'm finding myself again trying to figure out how things work in Zope, just to find out at the end that it is MUCH simpler that I thought -- but totally undocumented! Or maybe I just haven't looked for it enough ...
Isn't there somewhere a list of all method calls I can use from DTML (like manage_addXYZ)? It can't all be just trial and error or "read the code". -- Yes it can, but I don't want to be that pessimistic ;-)
Try: the zope quick reference. http://zdp.zope.org/projects/zqr/zqr/ZopeQR
O.k., my current problem is that I have a folder with icons and images in a ZClass that should be copied to all new instances of the class.
There seems to be a "manage_clone" call for that (just read about it in a posting), but how does it work and where do I find any documentation on it?
from the zqr: manage_clone(ob, id, [REQUEST]) Clone an object, creating a new object with the given id.
As all those methods are in the namespace, isn't there at least a trick to get a list of all names to print out? That would be a first start.
Nope, at least not an easy one.
I mean, I had to figure out every single call like manage_addDTMLDocument or manage_changeProperties by trial and error. That makes Zope so much less efficient that it could be ...
</frustration>
<plug>The ZDP site is growing steadily. You may find more answers there.</plug> Rik
manage_clone(ob, id, [REQUEST]) Clone an object, creating a new object with the given id.
Thanks for the tip with the Zope Quick Reference! It helps a lot. In my specific case however, I still have a problem. It may be caused by permission settings, but I don' really think so. I have a folder "sample_images" in the ZClass "foo". I in the "foo_add" method I try: <dtml-call "manage_clone(sample_images,'my_images')"> in the "with"-section. Things like "manage_addFolder" work there. The result is: "The object sample_images does not support this operation. " Suggestions? Thanks! Joachim.
Still the same problem, but I am a step further. Anyone to help?
I have a folder "sample_images" in the ZClass "foo". I in the "foo_add" method I try: <dtml-call "manage_clone(sample_images,'my_images')">
The result is: "The object sample_images does not support this operation. "
The reason for the error message was that the ZClass was not configured to hold subobjects of the type "Folders". O.k., now the error is: Error Type: AttributeError Error Value: 'None' object has no attribute 'importFile' Last line of the traceback: File /usr/local/zope/Zope-2.1.4-linux2-x86/lib/python/OFS/CopySupport.py, line 402, in _getCopy (Object: ElementWithAttributes) It MUST be possible, because I can do the same using copy and paste in the management console. The idea of all that is that I want to store a complete sample user in the ZClass and copy all the relevant items (icons, images, html documents) to the instance so that it can be customized. This would be so much more convenient than the things I have seen elsewhere (python functions creating the documents from scratch etc.). Thanks for any hints. Joachim Werner.
Joachim, Have you seen the *brilliant* Zope Quick Reference? If not I'd get it and treasure it. http://zdp.zope.org/projects/zqr You'll not regret this one :) Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Joachim Werner" <joachim.werner@iuveno.de> To: <zope@zope.org> Sent: Wednesday, March 29, 2000 9:35 AM Subject: [Zope] Documentation issues ... cloning folders into instances
<frustration>
I'm finding myself again trying to figure out how things work in Zope, just to find out at the end that it is MUCH simpler that I thought -- but totally undocumented! Or maybe I just haven't looked for it enough ...
Isn't there somewhere a list of all method calls I can use from DTML (like manage_addXYZ)? It can't all be just trial and error or "read the code". -- Yes it can, but I don't want to be that pessimistic ;-)
O.k., my current problem is that I have a folder with icons and images in a ZClass that should be copied to all new instances of the class.
There seems to be a "manage_clone" call for that (just read about it in a posting), but how does it work and where do I find any documentation on it?
As all those methods are in the namespace, isn't there at least a trick to get a list of all names to print out? That would be a first start.
I mean, I had to figure out every single call like manage_addDTMLDocument or manage_changeProperties by trial and error. That makes Zope so much less efficient that it could be ...
</frustration>
Joachim Werner.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Joachim Werner -
Phil Harris -
Rik Hoekstra