I'm hoping that the members of this list can help me out... I went through the archives and documentation, and couldn't quite answer these questions. I'm just getting into python scripting, and am looking at Zope to integrate that with web applications. I downloaded Zope 1.9, and used the built in ZopeHTTPServer (WinNT, by the way). I read the Technical Introduction to Object Publishing, and it says that objects within published modules can be referred to as URL's. Very cool. However, I don't think that it says how to publish modules to the server in the first place -- the Zope manager will let me use External methods, but it sounds like publishing a module is different. Do I have to use the Product API for this -- if so, than the Technical Introduction document is somewhat misleading? If not, than what is the advantage of using the product API? Second, is there a way to refer to sub-objects if the exact name is not known. For example, let's say I'm trying to write a threaded discussion forum. Each message has a sub-object that is a list of reply posts. Is there a way that I can use a URL to call a method on a specific reply post directly, or do I need some kind of proxy object to mediate the call? I appreciate your time, thanks. Noel ------- Noel Rappin Echo Bridge Productions noel@echobridge.com
On Mon, Feb 22, 1999 at 09:48:19AM -0500, Noel Rappin wrote:
I read the Technical Introduction to Object Publishing, and it says that objects within published modules can be referred to as URL's. Very cool. However, I don't think that it says how to publish modules to the server in the first place -- the Zope manager will let me use External methods, but it sounds like publishing a module is different. Do I have to use the Product API for this -- if so, than the Technical Introduction document is somewhat misleading? If not, than what is the advantage of using the product API?
Ah, here's the rub... the TITOP (last I checked) was really about the ZPublisher aspect (the object-publisher-formally-known-as-Bobo) which is but a small part of the Zope framework. You can use it by yourself. What Zope does is create objects to be published and store them in a object database. The objects are Folders, (in 1.9)Documents, Files, Images, etc... they all know how to "publish themselves" naturally when the ZPublisher runs through the database. If you want to JUST publish a full-up custom module, use ZPublisher by itself (You can look at the Main.py file for what is necessary in some ways), but if you want ot "attach" it to an existing Zope system (basically graft it onto the tree), that is going to really require a Product I think... a Product isn't that hard, Amos wrote a good introduction, it just has some interesting base requirements that have ot be implemented.
Second, is there a way to refer to sub-objects if the exact name is not known. For example, let's say I'm trying to write a threaded discussion forum. Each message has a sub-object that is a list of reply posts. Is there a way that I can use a URL to call a method on a specific reply post directly, or do I need some kind of proxy object to mediate the call?
I'm not sure what you mean... http://blah/Discussion/threadA/replies is the idea? I would use a method on the ThreadA object to return a list of replies, not a subobject... but that's me. Remember the last little piece is a method on an object (either a default method if ommitted or an explicit one). Chris -- | Christopher Petrilli | petrilli@amber.org
On 22-Feb-99 Noel Rappin wrote:
Second, is there a way to refer to sub-objects if the exact name is not known. For example, let's say I'm trying to write a threaded discussion forum. Each message has a sub-object that is a list of reply posts. Is there a way that I can use a URL to call a method on a specific reply post directly, or do I need some kind of proxy object to mediate the call?
You would have to use "direct traversal". For example \story\id\0898\reply\id\0907 would get a record from the "story" query, fill it into the class registered for that query's result, call the "reply" query method, put the result of this into its' specified class, and display the the index_html method of the resultant object. At least, that's if I've read the manual right. Any comments? --- Julian Morrison Programmer (Zereau Ltd)
participants (3)
-
Christopher G. Petrilli -
julian@zereau.net -
Noel Rappin