[Zope] Acquisition Problem
James W. Howe
jwh@allencreek.com
Thu, 21 Oct 1999 10:45:59 -0400
I have a Folder structure which looks something like this:
FolderA
FolderB
FolderC
In FolderA I have a DTMLMethod which iterates over all of its subfolders
and invokes a method for each folder in turn called "sidebarTitle". The
actual implementation of sidebarTitle resides in FolderA. It does some
work and then attempts to invoke methods which are defined in FolderB and
FolderC. When the iterating method gets invoked in FolderA it properly
invokes the sidebarTitle method. However, when the sidebarTitle method
tries to invoke the methods which are defined in FolderB and FolderC I get
a KeyError message. I can't figure out why the DTMLMethod isn't being
found. My actual code looks like this:
DTMLMethod rsidebar (Defined in FolderA)
<dtml-let originator=id>
<dtml-with FolderA>
<dtml-in "objectValues(['Folder'])" sort=folderOrder>
<dtml-var "sidebarTitle(sender=id, base=originator)">
</dtml-in>
</dtml-with>
</dtml-let>
DTMLMethod sidebarTitle (Defined in FolderA)
<dtml-if "sender == base">
<dtml-var expandedSidebar>
<dtml-else>
<dtml-var simpleSidebar>
</dtml-if>
DTMLMethod expandedSidebar (Defined in FolderB)
Expanded FolderB Content
DTMLMethod simpleSidebar (Defined in FolderB)
Simple FolderB Content
DTMLMethod expandedSidebar (Defined in FolderC)
Expanded FolderC Content
DTMLMethod simpleSidebar (Defined in FolderC)
Simple FolderC Content
If I change the code in the sidebarTitle method to simply display text
rather than attempting to invoke the expandedSidebar and simpleSidebar
methods, the output is what I would expect to see. However, when the
methods are used I get a KeyError on simpleSidebar.
Any idea on what might be happening?
Thanks.
James W. Howe mailto:jwh@allencreek.com
Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103