[Zope] "virtual" subobjects

Ross J. Reedstrom reedstrm@wallace.ece.rice.edu
Fri, 6 Aug 1999 09:46:28 -0500


On Thu, Aug 05, 1999 at 11:42:21PM -0700, Amos Latteier wrote:
> At 12:54 PM 8/6/99 +1000, Tim Potter wrote:
> >I'm grappling with the idea of having "virtual folders" (for want of a
> >better term) existing under a Zope folder and am not sure how to
> >implement it.  The user will basically be navigating through
> >subobjects whose identity will be stored in a database:
> >
> >http://somehost/notes/a/b/c
> >
> >where a, b, c correspond to some structure in the database.  My
> >question is it possible for the object at http://somehost/notes to
> >handle all requests to subobjects under it without creating them by
> >hand in Zope?  I suspect some Python programming would be involved but
> >I'm not sure what.
> 
> I'm pretty sure this is documented somewhere, I'm just not sure where, so
> here goes.
>

<SNIPPED deep Python/ZopeZen discussion by Amos> 

> If you want to experiment with stuff like this I highly recommend using
> ZPublisher.Test and ignoring the Zope framework until you understand object
> publishing on a more basic Pythonic level.
> 

Tim - if you don't want to get into the python right away, it sounds like
you mightr be able to use Direct Traversal of ZSQL objects. Where's that
doc - ah, here it is.  My ZSQL user's guide has it on page 11, under
'Object Access' give this example:

http://plutonia.com/Plutonia/Computer/lookup_part/part_number/fdax/orders

where lookup_part is a ZSQL method that takes part_number as a parameter,
'fdax' is the value it will be called with in this URL, and the result
object will be rendered with the 'orders' method. Pluggable brains get into
the act somewhere between my example an Amos's, I think. (Some times, I'd
like to plug in an upgraded, more ZopeZenCompatible(tm) brain for myself!)

HTH,

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005