'transparent' proxying to a method not in your namespace?
Problem: I have a custom folder type, and I want to hijack unsuccessful method lookups in its namespace and have them transparently proxy to code in another folder... I have a Python product class that uses Folder as it's base; it's cluttered with code objects, and I don't want to have to use Transparent Folders, which seem to break one thing or another. I'm also looking for (perhaps) something as an application-specific alternative/addition to acquisition as a namespace traversal mechanism. I had this idea of storing my various methods in a 'ProjectCode' folder in the Zope root, and having my 'Folder' evaluate its own namespace looking for a method; if it doesn't exist, before the Zope looks in the acquisition parent(s), the 'Folder' looks in the namespace for the 'ProjectCode' (or some other folder name) folder in the root to find the method, and run it within the 'Folder' namespace. I'm sort of ignorant as to where to start looking if I wanted to do this, but I'm willing to investigate and figure out how to code it if it's something that can be done within my product code or in a hotfix, and doesn't require a patch the size of Texas... Thoughts? Sean ========================= Sean Upton Senior Programmer/Analyst SignOnSanDiego.com The San Diego Union-Tribune 619.718.5241 sean.upton@uniontrib.com =========================
Sean, I think I understand what you're trying to do; if so, I've done something similar. What I had was a list of staff members pulled from LDAP, and a folder containing objects representing some of those staff members (those who had customized their information). The URLs from the staff list page were all the same, ie blah/staff/name or similar. I then had a site access_rule that grabbed and rendered the customized object if it existed, or retrieved some generic information from LDAP and rendered it if it didn't. I think that's approximately what you're trying to do? If the above method sounds plausible I can give you a copy of my code if it's any help. -d On Wed, Aug 08, 2001 at 09:22:51AM -0700, sean.upton@uniontrib.com wrote:
Problem: I have a custom folder type, and I want to hijack unsuccessful method lookups in its namespace and have them transparently proxy to code in another folder...
I have a Python product class that uses Folder as it's base; it's cluttered with code objects, and I don't want to have to use Transparent Folders, which seem to break one thing or another. I'm also looking for (perhaps) something as an application-specific alternative/addition to acquisition as a namespace traversal mechanism.
I had this idea of storing my various methods in a 'ProjectCode' folder in the Zope root, and having my 'Folder' evaluate its own namespace looking for a method; if it doesn't exist, before the Zope looks in the acquisition parent(s), the 'Folder' looks in the namespace for the 'ProjectCode' (or some other folder name) folder in the root to find the method, and run it within the 'Folder' namespace.
I'm sort of ignorant as to where to start looking if I wanted to do this, but I'm willing to investigate and figure out how to code it if it's something that can be done within my product code or in a hotfix, and doesn't require a patch the size of Texas...
Thoughts?
Sean
========================= Sean Upton Senior Programmer/Analyst SignOnSanDiego.com The San Diego Union-Tribune 619.718.5241 sean.upton@uniontrib.com =========================
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
-- | Dyon Balding . Software Engineer . HiringTools.Monster.com | dyon@hiringtools.com . +1 415 288 3375
participants (2)
-
Dyon Balding -
sean.upton@uniontrib.com