RE: [Zope] Zope 2.5 and TransparentFolder incompatibility
TFs are bad bad bad... too much magic to the namespace stack. They break Core Session Tracking in Zope < 2.5, and likely don't work with sessions in Zope 2.5. The reason for this is that with the session id manager (which in CST has to have the same name every time), you cannot have more than one (because TF screws up the namespace stack globally, and makes the session id managers appear to already exist for a folder that they don't, or something like that, I can't remember exactly)... If you really want the benefits of TF without the headache and unpredictability, your best bet if you want to hide/sort objects in a folder is to create your own product, subclass folder, and hack the dtml files in the product for the UI to only show what you want (perhaps putting everything else into another ZMI tab or something?). Sean -----Original Message----- From: Howard Hansen [mailto:zope@halfmagic.com] Sent: Monday, June 10, 2002 2:32 PM To: Dirk Datzert Cc: zope@zope.org; ct@gocept.com Subject: Re: [Zope] Zope 2.5 and TransparentFolder incompatibility Thanks for the response, but no, it's not that. Transparent Folders work with either DTML Documents or Methods -- at least under Zope 2.4 & prior. I did a quick test, and it confirms that a DTML Method has exactly the same problem as a Document. Has anyone else gotten TransparentFolders to work with Zope 2.5? Howard ----- Original Message ----- From: "Dirk Datzert" <dirk.datzert@rasselstein-hoesch.de> To: "Howard Hansen" <zope@halfmagic.com> Cc: <zope@zope.org>; <ct@gocept.com> Sent: Monday, June 10, 2002 1:53 PM Subject: Re: [Zope] Zope 2.5 and TransparentFolder incompatibility
Hi,
use DTML-Method for index_html. That should be the problem.
DTML-Document have it's own namespace. So 'hidden' is in the namespace of the transparent folder, but 'index_html' looking for 'hidden' in the namespace of 'index_html' and not in the namespace of the parent folder.
Regards, Dirk
Howard Hansen schrieb:
Sorry, reposting because I screwed up the thread with my digest subject!
I'm running Zope 2.5.1 under Debian Woody and the latest version of TransparentFolders that I could find on zope.org (0.3.2).
I just created a simple test case:
/test/ << folder tf/ << transparent folder hidden << dtml method index_html << dtml document
index_html contains only "<dtml-var hidden>"
Using Zope 2.4.2 under Debian Woody, I see the text contained in hidden
when
I view index_html. Under Zope 2.5.1, I get the error...
Error Type: KeyError Error Value: hidden
...with the following traceback...
Traceback (innermost last): File /usr/lib/zope/lib/python/Products/Hotfix_2002-04-15/__init__.py, line 51, in publish_module File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 114, in publish File /usr/lib/zope/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook (Object: t) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 98, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: index_html) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: index_html) File /usr/lib/zope/lib/python/OFS/DTMLDocument.py, line 127, in __call__ (Object: index_html) File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 473, in __call__ (Object: index_html) KeyError: (see above)
...when I try to view index_html.
Any idea why?
Thanks!
Howard Hansen
----- Original Message -----
Message: 20 Date: Mon, 10 Jun 2002 09:06:16 +0200 From: Christian Theune <ct@gocept.com> To: zope@zope.org Subject: Re: [Zope] Zope 2.5 and TransparentFolder incompatibility Organization: gocept gmbh & co. kg <mail@gocept.com>
Hi.
Do you have a more specific problem? I am using the latest TransparentFolder product with Zope 2.5.0 as well as 2.5.1 without any problems (including Session Tracking).
* Howard Hansen <howardh@halfmagic.com> [020610 06:40]:
Google doesn't tell me anything definitive, but it seems that the laudable TransparentFolder product is incompatible with Zope 2.5. Something about a conflict with session tracking? Is this so? Do I have to muck up my management screens with hundreds of little files? Does anyone have a patch or an alternative?
Regards
Christian
-- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981
reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])
Indeed it does.
_______________________________________________ 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 )
_______________________________________________ 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 )
Thanks for the response Sean, but could we try this again? This is not the answer I want to hear. Could you start your message with something like: "I've patched TF so it will work perfectly with 2.5 and all subsequent versions...." ;-) Seriously, this is not the first time I've heard the "TransparentFolders Considered Harmful" argument, and at some level I'm inclined to agree. Just not at the level of someone who has to wade through tons of dinky objects in his ZMI, nor at the level of someone who has to change lots of his code to account for other changes. It's too bad we can't use an underscore at the beginning of an object's id. Then we could have a "Hidden Contents" tab in the ZMI and view them that way. This would give us one transparent folder in each folder. A boy can dream. This leads me to a different question: how safe (or stable) is it to subclass folder and add some new behaviors to it? People blithely talk about doing it all the time, but my Zope sites total between 2000 and 5000 hits an hour. I get concerned about maintaining stability and performance. Obviously bad coding = bad performance and/or instability, but assuming competent coding, can I expect my subclassed folder to work as well as Folder? Howard Hansen http://howardsmusings.com/categories/zope ----- Original Message ----- From: <sean.upton@uniontrib.com> To: <zope@halfmagic.com>; <dirk.datzert@rasselstein-hoesch.de> Cc: <zope@zope.org>; <ct@gocept.com> Sent: Monday, June 10, 2002 3:34 PM Subject: RE: [Zope] Zope 2.5 and TransparentFolder incompatibility
TFs are bad bad bad... too much magic to the namespace stack. They break Core Session Tracking in Zope < 2.5, and likely don't work with sessions in Zope 2.5. The reason for this is that with the session id manager (which in CST has to have the same name every time), you cannot have more than one (because TF screws up the namespace stack globally, and makes the session id managers appear to already exist for a folder that they don't, or something like that, I can't remember exactly)... If you really want the benefits of TF without the headache and unpredictability, your best bet if you want to hide/sort objects in a folder is to create your own product, subclass folder, and hack the dtml files in the product for the UI to only show what you want (perhaps putting everything else into another ZMI tab or something?).
Sean
participants (2)
-
Howard Hansen -
sean.upton@uniontrib.com