From s341625@student.uq.edu.au Mon Nov 1 01:58:32 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Mon, 1 Nov 1999 11:58:32 +1000 (GMT+1000) Subject: [Zope-dev] XML Roadmap (Fwd: [XML-SIG] Hello) In-Reply-To: <3819D065.F1B979DC@digicool.com> Message-ID: On Fri, 29 Oct 1999, Michel Pelletier wrote: [snip] > Yep. I'm currently prototyping a new component for Zope called MFI > (Multi-Format Interface, I needed a good TLA). If you can follow my > stream of conciousness, MFI realizes two very cool ideas: > > 1) Objects that want to contain 'content' in various 'formats' > > 2) Objects that want to override their behavior at 'call time' (ie when > viewed by the browser) [description snipped] This sounds very similar to XMLWidgets, VisualZope and ZIE. A few extensions to the behaviour system as described by you which may be useful: * Add XMLWidgets Events to allow the Behaviour to be changed via the user clicking on an item in the browser * Add Javascript Behaviour code to allow Events to operate transparently accross the JavaScript/DTML boundary. * You will need a final rendering stage due to problems in Zope namespace conflicts. If you wish to utilise the ID property within an XML document you will need to rename it to CID and apply a text transformation to convert it to ID. * Why not allow multiple behaviours? For example, an XSFT transform to apply corporate styles, a DTML ZDOM transform for custom javascript and a few others to make some objects "Active". For example: ^^^^^^^^^ inherited from Behaviour objects in the aquisition path Cheers, Anthony Pfrunder From s341625@student.uq.edu.au Mon Nov 1 10:21:29 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Mon, 1 Nov 1999 20:21:29 +1000 (GMT+1000) Subject: [Zope-dev] HOWTO: Zclasses based on XML Documents Message-ID: [Posted for comment before posting on www.zope.org] This document describes a technique for subclassing XML Documents and adding content modifing functions which work as expected. No patches to XML Document are required and this technique eliminates the following issues / errors: * No aq_* attributes * Invalid / missing _id attribute * Failure of URL and other aquisition-based functions * Double adding of nodes when using insertBefore, AppendChild The document details the creation of a ZClass based on XML Documents but the same comments apply to a python-level Product. Procedure: ---------- 1 - Create a Zclass subclassing from _ZClass_for_XMLDocument 2 - Add a new Python Method which modifies the XML Document content in the new Zclass 3 - Items indicated with a [*] are items where caution is required to avoid the problems above. [Python Method] Parameters: self, REQUEST Body: # Get the first HEAD element of the XML Document. The index [0] ensures that a node and # NOT a NamedNodeList is returned head = self.getElementsByTagName('head')[0] # [*] Create a clone of the HEAD element. Here, the __of__ attribute returns # a clone of the HEAD node with the aquisition path pointing to the Zclass. # The aquisition path now looks like this: # Zclass # +--> head --> # +--> clone --> # This means that the cloned node "belongs" to the same XML Document as the source node. # This is required for content modification to work correctly. Do NOT add __of__ to # other content creation functions within XML Document as it will cause problems clone = head.cloneNode(1).__of__(head.OwnerDocument()) # Create a child element within the clone: where e123/e236 is the URL of an exisiting node within the XML Document. Note that because it is CLONED the original content is not changed. Hopefully this will be of help to some people developing XML-based Zclasses. Cheers, Anthony Pfrunder From sergey2b@mail.ru Mon Nov 1 10:44:16 1999 From: sergey2b@mail.ru (sergey2b) Date: Mon, 1 Nov 1999 13:44:16 +0300 Subject: [Zope-dev] Gadfly, ZODB Message-ID: <001401bf2456$10f96370$740100c0@ishop.ramax.spb.ru> This is a multi-part message in MIME format. ------=_NextPart_000_0011_01BF246F.30DCA6C0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Hi, All. Would you tell me, please.Zope in operating time holds documents, = methods, products (all that is in ZODB) in memory or reads out in memory = as required. At use Gadfly from Zope all tables Gadfly are loaded into = memory. What quantity of operative memory is necessary for use Zope, = Gadfly?=20 Best regards, Sergey. ------=_NextPart_000_0011_01BF246F.30DCA6C0 Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable
Hi, All.
Would you tell me, please.Zope in operating time holds documents, = methods,=20 products (all that is in ZODB) in memory or reads out in memory as = required. At=20 use Gadfly from Zope all tables Gadfly are loaded into memory. What = quantity of=20 operative memory is necessary for use Zope, Gadfly?
Best regards,=20 Sergey.
------=_NextPart_000_0011_01BF246F.30DCA6C0-- From jim@digicool.com Mon Nov 1 13:54:22 1999 From: jim@digicool.com (Jim Fulton) Date: Mon, 01 Nov 1999 08:54:22 -0500 Subject: [Zope-dev] Re: Zope container objects can't multitask; Z2 CONFLICT mis-reported References: <009f01bf2396$6d74c920$0b01010a@beetlejuice> Message-ID: <381D9B8E.FB8F2D6F@digicool.com> gtk wrote: > > Zope container objects can't multitask. If you try and add more than one > item to a folder at a time -- even if they have different ids -- a Z2 > CONFLICT error occurs. Adding items to a folder in separate threads does cause a conflict, since you are modifying the same object, the folder. The database detects this situation and raises a conflict error. The application detects conflict errors and retries the request up to three times. If the request doesn't succeed on the third try, then an error is returned to the user. The error should be a conflict error. Zope *is* successfully multi-tasking. The definition of successful multi-tasking is that, *if* data are written, they are written correctly. One thread doesn't overwrite partial results from another thread, causing data inconsistencies. Refusal to write data, while not desireable, is acceptable. If you have an application that has such a high write rate to a single object, such as a folder, you should consider redesigning the application to avoid this hot spot. In the future, we plan to add protocols that will allow objects to resolve conflicts at the application level. This would allow some conflicting operations, such as folder adds to be non-conflicting (assuming that the items added had different ids of course). > To add insult to injury, the error message sent to > the user seems to be almost random. I've seen both of these: > > Missing doc string at: http://BEETLEJUICE:8080/folder1 > The parameter, id, was omitted from the request. This is a bug. I have submitted it to the Collector (http://www.zope.org:8080/Collector/) on your behaf. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. From lansea@hotmail.com Mon Nov 1 14:26:19 1999 From: lansea@hotmail.com (Sheng Lan) Date: Mon, 01 Nov 1999 06:26:19 PST Subject: [Zope-dev] Re: [Zope] Can not search the chinese word in ZCtalog using TextIndex Message-ID: <19991101142624.89886.qmail@hotmail.com> >From: "Jeff Rush" >Reply-To: "Jeff Rush" >To: "Sheng Lan" >Subject: Re: [Zope] Can not search the chinese word in ZCtalog using >TextIndex >Date: Mon, 01 Nov 99 07:35:49 -0500 > >I don't think Zope supports double-byte chinese text. I do know >that other have asked how to do searches on german and french, >and the answer for both was that the current 2.0.1 release of Zope >truncates characters in the textindex source to 7-bits before searching >or indexing. The Zope people were apologetic and said that the >version of Zope in CVS (version control system) -does- support >german/french -- that they had removed the code that chops to >7-bits. However, I do _not_ know if this change would allow >chinese text or if they have more work to do to handle double >byte text. > >Ask at . > >-Jeff Rush > > >On Sat, 30 Oct 1999 03:37:13 PDT, Sheng Lan wrote: > > >I read the How-To: Z Catalog Tutorial and test the sample > >( http://www.zope.org/Documentation/How-To/ZCatalogTutorial ) > > > >I create a searchable catalog of CDs,and write some chinese word in > >description field using fulltextindex,but in Z search interface I fill > >description field this chinese word,I can not find any item , I can find >the > >english word. who can help me,thanks > > > > > ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com From lansea@hotmail.com Mon Nov 1 14:29:46 1999 From: lansea@hotmail.com (Sheng Lan) Date: Mon, 01 Nov 1999 06:29:46 PST Subject: [Zope-dev] Re: [Zope] Can not search the chinese word in ZCtalog using TextIndex Message-ID: <19991101142947.14481.qmail@hotmail.com> >From: "Jeff Rush" >Reply-To: "Jeff Rush" >To: "Sheng Lan" >Subject: Re: [Zope] Can not search the chinese word in ZCtalog using >TextIndex >Date: Mon, 01 Nov 99 07:35:49 -0500 > >I don't think Zope supports double-byte chinese text. I do know >that other have asked how to do searches on german and french, >and the answer for both was that the current 2.0.1 release of Zope >truncates characters in the textindex source to 7-bits before searching >or indexing. The Zope people were apologetic and said that the >version of Zope in CVS (version control system) -does- support >german/french -- that they had removed the code that chops to >7-bits. However, I do _not_ know if this change would allow >chinese text or if they have more work to do to handle double >byte text. > >Ask at . > >-Jeff Rush > > >On Sat, 30 Oct 1999 03:37:13 PDT, Sheng Lan wrote: > > >I read the How-To: Z Catalog Tutorial and test the sample > >( http://www.zope.org/Documentation/How-To/ZCatalogTutorial ) > > > >I create a searchable catalog of CDs,and write some chinese word in > >description field using fulltextindex,but in Z search interface I fill > >description field this chinese word,I can not find any item , I can find >the > >english word. who can help me,thanks > > > > > ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com From rob.page@digicool.com Mon Nov 1 14:55:44 1999 From: rob.page@digicool.com (Rob Page) Date: Mon, 1 Nov 1999 09:55:44 -0500 Subject: [Zope-dev] Gadfly, ZODB Message-ID: <613145F79272D211914B0020AFF640192E84F9@gandalf.digicool.com> Sergey wrote: > Would you tell me, please.Zope in operating time holds documents, > methods, products (all that is in ZODB) in memory or reads out in > memory as required. At use Gadfly from Zope all tables Gadfly are > loaded into memory. What quantity of operative memory is necessary > for use Zope, Gadfly? Zope uses an rather robust Object database for the storage of DTML Documents, DTML Methods, ZSQL Methods, etc.. These objects are loaded into real memory when they are needed by the application. They remain in a memory cache for some amount of time until they are retired back to disk. There are configuration parameters in Zope for controlling how large the memory cache is and how aggressively the Z Object Database retires objects out of real memory. Gadfly, on the other hand, is an external product developed by Aaron Watters. It has been included in Zope because it is simple to install and provides a nice out-of-the-box relational database for people to use when first tinkering with Zope. AFAIK, the current incarnation of Gadfly uses real memory for all of its data storage. This _may_ make it unpalatable for use with large databases. (Note -- if the real memory ramifications of suing Gadfly are acceptable, you'll have a pretty fast database...). Finally, the memory requirements of Gadfly are additive with the memory requirements of Zope. As a result, it's easy to incorrectly assume that Zope itself is consuming large amounts of real memory when, in reality, it might be the Gadfly database. I have heard a rumor that a forthcoming version of Gadfly will be able to use disk files for storage. Hope this helps, --Rob P.S. - It's much easier to reply to non-HTML formatted email messages From pavlos@gaaros.msrc.sunysb.edu Mon Nov 1 14:57:02 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Mon, 1 Nov 1999 09:57:02 -0500 (EST) Subject: [Zope-dev] Re: [Zope] Can not search the chinese word in ZCtalog using TextIndex In-Reply-To: <19991101142947.14481.qmail@hotmail.com> Message-ID: On Mon, 1 Nov 1999, Sheng Lan wrote: > k> >Reply-To: "Jeff Rush" > >To: "Sheng Lan" > >Subject: Re: [Zope] Can not search the chinese word in ZCtalog using > >TextIndex > >Date: Mon, 01 Nov 99 07:35:49 -0500 > > > >I don't think Zope supports double-byte chinese text. > >7-bits. However, I do _not_ know if this change would allow > >chinese text or if they have more work to do to handle double > >byte text. > > If you don't have a large set of objects you can always do a brute force search using string.find. I have used it succesfully on a chinese Squishdot site, and searches are not that slow. You can check it out at: http://www.yifannet.com:8080/News/ Pavlos From robin@jessikat.demon.co.uk Mon Nov 1 12:42:52 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Mon, 1 Nov 1999 12:42:52 +0000 Subject: [Zope-dev] Zope container objects can't multitask; Z2 CONFLICT mis-reported In-Reply-To: <009f01bf2396$6d74c920$0b01010a@beetlejuice> References: <009f01bf2396$6d74c920$0b01010a@beetlejuice> Message-ID: In article <009f01bf2396$6d74c920$0b01010a@beetlejuice>, gtk writes OK I tried to reproduce this, but have got an error on the client side. I'm running win32 on the same machine as the server and get >>> execfile('/python/devel/zope/import/thrash.py') >>> creating document 0.-141813 creating document 0.-188337 creating document 0.-187821 Traceback (innermost last): File "/python/devel/zope/import/thrash.py", line 54, in Test reply, msg, headers, body = createDTMLDocument(id, title) File "/python/devel/zope/import/thras h.py", line 45, in createDTMLDocument return httpPOST(dict, server, port, path + '/manage_add...... ck.connect(host, port) File "", line 1, in connect File "", line 1, in connectsocket socket..errorerror: : (10061, 'winsock error')(10061, 'winsock error') -- Robin Becker From gtk@well.com Mon Nov 1 08:19:07 1999 From: gtk@well.com (gtk) Date: Mon, 1 Nov 1999 19:19:07 +1100 Subject: [Zope-dev] Zope container objects can't multitask; Z2 CONFLICT mis-reported References: <009f01bf2396$6d74c920$0b01010a@beetlejuice> Message-ID: <00e401bf2443$1ab8f140$0b01010a@beetlejuice> > OK I tried to reproduce this, but have got an error on the client side. > [...] > socket..errorerror: : (10061, 'winsock error')(10061, 'winsock error') Try switching the comment tags at the bottom: Test(5) # MultiThreadedTest(3,3) If you can run Test but not MultiThreadedTest -- don't forget to create a fresh folder1 before starting! -- then you're probably seeing the conflict in action. Regards, Garth. -- From kid@kendermedia.com Mon Nov 1 21:19:52 1999 From: kid@kendermedia.com (Kevin Dangoor) Date: Mon, 1 Nov 1999 16:19:52 -0500 Subject: [Zope-dev] PTK Packaging Thought Message-ID: <013701bf24ae$d6fd57e0$7b5addc7@laptop> Hi, In working on KM|Net News, it has come to my attention that ZClass-based products are very easy to modify, but not very easy to upgrade once you have made changes. You could subclass the ZClasses, and make your changes in there. But, your new ZClasses have to be in the same product (making upgrades more difficult) and, if there is a factory, both ZClasses show up in your add list. I think this will be pretty relevant to the PTK. Let's say that the "News Item" does just about everything I can do with KMNN, but does not have the feature that allows readers to rate the articles. It would be nice if there was a mechanism allowing me to create my own extended News Item with extra properties and methods, but to still be able to easily upgrade when new versions of the PTK are released. Maybe a solution is to have ZClasses be subclassable between Products (even if there is no factory). Then, the PTK Product could have the basic "News Item", but the Zope user can subclass this in their own Product and delete the original factory so that only their new News Item shows up. Upgrading then becomes easy... just drop in the new Product and remove any unwanted factories. Does any of this make sense, or have I had a little too much Halloween candy? Kevin From s341625@student.uq.edu.au Mon Nov 1 22:19:43 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Tue, 2 Nov 1999 08:19:43 +1000 (GMT+1000) Subject: [Zope-dev] PTK Packaging Thought In-Reply-To: <013701bf24ae$d6fd57e0$7b5addc7@laptop> Message-ID: On Mon, 1 Nov 1999, Kevin Dangoor wrote: > Hi, [snip] > Maybe a solution is to have ZClasses be subclassable between Products > (even if there is no factory). Then, the PTK Product could have the basic > "News Item", but the Zope user can subclass this in their own Product and > delete the original factory so that only their new News Item shows up. > Upgrading then becomes easy... just drop in the new Product and remove any > unwanted factories. You can already do this. For example, to use the base Python-level class of another Product: import Products.MYProduct Then, add to your init function: def __init__(self): MYProduct.__init__(self) self.MYProduct = MYProduct Then, to upgrade, just update the ZClass associated with MYProduct and delete the factory. The low-level python code will continue to link to the methods of MYProduct (implicitedly or explicitly via self.MYProduct) This is the technique I use to merge XML Documents and XML Widgets with my custom code. Cheers, Anthony Pfrunder From zope@teleo.net Tue Nov 2 03:14:34 1999 From: zope@teleo.net (Patrick Phalen) Date: Mon, 1 Nov 1999 19:14:34 -0800 Subject: [Zope-dev] Comparison: Frontier vs. Allaire Spectra Message-ID: <99110119165403.01057@quadra.teleo.net> http://discuss.userland.com/msgReader$12608 From benno@sesgroup.net Tue Nov 2 03:25:09 1999 From: benno@sesgroup.net (Ben Leslie) Date: Tue, 2 Nov 1999 14:25:09 +1100 Subject: [Zope-dev] In search of an exchange server Message-ID: <19991102142509.A6496@sesgroup.net> Hi everyone, In the recent days I have been heavily revising/updating the NotMail product. A new version should be available in the next few days. I am working in a Linux environment and as a result have only been able to test the product aginst the UW Imap server. Whilst I have tried to follow the IMAP standrad I would like the ability to test against an Exchange server as well. If anyone out there would be kind enough to give me a guest account on an exchange server for a couple of days so I can thoroughly test NotMail before releasing it I would really aprreciate. Cheers, Benno From Bjorn.Stabell@ogilvy.com Tue Nov 2 06:48:18 1999 From: Bjorn.Stabell@ogilvy.com (Bjorn.Stabell@ogilvy.com) Date: Tue, 2 Nov 1999 14:48:18 +0800 Subject: [Zope-dev] Job announcement: Zope programmer Message-ID: Hello, OgilvyInteractive is seeking people enthusiastic and knowledgable on Internet technologies, in this case especially Zope, to join their team in Beijing, China. We can offer a competitive package, challenging and fun work, in a great environment. OgilvyInteractive is expanding rapidly and has the unique feeling of a small and exciting internet startup, but with the safety of a big company. Our clients include foreign multinationals (IBM, Nokia, Kraft, ...) as well as many local brands. OgilvyInteractive has 1,000 employees world-wide and is headquartered in New York. Applicants should speak and read Chinese. Please send applications to vivien.fan@ogilvy.com Kind regards, -- Bjorn Stabell CTO OgilvyInteractive, Beijing, China "WorldSecure Server " made the following annotations on 11/02/99 01:38:07 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From Victor.Zhai@ogilvy.com Tue Nov 2 12:12:18 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Tue, 2 Nov 1999 20:12:18 +0800 Subject: [Zope-dev] Help with Sendmail Mail! Message-ID: Hi, my name is Victor, and I'm a programmer and developer for an Interactive agency in China. This is my first time working on a Zope-based project. Due to my lack of Zope experience, I've been getting into some problems, and I hope your experience can help me. My SendFeedback.dtml file is: To: Feedback Recipient From: Zope Feedback Form Subject: Comments:

Thank you for your input!

Your comments have been sent.

My Feedback.dtml file is:

We want your input!

Your Name:

This does not work after display the information: "Your comments have been sent".I have not get one mail yet.Why! "WorldSecure Server " made the following annotations on 11/02/99 07:04:34 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From simon@joyful.com Tue Nov 2 15:57:10 1999 From: simon@joyful.com (Simon Michael) Date: 02 Nov 1999 07:57:10 -0800 Subject: [Zope-dev] Help with Sendmail Mail! In-Reply-To: Victor.Zhai@ogilvy.com's message of "Tue, 2 Nov 1999 20:12:18 +0800" References: Message-ID: <87zowwrind.fsf@readymix.joyful.com> Victor.Zhai@ogilvy.com writes: > To: Feedback Recipient > From: Zope Feedback Form Does it work if you use: > To: cosix@tonghua.com.cn > From: zgxbj@yahoo.com ? I think the sendmail tag is a bit fragile in 2.0. If I remember correctly it ignored the subject header too - add a body='Subject: ' + subj + '\n' + body to SendMail.send() in MailHost.py Also, if possible test against an smtp server where you can access the logs - this will help figure out what's going on. From michel@digicool.com Tue Nov 2 16:13:12 1999 From: michel@digicool.com (Michel Pelletier) Date: Tue, 02 Nov 1999 11:13:12 -0500 Subject: [Zope-dev] Re: FW: [Zope-dev] pam authentication support with PyPam References: Message-ID: <381F0D98.ED2C3077@digicool.com> Alexander Staubo wrote: > > Have you given any thoughts to my comments? Yes, sorry for the delay. > > > > > There are two aspects of the current security subsystem that bug me. > > > > The first is the fact that only user folders are accumulative > > only at folder boundaries. You cannot create one UserFolder > > and one NTUserFolder at the same level and have them co-opt > > the user authentication responsibility. I think this is a good idea, I wonder if the Generic User Folder recently prototyped (hey, who did that? I can't find any artifacts to it anywhere) does this. > > > > The second, more serious gripe is with the security > > permission model. Look at NT 4.0 and the security UI that > > comes with SP4/SP5's Security Configuration Manager for a > > good example (installing it will upgrade NT's security > > dialogs with a new UI). There are really deep and fundamental issues, I can see exactly what you're talking about, but implimentation could take a while, last time i looked at the security system I shuddered. Have you looked into implimentation? This is sort of a seperate issue from the user folder abstraction thing. -Michel From phd@phd.russ.ru Tue Nov 2 16:26:02 1999 From: phd@phd.russ.ru (Oleg Broytmann) Date: Tue, 2 Nov 1999 16:26:02 +0000 (GMT) Subject: [Zope-dev] mod_pcgi 2 Message-ID: Hello! I cannot remember much discussion about mod_pcgi. Is it possible that I am one or one of 2 or 3 people that want to use such module? Currently I am not using Andrew's mod_pcgi 'cause I need virtual hosting. I am about to start to write new version of mod_pcgi. It seems that I cannot use mod_pcgi, I will write new one from scratch. If anyone interested - I am open for discussion before I started to write actual code. Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN. From mj@antraciet.nl Tue Nov 2 19:37:29 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Tue, 02 Nov 1999 20:37:29 +0100 Subject: [Zope-dev] Help with Sendmail Mail! In-Reply-To: Message-ID: <4.2.1.10.19991102203631.027f3240@212.48.38.34> At 13:12 2-11-99 , Victor.Zhai@ogilvy.com wrote: >Hi, my name is Victor, and I'm a programmer and developer for an >Interactive agency in China. This is my first time working on a Zope-based >project. Due to my lack of Zope experience, I've been getting into some >problems, and I hope your experience can help me. >My SendFeedback.dtml file is: > > To: Feedback Recipient > From: Zope Feedback Form > Subject: > > Comments: > >

Thank you for your input!

>

Your comments have been sent.

>My Feedback.dtml file is: >

We want your input!

>
> Your Name: >
> >
> >
>This does not work after display the information: "Your comments have been >sent".I have not get one mail yet.Why! Make sure there is no whitespace before the headers. The text between the sendmail tags is sent verbatim to the SMTP server, and SMTP servers don't like header lines to start with whitespace. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From zen@cs.rmit.edu.au Wed Nov 3 01:14:38 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Wed, 3 Nov 1999 12:14:38 +1100 (EST) Subject: [Zope-dev] Re: FW: [Zope-dev] pam authentication support with PyPam In-Reply-To: <381F0D98.ED2C3077@digicool.com> Message-ID: On Tue, 2 Nov 1999, Michel Pelletier wrote: > > > The first is the fact that only user folders are accumulative > > > only at folder boundaries. You cannot create one UserFolder > > > and one NTUserFolder at the same level and have them co-opt > > > the user authentication responsibility. > > I think this is a good idea, I wonder if the Generic User Folder > recently prototyped (hey, who did that? I can't find any artifacts to it > anywhere) does this. It could in its current incarnation... although its a bit ugly :-) In your GenericUserFolder, create FolderA and FolderB. In FolderA create your UserFolder. In FolderB, create your NTUserFolder. In your GenericUserFolder, change the default DTML methods to simply call the required functions in the two sub user folders and return a combined list. Of course, the correct way to do this would be to move the relevant code from NTUserFolder to external methods and tidy everything up (you would still create a sub acl_users folder in the GenericUserFolder for 'manual' accounts if you need to override them with this interface - at least until I let people add User objects to the GenericUserFolder) > There are really deep and fundamental issues, I can see exactly what > you're talking about, but implimentation could take a while, last time i > looked at the security system I shuddered. Tell me about it - I'm trying to get GenericUserFolder to do cookies authentication 'securely'. The only way I can display a logon screen is to throw an exception from the validate method. Of course, throwing an exception means that the user folders above myself will never be checked. So this means my validate method, if it can't authenticate locally, has to crawl up the tree seeing if there are any positive validations before throwing the exception :-P ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From anthony@ekorp.com Wed Nov 3 06:26:42 1999 From: anthony@ekorp.com (Anthony Baxter) Date: Wed, 03 Nov 1999 17:26:42 +1100 Subject: [Zope-dev] ZOracleDA and select LONGs, for more than one row. Message-ID: <199911030626.RAA01433@crown.off.ekorp.com> (wah. www.zope.org/Collector gone away) Can someone verify that I'm not going insane? Doing a select on a table with a column of type LONG works, but only where the select returns a single row. Any that returns more than one row breaks with an IndexError (exception included below). given the following table: SQL> desc testlongs ; Name Null? Type ------------------------------- -------- ---- ID NUMBER(38) DATA LONG And the following SQL method: select * from testlongs It works when there's only one row in the result. SQL> insert into testlongs values ( 1, 'helllohelllohellllhelllohelllohelllohehellohello' ) ; SQL> insert into testlongs values ( 2, 'helllohelllohellllhelllohelllohelllohehellohello' ) ; select * from testlongs where id = 1 works. select * from testlongs where id = 2 works. select * from testlongs where id < 3 fails, with exceptions.IndexError: 1 Traceback (innermost last): File /export/zope/zope2/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /export/zope/zope2/lib/python/ZPublisher/Publish.py, line 176, in publish File /export/zope/zope2/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: testlong) File /export/zope/zope2/lib/python/ZPublisher/Publish.py, line 161, in publish File /export/zope/zope2/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_test) File /export/zope/zope2/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_test) File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, line 316, in manage_test (Object: testlong) File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, line 297, in manage_test (Object: testlong) File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, line 401, in __call__ (Object: testlong) File /export/zope/zope2/lib/python/Products/ZOracleDA/db.py, line 202, in query File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, line 340, in fetchmany File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, line 311, in fetchone IndexError: (see above) I've had a look at the code, and I really really can't see what's going on here. Anyone? Anthony From mj@antraciet.nl Wed Nov 3 08:31:03 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Wed, 03 Nov 1999 09:31:03 +0100 Subject: [Zope-dev] ZOracleDA and select LONGs, for more than one row. In-Reply-To: <199911030626.RAA01433@crown.off.ekorp.com> Message-ID: <4.2.0.58.19991103092945.00a35e50@lisp.atmm.nl> At 07:26 03/11/99 , Anthony Baxter wrote: >(wah. www.zope.org/Collector gone away) This has been on port 8080 for quite a while now. And with the move to a new machine, it can now be found at http://classic.zope.org:8080/Collector -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From gtk@well.com Tue Nov 2 23:22:57 1999 From: gtk@well.com (gtk) Date: Wed, 3 Nov 1999 10:22:57 +1100 Subject: [Zope-dev] Pointer-to-Object Properties, ObjectManagers and Z2 Conflicts References: <9FC702711D39D3118D4900902778ADC803E8A7@JUPITER> Message-ID: <031801bf258b$599ff400$0b01010a@beetlejuice> [Jim -- some detail on tangled objectmanagers?] > A small step up from this is to replace the second list (a list > of authors in a Book object) with a Catalog. The Book can determine all > of it's authors by searching the index of 'book-list' properties. > > With this change you never break data integrity by changing the list, > although it is possible to break it by deleting a Book. All you need to do is arrange for self.unindex_object to be called by self.manage_beforeDelete, I think. Oh, wierd! I just figured out why it's so hard to untangle the relationship between ObjectManagers and their children. The children are stored as attributes of the ObjectManager itself, NOT in a dict. This makes some sense from an acquisition point of view, but probably means that there are a whole bunch of "reserved ids" like manage_beforeDelete. Error Type: Bad Request Error Value: The id manage_beforeDelete is invalid - it is already in use. Yup! Can anyone tell me why Zope doesn't use __getattr__ to handle access to children of ObjectManagers and store the mapping to those children in a dictionary? That way we might have half a chance of preventing ZODB conflicts when adding multiple children simultaneously without losing the protection of ZODB conflicts when overlapping transactions try to modify the same attribute. Regards, Garth. -- From zope@infosys.com.ar Wed Nov 3 14:04:12 1999 From: zope@infosys.com.ar (zope@infosys.com.ar) Date: Wed, 3 Nov 1999 11:04:12 -0300 (ART) Subject: [Zope-dev] ZOracleDA and select LONGs, for more than one row. In-Reply-To: <199911030626.RAA01433@crown.off.ekorp.com> Message-ID: Hi! I could reproduce the same error. My env is Oracle8i on a Sun UltraSparc machine and Zope 2.0.1 on Linux. Has anyone a clue? I check, as Anthony, the source code and couldn't realize what's the problem. Cheers, /B On Wed, 3 Nov 1999, Anthony Baxter wrote: > (wah. www.zope.org/Collector gone away) > > Can someone verify that I'm not going insane? Doing a select on a > table with a column of type LONG works, but only where the select > returns a single row. Any that returns more than one row breaks with > an IndexError (exception included below). > > given the following table: > > SQL> desc testlongs ; > Name Null? Type > ------------------------------- -------- ---- > ID NUMBER(38) > DATA LONG > > And the following SQL method: > > select * from testlongs > > It works when there's only one row in the result. > > SQL> insert into testlongs values ( 1, > 'helllohelllohellllhelllohelllohelllohehellohello' ) ; > SQL> insert into testlongs values ( 2, > 'helllohelllohellllhelllohelllohelllohehellohello' ) ; > > select * from testlongs where id = 1 > works. > select * from testlongs where id = 2 > works. > > select * from testlongs where id < 3 > fails, with > exceptions.IndexError: 1 > > Traceback (innermost last): > File /export/zope/zope2/lib/python/ZPublisher/Publish.py, > line 214, > in publish_module > File /export/zope/zope2/lib/python/ZPublisher/Publish.py, > line 176, > in publish > File /export/zope/zope2/lib/python/Zope/__init__.py, > line 201, > in zpublisher_exception_hook > (Object: testlong) > File /export/zope/zope2/lib/python/ZPublisher/Publish.py, > line 161, > in publish > File /export/zope/zope2/lib/python/ZPublisher/mapply.py, > line 160, > in mapply > (Object: manage_test) > File /export/zope/zope2/lib/python/ZPublisher/Publish.py, > line 102, > in call_object > (Object: manage_test) > File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, > line 316, > in manage_test > (Object: testlong) > File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, > line 297, > in manage_test > (Object: testlong) > File /export/zope/zope2/lib/python/Shared/DC/ZRDB/DA.py, > line 401, > in __call__ > (Object: testlong) > File /export/zope/zope2/lib/python/Products/ZOracleDA/db.py, > line 202, > in query > File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, > line 340, > in fetchmany > File /opt/zope/zope2/lib/python/Products/ZOracleDA/DCOracle/ociCurs.py, > line 311, > in fetchone > IndexError: (see above) > > > I've had a look at the code, and I really really can't see what's going > on here. > > Anyone? > > Anthony > > _______________________________________________ > Zope-Dev maillist - Zope-Dev@zope.org > http://lists.zope.org/mailman/listinfo/zope-dev > > (Related lists - please, no cross posts or HTML encoding! > > To receive general Zope announcements, see: > http://lists.zope.org/mailman/listinfo/zope-announce > > For non-developer, user-level issues, > zope@zope.org, http://lists.zope.org/mailman/listinfo/zope ) > From Gilles lavaux" Hello, Is someone successfully using .XSL to format a XML documents? If yes the document probably look nice, but how does it looks during editing?? Is there some demo online where it is possible to edit a XML document, modify/add/delete nodes? (I used the sax python library to do it, but without XSL/CSS the document looks ugly) The only library I found for XSL and python is 'xslpattern', has anybody used it? Thanks for any hint. Gilles lavaux From petrilli@digicool.com Wed Nov 3 15:04:48 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Wed, 03 Nov 1999 10:04:48 -0500 Subject: [Zope-dev] ZOracleDA and select LONGs, for more than one row. In-Reply-To: <199911030626.RAA01433@crown.off.ekorp.com> Message-ID: On 11/3/99 1:26 AM, Anthony Baxter at anthony@ekorp.com wrote: > (wah. www.zope.org/Collector gone away) > > Can someone verify that I'm not going insane? Doing a select on a > table with a column of type LONG works, but only where the select > returns a single row. Any that returns more than one row breaks with > an IndexError (exception included below). I'll look at this and see if we can reproduce it. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From ap619@chebucto.ns.ca Wed Nov 3 16:23:07 1999 From: ap619@chebucto.ns.ca (Kevin Howe) Date: Wed, 3 Nov 1999 12:23:07 -0400 Subject: [Zope-dev] Accessing Class Attribute values Message-ID: <01f701bf2617$ba53ca60$c4a94f0a@kevin> I am trying to access the Class Attribute values (meta_type, class_icon, class_id, etc.) from a simple base class by doing the following: import Aquisition class myClass: def __str__(self): meta = self.classMetaType() return meta I've also tried: meta = classMetaType() return meta and : return self.getClassAttr('meta_type','') but none of these seem to work. How do you retreive these values? KH From akuchlin@mems-exchange.org Wed Nov 3 17:51:48 1999 From: akuchlin@mems-exchange.org (Andrew M. Kuchling) Date: Wed, 3 Nov 1999 12:51:48 -0500 (EST) Subject: [Zope-dev] mod_pcgi 2 In-Reply-To: References: Message-ID: <14368.30260.315255.605440@amarok.cnri.reston.va.us> Oleg Broytmann writes: > I cannot remember much discussion about mod_pcgi. Is it possible that I >am one or one of 2 or 3 people that want to use such module? Currently I am >not using Andrew's mod_pcgi 'cause I need virtual hosting. Some DC people have reported that they'll be using FastCGI, which already has an Apache module. If that's the case, then probably PCGI will slowly be replaced by FastCGI, and mod_pcgi becomes irrelevant. (I like it when projects become irrelevant, and the maintenance burden shifts to other people, so this is a good thing.) -- A.M. Kuchling http://starship.python.net/crew/amk/ Recipe for Loon Soup: Do not make loon soup. -- _The Eskimo Cookbook_ (1967) From eric@sourcegear.com Wed Nov 3 20:02:33 1999 From: eric@sourcegear.com (Eric W. Sink) Date: Wed, 3 Nov 1999 14:02:33 -0600 Subject: [Zope-dev] Nitpick: OK buttons should not say "Ok" Message-ID: <19991103140233.C3269@sourcegear.com> I'm new here, so take my comments with a grain of salt, particularly when they're as trivial as this one: In GUI design, the proper spelling of OK is "OK", not "Ok". Sorry -- this one is a long-standing pet peeve of mine. :-) So, should I log this as a bug somewhere (the Collector), or is sending it to this list appropriate? Thanks! -- Eric W. Sink, Software Craftsman SourceGear Corporation eric@sourcegear.com From bkc@murkworks.com Wed Nov 3 21:13:44 1999 From: bkc@murkworks.com (Brad Clements) Date: Wed, 3 Nov 1999 16:13:44 -0500 Subject: [Zope-dev] How to shutdown Zope from an embedded application? Message-ID: <199911032104.QAA09867@anvil.murkworks.com> I'm embedding python15.dll in a Windows application, and will be running z2.py one of the many thread/interpreter pairs. At some point my .exe has to be closed, I need to get Zope to shutdown as if I'd pressed the shutdown button in the control panel. Is there any way I can acquire the intepreter lock for the z2 "process" and call whatever function begins the shutdown process in Zope? I've looked at simulating keyboardInterrupt, but I'm doubtful about how well it'll work. Ideas? Thanks Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com ICQ: 14856937 From michel@digicool.com Wed Nov 3 22:24:29 1999 From: michel@digicool.com (Michel Pelletier) Date: Wed, 03 Nov 1999 17:24:29 -0500 Subject: [Zope-dev] Nitpick: OK buttons should not say "Ok" References: <19991103140233.C3269@sourcegear.com> Message-ID: <3820B61D.2F95F2A5@digicool.com> Eric W. Sink wrote: > > I'm new here, so take my comments with a grain of salt, particularly > when they're as trivial as this one: > > In GUI design, the proper spelling of OK > is "OK", not "Ok". > > Sorry -- this one is a long-standing pet peeve of mine. :-) > > So, should I log this as a bug somewhere (the Collector), or is > sending it to this list appropriate? The collector's fine, you could also submit patchs. This would get your peeve petted much quicker. -Michel From tdickenson@geminidataloggers.com Thu Nov 4 09:35:25 1999 From: tdickenson@geminidataloggers.com (Toby Dickenson) Date: Thu, 4 Nov 1999 09:35:25 -0000 Subject: [Zope-dev] ObjectManagers and their children Message-ID: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> > -----Original Message----- > From: gtk [mailto:gtk@well.com] > Subject: [Zope-dev] Pointer-to-Object Properties, > ObjectManagers and Z2 Conflicts > > Oh, wierd! I just figured out why it's so hard to untangle > the relationship > between ObjectManagers and their children. The children are stored as > attributes of the ObjectManager itself, NOT in a dict. This > makes some sense > from an acquisition point of view, but probably means that > there are a whole > bunch of "reserved ids" like manage_beforeDelete. > > Error Type: Bad Request > Error Value: The id manage_beforeDelete is invalid - it > is already in > use. I also feel a little worried that a future version of a class might add a class attribute which clashes with a pre-existing instance attribute added by the user. The protection you describe won't help if the attribute is added in an earlier version, before that class attribute was added. Has anyone else explored this potential problem? From phd@phd.russ.ru Thu Nov 4 11:09:15 1999 From: phd@phd.russ.ru (Oleg Broytmann) Date: Thu, 4 Nov 1999 11:09:15 +0000 (GMT) Subject: [Zope-dev] mod_pcgi 2 In-Reply-To: <14368.30260.315255.605440@amarok.cnri.reston.va.us> Message-ID: On Wed, 3 Nov 1999, Andrew M. Kuchling wrote: > Some DC people have reported that they'll be using FastCGI, which > already has an Apache module. If that's the case, then probably PCGI > will slowly be replaced by FastCGI, and mod_pcgi becomes irrelevant. FastCGI is essentially incompatible with Russian Apache (search through mail lists to find my discussion with Jeff Bauer what is Russian Apache and how to make mod_zope compatible)... Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN. From michel@digicool.com Fri Nov 5 17:57:13 1999 From: michel@digicool.com (Michel Pelletier) Date: Fri, 05 Nov 1999 12:57:13 -0500 Subject: [Zope-dev] Re: [Zope] xmlrpc calls require string results? References: <92C80F6CEAB6D1118DCB00609754111A72A9FB@remote.control.com> Message-ID: <38231A79.73104CF4@digicool.com> I've moved this thread to zope-dev. Dan Pierson wrote: > > > I can understand this in principal, but methods that return simple integers > fail. I'd expect xmlrpc to be able to handle them. It does. > Also some of the articles in the Byte series talk about passing structures > back and forth so I assumed that the xmlrpc support was smart enought to do > things like pack a list of ids (i.e. list of strings) as an XML structure on > its own. It does this also. DTML Method 'rpc': In Python: Py$ import xmlrpclib Py$ x = xmlrpclib.Server('http://korak:13080/') Py$ x.rpc() 5 Py$ From ap619@chebucto.ns.ca Fri Nov 5 20:03:14 1999 From: ap619@chebucto.ns.ca (Kevin Howe) Date: Fri, 5 Nov 1999 16:03:14 -0400 Subject: [Zope-dev] Renderable Base ZClass Message-ID: <009401bf27c8$ccd07820$c4a94f0a@kevin> Hi, I've finished a newer working version of the Renderable Base ZClass which is fully incorporated into ZClasses. Check it out and let me know what you think! http://www.zope.org/Members/admin/RenderableBaseZClassV3 KH From Brian@digicool.com Fri Nov 5 20:17:41 1999 From: Brian@digicool.com (Brian Lloyd) Date: Fri, 5 Nov 1999 15:17:41 -0500 Subject: [Zope-dev] ANNOUNCE: Zope 2.1.0 beta 1 released Message-ID: <613145F79272D211914B0020AFF6401914DD20@gandalf.digicool.com> Hi all. Zope 2.1.0 beta 1 has been released. This release includes many bug fixes, performance and reliability improvements and a number of new features such as the beginnings of internationalization support and relevance ranking for ZCatalog. You can get 2.1.0 beta 1 from: http://www.zope.org/Products/Zope/2.1.0b1/ I expect the beta period for this release to be pretty short - in about a week or so we expect to do either a b2 (if necessary) or a 2.1.0 final. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From dan@remote.control.com Fri Nov 5 20:18:27 1999 From: dan@remote.control.com (Dan Pierson) Date: Fri, 5 Nov 1999 15:18:27 -0500 Subject: [Zope-dev] RE: [Zope] xmlrpc calls require string results? Message-ID: <92C80F6CEAB6D1118DCB00609754111A72AA08@remote.control.com> OK, now I'm really confused. You're both right of course, the general case works, but see the following: [dan@silver alist]$ python Python 1.5.2 (#4, Sep 17 1999, 15:44:43) [GCC egcs-2.91.66 19990314/Linux (egcs- on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import xmlrpclib >>> x = xmlrpclib.Server('http://silver.control.com/zope/') >>> x >>> x.control_com.subject_count() 14 >>> x.control_com.subjects_list() ['Applications', 'Business', 'Communications', 'Engineering', 'HMI', 'Information', 'Languages', 'Motion Control', 'News', 'PCs in Automation', 'PLCs', 'Process Control', 'Sensors', 'Software in Automation'] >>> x.control_com.item_count() Traceback (innermost last): File "", line 1, in ? File "./xmlrpclib.py", line 547, in __call__ return self.__send(self.__name, args) File "./xmlrpclib.py", line 630, in __request request File "./xmlrpclib.py", line 582, in request headers xmlrpclib.ProtocolError: >>> Here are the method definitions, all in SquishSite in Squishdot.py: def has_subjects(self): ''' returns true if site has subject topics defined''' return len(self.subjects) def subject_count(self): ''' gives count of subject topics defined''' return self.has_subjects() def subjects_list(self): ''' lists all subjects ''' subjects = self.subjects.keys() subjects.sort() return subjects def item_count(self): return len(self.data) Maybe this is just a Squishdot problem, but I can't see any significant different between subject_count and item_count above, can you? Dan Pierson, Control Technology Corporation From jae@kavi.com Fri Nov 5 21:05:02 1999 From: jae@kavi.com (John Eikenberry) Date: Fri, 5 Nov 1999 13:05:02 -0800 (PST) Subject: [Zope-dev] error messages and patches In-Reply-To: <613145F79272D211914B0020AFF6401914DD20@gandalf.digicool.com> Message-ID: Is there any plan to have Unauthorized errors use the standard_error_message? Many of our clients want custom Unauthorized errors, for which we have to use a dtml-raise tag or modify the ZPublisher sources. Neither is ideal. It does seem like the Not Found error has been changed in Zope 2.1.0 to use standard_error_message. As is implied by: http://classic.zope.org:8080/Collector/796/view I hate having to modify the zope source to do things, it makes upgrading a real pain (still have a couple sites running 1.10.2 because we don't have time to patch 1.10.3). I've actually got a bit of time coming up that I have earmarked for moving our stuff up to Zope2. I'd like to eliminate the need of modifying the source code as much as possible. So if noone else is working on this problem, I can do it. While on the topic of patching Zope, we have a few other patches floating around here. There's one which allows for all passwords to be encrypted (both normal and UserDB pwds) and one that adds BCC to the Mail Host. Plus a patch to mod_auth_mysql it get it to understand zope formatted roles (so you can use a mysql DB for both zope/non-zope site authentication). Anybody interested in these? --- John Eikenberry [jae@kavi.com - http://zhar.net/] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin From simon@joyful.com Fri Nov 5 23:24:53 1999 From: simon@joyful.com (Simon Michael) Date: 05 Nov 1999 15:24:53 -0800 Subject: [Zope-dev] ANNOUNCE: ZWiki 0.1 released Message-ID: <8766zgfrne.fsf@readymix.joyful.com> I put some more time into this (wiki-on-zope product), and it's quite usable now. See announcement & product info at zope.org. Also, there's a demo running at http://163.182.196.200/zwiki . All feedback much appreciated. Regards, -Simon From simon@joyful.com Sat Nov 6 00:08:41 1999 From: simon@joyful.com (Simon Michael) Date: 05 Nov 1999 16:08:41 -0800 Subject: [Zope-dev] ANNOUNCE: ZWiki 0.1 released In-Reply-To: Simon Michael's message of "05 Nov 1999 15:24:53 -0800" References: <8766zgfrne.fsf@readymix.joyful.com> Message-ID: <871za4fpme.fsf@readymix.joyful.com> Simon Michael writes: > Also, there's a demo running at http://163.182.196.200/zwiki . (fixed a permission problem) From gtk@well.com Fri Nov 5 12:17:17 1999 From: gtk@well.com (gtk) Date: Fri, 5 Nov 1999 23:17:17 +1100 Subject: [Zope-dev] Zope multitasking: retrying doesn't seem to help at all Message-ID: <01ae01bf2788$4b6c7da0$0b01010a@beetlejuice> I've hacked HTTPRequest.py in 2.1 beta to give me some status, and I'm still not sure that Zope's retrying operation is going to be any help, here. I'm not exceeding the retry count, and Zope is still returning wierd errors to my clients. Here's one run output from trying to shove lots of documents with different IDs into a single folder at once: ------ 1999-11-05T11:58:29 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000\006\202' ------ 1999-11-05T11:58:29 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000\006\202' No retry action whatsoever, and I got two 404 errors back instead of created folders. Here's another: ------ 1999-11-05T12:00:22 INFO(0) Z2 CONFLICT Competing writes at, /folder1/testfolder /manage_addProduct/OFSP/addDTMLDocument ------ 1999-11-05T12:00:22 INFO(0) Z2 CONFLICT Competing writes at, /folder1/testfolder /manage_addProduct/OFSP/addDTMLDocument retry count is 0 of 3 retrying... retry count is 0 of 3 retrying... ------ 1999-11-05T12:00:23 INFO(0) Z2 CONFLICT Competing writes at, /folder1/testfolder /manage_addProduct/OFSP/addDTMLDocument retry count is 0 of 3 retrying... ------ 1999-11-05T12:00:23 INFO(0) Z2 CONFLICT Competing writes at, /folder1/testfolder /manage_addProduct/OFSP/addDTMLDocument retry count is 0 of 3 retrying... Okay, so my code hacked into HTTPRequest is working. Note how I'm never exceeding a retry count. At the client end, I got four 400 responses this time, along the lines of: Invalid request The parameter, id, was omitted from the request. Make sure to specify all required parameters, and try the request again. Four Z2 conflicts, cool. Four retries, cool. Four errors to the client, not cool. Here are the mods to HTTPRequest: def supports_retry(self): stderr.write("retry count is %d of %d\n" % (self.retry_count, self.retry_max_count)) return self.retry_count < self.retry_max_count def retry(self): stderr.write("retrying...\n") self.retry_count=self.retry_count+1 r=self.__class__(stdin=self.stdin, environ=self._orig_env, response=self.response.retry() ) return r ... and an appropriate import at the top. Hmmm. You know, I can't see anything in the code which suggests that the creation of a new request object in retry() makes any attempt to set its retry_count. So, hacking in some new code: retry_max_count=3 def supports_retry(self): stderr.write("retry count is %d of %d\n" % (self.retry_count, self.retry_max_count)) return self.retry_count < self.retry_max_count def retry(self): stderr.write("retrying...\n") self.retry_count=self.retry_count+1 r=self.__class__(stdin=self.stdin, environ=self._orig_env, response=self.response.retry(), retry_count=self.retry_count ) return r def __init__(self, stdin, environ, response, clean=0, retry_count=0): # ... if retry_count: stderr.write("this is retry %d\n" % retry_count) self.retry_count = retry_count 1999-11-05T12:14:51 INFO(0) ZServer Monitor Server (V1.5) started on port 8099 ------ 1999-11-05T12:14:59 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000\006\265' ------ 1999-11-05T12:15:00 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000\006\265' ------ 1999-11-05T12:15:01 INFO(0) Z2 CONFLICT Competing writes at, /folder1/testfolder /manage_addProduct/OFSP/addDTMLDocument retry count is 0 of 3 retrying... this is retry 1 Looks like I'm still not exceeding my retry count. That run had two 404s and a 400. I guess the conflicts are the 400s and the 404s are something wierd. Anyone know what's going on, here? Regards, Garth. -- From gtk@well.com Fri Nov 5 12:21:11 1999 From: gtk@well.com (gtk) Date: Fri, 5 Nov 1999 23:21:11 +1100 Subject: [Zope-dev] ObjectManagers and their children References: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> Message-ID: <01b001bf2788$5912c0e0$0b01010a@beetlejuice> >> The children are stored as attributes of the ObjectManager >> itself, NOT in a dict. This makes some sense from an >> acquisition point of view, but probably means that there >> are a whole bunch of "reserved ids" like manage_beforeDelete. > I also feel a little worried that a future version of a class > might add a class attribute which clashes with a pre-existing > instance attribute added by the user. > > The protection you describe won't help if the attribute is added > in an earlier version, before that class attribute was added. Aah, you're right. Well, we could perhaps hack ObjectManager to store its kids in a dictionary, but I'm not sure whether that'd break Acquisition. Does anyone know whether Acquisition works in a way which is compatible with __getattr__? [I guess I could try it, but I'm kinda Zoped out today after fighting Z2 conflicts again.] Regards, Garth. -- From jfarr@real.com Sat Nov 6 01:10:53 1999 From: jfarr@real.com (Jonothan Farr) Date: Fri, 5 Nov 1999 17:10:53 -0800 Subject: [Zope-dev] ObjectManagers and their children References: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> <01b001bf2788$5912c0e0$0b01010a@beetlejuice> Message-ID: <027001bf27f3$c5ec09e0$eb0217ac@dev.prognet.com> > Does anyone know whether Acquisition works in a way which is compatible with > __getattr__? I'm really interested in the answer to this, too. I had no luck getting __getattr__ to work with acquisition when developing the local file system product. What are the rules? Is this even possible? -jfarr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hi! I'm a signature virus. Copy me into your .sig to join the fun! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From Jeff Rush" On Fri, 5 Nov 1999 15:18:27 -0500, Dan Pierson wrote: >Here are the method definitions, all in SquishSite in Squishdot.py: > > def has_subjects(self): > ''' returns true if site has subject topics defined''' > return len(self.subjects) > > def subject_count(self): > ''' gives count of subject topics defined''' > return self.has_subjects() > > def subjects_list(self): > ''' lists all subjects ''' > subjects = self.subjects.keys() > subjects.sort() > return subjects > > def item_count(self): > return len(self.data) > >Maybe this is just a Squishdot problem, but I can't see any significant >different between subject_count and item_count above, can you? Uh, yes I can, a very big one. The item_count() method is missing a function-comment string, which means the ZPublisher module won't allow it to be externally called. That sure looks like your problem. -Jeff Rush From simon@joyful.com Sat Nov 6 01:54:50 1999 From: simon@joyful.com (Simon Michael) Date: 05 Nov 1999 17:54:50 -0800 Subject: [Zope-dev] ANNOUNCE: ZWiki 0.1 released In-Reply-To: David Kankiewicz's message of "Fri, 05 Nov 1999 17:00:03 -0800" References: <8766zgfrne.fsf@readymix.joyful.com> <871za4fpme.fsf@readymix.joyful.com> <38237D93.BCFBC11D@thegrid.net> Message-ID: <87yacce651.fsf@readymix.joyful.com> Hi David, I saw the problem - thanks for bringing it to light. Namely: it's easy to enter some bad dtml which then prevents the page from rendering. It has to be fixed through the management interface. Hmm what can we do about this. I had hoped to allow the use of DTML. Perhaps after an edit I can try: render new page except: revert to old content You also revealed a pagenames-with-spaces problem, fixed. The above issue aside, does anonymous DTML entry open up big security holes, I wonder ? I don't *think* so.. I think DTML's whole rationale is that it won't harm the server no matter what you do with it. Regards, -Simon From simon@joyful.com Sat Nov 6 02:01:09 1999 From: simon@joyful.com (Simon Michael) Date: 05 Nov 1999 18:01:09 -0800 Subject: [Zope-dev] ANNOUNCE: ZWiki 0.1 released In-Reply-To: David Kankiewicz's message of "Fri, 05 Nov 1999 17:00:03 -0800" References: <8766zgfrne.fsf@readymix.joyful.com> <871za4fpme.fsf@readymix.joyful.com> <38237D93.BCFBC11D@thegrid.net> Message-ID: <87vh7ge5ui.fsf@readymix.joyful.com> David Kankiewicz writes: > just an idea but wouldn't a text property field work? (no DTML > evaluation for text..) Oh.. are you saying, eg, make the edit box the whole page ? Hmm.. low-tech.. but effective! :) I'd like to offer this as a UI option. From pje@telecommunity.com Sat Nov 6 06:23:28 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Sat, 06 Nov 1999 01:23:28 -0500 Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <027001bf27f3$c5ec09e0$eb0217ac@dev.prognet.com> References: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> <01b001bf2788$5912c0e0$0b01010a@beetlejuice> Message-ID: <199911060623.WAA02346@zope.codeit.com> At 05:10 PM 11/5/99 -0800, Jonothan Farr wrote: > >> Does anyone know whether Acquisition works in a way which is compatible with >> __getattr__? > >I'm really interested in the answer to this, too. I had no luck getting >__getattr__ to work with acquisition when developing the local file system >product. What are the rules? Is this even possible? When acquisition wrappers go looking for attributes, they will call your __getattr__, but it is with an unwrapped self. This means that acquisition can use __getattr__ routines, but __getattr__ routines cannot make use of the object's acquired attributes. There is *no* workaround, short of rewriting the Acquisition ExtensionClass and creating an alternative application framework to Zope. (I actually did this myself, to solve this very problem of needing "wrapped __getattr__", but of course the resulting framework can't use Zope products. Oh well.) From michel@digicool.com Sat Nov 6 18:10:36 1999 From: michel@digicool.com (Michel Pelletier) Date: Sat, 06 Nov 1999 13:10:36 -0500 Subject: [Zope-dev] Re: [Zope] xmlrpc calls require string results? References: <92C80F6CEAB6D1118DCB00609754111A72AA08@remote.control.com> Message-ID: <38246F1C.D33DE320@digicool.com> Dan Pierson wrote: > def subject_count(self): > ''' gives count of subject topics defined''' > return self.has_subjects() > > def item_count(self): > return len(self.data) > > Maybe this is just a Squishdot problem, but I can't see any significant > different between subject_count and item_count above, can you? Which of these things is not like the other? ;) It doesn't have a doc string, and ZPublisher will not publish a method that does not have one. XML-RPC should have better error messages, but it doesn't. We didn't put XML-RPC support into Zope, so you would need to talk to the original author, Eric Kidd of Userland (http://linux.userland.com/)?, or send us some patches. -Michel From michel@digicool.com Sat Nov 6 18:27:43 1999 From: michel@digicool.com (Michel Pelletier) Date: Sat, 06 Nov 1999 13:27:43 -0500 Subject: [Zope-dev] ObjectManagers and their children References: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> <01b001bf2788$5912c0e0$0b01010a@beetlejuice> Message-ID: <3824731F.FCA131D9@digicool.com> gtk wrote: > > >> The children are stored as attributes of the ObjectManager > >> itself, NOT in a dict. This makes some sense from an > >> acquisition point of view, but probably means that there > >> are a whole bunch of "reserved ids" like manage_beforeDelete. > > > I also feel a little worried that a future version of a class > > might add a class attribute which clashes with a pre-existing > > instance attribute added by the user. > > > > The protection you describe won't help if the attribute is added > > in an earlier version, before that class attribute was added. > > Aah, you're right. Well, we could perhaps hack ObjectManager to store its > kids in a dictionary, but I'm not sure whether that'd break Acquisition. Not if you did it right. When ZPublisher traverses a heirarchy of objects, it looks for objects first with 'getattr' and then with 'getitem'. So for the path '/X/Y' It first tries 'X.Y' and then 'X[Y]'. So it is very possible to create an object manager that stores its children in a dictionary and defines an __getitem__ method that returns the children. In addition, you would need to make sure Acquisition worked right by having __getitem__ return *wrapped* children; otherwise Acquisition would fail. Something like: child = self.children[name] return child.__of__(self) (The last line can be read "Return child *in the context of* self"). That's the theory. Way back in the day, a few months ago, I tried to write a BTreeObjectManager that stored it's children in a dictionary (a BTree, but it acts just like a dict and it's faster and much more space efficient when working with ZODB). I got pretty far along, and it seemed to work ok, but there were bugs I never had time to fix. It was just an experiment. if I can dig up the code, I'll post it. -Michel From simon@joyful.com Sat Nov 6 19:17:23 1999 From: simon@joyful.com (Simon Michael) Date: 06 Nov 1999 11:17:23 -0800 Subject: [Zope-dev] ANNOUNCE: ZWiki 0.1 released In-Reply-To: Simon Michael's message of "05 Nov 1999 17:54:50 -0800" References: <8766zgfrne.fsf@readymix.joyful.com> <871za4fpme.fsf@readymix.joyful.com> <38237D93.BCFBC11D@thegrid.net> <87yacce651.fsf@readymix.joyful.com> Message-ID: <87ogd7e8fw.fsf@readymix.joyful.com> Simon Michael writes: > Perhaps after an edit I can > > try: > render new page > except: > revert to old content Ok, now after an edit I just call apply(DTMLDocument.DTMLDocument.__call__, (self, None, REQUEST, None)) and if there's a DTML problem zope rolls back the transaction & gives an appropriate error. Right on! I'll update the product on zope.org soon. From sdf@xanet.edu.cn Sun Nov 7 02:00:10 1999 From: sdf@xanet.edu.cn (sdf) Date: Sun, 7 Nov 1999 10:00:10 +0800 Subject: [Zope-dev] question:how can i modify a method of a product Message-ID: <003c01bf28c3$d56d3120$ce0d70ca@sdf.xanet.edu.cn> This is a multi-part message in MIME format. ------=_NextPart_000_0039_01BF2906.E08DDF80 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable I just want to make a product with a main document such as HTML file and related files such as image,I made a product basing object = manager,and so i can upload related files,but i don't know how I can = edit the index_html method of the product when using the product. it seems problem with the permission thanks ------=_NextPart_000_0039_01BF2906.E08DDF80 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
I just want to make a product with a = main=20 document such as HTML file
and related files such as image,I = made a product=20 basing object manager,and so i can upload related files,but i don't know = how I=20 can edit the index_html method of the product when using the=20 product.
it seems problem with the=20 permission
thanks
 
------=_NextPart_000_0039_01BF2906.E08DDF80-- From itamars@ibm.net Sun Nov 7 16:26:02 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Sun, 07 Nov 1999 18:26:02 +0200 Subject: [Zope-dev] Looking up objects, calling objects Message-ID: <3825A81A.1BBDC8E4@ibm.net> In my effort to create a simple python cache Product, I need to: A. Pass the name of a DTML method/document or PythonMethod to the ZCache, and then turn this into an object I can call from python (e.g. turn the string "QuickStart.index_html" into a object I can call, while still preserving security.) B. Call the above object from python, passing it the appropiate environment so it can run (_, REQUEST, etc.), that is execute a DTML method in the ZODB, for example, from inside a python Product. I'm also wondering about _v_ attributes - when are they flushed? Is it possible for them to persist in memory for a while at least, so I can use one to store the cached method? -- Itamar - itamars@ibm.net ---------------------------o----------------------------------------------o Perl/Gimp Greeting Cards | Trust? Ha! The US dollar is backed by ICBMs! | http://www.sealingwax.com | --Anonymous Coward, Slashdot | From RossBoylan@stanfordalumni.org Sun Nov 7 07:21:36 1999 From: RossBoylan@stanfordalumni.org (Ross Boylan) Date: Sat, 06 Nov 1999 23:21:36 -0800 Subject: [Zope-dev] Need help with Products Message-ID: <3.0.5.32.19991106232136.0098a300@pop.mindspring.com> I am trying to create a User subclass which will hold additional information about a user. Could someone help me get oriented? I've been using 3 primary sources of information: the existing poll product (as an example), Amos Latteier's recently released "Extending Zope in Python" slides, and Zen's "How-To: The (old) Product AP Tutorial." The latter notes it is out of date. I notice, for example, that the recent info has no reference to methods = ... to get the product creation methods out to the folders. Users have the additional complexity, I think, that there are two items to be managed: the folder which holds the users (the thing which appears as acl_list in the GUI?) and the users themselves. My only interest in a new folder is to assure that the right kind of user object gets created. My intention is that users will create their own user objects off a simple screen asking for the basic info. One specific problem has been that I kept getting a broken product because UserFolder was an unrecognized symbol. The tracebacks displayed on the product information seemed to show the error being thrown at class OrgUserFolder(UserFolder): in OrgUser.py, which in turn was being called from __init__.py's import statement. Yet my various attempts to trap the error failed (in fact, at least some times the code seemed to run OK when it was in the debugger). Mysteriously, when I took the context.RegisterClass out of the __init__ file, the product reported as OK. Note those statements occur after the apparent point the error was thrown. While tracing I also noticed that class definitions seemed to invoke an __init__ method in the App hierarchy (I don't recall the specifics) at the point they were scanned. Can anyone tell me how such a hook gets set up in general, and what it is doing in this case? Another specific question is whether spaces are legal for meta type names. I'm running on NT, and had Python 1.5.2 on my system before I installed Zope. Here's the current code. I've fiddled with lots of variants. ------------------------__init__.py----------------------------------------- ------------- __doc__='''Sample PSA Organizational User Adopted from Poll The job of this module is to provide any run-time initialization needed and to define meta data. ''' __version__='$Revision: 0.1 $'[11:-2] from ImageFile import ImageFile import OrgUser # meta-data: # Names of objects added by this product: meta_types=( {'name': 'PSA User' , # The name of the object type 'action': 'manage_addUser', # The method to add one. }, ) # Attributes (usually "methods") to be added to folders to support # creating objects: methods= { 'manage_addUserForm' : OrgUser.addUserForm, 'manage_addUser': OrgUser.addUser #I need to define this method } # the following gave me an error on UserFolder being unrecognized #def initialize(context): # context.registerClass(OrgUser) ----------------------OrgUser.py-------------------------------------------- --- from AccessControl.User import * addUserForm = HTMLFile('addUser', globals()) class OrgUser(User): """Add additional information on the user""" meta_type ='PSA User' id = 'Organizational_User' title = 'Organizational User' def __init__(self,name,password,roles,domains): User.__init__(self, name, password, roles, domains) self.email = "Your email here" class OrgUserFolder(UserFolder): ### this seems to be where I get the error that UserFolder is unrecognized """Base class for UserFolder-like objects""" meta_type='PSA User Folder' id ='PSA_users' title ='Organizational User Folder' def _doAddUser(self, name, password, roles, domains): """Create a new user""" self.data[name]=OrgUser(name,password,roles,domains) Globals.default__class_init__(OrgUserFolder) def manage_addUserFolder(self,dtself=None,REQUEST=None,**ignored): """ """ f=OrgUserFolder() self=self.this() try: self._setObject('acl_users', f) except: return MessageDialog( title ='Item Exists', message='This object already contains a User Folder', action ='%s/manage_main' % REQUEST['URL1']) self.__allow_groups__=f if REQUEST: return self.manage_main(self,REQUEST,update_menu=1) From webman@beehive.de Sun Nov 7 23:24:22 1999 From: webman@beehive.de (webman) Date: Mon, 8 Nov 1999 00:24:22 +0100 (CET) Subject: [Zope-dev] Need help with Products In-Reply-To: <3.0.5.32.19991106232136.0098a300@pop.mindspring.com> Message-ID: hello ross, On Sat, 6 Nov 1999, Ross Boylan wrote: > I am trying to create a User subclass which will hold additional > information about a user. Could someone help me get oriented? > I've been using 3 primary sources of information: the existing poll product > (as an example), Amos Latteier's recently released "Extending Zope in > Python" slides, and Zen's "How-To: The (old) Product AP Tutorial." The > latter notes it is out of date. I notice, for example, that the recent > info has no reference to methods = ... to get the product creation methods > out to the folders. you might also want to take a look at mkproduct. it comes with some documentation, a script and 2 skeletons showing you the basics of simple items or folderish objects. we have gotten a lot of positive feedback about it. definitely beats learning from the poll product. you can get it here: www.zope.de/software/mkproduct/index_eng_html it does not cover any zclass stuff though. regards, webman --------------------------------------------------------------------------- webman | _ beehive GmbH | ASCII ribbon campaign ( ) berlin, Germany | - against HTML email X http://www.beehive.de | & vcards / \ From pje@telecommunity.com Mon Nov 8 02:32:24 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Sun, 07 Nov 1999 21:32:24 -0500 Subject: [Zope-dev] Patch to provide "local" and "set" tags in DTML Message-ID: <199911080232.SAA23317@zope.codeit.com> Below is a patch for the current version of DocumentTemplates which adds "local" and "set" tags to DTML. Both use syntax identical to that of the "let" tag, with two key differences. First, where "let" defines variables that remain constant within the block, the "local" tag defines local variables which may be changed within the block's scope by using the "set" tag. The second difference is that the "set" tag is an empty tag like "var", not a block tag. Thus, it can be used repetitively (e.g. within "in" loops) or to set different values of a variable on opposing conditions of an "if" tag. There are some limitations, for security reasons. Only variables named in a "local" block may be set by "set", and only those in the innermost such block. This helps to prevent an untrusted, called DTML method from polluting its parent's namespace (since its caller can wrap the call with a "local" block that defines no variables). Naturally, "set" cannot be used outside a "local" block, although this is a runtime error rather than a compile-time error. The code should be considered alpha quality - I have used it for a few things over the past few months, but it has not been put to anything heavy yet. It is available for use under the same terms as the rest of DT_Let, which is to say, under the ZPL. Enjoy. Index: DT_Let.py =================================================================== RCS file: /cvs-repository/Zope2/lib/python/DocumentTemplate/DT_Let.py,v retrieving revision 1.5 diff -r1.5 DT_Let.py 122c122,127 < tname, args, section = blocks[0] --- > if hasattr(self,'blockContinuations'): > tname, args, section = (blocks[0]+(None,))[:3] > self.section = section.blocks > else: > tname, args = self.name, blocks > 124,125c129 < self.section = section.blocks < self.args = args = parse_let_params(args) --- > self.args = args = parse_let_params(args,tag=tname) 177a182,232 > > > > > localdictname = '__$local.dict__' > > class Local(Let): > > name = 'local' > > def render(self, md): > > d={}; md._push(d); > > try: > d[localdictname]=d > for name,expr in self.args: > if type(expr) is type(''): d[name]=md[expr] > else: d[name]=expr(md) > return render_blocks(self.section, md) > > finally: > if d.has_key(localdictname): del d[localdictname] > md._pop(1) > > __call__ = render > > > class Set: > name = 'set' > > __init__ = Let.__init__.im_func > > def render(self, md): > > try: > d = md[localdictname] > > except KeyError: > raise 'SetWithoutLocal',"'set' used outside of 'local' block" > > for name,expr in self.args: > > if not d.has_key(name): > raise 'SetUndefined',"variable '%s' is not defined within current 'local' block" > > if type(expr) is type(''): > d[name]=md[expr] > else: d[name]=expr(md) > > __call__ = render Index: DT_String.py =================================================================== RCS file: /cvs-repository/Zope2/lib/python/DocumentTemplate/DT_String.py,v retrieving revision 1.31 diff -r1.31 DT_String.py 141a142,143 > 'local': ('local', 'DT_Let', 'Local'), > 'set': ('set', 'DT_Let', 'Set'), _____ _/__) ___/ From mj@antraciet.nl Mon Nov 8 09:20:22 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 08 Nov 1999 10:20:22 +0100 Subject: [Zope-dev] Re: Dealing with form data in External Methods In-Reply-To: <38262C57.5A7136F8@magma-da.com> Message-ID: <4.2.0.58.19991108101204.00a3b180@lisp.atmm.nl> I am moving this to Zope-Dev. At 02:50 08/11/99 , David S. Harrison wrote: >After a little experimentation, I found that the values submitted >via a form are placed into the receiving DTML document's name space. >That is very nice. Now I am wondering whether these values are >also available to external methods I call as part of the evaluation >of the receiving DTML page. Let me be more specific: suppose >I have an external method: > >def ComputeColumns(self): > # Find the value of 'testcase' in the enclosing name space? > return computeList(testcase) > >The DTML page that calls this external method has a form >variable named 'testcase'. Is there some way I can use >the self object to evaluate names in the enclosing name space? >Or should I try to call the method explicitly with arguments? >Right now, the code in the DTML page is kind of nice: > > >
  • > > >I suppose I could change it to be a call. But I am not >clear on what should be used for the name of "ComputeColumns" >or how it should be called. My first guess would be: > > > >But I haven't tried it yet. I am hoping there is some >method I can call using 'self' to evaluate name space >variables in an external method. Brian Lloyd's External Method HowTo provides all the answers: http://www.zope.org/Documentation/How-To/ExternalMethods -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From gtk@well.com Sun Nov 7 22:47:52 1999 From: gtk@well.com (gtk) Date: Mon, 8 Nov 1999 09:47:52 +1100 Subject: [Zope-dev] RE: [Zope] xmlrpc calls require string results? References: <199911060126.TAA15509@rampart.timecastle.net> Message-ID: <000c01bf2972$47455580$0b01010a@beetlejuice> > Uh, yes I can, a very big one. The item_count() method is missing > a function-comment string, which means the ZPublisher module > won't allow it to be externally called. That sure looks like your > problem. That's already in my next draft of the Boring Product How-To, but just for the record: why are doc strings enforced? Are they used for anything yet? Regards, Garth. -- From michel@digicool.com Mon Nov 8 15:45:09 1999 From: michel@digicool.com (Michel Pelletier) Date: Mon, 08 Nov 1999 10:45:09 -0500 Subject: [Zope-dev] ObjectManagers and their children References: <9FC702711D39D3118D4900902778ADC803E8AD@JUPITER> <01b001bf2788$5912c0e0$0b01010a@beetlejuice> <3824731F.FCA131D9@digicool.com> Message-ID: <3826F005.7429DD42@digicool.com> This is a multi-part message in MIME format. --------------C0AACA7D70F4F8DCAC367E67 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Michel Pelletier wrote: > > That's the theory. Way back in the day, a few months ago, I tried to > write a BTreeObjectManager that stored it's children in a dictionary (a > BTree, but it acts just like a dict and it's faster and much more space > efficient when working with ZODB). I got pretty far along, and it > seemed to work ok, but there were bugs I never had time to fix. It was > just an experiment. if I can dig up the code, I'll post it. > > -Michel Code is attached. Code is as is, buggy, and purely experimental. Consists of two file, BTreeObjectManager.py and BTreeFolder.py. Both go in OFS (but it would probably be smart to make a seperate Product). -Michel --------------C0AACA7D70F4F8DCAC367E67 Content-Type: text/plain; charset=us-ascii; name="BTreeObjectManager.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="BTreeObjectManager.py" ############################################################################## # # Zope Public License (ZPL) Version 1.0 # ------------------------------------- # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright # notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions, and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # 3. Digital Creations requests that attribution be given to Zope # in any manner possible. Zope includes a "Powered by Zope" # button that is installed by default. While it is not a license # violation to remove this button, it is requested that the # attribution remain. A significant investment has been put # into Zope, and this effort will continue if the Zope community # continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning # features derived from or use of this software must display # the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # In the event that the product being advertised includes an # intact Zope distribution (with copyright and license included) # then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to # endorse or promote products derived from this software without # prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain # the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # Intact (re-)distributions of any official Zope release do not # require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as # patches to official Zope releases. Distributions that do not # clearly separate the patches from the original work must be clearly # labeled as unofficial distributions. Modifications which do not # carry the name Zope may be packaged in any form, as long as they # conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ############################################################################## __doc__="""Object Manager $Id: ObjectManager.py,v 1.80 1999/07/22 19:19:22 jim Exp $""" __version__='$Revision: 1.80 $'[11:-2] from BTree import BTree import ts_regex, Globals from ObjectManager import ObjectManager bad_id=ts_regex.compile('[^a-zA-Z0-9-_~\,\. ]').match #TS _marker=[] class BTreeObjectManager(ObjectManager): """BTree object manager This class provides core behavior for collections of heterogeneous objects. It's API is identical to that of the standard Zope ObjectManager. Instead of storing it's objects sequentially, the BTreeObjectManager stores its objects in very efficient BTree data structures written in C. """ meta_type ='BTree Object Manager' _objects = () _real_objects = BTree() def _checkId(self, id, allow_dup=0): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars. if not id: raise 'Bad Request', 'No id was specified' if bad_id(id) != -1: raise 'Bad Request', ( 'The id %s contains characters illegal in URLs.' % id) if id[0]=='_': raise 'Bad Request', ( 'The id %s is invalid - it begins with an underscore.' % id) if not allow_dup: if hasattr(self, 'aq_base'): self=self.aq_base if self._real_objects.has_key(id): raise 'Bad Request', ( 'The id %s is invalid - it is already in use.' % id) def _setOb(self, id, object): self._real_objects[id] = object def _delOb(self, id): del self._real_objects[id] def _getOb(self, id, default=_marker): if hasattr(self, 'aq_base'): base=self.aq_base else: base=self if not self._real_objects.has_key(id): if default is _marker: raise AttributeError, id return default return self._real_objects[id].__of__(self) Globals.default__class_init__(BTreeObjectManager) --------------C0AACA7D70F4F8DCAC367E67 Content-Type: text/plain; charset=us-ascii; name="BTreeFolder.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="BTreeFolder.py" ############################################################################## # # Zope Public License (ZPL) Version 1.0 # ------------------------------------- # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright # notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions, and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # 3. Digital Creations requests that attribution be given to Zope # in any manner possible. Zope includes a "Powered by Zope" # button that is installed by default. While it is not a license # violation to remove this button, it is requested that the # attribution remain. A significant investment has been put # into Zope, and this effort will continue if the Zope community # continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning # features derived from or use of this software must display # the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # In the event that the product being advertised includes an # intact Zope distribution (with copyright and license included) # then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to # endorse or promote products derived from this software without # prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain # the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # Intact (re-)distributions of any official Zope release do not # require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as # patches to official Zope releases. Distributions that do not # clearly separate the patches from the original work must be clearly # labeled as unofficial distributions. Modifications which do not # carry the name Zope may be packaged in any form, as long as they # conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ############################################################################## """Folder object Folders are the basic container objects and are analogous to directories. $Id: Folder.py,v 1.82 1999/07/05 14:44:49 jim Exp $""" __version__='$Revision: 1.82 $'[11:-2] import Globals, SimpleItem from BTreeObjectManager import BTreeObjectManager from PropertyManager import PropertyManager from AccessControl.Role import RoleManager from webdav.Collection import Collection from FindSupport import FindSupport from Globals import HTMLFile manage_addBTreeFolderForm=HTMLFile('btreeFolderAdd', globals()) def manage_addBTreeFolder(self, id, title='', createPublic=0, createUserF=0, REQUEST=None): """Add a new BTreeFolder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserBTreeFolder' objects are created respectively in the new folder. """ ob=BTreeFolder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None if createUserF: if (user is not None) and not ( user.has_permission('Add User Folders', self)): raise 'Unauthorized', ( 'You are not authorized to add User Folders.' ) ob.manage_addUserFolder() if createPublic: if (user is not None) and not ( user.has_permission('Add Documents, Images, and Files', self)): raise 'Unauthorized', ( 'You are not authorized to add DTML Documents.' ) ob.manage_addDTMLDocument(id='index_html', title='') if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1) class BTreeFolder(BTreeObjectManager, PropertyManager, RoleManager, Collection, SimpleItem.Item, FindSupport): """ The basic container object in Principia. BTreeFolders can hold almost all other Principia objects. """ meta_type='BTree Folder' _properties=({'id':'title', 'type': 'string'},) manage_options=( {'label':'Contents', 'action':'manage_main'}, {'label':'View', 'action':'index_html'}, {'label':'Properties', 'action':'manage_propertiesForm'}, {'label':'Import/Export', 'action':'manage_importExportForm'}, {'label':'Security', 'action':'manage_access'}, {'label':'Undo', 'action':'manage_UndoForm'}, {'label':'Find', 'action':'manage_findFrame', 'target':'manage_main'}, ) __ac_permissions__=() Globals.default__class_init__(BTreeFolder) --------------C0AACA7D70F4F8DCAC367E67-- From Jeff Rush" On Mon, 8 Nov 1999 09:47:52 +1100, gtk wrote: >That's already in my next draft of the Boring Product How-To, but just for >the record: why are doc strings enforced? Are they used for anything yet? Doc strings have been used by ZPublisher since the early days, as a way of authorizing whether a function is publically visible or not, just as the leading underscore in a name does. Why we need two ways? I guess there were existing functions w/o the underscore and they needed an access control mechanism. The doc strings are not -used- for anything re Zope and although I like the control it gives you, I've been bitten by omitted doc strings too. I'd just like a development-time option that makes ZPublisher complain into a logfile, so I can realize the error of my ways. Hmm, not a very satisfying answer... maybe DC will give a better one. -Jeff Rush From dsh@magma-da.com Mon Nov 8 22:48:03 1999 From: dsh@magma-da.com (David S. Harrison) Date: Mon, 08 Nov 1999 14:48:03 -0800 Subject: [Zope-dev] Returning lists of Tuples from External Methods Message-ID: <38275323.97FC2968@magma-da.com> Something special seems to happen if I return a list of two-element tuples from an external method. If I return a list of three-element tuples, Zope does what I expect. It allows me to sequence through each tuple in the list using and then I use and to access elements of the tuple. But if I return a two element tuple, I get a list of the second element of the tuple when I use . I suspect Zope is doing something like interpreting the tuple list as name/value pairs and adding them to the namespace. But I haven't found any documentation on it. Any clues on what is happening here? David S. Harrison (dsh@magma-da.com) From pje@telecommunity.com Mon Nov 8 23:01:41 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Mon, 08 Nov 1999 18:01:41 -0500 Subject: [Zope-dev] Returning lists of Tuples from External Methods In-Reply-To: <38275323.97FC2968@magma-da.com> Message-ID: <3.0.5.32.19991108180141.01787850@telecommunity.com> At 02:48 PM 11/8/99 -0800, David S. Harrison wrote: > >But if I return >a two element tuple, I get a list of the second element of the tuple >when I use . I suspect Zope is doing something like >interpreting the tuple list as name/value pairs and adding them >to the namespace. But I haven't found any documentation on it. >Any clues on what is happening here? When iterating over a sequence of two-item tuples, puts the first item into "sequence-key" and the second into "sequence-item". It is indeed treating the sequence as a .items() style list. From bkc@murkworks.com Mon Nov 8 23:02:46 1999 From: bkc@murkworks.com (Brad Clements) Date: Mon, 8 Nov 1999 18:02:46 -0500 Subject: [Zope-dev] Calling Python method from subclassed ZClass DTML method ? Message-ID: <199911082304.SAA18184@anvil.murkworks.com> I've created a simple Custom Python Class as described in the ZClass Tutorial, but I can't seem to call a python class method from a DHTML method in my derived ZClass. My Python module gets registered correctly. I went to Control Panel/ Products and saw my Package listed "Mercury". Under Mercury, I chose to create a new ZClass called Stats, which is subclassed from ModuleFactory, a class I registered in my Package's __init__.py Zope\Lib\Python\products\Mercury\__init__.py has import MercuryJobs import MercuryStats def initialize(context): """Called by Zope to initialize a product""" context.registerBaseClass(MercuryJobs.QueueManager) context.registerBaseClass(MercuryStats.ModuleFactory) ---- In the Zclass 'stat's, I added a new DTML method called getModules, and that method has: When I choose to view it, I get KeyError, ModuleList. Perhaps this can't be viewed until instantiated? Am I on the right track? MercuryStats.ModuleFactory returns a list of objects which I'll want to iterate over with #in. I'm expecting to add a "Mercury/Stats" object into a folder at some point, then #in on it to get the list of objects. Is this the correct way to call a method in a python base class from a DHTML method in Zclass? Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com ICQ: 14856937 From anthony@interlink.com.au Tue Nov 9 02:57:30 1999 From: anthony@interlink.com.au (Anthony Baxter) Date: Tue, 09 Nov 1999 13:57:30 +1100 Subject: [Zope-dev] manage_addDTMLMethod/Document taking contents as argument? Message-ID: <199911090257.NAA01737@mbuna.arbhome.com.au> Is there any reason why manage_addDTMLMethod/Document doesn't accept the new contents as anything other than a file object? Is something like the following acceptable? - def addDTMLDocument(self, id, title='', file='', REQUEST=None, submit=None): + def addDTMLDocument(self, id, title='', file='', data=None, REQUEST=None, + submit=None): """Add a DTML Document object with the contents of file. If 'file' is empty, default document text is used. """ if type(file) is not type(''): file=file.read() - if not file: file=default_dd_html + if not file: + if data is not None: + file=data + else: + file=default_dd_html ob=DTMLDocument(file, __name__=id) ob.title=title id=self._setObject(id, ob) if REQUEST is not None: try: u=self.DestinationURL() except: u=REQUEST['URL1'] if submit==" Add and Edit ": u="%s/%s" % (u,quote(id)) REQUEST.RESPONSE.redirect(u+'/manage_main') return '' From Anthony Baxter Tue Nov 9 04:43:30 1999 From: Anthony Baxter (Anthony Baxter) Date: Tue, 09 Nov 1999 15:43:30 +1100 Subject: [Zope-dev] manage_addDTMLMethod/Document taking contents as argument? In-Reply-To: Message from "Jonothan Farr" of "Mon, 08 Nov 1999 19:07:01 -0800." <00bd01bf2a5f$7e1d6aa0$eb0217ac@dev.prognet.com> Message-ID: <199911090443.PAA01980@mbuna.arbhome.com.au> >>> "Jonothan Farr" wrote > You shouldn't need to modify the source to pass in a string as the document > data. You just pass in a string as the file argument. I use this in the local > file system product. I think you can also pass in a 'file-like' object that > has read() and readline() methods although I haven't tried this. blah. smack me for not being able to read. my excuse is that I'm very tired. Anthony From gtk@well.com Mon Nov 8 19:39:58 1999 From: gtk@well.com (gtk) Date: Tue, 9 Nov 1999 06:39:58 +1100 Subject: [Zope-dev] @#$%^&*( Zope Concurrency Message-ID: <006101bf2a21$5011e2a0$0b01010a@beetlejuice> Bait: I am willing to SPEND MONEY to get this bastard solved. Summary of the situation so far: - Zope cannot deal with overlapping modifications to one object - That includes adding children to containers - The retry mechanism doesn't work - The user sees extremely messy errors - This seriously limits Zope's usability for write-intensive tasks like conferencing - Since all of my plans are for write-intensive tasks, that makes me uncomfortable I've spent my last 24 hours of work on Zope trying to figure out where to hack in any kind of method-aware queueing which could -- at its most simple -- simply not attempt to place more than one call to an object at once. From there, I'd be able to hack the routine for more subtlety. So far, no go. I'm just chasing my tail all around Publish, mapply and a few others, getting nowhere particularly fast. Well, I'm sick of whacking in calls to traceback.print_stack(), guys. I'd much rather get someone who knows what they're talking about to point out "oh, there's half a system in blah.py which needs 30 minutes of work to do what you need, and yeah we know retry is fundamentally broken". Or whatever. So, here goes bribery: If you're Australian and first to point out where I need to apply code, I'll buy you lunch next time I'm in your home city. If you're outside Australia, I'll have Amazon ship a copy of Slaughtermatic to your doorstep. Just someone, please, for fuck's sake, help me solve this concurrency problem before I'm forced to abandon the ZODB and/or Zope entirely. Regards, Garth. -- From sergey2b@mail.ru Tue Nov 9 09:10:27 1999 From: sergey2b@mail.ru (sergey2b) Date: Tue, 9 Nov 1999 12:10:27 +0300 Subject: [Zope-dev] ZCatalog search, index Message-ID: <001a01bf2a92$44e8c300$740100c0@ishop.ramax.spb.ru> Kind day. How indexing and to search in objects File using ZCatalog? The object File contains txt the document. As Zope 2.1. in ZCatalog to receive the list of all words in an index. Sergey. From Jeff Rush" On Mon, 08 Nov 1999 18:01:41 -0500, Phillip J. Eby wrote: >At 02:48 PM 11/8/99 -0800, David S. Harrison wrote: >> >>But if I return >>a two element tuple, I get a list of the second element of the tuple >>when I use . I suspect Zope is doing something like >>interpreting the tuple list as name/value pairs and adding them >>to the namespace. But I haven't found any documentation on it. >>Any clues on what is happening here? > >When iterating over a sequence of two-item tuples, puts the first >item into "sequence-key" and the second into "sequence-item". It is indeed >treating the sequence as a .items() style list. So *that's* whats happening! Drove me crazy trying to get it to work here, and I finally came up with workaround that used sequence-index to subscript into the original sequence. Would that behavior be considered a bug? I kept looking for an option to dtml-in to tell it "hands off" my sequence and don't get smart with it. abs_path="_.string.split((URL2+'/'+item[0]), REQUEST.script)[1][1:]">     
    -Jeff Rush From hoekstra@fsw.LeidenUniv.nl Tue Nov 9 09:30:44 1999 From: hoekstra@fsw.LeidenUniv.nl (Rik Hoekstra) Date: Tue, 09 Nov 1999 10:30:44 +0100 Subject: [Zope-dev] Strange behavior in modifying properties Message-ID: <01JI4PGS0KS28WW6ZO@FSW.LEIDENUNIV.NL> Today I was experimenting a little with inserting and deleting from lines properties (though I see no reason why this would not apply to other properties. There was some strange behavior with modifying lists from dtml. The method was as follows: where lst is a property of the containing folder. The proper way to do this would be to make a local copy of the list and replacing the property with it, but that's not the point. Now, as far as I'm aware this method should have no effect on the properties of the folder, or is it. But is has: it changes the property and it seems to have a permanent effect. But, as it is not a completed transaction changes are undone if ZServer is closed down. A few questions: - has anyone seen this as well - could someone explain me how this works - is this a bug or a feature - if it is a feature - could someone show me its use Rik Hoekstra From zen@cs.rmit.edu.au Tue Nov 9 09:30:32 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Tue, 9 Nov 1999 20:30:32 +1100 (EST) Subject: [Zope-dev] @#$%^&*( Zope Concurrency In-Reply-To: <006101bf2a21$5011e2a0$0b01010a@beetlejuice> Message-ID: Do the '404' errors you get contain the text 'the requested Zope resource' or something different? If it doesn't, then uncaught exceptions are propogating back to Medusa (probably from work() in HTTPServer.py). > - This seriously limits Zope's usability for write-intensive tasks like > conferencing Unless you run in single thread mode (*duck*) ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From mj@antraciet.nl Tue Nov 9 10:23:38 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Tue, 09 Nov 1999 11:23:38 +0100 Subject: [Zope-dev] Strange behavior in modifying properties In-Reply-To: <01JI4PGS0KS28WW6ZO@FSW.LEIDENUNIV.NL> Message-ID: <4.2.0.58.19991109112203.00b23ee0@lisp.atmm.nl> At 10:30 09/11/99 , Rik Hoekstra wrote: >Today I was experimenting a little with inserting and deleting from lines >properties (though I see no reason why this would not apply to other >properties. There was some strange behavior with modifying lists from dtml. >The method was as follows: > > > > > > > > >where lst is a property of the containing folder. The proper way to do this >would be to make a local copy of the list and replacing the property with >it, but that's not the point. > >Now, as far as I'm aware this method should have no effect on the properties >of the folder, or is it. But is has: it changes the property and it seems to >have a permanent effect. >But, as it is not a completed transaction changes are undone if ZServer is >closed down. > >A few questions: >- has anyone seen this as well >- could someone explain me how this works >- is this a bug or a feature >- if it is a feature - could someone show me its use You are modifying a mutable list, something the ZODB doesn't detect. This is a documented shortcoming of the Persistence mechanism. If you make a copy of the list, and put that copy back using editProperties or some such API method, the change will be detected and made persistent. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From gtk@well.com Mon Nov 8 23:39:36 1999 From: gtk@well.com (gtk) Date: Tue, 9 Nov 1999 10:39:36 +1100 Subject: [Zope-dev] @#$%^&*( Zope Concurrency References: Message-ID: <009f01bf2a43$038cd580$0b01010a@beetlejuice> > Do the '404' errors you get contain the text 'the requested Zope resource' > or something different? I'd have to check. Mainly, I get spurious-looking "you didn't supply this property" errors, which someone (can't remember who) said was a bug. > > - This seriously limits Zope's usability for write-intensive tasks like > > conferencing > > Unless you run in single thread mode (*duck*) I'm not hugely fond of that idea, no. :) Regards, Garth. -- From pje@telecommunity.com Tue Nov 9 13:47:01 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Tue, 09 Nov 1999 08:47:01 -0500 Subject: [Zope-dev] @#$%^&*( Zope Concurrency In-Reply-To: <006101bf2a21$5011e2a0$0b01010a@beetlejuice> Message-ID: <199911091347.FAA21775@zope.codeit.com> At 06:39 AM 11/9/99 +1100, gtk wrote: >Bait: I am willing to SPEND MONEY to get this bastard solved. Me too. That's why my company is paying DC for some consulting work in this area, although at this point just to discuss possible solutions to this and related subjects. >- The retry mechanism doesn't work >- The user sees extremely messy errors These sounds to me like bug(s), which I'm sure the DC folks will fix once they're sufficiently pinned down. >- This seriously limits Zope's usability for write-intensive tasks like >conferencing >- Since all of my plans are for write-intensive tasks, that makes me >uncomfortable Ditto. Ty Sarna and I have done some extensive analysis and testing of ZODB and have found pretty much the same. Any write-intensive data structure will have conflict issues. We came up with several ideas for solutions, but they all require changes to the ZODB architecture, either to allow a lock to be placed on a persistent object (which would be held to the end of the transaction, and guarantee that the in-memory version for that thread was up-to-date), to delay certain operations until a different transaction phase, or to allow objects to be given a chance to resolve conflicts by themselves (e.g. serialize writes that don't really conflict.) This is why we're consulting with DC; to find out which approaches are most feasible. (Side note: DC themselves have noted that currently they recommend that people use external databases for write-intensive objects.) >- Zope cannot deal with overlapping modifications to one object >- That includes adding children to containers Yep. This also includes Catalogs, unfortunately. >I've spent my last 24 hours of work on Zope trying to figure out where to >hack in any kind of method-aware queueing which could -- at its most >simple -- simply not attempt to place more than one call to an object at >once. From there, I'd be able to hack the routine for more subtlety. It's not quite that simple. Technically, you'd need all the fundamental ZODB interfaces (Connection, Database, and Storage) to support a lock() operation, which would store the appropriate information at that level, and be removed upon termination (successful or otherwise) of the transaction. It's also probable that you'd need deadlock checking. From michel@digicool.com Tue Nov 9 16:08:19 1999 From: michel@digicool.com (Michel Pelletier) Date: Tue, 09 Nov 1999 11:08:19 -0500 Subject: [Zope-dev] Re: [Zope] Virtual hosting with ZServer References: <4.2.0.58.19991109112401.00bd9c90@lisp.atmm.nl> <4.2.0.58.19991109112401.00bd9c90@lisp.atmm.nl> <4.2.0.58.19991109115517.03e5c220@lisp.atmm.nl> Message-ID: <382846F3.B10FE998@digicool.com> Martijn Pieters wrote: > > No, you'll run into trouble with Zope's need to have sites starting at it's > root Folder. People are working on work-arounds for this. One way that > seems to work for people is Evan Simpson's SiteAccess product: > > http://www.zope.org/Members/4am/SiteAccess > > It's release information will tell you how it can be used. I just finished an alpha stab at virtual hosting, ala SiteAccess in Zope. It apears to work well, and is much simpler than Evan's product, since it was possible for us to modify ZPublisher ;). Essentally, it consists of two new features in the infrastructure, first, a 'setSite' method on the REQUEST object that resets all the URLx and BASEx variables, and second we made 'absolute_url()' recursive, so that terminating a URL path from object to root can be done by an intervening SiteObject with not need to maintain lists of path elements etc. that SiteAccess had to do. Many of the idea of SiteObjects came from SiteAccess, Evan has written a nifty product. Once caveat however, in order for Evan to do the things he did, he has the dynamically patch methods in ZPublisher and the REQUEST object. If you use the SiteAccess product, your Zope could concivably break if you upgraded to a new version and we changed the semantics of the methods that Evan patches. In either case, 'official' virtual hosting, ala siteAccess, will be in 2.2. -Michel From Brian@digicool.com Tue Nov 9 15:38:37 1999 From: Brian@digicool.com (Brian Lloyd) Date: Tue, 9 Nov 1999 10:38:37 -0500 Subject: [Zope-dev] manage_addDTMLMethod/Document taking contents as a rgument? Message-ID: <613145F79272D211914B0020AFF6401914DD2E@gandalf.digicool.com> > Is there any reason why manage_addDTMLMethod/Document doesn't > accept the > new contents as anything other than a file object? > > Is something like the following acceptable? > > - def addDTMLDocument(self, id, title='', file='', > REQUEST=None, submit=None): > + def addDTMLDocument(self, id, title='', file='', data=None, > REQUEST=None, > + > submit=None): > """Add a DTML Document object with the contents of file. If > 'file' is empty, default document text is used. > """ > if type(file) is not type(''): file=file.read() > - if not file: file=default_dd_html > + if not file: > + if data is not None: > + file=data > + else: > + file=default_dd_html > ob=DTMLDocument(file, __name__=id) > ... Actually, file may be either a file object *or* a string - you should just be able to do: self.addDTMLDocument('MyDoc', title='MyTitle', file='my data...') Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From dsh@magma-da.com Tue Nov 9 21:55:11 1999 From: dsh@magma-da.com (David S. Harrison) Date: Tue, 09 Nov 1999 13:55:11 -0800 Subject: [Zope-dev] Asking for the type of a variable Message-ID: <3828983F.54632CEA@magma-da.com> It looks like I need to ask for the type of a python variable from DTML. So far, I haven't been able to get this to work: I am trying to see if the TAG variable is a string. Zope complains about "type". I tried using the special name space: But it looks like "type" is not a function available through that means. Is there another way to use the type of a variable for branching? Actually, the reason this arises is forms. I have a series of radio buttons in a form. When submitted to Zope, I notice that if one item is selected, the value is a string. When many items are selected, the value is a list of strings. Since does not accept a single string as an argument, I need to test to see if the incoming value is a string or a list of strings before processing it. I will gladly accept any better idioms for handling this case. The tests certainly make the DTML code more complex than I think it should be. David S. Harrison (dsh@magma-da.com) From hannu@tm.ee Tue Nov 9 22:08:44 1999 From: hannu@tm.ee (Hannu Krosing) Date: Wed, 10 Nov 1999 00:08:44 +0200 Subject: [Zope-dev] Asking for the type of a variable References: <3828983F.54632CEA@magma-da.com> Message-ID: <38289B6C.120556D7@tm.ee> "David S. Harrison" wrote: > Actually, the reason this arises is forms. I have a series of radio > buttons in a form. When submitted to Zope, I notice that if one item > is selected, the value is a string. When many items are selected, > the value is a list of strings. then it's most likely a checkbox ? > Since does not accept a > single string as an argument, I need to test to see if the incoming > value is a string or a list of strings before processing it. I will > gladly accept any better idioms for handling this case. set the name to myradiobutton:list , i.e or for numeric values > The tests > certainly make the DTML code more complex than I think it should be. Sure ;) -------------- Hannu From pavlos@gaaros.msrc.sunysb.edu Tue Nov 9 22:13:59 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Tue, 9 Nov 1999 17:13:59 -0500 (EST) Subject: [Zope-dev] Asking for the type of a variable In-Reply-To: <3828983F.54632CEA@magma-da.com> Message-ID: On Tue, 9 Nov 1999, David S. Harrison wrote: > > Actually, the reason this arises is forms. I have a series of radio > buttons in a form. When submitted to Zope, I notice that if one item > is selected, the value is a string. When many items are selected, > the value is a list of strings. Since does not accept a > single string as an argument, I need to test to see if the incoming > value is a string or a list of strings before processing it. I will You can just append :list to your variable in the Form and it will automatically get converted to a list. Then you can use even for one item. Pavlos From lstafford@icompression.com Tue Nov 9 22:14:47 1999 From: lstafford@icompression.com (Loren Stafford) Date: Tue, 9 Nov 1999 14:14:47 -0800 Subject: [Zope-dev] Asking for the type of a variable In-Reply-To: <3828983F.54632CEA@magma-da.com> Message-ID: <000a01bf2aff$d56ed1e0$8b0127d8@eagle.icompression.com> You need to look at: http://www.zope.org/Members/Zen/howto/FormVariableTypes Use :list to make your form field a list, no matter how many entries it has. -- Loren > -----Original Message----- > From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf > Of David S. Harrison > Sent: Tuesday, November 09, 1999 13:55 > To: zope-dev@zope.org > Subject: [Zope-dev] Asking for the type of a variable > > > > It looks like I need to ask for the type of a python variable from DTML. > So far, I haven't been able to get this to work: > > > > I am trying to see if the TAG variable is a string. Zope complains about > "type". I tried using the special name space: > > > > But it looks like "type" is not a function available through that means. > Is there another way to use the type of a variable for branching? > > Actually, the reason this arises is forms. I have a series of radio > buttons in a form. When submitted to Zope, I notice that if one item > is selected, the value is a string. When many items are selected, > the value is a list of strings. Since does not accept a > single string as an argument, I need to test to see if the incoming > value is a string or a list of strings before processing it. I will > gladly accept any better idioms for handling this case. The tests > certainly make the DTML code more complex than I think it should be. > > David S. Harrison > (dsh@magma-da.com) > From mj@antraciet.nl Tue Nov 9 22:11:42 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Tue, 09 Nov 1999 23:11:42 +0100 Subject: [Zope-dev] Asking for the type of a variable In-Reply-To: <3828983F.54632CEA@magma-da.com> Message-ID: <4.2.1.10.19991109230930.027e7e20@212.48.38.34> At 22:55 9-11-99 , David S. Harrison wrote: >Actually, the reason this arises is forms. I have a series of radio >buttons in a form. When submitted to Zope, I notice that if one item >is selected, the value is a string. When many items are selected, >the value is a list of strings. Since does not accept a >single string as an argument, I need to test to see if the incoming >value is a string or a list of strings before processing it. I will >gladly accept any better idioms for handling this case. The tests >certainly make the DTML code more complex than I think it should be. I take it you mean checkboxes. Just append the :list modifier to the checkbox name, and it will always be a list, wether the user selected zero, one, or more checkboxes: Magazine
    Book
    EZine (email magazine)
    -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From dsh@magma-da.com Tue Nov 9 22:14:40 1999 From: dsh@magma-da.com (David S. Harrison) Date: Tue, 09 Nov 1999 14:14:40 -0800 Subject: [Zope-dev] Asking for the type of a variable References: <3828983F.54632CEA@magma-da.com> <38289B6C.120556D7@tm.ee> Message-ID: <38289CD0.E13F9F2E@magma-da.com> Hannu Krosing wrote: > set the name to myradiobutton:list , i.e > > > Interesting. I didn't see any coverage for this kind of thing in the content guide or the DTML guide. Is there someplace else I should look to see what kinds of things are supported as types in forms? David S. Harrison (dsh@magma-da.com) From hannu@tm.ee Tue Nov 9 22:21:51 1999 From: hannu@tm.ee (Hannu Krosing) Date: Wed, 10 Nov 1999 00:21:51 +0200 Subject: [Zope-dev] Asking for the type of a variable References: <3828983F.54632CEA@magma-da.com> <38289B6C.120556D7@tm.ee> <38289CD0.E13F9F2E@magma-da.com> Message-ID: <38289E7F.A987C0A4@tm.ee> "David S. Harrison" wrote: > > Hannu Krosing wrote: > > set the name to myradiobutton:list , i.e > > > > > > > > Interesting. I didn't see any coverage for this kind of thing in > the content guide or the DTML guide. Is there someplace else > I should look to see what kinds of things are supported as > types in forms? For some obscure reason this info is hidden in Zope SQL Methods manual more exactly in file ZSQL.1.4.2.html ;) ------------ Hannu From zen@cs.rmit.edu.au Wed Nov 10 05:58:49 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Wed, 10 Nov 1999 16:58:49 +1100 (EST) Subject: [Zope-dev] Asking for the type of a variable In-Reply-To: <38289CD0.E13F9F2E@magma-da.com> Message-ID: On Tue, 9 Nov 1999, David S. Harrison wrote: > > set the name to myradiobutton:list , i.e > > > > > > > > Interesting. I didn't see any coverage for this kind of thing in > the content guide or the DTML guide. Is there someplace else > I should look to see what kinds of things are supported as > types in forms? There is a HowTo on this, stolen from old Documentation by Jim Fulton: http://www.zope.org/Members/Zen/howto/FormVariableTypes ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From Victor.Zhai@ogilvy.com Wed Nov 10 08:30:05 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Wed, 10 Nov 1999 16:30:05 +0800 Subject: [Zope-dev] How to Access existing objects of It's own? Message-ID: Hi: I I have encountered a problerm that must be resolved right now. One method of My Object want to change the existing object of it's own.For example: In the container Object,each object in it has a attribute name :Name: which has a original value,But later I want to change All the Name of each object, Whick method can help. I do it like this: for id in self.objectItems(): o=getattr(self, id) try: o.sortflag = 'date_created' #I want to change all object value: "sortflag". except: pass Thanks a lot in advance. "WorldSecure Server " made the following annotations on 11/10/99 03:24:02 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From petrilli@digicool.com Wed Nov 10 13:28:34 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Wed, 10 Nov 1999 08:28:34 -0500 Subject: [Zope-dev] Asking for the type of a variable In-Reply-To: <3828983F.54632CEA@magma-da.com> Message-ID: On 11/9/99 4:55 PM, David S. Harrison at dsh@magma-da.com wrote: > > It looks like I need to ask for the type of a python variable from DTML. > So far, I haven't been able to get this to work: > > > > I am trying to see if the TAG variable is a string. Zope complains about > "type". I tried using the special name space: > > BTW, the reason 'type' isn't in the name space is security related and has to do with what 'type' returns (the base abstract class in Python), and the ability you could then have to modify things that you shouldn't. We've thought a lot about what would be useful, perhaps just returning the stringified version of it's class info. Dunno, ideas? Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From evan@4-am.com Wed Nov 10 15:31:29 1999 From: evan@4-am.com (Evan Simpson) Date: Wed, 10 Nov 1999 15:31:29 +0000 Subject: [Zope-dev] Asking for the type of a variable References: Message-ID: <38298FD1.35EF123D@4-am.com> Christopher Petrilli wrote: > On 11/9/99 4:55 PM, David S. Harrison at dsh@magma-da.com wrote: [snip] > Since I've hardly ever seen 'type' used *except* in this exact kind of construction, how about a standard namespace function: def same_type(a, b): return type(a) == type(b) which would allow . It could even be extended to fall back to meta_type on ExtensionClasses, but it's nice and simple as is. Cheers, Evan @ 4-am From hoekstra@fsw.LeidenUniv.nl Wed Nov 10 15:46:13 1999 From: hoekstra@fsw.LeidenUniv.nl (Rik Hoekstra) Date: Wed, 10 Nov 1999 16:46:13 +0100 Subject: [Zope-dev] Using DTML is too difficult (was: [Zope] DTML Syntax contd. + rant) In-Reply-To: <382953E4.970A6881@vet.uu.nl> Message-ID: <01JI6GVMKCO28WWG4Y@FSW.LEIDENUNIV.NL> Martijn, I _really_ like Zope, but I am afraid I have to agree with you. I'll add some more rant. I believe it's important to stress that this is _not_ meant as criticism per se, but only to point out what even for people who have used ZOpe for almost a year are major flaws in its usability. And I can vote for Martijn, that he's not stupid; I myself have the excuse of not coming from a computer science background, but still I rabble on. > Philosophical end rant: > > If I ever get the time I'd be tempted to work on a DTML 'cleanup' > project. DTML is currently *far* too much like Perl and not enough like > Python. *some* easy things are very easy, but as a consequence some > other easy things become far too hard, or at least look far too > complicated. You can spell the same thing in too many ways. The > community encourages and praises additions for convenience (like the > 'default' option, or the new extended &entity; syntax) but as a result > DTML loses its conceptual integrity. It becomes too big and not easy to > understand. > > I understand the argument that DTML shouldn't be used for complicated > purposes, and that you should use Python. This is fine and good, but in > practice people *do* use DTML for complicated purposes. ZClasses in fact > encourage this. The point is that it's not always clear when things are complicated. And using python for complicated tasks is not exactly a piece of cake either, for a number of reasons. - writing products in python is complicated and mostly not worth it - writing python base classes for ZClasses is easier, but using them in the Z framework requires quite a bit of understanding of ZClasses and the Zope framework in general - External methods are much easier, but they have their own disadvantages: (1) it is less than obvious how they interact with the dtml methods/namespace they are called from (2) they are not easily transported to another machine, because you need physical access to the filesystem for that (I understand that that's the only way) > > DTML should be more like Python. Yes > Luckily the Zope framework does allow > new objects to be plugged in using something else than DTML, so not all > hope is lost. :) But it should be easier to use this stuff (do I hear the word developer documentation??? uuummm) > > Feedback on this rant would be appreciated. My 2 cents. Rik From akuchlin@mems-exchange.org Wed Nov 10 16:15:19 1999 From: akuchlin@mems-exchange.org (Andrew M. Kuchling) Date: Wed, 10 Nov 1999 11:15:19 -0500 (EST) Subject: [Zope-dev] Using DTML is too difficult In-Reply-To: <01JI6GVMKCO28WWG4Y@FSW.LEIDENUNIV.NL> References: <382953E4.970A6881@vet.uu.nl> <01JI6GVMKCO28WWG4Y@FSW.LEIDENUNIV.NL> Message-ID: <14377.39447.652624.322668@amarok.cnri.reston.va.us> Rik Hoekstra writes: >(quoting Martijn) >> If I ever get the time I'd be tempted to work on a DTML 'cleanup' >> project. DTML is currently *far* too much like Perl and not enough like >> Python. *some* easy things are very easy, but as a consequence some >> other easy things become far too hard, or at least look far too >> complicated. You can spell the same thing in too many ways. The >> community encourages and praises additions for convenience (like the >> 'default' option, or the new extended &entity; syntax) but as a result >> DTML loses its conceptual integrity. It becomes too big and not easy to >> understand. Amusingly, Greg Ward, the resident Perl expert here, made the same comparison after working with Zope for a while, and I can see his point. There are lots of default behaviours that usually do the Right Thing, but when they aren't what you want, it can be hard to figure out what's going on. When things do go wrong, you don't have a lot of diagnostic tools to pin down the problem; what's my namespace stack look like? Developing Zope stuff, I find I'm often inserting "return repr(someobject)" into ExternalMethods to check on variable values; a Web-based namespace + variable browser would be helpful. DTML is beautiful when the problem maps nicely to existing DTML constructs; however, once you start wanting to add lots of complicated behaviour, you have to start writing Python code, and for writing Python code, the Zope development environment has drawbacks, ably listed by Rik: >- writing products in python is complicated and mostly not worth it >- writing python base classes for ZClasses is easier, but using them in the >Z framework requires quite a bit of understanding of ZClasses and the Zope >framework in general >- External methods are much easier, but they have their own disadvantages: > (1) it is less than obvious how they interact with the dtml >methods/namespace they are called from > (2) they are not easily transported to another machine, because you >need physical access to the > filesystem for that (I understand that that's the only way) Security is, I think, part of the reason that DTML is a sandbox; if someone gets your Zope management password, they can edit your pages and run SQL commands in your database, but they can't do 'rm -rf /', because they can't install ExternalMethods or classes without access to the machine's filesystem, and there's no way to do such things from DTML. I'm not sure what the fix is: a hypothetical ngDTML, which is different from DTML and would provide more of Python's power? Better debugging tools and support with Zope? Better support for developing and debugging your code outside of the Zope server? I think the solution lies more with the latter two options; ngDTML would be difficult to design, and it might be easy to repeat the same mistakes. Let me hasten to add that this isn't Zope-bashing. We also use Java servlets using Apache's mod_jserv. Servlets have all of the same problems, with some additional ones: 1) Instead of a fast interpreter, you get to run the slow "javac" every time you make a change. 2) No standard solution for HTML templating. Sun has JSP, but they mix your Java code with the HTML, which is a design mistake that we're trying to get away from! 3) Instead of writing L = ['material', 'substrate'] in Python, you get to write: import java.lang.Vector; ... Vector L = new Vector(); L.addElement( "material" ); L.addElement( "substrate" ); (Why people think a systems language like Java is appropriate for Web stuff is beyond me.) 4) All those useful #in and #tree tags? Not there -- start writing your own! 5) SQL queries? Start writing JDBC code... try { ResultSet rs = doSelect(query); if (rs.next()) return new Integer(rs.getInt(1)); } catch (SQLException e) { throw new DatabaseCriticalException("Error accessing ResultSet in SequenceWrapper.currentVersion().\nQuery: " + qry + "\nException: " + e.getMessage()); } is much easier, obviously. Let me be clear; we're finding that Zope blows other tools out of the water. (If I were to get a management edict that "Zope is out; tool X is in", I'd start tidying up my CV. Such an edict is unlikely, thankfully.) There's just still lots of room for improvement, and we all really care about that. :) -- A.M. Kuchling http://starship.python.net/crew/amk/ "I must confess, I have always wondered what lay beyond life, my dear." "Yeah, everybody wonders. And sooner or later everybody gets to find out." -- Norton I and Death, in SANDMAN #31: "Three Septembers and a January" From evan@4-am.com Wed Nov 10 16:16:00 1999 From: evan@4-am.com (Evan Simpson) Date: Wed, 10 Nov 1999 16:16:00 +0000 Subject: [Zope-dev] PROPOSAL: New SQLDA functionality References: <19991110132218.6798.qmail@mail.kollegie6400.dk> Message-ID: <38299A3F.79B642DB@4-am.com> Steen Suder wrote: > I'm using PostgreSQL 6.5 and Zope 2.x on RH6. > > When inserting a new record in database I'd like to access the return OID > from the INSERT query from within my ZSQL method. > > That is: if it returns anything... psql does return the OID. > > How do I do? Patch ZPyGreSQLDA :-( Since OIDs (and their return from INSERTs) aren't a generic SQL feature, there isn't any general DA support for them. You would have to hack up something in ZPyGreSQLDA to return the OID as thought it were a SELECT result. I've been thinking that it would be useful to change the standard DA machinery a bit to allow individual adapters to return arbitrary data for each SQL statement. Some kind of 'side-car' attribute containing a sequence of server-specific data. This could be used to allow something like: ('statment_xdata' would be a list with one element: {'oid': 15678} constructed from the PostgreSQL return value) Cheers, Evan @ 4-am From Fredrick.Rybarczyk@lub.lu.se Wed Nov 10 16:20:31 1999 From: Fredrick.Rybarczyk@lub.lu.se (Fredrick Rybarczyk) Date: Wed, 10 Nov 1999 17:20:31 +0100 Subject: [Zope-dev] Re: [Zope] Z39.50 References: <01JI6D0KWCTU8WWBXU@FSW.LEIDENUNIV.NL> Message-ID: <38299B4F.F34CCC09@lub.lu.se> Hi Rik, I'm sinking into deeper into a deep pit of dung timewise right now, but I'd really like to do something like this. I also think that zope provides an excellent base for a z39.50 gateway. Most of the machinery is already there. I will try to sketch out a workplan in the beginning of next week (I'm working part-time right now.) but I think these are the main issues of a simple service: 1. Define a way to map a search form query to z39.50 queries. That will require knowledge about the target z39.50 servers so we would need some sort of tool here. 2. Create persistent connections to the target servers.. ..shouldn't be too hard. 3. After sending out the query we need to wait for the result sets and sort them together according to their ranking and user preferences. 4. Present the results. 5. Lots of stuff that I either can't express or type or be bothered with right now :-) 0. Todo all this we need to create a solid session concept -possibly with threads?!? -1. I'm not a crackshot zoper but I'm quite handy with python and c/c++ There aren't much python code out there that I know of but there's a lot of stuff in c:ish languages. Chris, you wrote: """A couple years ago, I worked iwth the freewaissf client libraries, and they're not too bad... I can imagine you might be able to create a new database adapter that would work, similar to how we do LDAP. If you need some ideas, let me know.""" Well, we do need ideas, toss in a few solid concepts and we'll hear you out. Best regards, Fredrick. PS. I'll have a talk about this with the z39.50 dudes around netlab (my work that is).. Rik Hoekstra wrote: > Hello Fredrick, > > Any news on the Z39.50 front? Something from Chris Petrilli > I think Zope could be an ideal vehicle for a Z39.50 gateway, especially when > you want to combine them with other (database) searches, but I have never > quite found a place to start with - doing it all from the bottom up always > seemed a mountain I could not climb - especially as I have not much > experience about Z39.50 and it's so complicated (I do know quite a bit more > about python and Zope, though). > > I have been looking at the research area of your website, and was quite > impressed with the projects there. It seems you would have interesting ideas > on the integration of a z39.50 gateway in Zope. > > greetings, > > Rik Hoekstra > > Faculty of Social Science Library > Leiden University > email: hoekstra@fsw.leidenuniv.nl -- +-----------------------------------------------------+ | Fredrick Rybarczyk voice +46 46 222 9369 | | Research Engineer fax +46 46 222 3682 | | LUB NetLab http://www.lub.lu.se/~fredrick/ | +-----------------------------------------------------+ From m.faassen@vet.uu.nl Wed Nov 10 16:33:09 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Wed, 10 Nov 1999 17:33:09 +0100 Subject: [Zope-dev] Re: Using DTML is too difficult (was: [Zope] DTML Syntax contd. + rant) References: <01JI6GVMKCO28WWG4Y@FSW.LEIDENUNIV.NL> Message-ID: <38299E45.E5BA68B0@vet.uu.nl> Hi people, Ah, you're replying to my rant here. :) Rik Hoekstra wrote: [snip] > I _really_ like Zope, me too, no question. > but I am afraid I have to agree with you. I agree with myself too. :) > I'll add > some more rant. I believe it's important to stress that this is _not_ meant > as criticism per se, but only to point out what even for people who have > used ZOpe for almost a year are major flaws in its usability. And I can vote > for Martijn, that he's not stupid; I myself have the excuse of not coming > from a computer science background, but still I rabble on. Thanks for your vote of non-stupidity. :) > > Philosophical end rant: > > > > If I ever get the time I'd be tempted to work on a DTML 'cleanup' > > project. DTML is currently *far* too much like Perl and not enough like > > Python. *some* easy things are very easy, but as a consequence some > > other easy things become far too hard, or at least look far too > > complicated. You can spell the same thing in too many ways. The > > community encourages and praises additions for convenience (like the > > 'default' option, or the new extended &entity; syntax) but as a result > > DTML loses its conceptual integrity. It becomes too big and not easy to > > understand. > > > > I understand the argument that DTML shouldn't be used for complicated > > purposes, and that you should use Python. This is fine and good, but in > > practice people *do* use DTML for complicated purposes. ZClasses in fact > > encourage this. > > The point is that it's not always clear when things are complicated. And > using python for complicated tasks is not exactly a piece of cake either, > for a number of reasons. > - writing products in python is complicated and mostly not worth it Though this is getting easier in the newer Zopes. Or I'm learning more about it. I highly recommend the 'Boring HOWTO' in this regard, by the way. > - writing python base classes for ZClasses is easier, but using them in the > Z framework requires quite a bit of understanding of ZClasses and the Zope > framework in general Yes, this is pretty easy, but (as Amos remarked in his slides), distribution is currently difficult. Also if something goes wrong you can end up with objects in weird states which you can't delete. And it's true they could probably be simplified (or the documentation improved) so that still less understanding about Zope's inner details is necessary. > - External methods are much easier, but they have their own disadvantages: > (1) it is less than obvious how they interact with the dtml > methods/namespace they are called from > (2) they are not easily transported to another machine, because you > need physical access to the > filesystem for that (I understand that that's the only way) Though you can say the same for Products and ZClasses for Python base classes. Python Methods are cool. I haven't played a lot with them as I'm working on a production site, but I intend to play with them more. > > > > DTML should be more like Python. > > Yes > > > Luckily the Zope framework does allow > > new objects to be plugged in using something else than DTML, so not all > > hope is lost. :) > > But it should be easier to use this stuff (do I hear the word developer > documentation??? uuummm) It's not only documentation though. The 'with' issue that caused me to rant is simply not consistent enough. There are more places in DTML where it is like this. The _[_['sequence-item']] style constructions are also obfuscatory. > > Feedback on this rant would be appreciated. > > My 2 cents. Thanks! Regards, Martijn From m.faassen@vet.uu.nl Wed Nov 10 16:48:29 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Wed, 10 Nov 1999 17:48:29 +0100 Subject: [Zope-dev] Using DTML is too difficult References: <382953E4.970A6881@vet.uu.nl> <01JI6GVMKCO28WWG4Y@FSW.LEIDENUNIV.NL> <14377.39447.652624.322668@amarok.cnri.reston.va.us> Message-ID: <3829A1DD.401095F6@vet.uu.nl> Ah, more people replying to my rant. Thanks! "Andrew M. Kuchling" wrote: [I say DTML is too much like Perl] > Amusingly, Greg Ward, the resident Perl expert here, made the same > comparison after working with Zope for a while, and I can see his > point. There are lots of default behaviours that usually do the Right > Thing, but when they aren't what you want, it can be hard to figure > out what's going on. Right. And often things are spelled in rather nasty ways. Note that it is great that you *can* spell them at all. DTML is undoubtely extremely powerful. > When things do go wrong, you don't have a lot of > diagnostic tools to pin down the problem; what's my namespace stack > look like? Developing Zope stuff, I find I'm often inserting "return > repr(someobject)" into ExternalMethods to check on variable values; a > Web-based namespace + variable browser would be helpful. As another trick you can raise an exception. I've used this to debug products and such. A nice browser would definitely help, though. > DTML is beautiful when the problem maps nicely to existing DTML > constructs; Agreed. Today my coworker wanted a list sorted alphabetically. That was just a question of adding 'sort=title' to the in tag and it worked. About a minute work. That's great. We shouldn't lose that. [discussion of drawbacks of writing Python] I comment on this in my reply to Rik's post. > Security is, I think, part of the reason that DTML is a sandbox; if > someone gets your Zope management password, they can edit your pages > and run SQL commands in your database, but they can't do 'rm -rf /', > because they can't install ExternalMethods or classes without access > to the machine's filesystem, and there's no way to do such things from > DTML. Don't forget Zope's powerful security delegation features as well. Someone who is only a local manager is unable to mess up the rest of the site. DTML security is good here too. > I'm not sure what the fix is: a hypothetical ngDTML, which is > different from DTML and would provide more of Python's power? I think a start from scratch with a 'ngDTML' would definitely be a good approach, in time. It could still look and feel very similar to current DTML, but be more consistent and simpler. Current powerful but adhoc constructs should be generalized or moved into a 'library' somehow. > Better > debugging tools and support with Zope? This would help too. > Better support for developing > and debugging your code outside of the Zope server? This would help too. > I think the > solution lies more with the latter two options; Definitely the latter two options, combined with more and better documentation would be the best short term approach, but I don't think the current evolution of DTML is good in the long term. > ngDTML would be > difficult to design, and it might be easy to repeat the same mistakes. Definitely it wouldn't be an easy thing to design. But I think this is a solution we should definitely look at for the longer term. > Let me hasten to add that this isn't Zope-bashing. [snip] This isn't either. Zope is cool! Regards, Martijn From reedstrm@wallace.ece.rice.edu Wed Nov 10 18:18:30 1999 From: reedstrm@wallace.ece.rice.edu (Ross J. Reedstrom) Date: Wed, 10 Nov 1999 12:18:30 -0600 Subject: [Zope-dev] PostgreSQL and Zope (was Re: [Zope] Summary of DB Discussion) In-Reply-To: <19991109183119.P6619@feynman.florin>; from Karl Fast on Tue, Nov 09, 1999 at 06:31:19PM -0600 References: <19991109183119.P6619@feynman.florin> Message-ID: <19991110121830.A22493@wallace.ece.rice.edu> On Tue, Nov 09, 1999 at 06:31:19PM -0600, Karl Fast wrote: > > - There are DA's for MySQL and PostgreSQL, the two open source databases > (yeah, yeah, MySQL isn't truly open source--although one of the older > version is). They work, although both are still in development (is this > active?) and some people have had troubles getting them to compile. > This seems especially true of the MySQL DA judging from pleas for help > sent to the zope list, although this may be more of a reflection of > MySQL's popularity over PostgreSQL. Since there have been a number of posts recently in the "works for me" catagory, I like to think it reflects fewer problems. ;-) > > - DC is looking for someone in the zope community to take ownership of > the MySQL DA (what's the status of the PostgreSQL DA?) > Other have addressed some of these points. Since the PostgreSQL DA is on my Zope member page, I thought I should comment on the current state of development. I recently took some vacation: just before I left, the original author of the ZPyGreSQLDA resurfaced in email. Since I've been back, I haven't caught up at paying work, so progress on the DA has suffered. The biggest problem has been that my project at work has gone completely ColdFusion (Zope wasn't there early enough), although we do use PostgreSQL. So I haven't been able to justify much daytime work on it. The biggest problem is probably that I've written many more lines of Tcl than Python, so I'm climbing more than one learing curve at a time. (What I could really use is some good open source time and project management software. Anyone have any recommendations? And what happened to the ZopeCalendar <-> PalmPilot conduit project? ) My experience with the PostgreSQL developers and mailing lists are very similar to the Zope lists: lots of clueful, helpful people (some of them are the same people ;-) Bugs exist (what software is perfect?), but get diagnosed and fixed very rapidly. Features are added (and limitations removed) on a weekly basis. I get the feeling that the pgsql project has turned a corner in the last year or two: the code base has been cleaned up, making it easier to understand, and contribute code. New developers are being attracted, and quickly becoming contributers. It feels like it's reaching critical mass. The pgsql-hackers list reminds me of the linux-kernel list from about '92 or so, in that respect. If you haven't looked at PostgreSQL since it's Postgres95 days, it's definitely time to look again. To get this back on topic for the Zope lists, in particular, I think DC should take a serious look at it: the licenses are compatible (pgsql is Berkeley software, after all) and the corporate attitudes are compatible. (The core developers recently formed PostgreSQL, Inc. and are learning how to be a business, as well as a project: could probably use some pointers from you folks ;-) As another poster mentioned, pgsql is an EORDBMS: Extensible Object Relational DBMS, and not only because you get the source. Building a ZStore for the ZODB on top of PostgreSQLs object features should be easier that relying totally on relational calculus, and might reveal some interesting synergies. If I could unleash the crystal ball (rose tinted), I can see future where Zope and PostgreSQL are the defacto next generation tools for web applications, taking over from perl and MySQL as more critical, core business functions move to the web. Boy, now that I've expressed all that in words, I better get cracking on that DA, shouldn't I? Now that 2.0 seems to have settled down a little, (and 2.1 is in beta) any one want to take a crack at helping? Patches always welcome! Ross -- Ross J. Reedstrom, Ph.D., NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005 From reedstrm@wallace.ece.rice.edu Wed Nov 10 19:14:57 1999 From: reedstrm@wallace.ece.rice.edu (Ross J. Reedstrom) Date: Wed, 10 Nov 1999 13:14:57 -0600 Subject: [Zope-dev] HP E-speak and XML-RPC Message-ID: <19991110131457.A24187@wallace.ece.rice.edu> Hey Zopistas: Just ran across this from cnet (via slashdot): "HP releases code to e-commerce software" It's about HP's 'Espeak' web commerce/interaction/standard gizmo-what-have-you. From 30,000 feet, the intent looks like something that could be fulfilled with some defined XML-RPC. Anyone here know enough about the two to know how they would interact/compare? Does Espeak define a wire protocol? Would this be something to fold into Medusa? Uninformed minds want to know! Ross -- Ross J. Reedstrom, Ph.D., NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005 From hannu@tm.ee Wed Nov 10 20:37:16 1999 From: hannu@tm.ee (Hannu Krosing) Date: Wed, 10 Nov 1999 22:37:16 +0200 Subject: [Zope-dev] PostgreSQL and Zope (was Re: [Zope] Summary of DB Discussion) References: <19991109183119.P6619@feynman.florin> <19991110121830.A22493@wallace.ece.rice.edu> Message-ID: <3829D77C.ECFB9F4D@tm.ee> "Ross J. Reedstrom" wrote: > > If you haven't looked at PostgreSQL since it's Postgres95 days, it's > definitely time to look again. To get this back on topic for the Zope > lists, in particular, I think DC should take a serious look at it: > the licenses are compatible (pgsql is Berkeley software, after all) and > the corporate attitudes are compatible. (The core developers recently > formed PostgreSQL, Inc. and are learning how to be a business, as well as > a project: could probably use some pointers from you folks ;-) As another > poster mentioned, pgsql is an EORDBMS: Extensible Object Relational DBMS, > and not only because you get the source. Building a ZStore for the ZODB on > top of PostgreSQLs object features should be easier that relying totally > on relational calculus, and might reveal some interesting synergies. Apart from being EORDBMS, it has another nice feature that could (or even should ?) be used in DA and possibly even in ZODB-over-PostgreSQL, namely the LISTEN/NOTIFY that could be used (combined with triggers) both for determining cache'ing times for queries and synchronizing shared ZODB for multiple Zope frontends. And one more thing that maybe is no different from MySQL, but still important for some - PostgreSQL is used in projects storing tens or even hundreds of Gigabytes. > > If I could unleash the crystal ball (rose tinted), I can see future > where Zope and PostgreSQL are the defacto next generation tools for > web applications, taking over from perl and MySQL as more critical, > core business functions move to the web. Yess! PostgreSQL 7.0 + Zope 2.2 = PostgreSQL 8i :) > > Boy, now that I've expressed all that in words, I better get cracking on > that DA, shouldn't I? Now that 2.0 seems to have settled down a little, > (and 2.1 is in beta) any one want to take a crack at helping? I've sent one additional method for query_result object to D'Arcy that returns more detailed info about types and sizes/precisions of returned data. If it does not appear in _pgmodule but you need it in improving the DA I may send it directly to you. There was also another patch (not by me)that returned NULL's as None's (instead of '' or 0). >Patches always welcome! My current biggest gripes are some missing types in Zope (Time and BigDecimal, pure DATE (without the 12.00 time part) would also be nice), that can't be remedied by just improving the DA. And the _pgmodule still lacks some functionality of libpq (like decoupling sending query and receiving the result), so I guess that better database (PostgreSQL) integration requires patches to all three - Zope, ZPgSQLDA,and PyGreSQL. ----------- Here I also take the opportunity to once again ask the Zope-dev list : What do people think, If I need both Date, Time and DateTime types, could I just make a product that uses mxDATE to have it or should I patch/replace the builtin Date.py ? If i make a product can I also make the formats work for my new types ? ------------ Hannu From zope@teleo.net Wed Nov 10 20:47:30 1999 From: zope@teleo.net (Patrick Phalen) Date: Wed, 10 Nov 1999 12:47:30 -0800 Subject: [Zope-dev] HP E-speak and XML-RPC In-Reply-To: <19991110131457.A24187@wallace.ece.rice.edu> References: <19991110131457.A24187@wallace.ece.rice.edu> Message-ID: <99111012564203.01820@quadra.teleo.net> I believe Cameron Laird may be contemplating an interview with Rajiv Gupta (chief architect) about the shape and size of Espeak, once the E-services developer's conference is over this week in San Jose. (Python is the Espeak scripting language.). Stayed tuned to the Python list and/or Cameron's Regular Expressions column. [Ross J. Reedstrom, on Wed, 10 Nov 1999]: :: Hey Zopistas: :: Just ran across this from cnet (via slashdot): :: "HP releases code to e-commerce software" :: :: It's about HP's 'Espeak' web commerce/interaction/standard :: gizmo-what-have-you. From 30,000 feet, the intent looks like :: something that could be fulfilled with some defined XML-RPC. :: Anyone here know enough about the two to know how they would :: interact/compare? Does Espeak define a wire protocol? Would :: this be something to fold into Medusa? Uninformed minds want :: to know! :: :: Ross :: -- :: Ross J. Reedstrom, Ph.D., :: NSBRI Research Scientist/Programmer :: Computer and Information Technology Institute :: Rice University, 6100 S. Main St., Houston, TX 77005 :: :: _______________________________________________ :: 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 ) From s341625@student.uq.edu.au Wed Nov 10 21:55:29 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Thu, 11 Nov 1999 07:55:29 +1000 (GMT+1000) Subject: [Zope-dev] Using DTML is too difficult In-Reply-To: <3829A1DD.401095F6@vet.uu.nl> Message-ID: Hi, Noting this interesting discussion I thought I might butt in with some ideas. Firstly, Python Methods are *really* cool! By making them with parameters of [self, REQUEST] you can use them as drop-in replacements for DTML methods/Docs. A lot of the disadvantages mentioned are solved in Python Methods. With regards to a DTML replacement you may wish to look at the ideas expressed in the MFI, XMLWidgets and my never-ending project - VisualZope. VZ works by having a XML Form with namespaces (almost) implemented. Then, by defining widgets in either Zclass/Repository or in the acquisition path of the Form you can define how Form tags are interpreted. This is so useful that I've added a simple "intelligent" version of dtml-var to allow XML forms to be merged together. Basically, Forms are like DTML Documents except that they provide a structured way of modifing other parts of the Form than the area indicated by the tag. So, you can "include" a widget and the divisions will be created, the css sheets merged in and the javascript client-side DOM will be added all automatically. They will all be placed in the correct place without having multiple . We *NEED* behaviours (the equivalent of the MFI selection system I think). For example, if you add the "window" behaviour to the tag above then the behaviour will add in css,division additions to make it look like a MDI window and add javascript code to the constructor to make it draggable, resizable and hiddable. If you then add "ZAMLEditor" behaviour then you can use the XMLWidgets style of editing to edit the contents of this window. Yet another idea is to add the "theme-beos" behaviour before the window behaviour to make the window use the pixmaps etc in the beos theme. By the way - can DigiCool add ZWiki to the Zope.org site? This would be *really* cool for adding group scratchpads for various projects. Cheers, Anthony Pfrunder Computer Systems Engineering University of Queensland From itamars@ibm.net Wed Nov 10 22:28:18 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Thu, 11 Nov 1999 00:28:18 +0200 Subject: [Zope-dev] Using DTML is too difficult References: Message-ID: <3829F182.1D378F1@ibm.net> Anthony Pfrunder wrote: > Firstly, Python Methods are *really* cool! By making them with parameters > of [self, REQUEST] you can use them as drop-in replacements for DTML > methods/Docs. A lot of the disadvantages mentioned are solved in Python > Methods. Not to mention the ability to do some really cool stuff with ZCatalogs (find all items beginning with the letter 'A', searching using metaphone or soundex [I did this, if anyon'es interested], etc.) I can't figure how to do the tag in python, though. -- Itamar - itamars@ibm.net From evan@4-am.com Wed Nov 10 22:59:18 1999 From: evan@4-am.com (Evan Simpson) Date: Wed, 10 Nov 1999 22:59:18 +0000 Subject: [Zope-dev] Using DTML is too difficult References: <3829F182.1D378F1@ibm.net> Message-ID: <3829F8C6.7E56F5A3@4-am.com> Itamar Shtull-Trauring wrote: > Not to mention the ability to do some really cool stuff with ZCatalogs (find > all items beginning with the letter 'A', searching using metaphone or > soundex [I did this, if anyon'es interested], etc.) I can't figure how to > do the tag in python, though. For some uses (such as ), you can substitute local variables. For example, something like could become it = ick.arg.blah print it.thingy it.amethod() Pushing namespaces onto the stack for the use of called methods is quite another matter. You would need code like try: _._push(ick.arg.blah) ... finally: _.pop() and of course this won't work since _push and _pop are private methods. Even if they were properly exposed, I'm not sure how this could be made pretty. Cheers, Evan @ 4-am From s341625@student.uq.edu.au Wed Nov 10 23:05:36 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Thu, 11 Nov 1999 09:05:36 +1000 (GMT+1000) Subject: [Zope-dev] Using DTML is too difficult In-Reply-To: <3829F182.1D378F1@ibm.net> Message-ID: On Thu, 11 Nov 1999, Itamar Shtull-Trauring wrote: [snip] > Not to mention the ability to do some really cool stuff with ZCatalogs (find > all items beginning with the letter 'A', searching using metaphone or > soundex [I did this, if anyon'es interested], etc.) I can't figure how to > do the tag in python, though. --> self.MyStuff.coolstuff(REQUEST) The other way is to "emulate" a dictionary (which is all REQUEST is) and pass that to your Python Method and then use it to look things up. The (yet) other way is to "emulate" an __of__ relationship in the base class and then every attribute acquisition is passed to your class and you can do what you wish in the ZClasses Python Method. Cheers, Anthony Pfrunder Computer Systems Engineering University of Queensland From zen@cs.rmit.edu.au Thu Nov 11 00:11:00 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Thu, 11 Nov 1999 11:11:00 +1100 (EST) Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: <382953E4.970A6881@vet.uu.nl> Message-ID: (Originally to zope, but should have been to zope-dev) On Wed, 10 Nov 1999, Martijn Faassen wrote: > If I ever get the time I'd be tempted to work on a DTML 'cleanup' > project. DTML is currently *far* too much like Perl and not enough like > Python. *some* easy things are very easy, but as a consequence some > other easy things become far too hard, or at least look far too > complicated. You can spell the same thing in too many ways. The > community encourages and praises additions for convenience (like the > 'default' option, or the new extended &entity; syntax) but as a result > DTML loses its conceptual integrity. It becomes too big and not easy to > understand. > > I understand the argument that DTML shouldn't be used for complicated > purposes, and that you should use Python. This is fine and good, but in > practice people *do* use DTML for complicated purposes. ZClasses in fact > encourage this. > > DTML should be more like Python. Luckily the Zope framework does allow > new objects to be plugged in using something else than DTML, so not all > hope is lost. :) > > Feedback on this rant would be appreciated. I'm with you 100%. It makes me feel like I'm programming a reverse polish calculator sometimes :-) A low-level user (one not confidant in writing external methods) shouldn't have use magic constructs like dtml-in is the main culprit - a synonyms for the magic variables that conform to python naming standards need to be created and the old ones depricated. Is there any reason why I should fix this and submit the patch for 2.1? (or 2.2?) Possibly REQUEST needs to be available through aquisition rather than having to be passed to everything. How about print "

    " print html_quote('''The tag is executed, the code contained between the tags simply writing to standard out to produce the rendered version.''') print '''

    This could be done either through stealing from the existing PythonMethods code if it can be proven to be as secure as DTML''' if untrusted_pythonmethods: print '''

    An alternative approach would be to run the code using r_eval. A BastionClass wrapper would be used to protect access to objects - the code would initially only have access to the bastionised _ object, and all the getattr and getitem methods would aquire objects as normal, but return another bastion wrapper instead of the real object.

    Of course, this may be how PythonMethods already works for all I know....''' print '''

    Currently, calling python functions needs to be done through the current namespace, with calls like _.string.split(...). This seems arse over tit - wouldn't it conceptually be better to use a prefix for aquisition? _.standard_html_header() for example - this makes it much clearer IMHO what is going on and easier to grasp. It might be too late in the day to change this however.''' Is existing DTML good enough for 'simple' scripting? I think the current confusion threshold occurs when people start needing to pass parameters to methods (and the whole quoted and unquoted thing kicks in, and suddenly they have to understand about the _ namespace, and the magic variables to pass a DTML method to make it work). - Zen, who is still a bit grumpy today. ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From petrilli@digicool.com Thu Nov 11 00:43:44 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Wed, 10 Nov 1999 19:43:44 -0500 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: Message-ID: On 11/10/99 7:11 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > I'm with you 100%. It makes me feel like I'm programming a reverse polish > calculator sometimes :-) It is sub-optimal, but it is not a programming language, so please don't try and hold it to those standards. DTML is a reporting language, and trying to make it do things it isn't designed to is simply going to further complicate the matter. Things like 'dtml-let' are dangerous in this reguard... they make ou think you actually have a language worth doing anything beyond reporting in. > A low-level user (one not confidant in writing external methods) shouldn't > have use magic constructs like > dtml-in is the main culprit - a synonyms for the magic variables that conform > to python naming standards need to be created and the old ones depricated. > Is there any reason why I should fix this and submit the patch for 2.1? > (or 2.2?) I agree, I don't honestly know why this is done this way. I'll discuss this Monday to see about getting them aliased to 'sequence_item', simply swapping the '-' for a '_'. > How about > Well, if it were my decision, I'd say "over my dead body," but it's not... HOWEVER, I'll fight this personally because I think this makes it more PHPish, and looses the point of the isolation of presentation and logic. DTML is for presentation, not logic. It's simply been moved too much into the logic side because of a lack of something suitable for that application. We are working on this, including talking with Evan Simpson abou bringing PythonMethods in line with what we need to include it out of the box. I would vigorously recommend working on THAT ,rather than trying to make DTML something it isn't designed to be. Always measure something by the scope of its problem domain, not by what people try and use it for. The latter indicates a separate problem enirely. > Is existing DTML good enough for 'simple' scripting? I think the current > confusion threshold occurs when people start needing to pass parameters > to methods (and the whole quoted and unquoted thing kicks in, and suddenly > they have to understand about the _ namespace, and the magic variables to > pass a DTML method to make it work). well, this is beyond the above outlined problem domain. So we have a seperate problem, not a DTML problem, but a lack of a solution problem. I sound a bit harsh, but I'm trying to clarify the problem domain that DTML solves (just as we're trying to be more explicit about the domain ZClasses are designed to solve). It's dangerous to take it outside its problem domain, as it collapses quickly into a morass of tangled code. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From petrilli@digicool.com Thu Nov 11 00:43:51 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Wed, 10 Nov 1999 19:43:51 -0500 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: Message-ID: On 11/10/99 7:11 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > I'm with you 100%. It makes me feel like I'm programming a reverse polish > calculator sometimes :-) It is sub-optimal, but it is not a programming language, so please don't try and hold it to those standards. DTML is a reporting language, and trying to make it do things it isn't designed to is simply going to further complicate the matter. Things like 'dtml-let' are dangerous in this reguard... they make ou think you actually have a language worth doing anything beyond reporting in. > A low-level user (one not confidant in writing external methods) shouldn't > have use magic constructs like > dtml-in is the main culprit - a synonyms for the magic variables that conform > to python naming standards need to be created and the old ones depricated. > Is there any reason why I should fix this and submit the patch for 2.1? > (or 2.2?) I agree, I don't honestly know why this is done this way. I'll discuss this Monday to see about getting them aliased to 'sequence_item', simply swapping the '-' for a '_'. > How about > Well, if it were my decision, I'd say "over my dead body," but it's not... HOWEVER, I'll fight this personally because I think this makes it more PHPish, and looses the point of the isolation of presentation and logic. DTML is for presentation, not logic. It's simply been moved too much into the logic side because of a lack of something suitable for that application. We are working on this, including talking with Evan Simpson abou bringing PythonMethods in line with what we need to include it out of the box. I would vigorously recommend working on THAT ,rather than trying to make DTML something it isn't designed to be. Always measure something by the scope of its problem domain, not by what people try and use it for. The latter indicates a separate problem enirely. > Is existing DTML good enough for 'simple' scripting? I think the current > confusion threshold occurs when people start needing to pass parameters > to methods (and the whole quoted and unquoted thing kicks in, and suddenly > they have to understand about the _ namespace, and the magic variables to > pass a DTML method to make it work). well, this is beyond the above outlined problem domain. So we have a seperate problem, not a DTML problem, but a lack of a solution problem. I sound a bit harsh, but I'm trying to clarify the problem domain that DTML solves (just as we're trying to be more explicit about the domain ZClasses are designed to solve). It's dangerous to take it outside its problem domain, as it collapses quickly into a morass of tangled code. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From robert@leftfieldcorp.com Thu Nov 11 00:54:35 1999 From: robert@leftfieldcorp.com (Robert Leftwich) Date: Thu, 11 Nov 1999 11:54:35 +1100 Subject: [Zope-dev] Generic filtering of objects In-Reply-To: <19991110131457.A24187@wallace.ece.rice.edu> Message-ID: I have a requirement to be able to apply a user-definable filter to all the views on the object database. Obviously this would be best applied at a low a level as possible in order to minimise the impact on the application code and to be made as generic as possible for maximum flexibility. To save re-inventing the wheel, has anyone else had this requirement and if so how did you implement it ? If not, I would love to hear any suggestions on the best way to proceed. For example, are there any hooks in the code to make this easier, can I leverage some pre-existing code to do what I want e.g. the skip-unauthorised is similar in concept to what I want, but it needs to work in all published methods, not just the tree tag. Is the pluggable brain applicable ?, etc. It seems to me that doing something with getattr/getitem would be the most likely scenario, but acquisition might throw a spanner in the works at that level. TIA Robert Leftwich From pavlos@gaaros.msrc.sunysb.edu Thu Nov 11 01:00:11 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Wed, 10 Nov 1999 20:00:11 -0500 (EST) Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: Message-ID: On Wed, 10 Nov 1999, Christopher Petrilli wrote: > > to methods (and the whole quoted and unquoted thing kicks in, and suddenly > > they have to understand about the _ namespace, and the magic variables to > > pass a DTML method to make it work). > > well, this is beyond the above outlined problem domain. So we have a > seperate problem, not a DTML problem, but a lack of a solution problem. Let me add here that in many cases passing arguments to DTML Methods can be avoided if acquisition and factoring are properly employed. Seems to me that newcomers to Zope thing in terms of defining functions and calling them with parameters and thus hitting the namespace issues. Maybe better explanations (with clear examples) are needed to expose acquisition even more. My thoughts ... Pavlos From dsh@magma-da.com Thu Nov 11 01:44:53 1999 From: dsh@magma-da.com (David S. Harrison) Date: Wed, 10 Nov 1999 17:44:53 -0800 Subject: [Zope-dev] Writing results directly back to browser Message-ID: <382A1F95.53579EE@magma-da.com> I have an external method that is capable of generating a PNG image in response to some input data. I would like to use this in the context of Zope to display a computed image on the fly. I am looking for suggestions on a couple of fronts: how can I wire this infrastructure into DTML and how does one write directly back to the browser from an external method? Here are my first guesses on both fronts. For DTML, my thinking is along the following lines: Here, I imagine that "GenerateGraphics" is an external method. I read somewhere (although I can't recall where), that an external method can take RESPONSE as an argument. So, on the second front, I am imagining that the external method uses RESPONSE to set the content type and then writes the results using the RESPONSE.write() method. Am I on the right track here? David S. Harrison (dsh@magma-da.com) From egibson@connect.com.au Thu Nov 11 02:13:16 1999 From: egibson@connect.com.au (Evan Gibson) Date: Thu, 11 Nov 1999 13:13:16 +1100 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: ; from Christopher Petrilli on Wed, Nov 10, 1999 at 07:43:44PM -0500 References: Message-ID: <19991111131316.29038@connect.com.au> On Wed, Nov 10, 1999 at 07:43:44PM -0500, Christopher Petrilli wrote: > On 11/10/99 7:11 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > I'm with you 100%. It makes me feel like I'm programming a reverse polish > > calculator sometimes :-) > > It is sub-optimal, but it is not a programming language, so please don't try > and hold it to those standards. DTML is a reporting language, and trying to > make it do things it isn't designed to is simply going to further complicate > the matter. Things like 'dtml-let' are dangerous in this reguard... they > make you think you actually have a language worth doing anything beyond > reporting in. We've been talking about this around work and have pretty much agreed that DTML lets you do too much... It _lets_ you use it as a programming language, when what we should really be doing is restricting dtml to reporting stuff, make Python methods an intrinsic part of Zope and _require_ people to use python to do the really nasty stuff. DTML is _perfect_ as a reporting language and should always provide the front end to objects, but the objects themselves should be either database queries or python code. Initially we did things in DTML because it was easier than writing external methods, but if you can write python methods inside Zope and cut out a lot of the dangerous namespace games in DTML (like _, dtml-let, REQUEST.set) then you _force_ the divorce between functionality and display, get DTML looking elegant again, which it does when you don't have code like: (This is my root standard_html_header, I'll be moving to use Chameleon which turned up the same night I actually sat down to write it up properly as an external product. Amusing coincidence.) I _shouldn't_ be doing things like this in DTML. It shouldn't even let me. The whole _.getattr(blah) sections are far beyond the reality of a reporting language, and they don't go properly with an Object Oriented paradigm either. I should instead have an object made and be going: But the existing framework doesn't encourage this. If you banned _ access in anything but python methods and made it so python methods can only be used in Products, then you'd have the proper divide. DTML should call objects and database queries and display them, it should never be doing the actual program logic. > > How about > Well, if it were my decision, I'd say "over my dead body," but it's not... > HOWEVER, I'll fight this personally because I think this makes it more > PHPish, and looses the point of the isolation of presentation and logic. > DTML is for presentation, not logic. It's simply been moved too much into > the logic side because of a lack of something suitable for that application. > We are working on this, including talking with Evan Simpson abou bringing > PythonMethods in line with what we need to include it out of the box. I > would vigorously recommend working on THAT ,rather than trying to make DTML > something it isn't designed to be. Yep. I agree. Also, one thing that annoys me... With sql_methods I have to go: sql.get_skin(username='default')[0].skin even when the only thing the sql statement is returning is a single value and it's value _is_ ".skin". It'd be good if the database objects actually rendered as either a value or a list of values if they only had one column in the result. Then I could just go: sql.get_skin(username='default') (I keep a lot of my sql methods in a root level sql directory for neatness) This looks far nicer and is easier to understand. I keep forgetting that database queries return lists of objects regardless of what you ask them for. Perhaps even have an option in the method itself which lets you decide how to return the result, as an object, a string or an int. I was actually looking through trying to find the SQL methods code the other day, trying to find the way caching works. Whereabouts in the code that implements them? Basically we currently have a caching problem with different users coming to the site getting given someone else's preferences and I was wondering whether it's an SQL caching problem. (even though I've set cache level to 0 and turned off caching in netscape for that domain). Do the queries i.e. sql.get_skin(username='default') cache only for that given set of inputs? Or do they cache regardless of the inputs? Because we have seen some evidence that the result returned doesn't always change even when the username does and it _should_ have to go look it up again. Hmmm... This was a little longer than expected. Stop now. Need coffee. > Chris > -- > | Christopher Petrilli Python Powered Digital Creations, Inc. > | petrilli@digicool.com http://www.digicool.com -- Evan ~ThunderFoot~ Gibson ~ nihil mutatem, omni deletum ~ May the machines watch over you with loving grace. From pje@telecommunity.com Thu Nov 11 03:50:27 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Wed, 10 Nov 1999 22:50:27 -0500 Subject: [Zope-dev] Generic filtering of objects In-Reply-To: References: <19991110131457.A24187@wallace.ece.rice.edu> Message-ID: <199911110350.TAA24829@zope.codeit.com> At 11:54 AM 11/11/99 +1100, Robert Leftwich wrote: >I have a requirement to be able to apply a user-definable filter to all the >views on the object database. Obviously this would be best applied at a low >a level as possible in order to minimise the impact on the application code >and to be made as generic as possible for maximum flexibility. >To save re-inventing the wheel, has anyone else had this requirement and if >so how did you implement it ? Ty Sarna and I have come up with a concept for this, which we have not yet implemented, as we are still finalizing design details. We believe that it could be made quite general. The basic idea is that you have a "Predicate" interface, for objects which can be combined with "and", "or", and "not" to result in more complex predicates. The Predicate interface would also include functions to return a Generator or a Filter. A Generator is an object which can return a list of objects matching the Predicate, while the Filter is a callable object which may be passed an object and returns true if the object matches the Predicate. Generators and Filters have to also provide a small amount of metadata indicating their cost to filter or generate information. The and, or, and not operations return generic Intersect, Union, and Complement objects which, when asked for their Generator or Filter, create optimized versions based on the cost criteria of their component Predicates. For example, if you ask an Intersect predicate for a generator, it should ask its component predicates for the generator likely to produce the smallest set, then use the remaining predicates to filter that generator. Conversely, if you ask a Union for a filter, it should apply its component Predicate filters in such a way as to maximize the probability of an early hit. Anyway, here's where the fun part comes in. Let's say that you define a set of Predicates that can either verify an object attribute when used as a filter, OR can search a ZCatalog when used as a generator. Let's say you also define another predicate, such as "ContainedWithin", which tells you if one object is reachable from another. Now, to search your site for things with a certain field value, you can do something like this: blue_under_here = Keywords['blue'] & ContainedWithin[somefolder] to get a Predicate which expresses your search. Now, you can do something like: blue_under_here.getResults() to get the actual objects, or, you can say: blue_filter = blue_under_here.getFilter() blue_filter(something) to see if object 'something' matches the criterion. Depending on what the ContainedWithin and Keywords predicates tell their Intersection object, it will pick one of them to return the objects and use the other predicate to filter the list. The interesting thing about the Predicate concept is that predicates can apply to *anything*. For example, suppose you create a PrimeNumber predicate, and a FibonacciSequence predicate. You can intersect them both with a Range predicate, and find all the prime Fibonacci numbers in a certain range. Okay, maybe you don't have any reason to do that. But how about a RandomSelection predicate that selects a random member of the enclosed set? So that: RandomSelection[Keywords['blue'] & ContainedWithin[somefolder]].getResults() Will return a random member of the set of 'blue' keyword-bearing objects within somefolder? Might be fun for returning random taglines keyed to a user's preferences, eh? Or random selection of one they haven't seen in X number of days, or... How about predicates associated with a relational DB? Intersect the two, or join them. By our convention, parameterized predicates (such as Keywords and ContainedWithin) use __getitem__ or __getslice__ to return a predicate which applies to the set of values given, which may itself be a predicate (which is used as a filter for the values of the property the predicate tests). Hm. That might not have been too clear. Let's take Keywords as an example. Keywords[StringContaining['u']] would match keywords like 'blue', 'purple', and 'puce'. If used as a filter, it would do this by applying the inner predicate as a filter against an attribute value of the object being checked. If being used as a generator, it would have to get the unique values for the keywords attribute from the catalog first, then apply the StringContaining filter against them to get the list it would use as a catalog query. (Notice that while all Predicates must support being used as filters, not all can support being generators. PrimeNumber and FibonacciSequence, for example, have to be intersected with some finite number set before you can use them as a generator.) Let's look at more interesting ways to apply predicate projection (if that's the correct term.) How about: ContainedWithin[Keywords['blue']] Used as a filter, this would tell you whether an object had a parent with a keywords attribute of 'blue'. Used as a generator, it would search the catalog for objects with keyword 'blue', then return all objects reachable from those objects. Is your head spinning yet? How about this: you drop in some Predicates that union the predicates from several catalogs plus an LDAP server and a relational database, so that Keywords is now really Catalog1.Keywords || Catalog2.Keywords || SQLDB.Keywords || LDAP1.Keywords. Performing any of the searches above still works, only now you have a (lazy) search set spanning multiple data sources. Most predicates will probably want to check if they have a type or data source in common when doing 'and' and 'or' operations so as to create appropriate union or intersection predicates. For example, a predicate which refers to a field or index in a particular Catalog will want to see if is being intersected with another from the same Catalog, as that will allow it to construct a better query when used as a generator. Okay, this all sounds great in principle, but where's the implementation? We understand the basics of the abstract interface, but there are a few details we need to work out to ensure that the framework will have high interoperability. The base module will probably include: * Constants to be used in optimization metadata (e.g., COST_BUILTIN_FILTER, COST_IN_MEMORY_GENERATOR, COST_DISK_ACCESS) * Some basic predicates like AlwaysTrue, EmptySet, IsObject, EqualsObject, AttributeValue * Utility classes to construct atomic predicates from various standard Python objects like callables and sequences, so that predicates like the Keywords example don't have to care whether you pass them a function, a string, or another predicate. (e.g. KeyOf(dict) would give you a predicate whose getFilter would return dict.has_key, which is ready to be used as a filter. getResults(), on the other hand, would return the results of calling the dictionary's keys() method.) * Basic Union and Intersect objects that can perform crude optimization and re-organization, reshuffling their components to group Predicates together that have common data sources, as well as predicting the best way to go about doing a filtering or generating operation based on the components' cost estimates. We believe such a framework would make a great many interesting things do-able in Zope, as well as serving as a fully general "object query language" for Zope. (Not to mention for Python in general!) Which is why we want to implement it. Our first implementation will probably be a strawman which we'll publish for comments and feedback. We'll probably implement some silly things like Prime, Fibonacci, RandomSelection, IntegerRange, and so on, just to get the feel of using predicates. We might also do some wrappers over the Query objects which are part of the Zope2 library. They'll undoubtedly make great Filters for many purposes, especially since they're implemented in C. We'll probably also reuse some code from Lazy.py so that generators can be kept from fully instantiating huge result sets. From jhauser@ifm.uni-kiel.de Thu Nov 11 08:27:53 1999 From: jhauser@ifm.uni-kiel.de (Janko Hauser) Date: Thu, 11 Nov 1999 09:27:53 +0100 (CET) Subject: [Zope-dev] Zope-beta failure on OSF/Alpha Message-ID: <14378.32265.811571.860760@ifm.uni-kiel.de> I tried for the first time to install Zope on an alpha machine. The compilation went fine, I can start zope and get the initial screen, but if I try to get the management screen zope breaks with a stack overflow and restarts itself. I can ftp into ZServer and get and put files. Anything I can do to investigate this further? Has someone else Zope running on an alpha machine? __Janko From Gilles lavaux" Message-ID: <005101bf2c25$eea89160$fce3ccc1@esrin.esa.it> Hello, I run Zope on alpha, but on linux alpha(RH5.1 and RH6.0) Zope1.10.3b1 works fine, and we have developped a lot of things on it: inventory database, user helpdesk ticket system, team activity monitoring. All this with a Postgresql database( which is wonderfull). But with Zope2 I had problems, things like confera or squishdot doesn't works(impossible to posr a article) and the soft we have in zope1 doesn't run completly. On this topic I have a request for the DC guys: you should do a 'test script' to allow the new users to test a Zope installation (all the DC products & functionalitys). This way it would be easy to be shure that everything if ok. My personal conclusion is: running on alpha add some troubles. Gilles ----- Original Message ----- From: Janko Hauser To: Sent: Thursday, November 11, 1999 9:27 AM Subject: [Zope-dev] Zope-beta failure on OSF/Alpha > I tried for the first time to install Zope on an alpha machine. The > compilation went fine, I can start zope and get the initial screen, > but if I try to get the management screen zope breaks with a stack > overflow and restarts itself. > > I can ftp into ZServer and get and put files. Anything I can do to > investigate this further? > > Has someone else Zope running on an alpha machine? > > __Janko > > _______________________________________________ > 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 ) > > From gtk@well.com Wed Nov 10 23:45:02 1999 From: gtk@well.com (gtk) Date: Thu, 11 Nov 1999 10:45:02 +1100 Subject: [Zope-dev] Re: [Zope] Locks? References: <19991111134029.D21601@netizen.com.au> Message-ID: <031301bf2bd6$c8632640$0b01010a@beetlejuice> [slowly moving this to zope-dev] > I've got a situation where I'd like to be able to have a mutex lock. > Unfortunately, I can't use Lock objects out of the thread module as they > appear to be unpicklable. Code your own module (for my Shrubbery product I called it ShrubLock) which has its own acquire() and release() calls. If you need lots of locks, hack extra stuff into the module and pickle something like an ID. I considered using an MD5 hash of the object URL. Note that this is NOT enough to avoid Z2 CONFLICT errors, as Zope does enough stuff after leaving the methods in your object that there's plenty of time for another transaction to start on the same object. This seems to be a fundamental problem with Zope and needs some serious work on Zope's guts to be resolved. DC apparently advise anyone with write-intensive needs to use non-ZODB storage. Unfortunately, as far as I can tell, "write-intensive" devolves to *any* two modifications at once if you're doing stuff like trying to maintain a ZCatalog of your web site by having your CatalogAware objects call reindex_object(). ZCatalog fans, you better use a cron job to trigger regular re-indexes if your site is going to be at all busy. Regards, Garth. -- From alex@gabuzomeu.net Thu Nov 11 12:03:52 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Thu, 11 Nov 1999 13:03:52 +0100 Subject: [Zope-dev] Character codes Message-ID: <4.2.0.58.19991111125637.00af3c60@192.168.0.2> Hello, when displaying the raw content of a list with this code: (The list values are extended characters for French accented letters. They may not display correctly in your mailer.) I get this output: ['\351', '\340', '\371', '\350'] So internally these characters are mapped to character codes. Where can I find reference information about this mapping system? Thanks. Alexandre From jhauser@ifm.uni-kiel.de Thu Nov 11 12:09:41 1999 From: jhauser@ifm.uni-kiel.de (Janko Hauser) Date: Thu, 11 Nov 1999 13:09:41 +0100 (CET) Subject: [Zope-dev] Zope-beta failure on OSF/Alpha In-Reply-To: <199911111133.FAA04655@rampart.timecastle.net> References: <199911111133.FAA04655@rampart.timecastle.net> Message-ID: <14378.45573.861353.390831@ifm.uni-kiel.de> Gilles lavaux writes: > Hello, > > I run Zope on alpha, but on linux alpha(RH5.1 and RH6.0) > Zope1.10.3b1 works fine, and we have developped a lot of things on it: > inventory database, user helpdesk ticket system, team activity monitoring. > All this with a Postgresql database( which is wonderfull). > > But with Zope2 I had problems, things like confera or squishdot doesn't > works(impossible to posr a article) and the soft we have in zope1 doesn't > run completly. On this topic I have a request for the DC guys: you should do > a 'test script' to allow the new users to test a Zope installation (all the > DC products & functionalitys). This way it would be easy to be shure that > everything if ok. > > My personal conclusion is: running on alpha add some troubles. and Jeff Rush writes: > Sorry to hear of your problem. Are you by chance running > Red Hat Linux/Alpha? I do know that Red Hat took my Zope > RPMs, rebuilt them (w/o change) on an Alpha and they said > it all worked fine. Personally I've never seen an Alpha so I > can't speak with authority but it -ought- to work. > > Or are you running the 2.1.0 beta 1 release? > I use the 2.1.0 Beta, but had a similar problem with the stable source, although I didn't looked further back than. According to the wonderful platform.py the system is 'OSF1-V4.0-alpha-alpha'. The exact error is: Stack overflow: pid 26669, proc python, addr 0x140889ff8, pc 0x120049ef0 Python runs fine on normal stuff, although I haven't tested the threading stuff. Is there a simple test for threading alone (python make test works for threads)? I have in the meantime compiled the extensions without optimization, which does not change anything. Is it ok to assume that one can conclude from the fact that zope runs under redhat there are no inherent problems with 64 bit machines? Something more suspicious. I can't lookup documents past the initial screen over http but can do this over ftp. Can one assume that the ZODB subsystem is working, can I test this in other ways? Thanks nevertheless, __Janko From m.faassen@vet.uu.nl Thu Nov 11 15:08:36 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 11 Nov 1999 16:08:36 +0100 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant References: Message-ID: <382ADBF4.861713CB@vet.uu.nl> Christopher Petrilli wrote: > > On 11/10/99 7:11 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > > I'm with you 100%. It makes me feel like I'm programming a reverse polish > > calculator sometimes :-) > > It is sub-optimal, but it is not a programming language, so please don't try > and hold it to those standards. But we should hold to the standards of simplicity, one-syntax-to-do-it, etc, of Python. It shouldn't *be* Python, however. > DTML is a reporting language, and trying to > make it do things it isn't designed to is simply going to further complicate > the matter. So it should be the Python of reporting languages. :) > Things like 'dtml-let' are dangerous in this reguard... they > make ou think you actually have a language worth doing anything beyond > reporting in. Yes, but the problem is people *will* currently apparently use DTML beyond its design specifications. It's a difficult situation; if you don't give people dtml-let, they'll use some other feature (dtml-with and namespace and whatnot) to do the same. This is even *more* complicated. DTML is currently moving in several incompatible directions at once. Under pressure of its users DTML moves to a more full-fledged programming language. At the same time, features are added that are rather ad-hoc to make specific reporting tasks more easy. The interaction between these two pressures causes DTML to become unnecessarily difficult for both programming *and* reporting tasks. Note that many programming and reporting tasks *are* very easy in DTML; it's just that too many aren't. I'm not sure what one could do to let DTML become a conceptually pure reporting language. Redesign it in some unspecified fashion. Offer an alternative that is as easy to use as DTML; people currently use DTML as it's quick and easy. PythonMethods are perhaps the solution there. We need to ponder more about what makes anything a conceptually pure reporting language. This topic must've been studied before, perhaps there's material on the net... [sequence-item vs sequence_item] > > How about > > > > Well, if it were my decision, I'd say "over my dead body," but it's not... > HOWEVER, I'll fight this personally because I think this makes it more > PHPish, and looses the point of the isolation of presentation and logic. > DTML is for presentation, not logic. It's simply been moved too much into > the logic side because of a lack of something suitable for that application. Agreed. > We are working on this, including talking with Evan Simpson abou bringing > PythonMethods in line with what we need to include it out of the box. I > would vigorously recommend working on THAT ,rather than trying to make DTML > something it isn't designed to be. Agreed. We should move DTML *more* into the direction of its original target. > Always measure something by the scope of its problem domain, not by what > people try and use it for. The latter indicates a separate problem enirely. Agreed. > > Is existing DTML good enough for 'simple' scripting? I think the current > > confusion threshold occurs when people start needing to pass parameters > > to methods (and the whole quoted and unquoted thing kicks in, and suddenly > > they have to understand about the _ namespace, and the magic variables to > > pass a DTML method to make it work). > > well, this is beyond the above outlined problem domain. So we have a > seperate problem, not a DTML problem, but a lack of a solution problem. Yes, but. I still have (admittedly completely vague) ideas about how DTML could be a more pure reporting language. A DTML where ugly constructs simply aren't *possible* (utopic, but at least we could move it in that direction). Instead, in this ideal DTML it'll be *natural* and *easy* to use a PythonMethod (or whatever), whenever you notice (and this should be easy) that you're going beyond DTML's abilities. > I sound a bit harsh, but I'm trying to clarify the problem domain that DTML > solves (just as we're trying to be more explicit about the domain ZClasses > are designed to solve). It's dangerous to take it outside its problem > domain, as it collapses quickly into a morass of tangled code. Yes, but this is already happening. And worse, this causes DTML to miss its original reporting target as well, in some cases; witness my dtml-with discussion that prompted me to start the rant. That wasn't a deep programming problem, it was a simple reporting issue, and the DTML was just too confusing. Regards, Martijn From m.faassen@vet.uu.nl Thu Nov 11 15:13:53 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 11 Nov 1999 16:13:53 +0100 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant References: <19991111131316.29038@connect.com.au> Message-ID: <382ADD31.C9503FD3@vet.uu.nl> Evan Gibson wrote: > > On Wed, Nov 10, 1999 at 07:43:44PM -0500, Christopher Petrilli wrote: > > On 11/10/99 7:11 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > > I'm with you 100%. It makes me feel like I'm programming a reverse polish > > > calculator sometimes :-) > > > > It is sub-optimal, but it is not a programming language, so please don't try > > and hold it to those standards. DTML is a reporting language, and trying to > > make it do things it isn't designed to is simply going to further complicate > > the matter. Things like 'dtml-let' are dangerous in this reguard... they > > make you think you actually have a language worth doing anything beyond > > reporting in. > > We've been talking about this around work and have pretty much agreed that > DTML lets you do too much... It _lets_ you use it as a programming > language, when what we should really be doing is restricting dtml to > reporting stuff, make Python methods an intrinsic part of Zope and > _require_ people to use python to do the really nasty stuff. Ah, I said almost exactly the same in another post I just sent. :) Using Python or something else non-DTML should be obvious and natural and easy, whenever you reach the limits of DTML. And it should be easy to know that you have reached those limits. > DTML is _perfect_ as a reporting language and should always provide the > front end to objects, but the objects themselves should be either database > queries or python code. Agreed. > Initially we did things in DTML because it was easier than writing external > methods, but if you can write python methods inside Zope and cut out a lot > of the dangerous namespace games in DTML (like _, dtml-let, REQUEST.set) > then you _force_ the divorce between functionality and display, get DTML > looking elegant again [snip] Yes.. Though it probably takes a bit of thought figuring out how to make this natural and easy. Hm. Throwing out the _ namespace for instance might induce people to do something else that's horrible instead, if care isn't taken. [snip discussion on how to adapt DTML, and other discussions about ZSQL methods] Regards, Martijn From michel@digicool.com Thu Nov 11 16:47:15 1999 From: michel@digicool.com (Michel Pelletier) Date: Thu, 11 Nov 1999 11:47:15 -0500 Subject: [Zope-dev] Writing results directly back to browser References: <382A1F95.53579EE@magma-da.com> Message-ID: <382AF313.F34E3351@digicool.com> David S. Harrison wrote: > > I have an external method that is capable of generating a PNG image > in response to some input data. I would like to use this in the > context of Zope to display a computed image on the fly. I am looking > for suggestions on a couple of fronts: how can I wire this infrastructure > into DTML and how does one write directly back to the browser from > an external method? > > Here are my first guesses on both fronts. For DTML, my thinking > is along the following lines: > > This is HTML, not DTML. -Michel From michel@digicool.com Thu Nov 11 16:53:04 1999 From: michel@digicool.com (Michel Pelletier) Date: Thu, 11 Nov 1999 11:53:04 -0500 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant References: <19991111131316.29038@connect.com.au> Message-ID: <382AF470.5146F388@digicool.com> Evan Gibson wrote: > > Also, one thing that annoys me... > With sql_methods I have to go: > > sql.get_skin(username='default')[0].skin > > even when the only thing the sql statement is returning is a single value > and it's value _is_ ".skin". Actually, I think DTML can express this quite well. If you know there's only one result (as you do here, because you're hardcoding the [0]) You can get clean DTML with an #in block: Little extra typing, but it looks clean to me. ;) -Michel From pavlos@gaaros.msrc.sunysb.edu Thu Nov 11 15:47:38 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Thu, 11 Nov 1999 10:47:38 -0500 (EST) Subject: [Zope-dev] Writing results directly back to browser In-Reply-To: <382A1F95.53579EE@magma-da.com> Message-ID: On Wed, 10 Nov 1999, David S. Harrison wrote: > for suggestions on a couple of fronts: how can I wire this infrastructure > into DTML and how does one write directly back to the browser from > an external method? > Hi David - You can actually just return the image file from the external method. For instance if your method is called gen_im def gen_im(self): imag=doimage... return imag then going to its URL will actually return the image. You might want to set the header through the Response object. Similarly you can just call the external method from DTML. (I think I am not clear but I haven't had my shakky coffee yet) Pavlos From hoekstra@fsw.leidenuniv.nl Thu Nov 11 16:03:07 1999 From: hoekstra@fsw.leidenuniv.nl (Rik Hoekstra) Date: Thu, 11 Nov 1999 17:03:07 +0100 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: <382ADBF4.861713CB@vet.uu.nl> Message-ID: <01JI7VR45S2E934UP1@ITS.TUDelft.NL> > > So it should be the Python of reporting languages. :) Ah! > > > Things like 'dtml-let' are dangerous in this reguard... they > > make ou think you actually have a language worth doing anything beyond > > reporting in. > > Yes, but the problem is people *will* currently apparently use DTML > beyond its design specifications. It's a difficult situation; if you > don't give people dtml-let, they'll use some other feature (dtml-with > and namespace and whatnot) to do the same. This is even *more* > complicated. > > DTML is currently moving in several incompatible directions at once. > Under pressure of its users DTML moves to a more full-fledged > programming language. At the same time, features are added that are > rather ad-hoc to make specific reporting tasks more easy. The > interaction between these two pressures causes DTML to become > unnecessarily difficult for both programming *and* reporting tasks. Note > that many programming and reporting tasks *are* very easy in DTML; it's > just that too many aren't. > > I'm not sure what one could do to let DTML become a conceptually pure > reporting language. Redesign it in some unspecified fashion. Offer an > alternative that is as easy to use as DTML; people currently use DTML as > it's quick and easy. PythonMethods are perhaps the solution there. > > We need to ponder more about what makes anything a conceptually pure > reporting language. This topic must've been studied before, perhaps > there's material on the net... > > [sequence-item vs sequence_item] > > > > How about > > > > > > > Well, if it were my decision, I'd say "over my dead body," but it's not... > > HOWEVER, I'll fight this personally because I think this makes it more > > PHPish, and looses the point of the isolation of presentation and logic. > > DTML is for presentation, not logic. It's simply been moved too much into > > the logic side because of a lack of something suitable for that application. > > Agreed. > > > We are working on this, including talking with Evan Simpson abou bringing > > PythonMethods in line with what we need to include it out of the box. I > > would vigorously recommend working on THAT ,rather than trying to make DTML > > something it isn't designed to be. > > Agreed. We should move DTML *more* into the direction of its original > target. > > > Always measure something by the scope of its problem domain, not by what > > people try and use it for. The latter indicates a separate problem enirely. > > Agreed. > > > > Is existing DTML good enough for 'simple' scripting? I think the current > > > confusion threshold occurs when people start needing to pass parameters > > > to methods (and the whole quoted and unquoted thing kicks in, and suddenly > > > they have to understand about the _ namespace, and the magic variables to > > > pass a DTML method to make it work). > > > > well, this is beyond the above outlined problem domain. So we have a > > seperate problem, not a DTML problem, but a lack of a solution problem. > > Yes, but. I still have (admittedly completely vague) ideas about how > DTML could be a more pure reporting language. A DTML where ugly > constructs simply aren't *possible* (utopic, but at least we could move > it in that direction). Instead, in this ideal DTML it'll be *natural* > and *easy* to use a PythonMethod (or whatever), whenever you notice (and > this should be easy) that you're going beyond DTML's abilities. > > > I sound a bit harsh, but I'm trying to clarify the problem domain that DTML > > solves (just as we're trying to be more explicit about the domain ZClasses > > are designed to solve). It's dangerous to take it outside its problem > > domain, as it collapses quickly into a morass of tangled code. > > Yes, but this is already happening. And worse, this causes DTML to miss > its original reporting target as well, in some cases; witness my > dtml-with discussion that prompted me to start the rant. That wasn't a > deep programming problem, it was a simple reporting issue, and the DTML > was just too confusing. Yes. I recall it took me _days_ to discover how to make an object with an id provided from a request, then change to the object and change things in it. THis is a simple operation, and it is ubiquitous, but it does involve such esoteric constructs as or worse: Or something alike, because I always forget what it is. Reading all the thread and the different remarks, I'm tempted to make Paul's compilation but I won't, because I do not have time. There is a few important conclusions to be made, however: 1. DTML may be meant to be a reporting language, but it's able to do many more things and used for many more things 2. There are Python alternatives, but these are not obvious, nor is it clear when to use what 3. Thus, there is no integration between DTML and Python in the framework. By this, I mean that it should be easy to do simple things in DTML. Then (as it goes), find out you have to do more complicated things, and then be able to switch to a Python alternative (be it Python Methods, ZClasses, External Methods, although these are presented in the documentation a sort of 'hack glue' ). I'm sure this can be done by now, or be accomplished with little effort. IMHO, the advantage would be that it would bring the modularity Zope excels in in its design to programming Zope. While it will not be possible to enforce this by technological means (as many have remarked), there must be a solution in design practices. After all, there in a product so well designed as Zope, there are already al lot of assumptions of what is the best place/way of doing. The most easy solution to this would be something like a 'best practices in Zope programming' document. In it, it we could point out a number of 'rules of thumb' to Zope users/programmers/designers of 'what to use when and where in programming Zope, and how to integrate your efforts to a coherent whole. Then people will still get tangled up in their dtml, but at least we can point them out that 'the preferred way of doing this is Zope is not in DTML, but in Python, along such and such lines' (I'll be happy to contribute, but I'm afraid this is too much/complicated for me alone) What do you all think. Is this a direction for (at least a partial) solution to a very complicated problem? Rik From akuchlin@mems-exchange.org Thu Nov 11 16:30:10 1999 From: akuchlin@mems-exchange.org (Andrew M. Kuchling) Date: Thu, 11 Nov 1999 11:30:10 -0500 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant In-Reply-To: <382ADBF4.861713CB@vet.uu.nl> References: <382ADBF4.861713CB@vet.uu.nl> Message-ID: <14378.61202.219987.179872@amarok.cnri.reston.va.us> Martijn Faassen writes: >I'm not sure what one could do to let DTML become a conceptually pure >reporting language. Redesign it in some unspecified fashion. Offer an >alternative that is as easy to use as DTML; people currently use DTML as >it's quick and easy. PythonMethods are perhaps the solution there. This leads on to a security-related, I think. DC staff have said in the past that Python code isn't stored in the database for security reasons. PythonMethods change this; someone who gets your manager password can create a Python method that makes a setuid copy of your shell or whatever. (Disclaimer: I haven't actually gotten around to trying out PythonMethods yet.) On the one hand, I can agree that I don't want the security of my system depending on Zope passwords that are sent using HTTP's insecure Basic Authentication. (What's the status of Digest Authentication these days, anyway?) That's bad. On the other hand, PythonMethods would make it much easier to push complicated logic out of DTML and into Python code. That's good. Question: Is there a way we can reconcile these two conflicting drives? If some solution can be found, then maybe PythonMethods could be added to the products that come with basic Zope. Suggestions? 1) Perhaps PythonMethods could be enabled or disabled when you install Zope; if people are going to be using Zope over insecure links, and shouldn't be using PythonMethods, don't install them.. 2) Perhaps they could use the rexec module or Zope's existing sandbox to run their code (but would the sandbox limit their usefulness? -- maybe not, if you take the attitude that serious Python code should still be in a product or ExternalMethod). -- A.M. Kuchling http://starship.python.net/crew/amk/ None could break the Web, no wings of fire. / So twisted the cords, & so knotted / The meshes: twisted like to the human brain. -- William Blake From Gilles lavaux" Message-ID: <001901bf2c66$c57c3080$fce3ccc1@esrin.esa.it> Hello all -Jeff Rush wrote: > > I know little about alphas but one question, if I may. Did you compile > the Zope yourself from the source tarball or use the RPMs that Red Hat > makes available for Linux/Alpha? > > The reason I ask is that I created the RPMs and Red Hat then tested > them on all of their platforms and reported that it works on all. Now > I'm wondering whether their testing was extensive enough and > they really don't work on an alpha. > I compiled the Zope2 from source myself, I also have compiled the new python(1.5.2). I didn't know that Red-hat has a RPM for the version 2 of Zope, where is it?? Anyway I think that it can not works directly out of the Red-hat instalation because of the fact that pyhton with red-hat 6.0 is version 1.5.10 whithout thread. So you have to recompile or reinstall python. For Zope itself, a lot of things works on 64bits, ZODB ,DA , ftp access, http,etc.. The only2 problems I have seen is the failure during a posting of article in confera/sqhisdot: ############################################ Zope Error Zope has encountered an error while publishing this resource. Error Type: SystemError Error Value: NULL result without error in call_object ---------------------------------------------------------------------------- ---- Troubleshooting Suggestions ........ Traceback (innermost last): File /home/dev/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/dev/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/dev/Zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/dev/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/dev/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: addMessage) File /home/dev/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: addMessage) File lib/python/Products/Confera/Confera.py, line 310, in addMessage (Object: ElementWithAttributes) File lib/python/Products/Confera/Confera.py, line 196, in setItem (Object: ElementWithAttributes) SystemError: (see above) #################################### And also inside loops or accessing images/documents properties(but it's maybe my code which is non Zope2 compatible). If someone doesn't have this confera error on RedHat 6.0/digital alpha linux 2-2.5-16/python1.5.2, please let me know. Thanks Gilles From evan@tokenexchange.com Thu Nov 11 17:09:16 1999 From: evan@tokenexchange.com (Evan Simpson) Date: Thu, 11 Nov 1999 11:09:16 -0600 Subject: [Zope-dev] DTML Syntax contd. + rant References: <382ADBF4.861713CB@vet.uu.nl> <14378.61202.219987.179872@amarok.cnri.reston.va.us> Message-ID: <002d01bf2c67$80fcd490$8d84b2d8@token.hapenney.com> From: Andrew M. Kuchling > This leads on to a security-related, I think. DC staff have said in > the past that Python code isn't stored in the database for security > reasons. PythonMethods change this; someone who gets your manager > password can create a Python method that makes a setuid copy of your > shell or whatever. (Disclaimer: I haven't actually gotten around to > trying out PythonMethods yet.) The latest release of the PythonMethod Product has two kinds of PythonMethod: regular and XXX. A switch in the source code allows you to turn "XXXPythonMethod"s on and off, and they are off by default. XXXPMs are wild, unsafe, and unrestricted, with (lack of) security equivalent to External Methods. The only limit on them (under *nix, anyway) is that they're likely to be running as user "nobody". Regular PMs, on the other hand, are meant to be completely safe, and subject to all the same restrictions as DTML, although this goal has not yet been acheived. Any holes in regular PM security, however, only give improper access to Zope objects, *not* the system at large. > Question: Is there a way we can reconcile these two conflicting > drives? If some solution can be found, then maybe PythonMethods could > be added to the products that come with basic Zope. Suggestions? The DC folks have started talking with me about this. I'm optimistic. > 1) Perhaps PythonMethods could be enabled or disabled when you install > Zope; if people are going to be using Zope over insecure links, and > shouldn't be using PythonMethods, don't install them.. Substitute "XXXPythonMethods" for "PythonMethods", and I agree. Already done, too :-) > 2) Perhaps they could use the rexec module or Zope's existing sandbox > to run their code (but would the sandbox limit their usefulness? -- > maybe not, if you take the attitude that serious Python code should > still be in a product or ExternalMethod). XXXPythonMethods should never be used on a system with untrusted clients, or which is accessed via an unsecure link. People will anyway, of course, but they've been warned. Regular PMs with proxy roles and External Methods should be the norm. Cheers, Evan @ 4-am From JYule@extend.com Thu Nov 11 17:27:56 1999 From: JYule@extend.com (Jos Yule) Date: Thu, 11 Nov 1999 12:27:56 -0500 Subject: [Zope-dev] Zcatalog q: howto do a NOT? Message-ID: I've got a ZClass which is catalog aware object. Its got a Property which is a 'list'. I want to do a ZCatalog search on this property, excluding all Objects which have a certain value some where in the list property... How the heck do i do this? How do i do a plain ? I can't figure out the proper DTML syntax... Thanks again!!! j From simon@joyful.com Thu Nov 11 17:46:34 1999 From: simon@joyful.com (Simon Michael) Date: 11 Nov 1999 09:46:34 -0800 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: Martijn Faassen's message of "Thu, 11 Nov 1999 16:08:36 +0100" References: <382ADBF4.861713CB@vet.uu.nl> Message-ID: <87r9hwyl8l.fsf@readymix.joyful.com> Fully agree with this and the original posting.. after a year on and off zoping, DTML is still hard. And while I may be using it the "wrong way", as it stands every other zope beginner will do the same. What can be done ? NB I post these 2 cents to stimulate ideas and don't imply that DC folk haven't already thought through this whole issue thoroughly. 1. documentation Documenting high-level design patterns and low-level code snippets will definitely help, but I foresee an explosion of recipes. You know something is not optimal when you find yourself saving every useful snippet because you know it will be hard to reinvent. 2. clearer partitioning Clearer partitioning of functionality should clarify the learning curve and reduce frustration. 3. something else What's the ideal situation from user's point of view ? I've heard smalltalk, particularly squeak smalltalk, described as "liquid" and "transparent", meaning you can change things from the application level right down to virtual machine and it's completely consistent. There are no steep jumps in the learning curve requiring a new mindset, language, etc. I'm also reminded of Lucent's inferno where /*everything*/is/in/one/access-controlled/namespace. For zope to be more like this (it already goes a long way), I guess it would be python all the way, with a single conceptually-simple namespace that is always available, from bottom to top. Python is too hard for some ? Keep a limited DTML as an alternative. But to python users we will say: forget dtml; use python, use this single zope namespace, and you can do anything you want, things will work as you expect. Is this (a) what we have already ? (b) attainable ? (c) unrealistic ? Comments welcome. Regards, -Simon From eroussel@maestria.com Thu Nov 11 17:58:13 1999 From: eroussel@maestria.com (Emmanuel Rousselle) Date: Thu, 11 Nov 1999 12:58:13 -0500 Subject: [Zope-dev] Passing arguments to external methods Message-ID: <4.1.19991111124914.00a277a0@manoir.bloodwolf.org> I'm currently trying to play with external methods using the How-To written by "brian". cf. http://www.zope.org/Documentation/How-To/ExternalMethods When I'm trying to pass the REQUEST object to my external method, Zope complains: Zope has encountered an error while publishing this resource. Error Type: TypeError Error Value: not enough arguments; expected 2, got 1 The method definition looks like "def helloWorld(self, REQUEST)". And the call to the external methods looks like "". So it looks to me like Zope is asking for the "self" variable, which is a bit strange since this argument is supposed to be implicit. Version details: Zope version: Zope 2.0.1 (binary release, python 1.5.2, win32-x86) Python version: 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] System Platform: win32 -- Emmanuel From dsh@magma-da.com Thu Nov 11 18:01:48 1999 From: dsh@magma-da.com (David S. Harrison) Date: Thu, 11 Nov 1999 10:01:48 -0800 Subject: [Zope-dev] Writing results directly back to browser References: Message-ID: <382B048C.DC3106C9@magma-da.com> Maybe I am not being clear. There is no image file. It will be generated completely from within the external method. I would like the external method to write to some sort of sink that will deliver the bits directly to the browser. If I can help it, I don't want the image to be written to disk at all. Pavlos Christoforou wrote: > > On Wed, 10 Nov 1999, David S. Harrison wrote: > > > for suggestions on a couple of fronts: how can I wire this infrastructure > > into DTML and how does one write directly back to the browser from > > an external method? > > > > Hi David - > > You can actually just return the image file from the external method. For > instance if your method is called gen_im > > def gen_im(self): > imag=doimage... > return imag > > then going to its URL will actually return the image. You might want to > set the header through the Response object. Similarly you can just call > the external method from DTML. > > (I think I am not clear but I haven't had my shakky coffee yet) > > Pavlos From pje@telecommunity.com Thu Nov 11 18:11:18 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Thu, 11 Nov 1999 13:11:18 -0500 Subject: [Zope-dev] ngDTML (aka "PSP" or ZScript?) proposal In-Reply-To: <382AD780.6BB8C9DE@vet.uu.nl> References: <199911111228.XAA27950@mbuna.arbhome.com.au> Message-ID: <3.0.5.32.19991111131118.01ae3a00@telecommunity.com> I have a proposal for a template language which (hopefully) won't be too difficult to create, building as it does on existing works. My proposal is specifically addressed towards making a scripting language that is amenable to learning, doing, and performance, at the expense of being itself valid HTML or XML, and sometimes at the expense of brevity of expression. The syntax I propose we steal from ASP+Python, with one minor alteration. I already have code (written almost 3 years ago and not interfaced to Zope) which parses this syntax, including the necessary machinations to compile out "end if", "end for", etc. and reformat the Python as indented, using the end statements as block delimiters. Such delimiters are necessary when embedding Python in arbitrary text, both for clarity and because indenting is a royal pain in embedded script. Anyway, a basic page might have something like: <% from _ import id, somesqlquery %> Information for <%= _(id) %> <% for record in _(somesqlquery): %> <% end for %>
    <%= _(record.name1) %> <%= _(record.name2, fmt="%05.2d") %>
    Let's go through this and look at the interesting bits. First, we use the name '_' to represent the current Zope namespace. Importing variables from it, or using it as a dictionary always returns those objects *uninterpreted*. However, calling _ with an unnamed first parameter will attempt to execute the object (if it is callable), and then take any keyword parameters as "var"-style formatting arguments. Let's get more specific about the execution part. The execution algorithm is: Push locals() onto the namespace stack, then: 1) If the object has isDocTemp==1, return the result of calling the object with (None,namespace) 2) Otherwise, use ZPublisher's "mapply" function so that the namespace stack can be passed through to the called object's parameters. Thus, if you call a Python function, SQL method, etc., its arguments can automatically be filled in for you as a timesaver. Note that one is under no obligation to use _() to render an object, and that if you want to prevent calling an object you wish to render in its "raw" form, you can simply use str() or repr() or `` on it first. (e.g. _(str(something),fmt="*%s*")) More interesting bits. The Python namespace takes precedence unless you specifically import or otherwise retrieve an object from _. _ itself, REQUEST and RESPONSE, however, are already in the namespace when your method starts, in addition to any parameters defined by the method (ala SQL methods.) There are some special aspects of how import should work. Importing a module should attempt to find an object of that name in the _ namespace, and check the current user's permissions for that object (taking proxy roles into account) before allowing the import. This would allow the use of "PythonModule" objects which you add to a Zope hierarchy and set permissions on. They would import modules only from the "safe" extension and product directories. Of course, any modules generally considered safe could be imported without a lookup/permissons check. Now on to the compilation and execution model. An ngDTML script is rewritten as straight Python code, replacing all <%= expr %> blocks with _.write(expr) and all non-Python text as _.write('text') statements. The resulting code is compiled, and the important aspects of both DTML and Evan Simpson's bytecode transforms and alteration of __builtins__ are performed, to render the resulting code safe for execution. The code block is set up as a function which does a "return _" if execution falls off the end of the script. (Thus, a method can return something instead of writing output, ala the DTML "return" tag.) The _ object would be able to render itself as a string by returning the accumulated writes, and thus when an ngDTML object is called by ZPublisher, its output will be properly sent to the RESPONSE. Whew. It's a long and tedious list of things that have to be implemented. However, it is clearly able to be implemented, and all the pieces already exist, although some bits may have to be re-implemented in order to be integrated. To sum up, the advantages of this language are: 1. It's Python, so the basic syntax is clean and simple. Plenty of books are out there on Python, and when it comes right down to it, we've been continuously extending DTML trying to make it more like Python, so why not just go there? 2. It's based on a well-established embedded scripting paradigm which is used in numerous other application environments including the giants ASP and PHP. It is easier to teach to someone coming over from one of those environments, and many editing tools can already cope with <% %> syntax. 3. All the bits of DTML which are really handy, such as auto-calling, namespace passing, formatting utilities, etc., are all tidily packaged into the "_" swiss-army knife, and there is no confusing Perl-ish automagic anywhere. (Note, by the way, that using _.string, _.None, etc. is not valid in ngDTML; these things should be imported with import. _ is for generally useful ngDTML utilities only.) What about disadvantages? Well, there's no "in" tag and all its goodies, although these could be conceivably implemented using an object that wrapped a sequence for you, and maybe even fitted in as another capability of the '_' object. I haven't given this one a great deal of thought yet. Also, doing things like the tree, sendmail, and sqlgroup tags are tricky unless you can ask the _ object to push and pop its write() buffer; then you can do something like: <% try: _.push() %>From: <%= sender %> To: <%= string.join(recipients,',') %> Subject: test Hi! <% somehost.sendmail(recipients,str(_)) finally: _.pop() %> Which, I have to admit is a lot messier than . On the other hand, the above can also be written: <% somehost.sendmail(recipients,_(message)) %> Since one can define functions within the body of an ngDTML block, and pass them to utility routines, dtml-tree and other things that want blocks to render could be passed functions. This leaves text-transforming tags like sqlgroup, which are harder to manage in this form. Anyway, other than these points, I believe I have described here a language which is capable of doing anything the DTML core can do, while being much clearer and more consistent, and at the same time practical to implement. Comments, anyone? From pavlos@gaaros.msrc.sunysb.edu Thu Nov 11 18:23:29 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Thu, 11 Nov 1999 13:23:29 -0500 (EST) Subject: [Zope-dev] Writing results directly back to browser In-Reply-To: <382B048C.DC3106C9@magma-da.com> Message-ID: On Thu, 11 Nov 1999, David S. Harrison wrote: > > Maybe I am not being clear. There is no image file. It will be generated No you were clear ... > completely from within the external method. I would like the external > method to write to some sort of sink that will deliver the bits > directly to the browser. If I can help it, I don't want the image > to be written to disk at all. Still I will repeat the original recipe ;-) > > > > def gen_im(self): > > imag= > > return imag > > access it like: http://Zobjects.in.the.mirror.appear.harder/myfolder/gen_im ok maybe you need to set: RESPONSE.setHeader('content-type',') before you return the object Pavlos From pje@telecommunity.com Thu Nov 11 18:30:24 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Thu, 11 Nov 1999 13:30:24 -0500 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: <19991111131316.29038@connect.com.au> References: Message-ID: <3.0.5.32.19991111133024.01420100@telecommunity.com> At 01:13 PM 11/11/99 +1100, Evan Gibson wrote: > >I _shouldn't_ be doing things like this in DTML. It shouldn't even let me. >The whole _.getattr(blah) sections are far beyond the reality of a >reporting language, and they don't go properly with an Object Oriented >paradigm either. >I should instead have an object made and be going: > > > >But the existing framework doesn't encourage this. If you banned _ access >in anything but python methods and made it so python methods can only be >used in Products, then you'd have the proper divide. I've got to say I disagree on a fundamental level with the whole, "DTML shouldn't let you do stuff" idea. Having to have two different languages to program one application is really pretty ridiculous to me. If it made sense, then why *aren't* we all "doing the right thing" and making objects and using DTML only to format HTML? Well, for one thing, it breaks the flow of development. It's like saying you should use Python only for scripting and anything that's "real programming" you should immediately drop down to C or C++ and implement something you can call from Python. Doesn't that seem rather silly? But there's a second, and far more significant reason why trying to make DTML "just a reporting language" doesn't work in reality. It's this: *generating HTML is a programming task*. The reason you need programming capability in DTML is because you need to program the bloody HTML, URL's, query strings, and all the other overhead of making an interactive application. If you start pushing the hard bits into Python, then sure, you don't "pollute your presentation with programming", but then, you start polluting your programming with presentation, which is equally bad, if not worse. Should people use good style? Sure. Should you make products that implement all the data/business rules stuff and provide a clean interface? Absolutely! But doing this won't keep the need for programming out of DTML, because there will always be the need to perform transformations and compositions of arbitrary kinds on those data objects, precisely *because* they encapsulate data and ignore presentation! That's the dirty little secret of why none of us can kick the programming-in-DTML habit. From dsh@magma-da.com Thu Nov 11 18:32:01 1999 From: dsh@magma-da.com (David S. Harrison) Date: Thu, 11 Nov 1999 10:32:01 -0800 Subject: [Zope-dev] Writing results directly back to browser References: Message-ID: <382B0BA1.3D1C733B@magma-da.com> Maybe I am not understanding your point. What is the type of 'imag' in your example? Is it a string? If so, that means that the external image must write the image to disk and that location must be visible to the ZServer. I would like to avoid it if possible. If 'imag' is some other type, how does ZServer know what to do with it? Pavlos Christoforou wrote: > > On Thu, 11 Nov 1999, David S. Harrison wrote: > > > > > Maybe I am not being clear. There is no image file. It will be generated > > No you were clear ... > > > completely from within the external method. I would like the external > > method to write to some sort of sink that will deliver the bits > > directly to the browser. If I can help it, I don't want the image > > to be written to disk at all. > > Still I will repeat the original recipe ;-) > > > > > > > def gen_im(self): > > > imag= > > > return imag > > > > > access it like: > > http://Zobjects.in.the.mirror.appear.harder/myfolder/gen_im > > ok maybe you need to set: > RESPONSE.setHeader('content-type',') before you return > the object > > Pavlos From Brian@digicool.com Thu Nov 11 18:50:40 1999 From: Brian@digicool.com (Brian Lloyd) Date: Thu, 11 Nov 1999 13:50:40 -0500 Subject: [Zope-dev] Passing arguments to external methods Message-ID: <613145F79272D211914B0020AFF6401914DD42@gandalf.digicool.com> > I'm currently trying to play with external methods using the > How-To written > by "brian". > > cf. http://www.zope.org/Documentation/How-To/ExternalMethods > > When I'm trying to pass the REQUEST object to my external method, Zope > complains: > > Zope has encountered an error while publishing this resource. > > Error Type: TypeError > Error Value: not enough arguments; expected 2, got 1 > > The method definition looks like "def helloWorld(self, > REQUEST)". And the > call to the external methods looks like " "helloWorld(REQUEST)">". > So it looks to me like Zope is asking for the "self" > variable, which is a > bit strange since this argument is supposed to be implicit. You aren't trying to call it from another External Method by any chance, are you? Can you post the code/dtml that you are actually using to call the helloWorld method? Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From hannu@tm.ee Thu Nov 11 18:49:04 1999 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 11 Nov 1999 20:49:04 +0200 Subject: [Zope-dev] Character codes References: <4.2.0.58.19991111125637.00af3c60@192.168.0.2> Message-ID: <382B0FA0.6984A2BD@tm.ee> Alexandre Ratti wrote: > > Hello, > > when displaying the raw content of a list with this code: > > > > > (The list values are extended characters for French accented letters. They > may not display correctly in your mailer.) > > I get this output: > > ['\351', '\340', '\371', '\350'] I guess it is called iso-8559-1 ? what you see are octal (NON)ASCII codes for the characters. The list is composed of 4 one-character strings, each shown as its octal code if outside the range 32 <= x < 127 ----------------- Hannu From eroussel@maestria.com Thu Nov 11 18:50:14 1999 From: eroussel@maestria.com (Emmanuel Rousselle) Date: Thu, 11 Nov 1999 13:50:14 -0500 Subject: [Zope-dev] Passing arguments to external methods In-Reply-To: <613145F79272D211914B0020AFF6401914DD42@gandalf.digicool.co m> Message-ID: <4.1.19991111134523.00a20100@manoir.bloodwolf.org> At 01:50 PM 11/11/99 -0500, Brian Lloyd wrote: >You aren't trying to call it from another External Method >by any chance, are you? Can you post the code/dtml that >you are actually using to call the helloWorld method? I'm using a DTML Document:

    This is the Document.

    and it is generating the error I described. On the other hand if I use: instead of: (as recommended by sergey2b@mail.ru in a previous post - thanks by the way ...) all work perfectly. -- Emmanuel From hannu@tm.ee Thu Nov 11 18:57:25 1999 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 11 Nov 1999 20:57:25 +0200 Subject: [Zope-dev] Writing results directly back to browser References: <382B0BA1.3D1C733B@magma-da.com> Message-ID: <382B1195.F60D9FD2@tm.ee> "David S. Harrison" wrote: > > Maybe I am not understanding your point. What is the type of 'imag' > in your example? type is string contents are what your external method generated (or what would be written to the file if the generated image were saved to disk) > Is it a string? If so, that means that the external > image must write the image to disk and that location must be visible > to the ZServer. There is no /law/ that strings should be written to disk :) You can just as well return them from functions. > I would like to avoid it if possible. > If 'imag' is some other type, how does ZServer know what to do with it? Zope has no need to know what to do with it, it just returns it to the browser that requested the url. You should set the Content-type: header though, so that the _browser_ would know that it is a png image ------------ Hannu From weiner@tu-harburg.de Thu Nov 11 19:01:16 1999 From: weiner@tu-harburg.de (Thomas Weiner) Date: Thu, 11 Nov 1999 20:01:16 +0100 Subject: [Zope-dev] Zope-beta failure on OSF/Alpha References: <199911111137.FAA04675@rampart.timecastle.net> <001901bf2c66$c57c3080$fce3ccc1@esrin.esa.it> Message-ID: <382B127C.69E8F1D9@tu-harburg.de> Gilles lavaux schrieb: [...] > > For Zope itself, a lot of things works on 64bits, ZODB ,DA , ftp access, > http,etc.. The only2 problems I have seen is the failure during a posting of > article in confera/sqhisdot: [traceback snipped] > > If someone doesn't have this confera error on RedHat 6.0/digital alpha linux > 2-2.5-16/python1.5.2, please let me know. hmmm, on NT 4 I had a similiar error with confera postings after porting confera topics from 1.10.3 to 2.1 (this affected only ported topics). Here the traceback I had: Traceback (innermost last): File D:\PROGRA~1\Zope2-0\lib\python\ZPublisher\Publish.py, line 214, in publish_module File D:\PROGRA~1\Zope2-0\lib\python\ZPublisher\Publish.py, line 179, in publish File D:\PROGRA~1\Zope2-0\lib\python\Zope\__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File D:\PROGRA~1\Zope2-0\lib\python\ZPublisher\Publish.py, line 165, in publish File D:\PROGRA~1\Zope2-0\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: addMessage) File D:\PROGRA~1\Zope2-0\lib\python\ZPublisher\Publish.py, line 102, in call_object (Object: addMessage) File D:\Programme\Zope2-0\lib\python\Products\Confera\Confera.py, line 309, in addMessage (Object: ElementWithAttributes) File D:\Programme\Zope2-0\lib\python\Products\Confera\Confera.py, line 195, in setItem (Object: ElementWithAttributes) File D:\PROGRA~1\Zope2-0\lib\python\SearchIndex\Index.py, line 222, in index_item AttributeError: (see above) I have no clue, if this is the same error, due to the fact, that your traceback stopped in the line before the last line I fixed it by changing Index.py in line 222: try: #new .. prevent confera error with addmessage in 1.10.3 topics if self.call_methods: k=k() except: pass quite simple .. but this helped in my case. hth, thomas -- fon: ++49 (0)40 42878 3781 fax: ++49 (0)40 42878 2728 From zope@teleo.net Thu Nov 11 18:29:21 1999 From: zope@teleo.net (Patrick Phalen) Date: Thu, 11 Nov 1999 10:29:21 -0800 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant In-Reply-To: <87r9hwyl8l.fsf@readymix.joyful.com> References: <382ADBF4.861713CB@vet.uu.nl> <87r9hwyl8l.fsf@readymix.joyful.com> Message-ID: <99111111125302.02136@quadra.teleo.net> [Simon Michael, on Thu, 11 Nov 1999]: : :: What's the ideal situation from user's point of view ? :: :: I've heard smalltalk, particularly squeak smalltalk, described as :: "liquid" and "transparent", meaning you can change things from the :: application level right down to virtual machine and it's completely :: consistent. There are no steep jumps in the learning curve requiring :: a new mindset, language, etc. I'm also reminded of Lucent's inferno :: where /*everything*/is/in/one/access-controlled/namespace. :: :: For zope to be more like this (it already goes a long way), I guess it :: would be python all the way, with a single conceptually-simple :: namespace that is always available, from bottom to top. :: :: Python is too hard for some ? Keep a limited DTML as an alternative. :: But to python users we will say: forget dtml; use python, use this :: single zope namespace, and you can do anything you want, things will :: work as you expect. :: :: Is this (a) what we have already ? (b) attainable ? (c) unrealistic ? :: Comments welcome. This is a great thread. It reminds me of the agony of decisionmaking going on right now on the XML standards lists. Wrestling with these issues can be painful, but is necessary. I'm in agreement with the thrust of Simon's ideas, and have been for some time. I'm going to express my opinion, although I do so hestitantly, because I'm sure some folks may disagree violently. ;) It's only my opinion. Paul asked for someone to collate the arguments of this thread, which perhaps someone will have the time to do. But I think the crux is that Zope access maps into two areas - DTML and Python. Between the two there is a great divide. One of the benefits of this discussion thus far is that several DC folk have confirmed that bridging this gap is diffcult, no magic bullet is forthcoming this week or next. Newbies can install Zope and build dynamic web sites with it without learning Python, *to a point*. But Zope is built out of Python, was inspired by Python and benefits from its integration with Python to such a degree that I think the newbie should be encouraged and aided from the beginning to drill down and learn the language. Look at Vignette StoryServer, a very successful product. To do anything interesting with it requires that you learn, not TCL, but a strange hybrid of TCL. Why? Because TCL, by design, doesn't address the same problem domain that Python does and needed to be extended. This means that big web development projects under Storyserver can't just pull new developers from the TCL community, but need to draw from the much smaller StoryServer/TCL community. Python doesn't suffer from this problem. Python is Zope's secret weapon. It's such an easy language to learn, that Guido van Rossum has grant money to explore using it as the basis for a massive, national, federally funded Computer Programming for Everyone project. I believe that most people who come to Zope are looking for tools that enable them to do Web Wizardry, not just get a site up. If you're responsible for architecting a new site, learn Python. DTML is for your content managers. Don Porter says that he feels he's been misled. That's not good. That's a problem with Zope's message to new users. I think new users should be encouraged, inspired and exhorted to embrace Python from the gitgo and given help to do that. *Perhaps*, in the final analysis, it's a disservice to everyone involved to maintain an atmosphere of "Python Denial." If you want to be a Web Wizard with Zope, let's face it, you should learn a little Python. You'll be happy you did. If you've never ever programmed a computer before, then you'll be REALLY happy you did. :) From sergey2b@mail.ru Thu Nov 11 19:18:06 1999 From: sergey2b@mail.ru (sergey2b) Date: Thu, 11 Nov 1999 22:18:06 +0300 Subject: [Zope-dev] Character codes Message-ID: <001e01bf2c79$878616c0$740100c0@ishop.ramax.spb.ru> add in z2.py #z2.py import locale locale.setlocale(locale.LC_ALL, "fr") -----Original Message----- From: Hannu Krosing To: Alexandre Ratti Cc: zope-dev@zope.org Date: 11 ÎÏÑÂÒÑ 1999 Ç. 21:56 Subject: Re: [Zope-dev] Character codes >Alexandre Ratti wrote: >> >> Hello, >> >> when displaying the raw content of a list with this code: >> >> >> >> >> (The list values are extended characters for French accented letters. They >> may not display correctly in your mailer.) >> >> I get this output: >> >> ['\351', '\340', '\371', '\350'] > >I guess it is called iso-8559-1 ? > >what you see are octal (NON)ASCII codes for the characters. > >The list is composed of 4 one-character strings, each shown as its octal >code if outside the range 32 <= x < 127 > >----------------- >Hannu > >_______________________________________________ >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 ) > > > From michel@digicool.com Thu Nov 11 20:37:39 1999 From: michel@digicool.com (Michel Pelletier) Date: Thu, 11 Nov 1999 15:37:39 -0500 Subject: [Zope-dev] Zope-beta failure on OSF/Alpha References: <199911111133.FAA04655@rampart.timecastle.net> <14378.45573.861353.390831@ifm.uni-kiel.de> Message-ID: <382B2913.FB42A325@digicool.com> Janko Hauser wrote: > > My personal conclusion is: running on alpha add some troubles. > > and > > Jeff Rush writes: > > Sorry to hear of your problem. Are you by chance running > > Red Hat Linux/Alpha? I do know that Red Hat took my Zope > > RPMs, rebuilt them (w/o change) on an Alpha and they said > > it all worked fine. Personally I've never seen an Alpha so I > > can't speak with authority but it -ought- to work. > > > > Or are you running the 2.1.0 beta 1 release? > > > > I use the 2.1.0 Beta, but had a similar problem with the stable > source, although I didn't looked further back than. According to the > wonderful platform.py the system is 'OSF1-V4.0-alpha-alpha'. The exact > error is: > > Stack overflow: pid 26669, proc python, addr 0x140889ff8, pc 0x120049ef0 Is there a way you can turn up the per-process stack? Perhaps a compilation option, or an OS runtime option. Perhap's OSF's default is too low. > Python runs fine on normal stuff, although I haven't tested the Your other stuff may not generate stacks nearly as deep as Zope, it's worth looking into. -Michel From Brian@digicool.com Thu Nov 11 19:42:59 1999 From: Brian@digicool.com (Brian Lloyd) Date: Thu, 11 Nov 1999 14:42:59 -0500 Subject: [Zope-dev] Zope 2.1.0 beta 1 caution - please read Message-ID: <613145F79272D211914B0020AFF6401914DD47@gandalf.digicool.com> Hi all - We (DC) have run across a bug in the 2.1.0 beta that has given us some grief on the zope.org site, and I wanted to post a caution to those folks currently using the beta. In short, if you are doing any ZClass development where your ZClasses are based on Python base classes that are still in development (e.g. you are updating the Python base classes at times), there is a risk of getting a non- unpicklable object stuck into your object database. While the sequence of events required to cause this is pretty arcane, it can potentially be a real pain to recover from. So, if you are doing active ZClass development in 2.1.0b1 we strongly suggest that you either go back to 2.0.1 or take a break until tomorrow or Monday (I hope to have a 2.1.0 b2 ready that resolves this by then). If this is too painful (or you're hardheaded or just like living on the edge :) at least be sure to back up your Data.fs regularly just in case. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From tsarna@endicor.com Thu Nov 11 19:40:14 1999 From: tsarna@endicor.com (Ty Sarna) Date: 11 Nov 1999 19:40:14 GMT Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <3826F005.7429DD42@digicool.com> Message-ID: <942349214.794732@fezzik.endicor.com> In article <3826F005.7429DD42@digicool.com>, Michel Pelletier wrote: > Consists of two file, BTreeObjectManager.py and BTreeFolder.py. Both go > in OFS (but it would probably be smart to make a seperate Product). BTW, I wrote something like this a month back or so called ZRack, which is similar. It was based onm BTree at first, but I later changed it to use Phillip Eby's simpletree, which has better write performance (doesn't always have to update one page per level of the tree). It also will assign id's for you, if you want. At any rate, one problem I ran into is that the ZClass support doesn't interract well with objectmanager's that don't support __getattr__. Adding a ZClass instance wants to add the instance, and then immediately getattr it back out. It was easy to hack around this, but it sure would be nice if the tree-ObjectManager *could* support getattr. The inability to override __getattr_ on Persistent subclasses keeps biting me (and others, from what I see on the lists) again and again. It would be *really* nice if this could be fixed. I'd even be happy with something like "You can't override __getattr_, but if you define __foo_getattr__, persistent will try it before returning AttributeError". From michel@digicool.com Thu Nov 11 21:21:35 1999 From: michel@digicool.com (Michel Pelletier) Date: Thu, 11 Nov 1999 16:21:35 -0500 Subject: [Zope-dev] ObjectManagers and their children References: <942349214.794732@fezzik.endicor.com> Message-ID: <382B335F.3160393A@digicool.com> Ty Sarna wrote: > In article <3826F005.7429DD42@digicool.com>, > Michel Pelletier wrote: > > Consists of two file, BTreeObjectManager.py and BTreeFolder.py. Both go > > in OFS (but it would probably be smart to make a seperate Product). > > BTW, I wrote something like this a month back or so called ZRack, which > is similar. It was based onm BTree at first, but I later changed it to > use Phillip Eby's simpletree, which has better write performance > (doesn't always have to update one page per level of the tree). It also > will assign id's for you, if you want. BTW, we plan of fixing the update-one-per-level bug, which Phillip pointed out to us. Can't make any promises on time... > At any rate, one problem I ran into is that the ZClass support doesn't > interract well with objectmanager's that don't support __getattr__. > Adding a ZClass instance wants to add the instance, and then immediately > getattr it back out. Hmm.. this sounds like more of a bug in ZClasses to me than OMs, but I see your point below, it's really about wanting to override __getattr__ > It was easy to hack around this, but it sure would be nice if the > tree-ObjectManager *could* support getattr. The inability to override > __getattr_ on Persistent subclasses keeps biting me (and others, from > what I see on the lists) again and again. It would be *really* nice if > this could be fixed. I'd even be happy with something like "You can't > override __getattr_, but if you define __foo_getattr__, persistent will > try it before returning AttributeError". I suspect jim would frown on another hook, we're trying to avoid as many new hooks as possible, especialy ones that may have a per hit or per traversal penalty. Perhaps I haven't thought about your idea enough though. -Michel From tsarna@endicor.com Thu Nov 11 21:34:12 1999 From: tsarna@endicor.com (Ty Sarna) Date: 11 Nov 1999 21:34:12 GMT Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <382B335F.3160393A@digicool.com> Message-ID: <942356052.146845@fezzik.endicor.com> In article <382B335F.3160393A@digicool.com>, Michel Pelletier wrote: > Hmm.. this sounds like more of a bug in ZClasses to me than OMs, but I > see your point below, it's really about wanting to override __getattr__ Right. > > It was easy to hack around this, but it sure would be nice if the > > tree-ObjectManager *could* support getattr. The inability to override > > __getattr_ on Persistent subclasses keeps biting me (and others, from > > what I see on the lists) again and again. It would be *really* nice if > > this could be fixed. I'd even be happy with something like "You can't > > override __getattr_, but if you define __foo_getattr__, persistent will > > try it before returning AttributeError". > > I suspect jim would frown on another hook, we're trying to avoid as many > new hooks as possible, especialy ones that may have a per hit or per > traversal penalty. Perhaps I haven't thought about your idea enough > though. Right. I'm just saying that if there does have to be a gross hack, I could accept that. It would be nice if it were simply possible to override __getattr__ in the usual manner. Or in an unusual manner, for that matter :-). So long as there's some way, I'm happy :-) From circle@gwi.net Thu Nov 11 21:56:51 1999 From: circle@gwi.net (Andrew Wilcox) Date: Thu, 11 Nov 1999 16:56:51 -0500 Subject: [Zope-dev] Best way to do access logging? Message-ID: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> I'm interested in doing some access logging for my Zope site -- a record that such and such an authenticated user accessed such and such a page. Anybody have an access log product already? Where is the best place to hook into the page serving process to grab the user name and URL when a page gets served? Any issues with storing the log in the ZODB? I can send it out to a SQL database if necessary, but would prefer to keep it within Zope (and more portable) unless there is a good reason not to. Thanks! Andrew From itamars@ibm.net Thu Nov 11 22:22:12 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Fri, 12 Nov 1999 00:22:12 +0200 Subject: [Zope-dev] Best way to do access logging? References: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> Message-ID: <382B4194.32DDA8C3@ibm.net> Andrew Wilcox wrote: > > I'm interested in doing some access logging for my Zope site -- a record > that such and such an authenticated user accessed such and such a page. We're starting to work on just that next week, or at least logging changes done by authenticated users. We're going to use SQL - we want to add a workflow tab (together with a record of who did what when) to lots of ZClasses, and we don't want to have to subclass them from a Workflow class. So we'll use a workflow object that'll be a method of the ZClasses, storing data in an external SQL database, 'cause the properties of the method will be in the class, not the instances. And I'd rather not keep this kind of data in Zope anyway. -- Itamar - itamars@ibm.net ---------------------------o----------------------------------------------o Perl/Gimp Greeting Cards | Trust? Ha! The US dollar is backed by ICBMs! | http://www.sealingwax.com | --Anonymous Coward, Slashdot | From simon@joyful.com Thu Nov 11 22:25:36 1999 From: simon@joyful.com (Simon Michael) Date: 11 Nov 1999 14:25:36 -0800 Subject: [Zope-dev] OT: inferno In-Reply-To: Patrick Phalen's message of "Thu, 11 Nov 1999 10:29:21 -0800" References: <382ADBF4.861713CB@vet.uu.nl> <87r9hwyl8l.fsf@readymix.joyful.com> <99111111125302.02136@quadra.teleo.net> Message-ID: <87d7tgy8bj.fsf_-_@readymix.joyful.com> Patrick Phalen writes: > Q. Why didn't Inferno kick Java's ass before Java got so much hype > and attention? > A. Because Lucent's CEO didn't even know it existed until well after > the WWW got big. :( His finding out about it stopped it dead, as far we and the world at large is concerned - it's a commercial asset now. We'll see it again in 5 years, perhaps. :) so-it-seems-ly-yrs, -Simon From zen@cs.rmit.edu.au Thu Nov 11 22:35:34 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 12 Nov 1999 09:35:34 +1100 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: <002d01bf2c67$80fcd490$8d84b2d8@token.hapenney.com> Message-ID: On Thu, 11 Nov 1999, Evan Simpson wrote: > The latest release of the PythonMethod Product has two kinds of > PythonMethod: regular and XXX. A switch in the source code allows you to > turn "XXXPythonMethod"s on and off, and they are off by default. XXXPMs are > wild, unsafe, and unrestricted, with (lack of) security equivalent to > External Methods. The only limit on them (under *nix, anyway) is that > they're likely to be running as user "nobody". Regular PMs, on the other > hand, are meant to be completely safe, and subject to all the same > restrictions as DTML, although this goal has not yet been acheived. Any > holes in regular PM security, however, only give improper access to Zope > objects, *not* the system at large. Is this using r_exec and Bastion from Python? Or do you have to roll your own? > > Question: Is there a way we can reconcile these two conflicting > > drives? If some solution can be found, then maybe PythonMethods could > > be added to the products that come with basic Zope. Suggestions? > > The DC folks have started talking with me about this. I'm optimistic. My summary of the thread so far would be along the lines of: Magic sequence- variables need to have aliases of sequence_ (everyone rabidly agrees on this) Strangely enough no one has owned up to actually implementing the '-' variables, most likely as they are afraid of being lynched. Program code should not be embedded in the Reporting language. DTML sucks when used beyond its intended scope as a Reporting language. The ability to program in DTML should be discouraged or possibly depricated. DTML is constantly being used beyond its intended scope, as there is no way to program Zope without resorting to External methods or Python Products with their various caveats. In particular, there is no way of running program code in a sandbox without using DTML which means all Zope programmers need to be given effective full control over the Zope installation. PythonMethods is available now and could fill the void if it is integrated with the Zope distribution. Work will need to be done proving that Python Methods opens no security concerns not already valid with DTML. > > 2) Perhaps they could use the rexec module or Zope's existing sandbox > > to run their code (but would the sandbox limit their usefulness? -- > > maybe not, if you take the attitude that serious Python code should > > still be in a product or ExternalMethod). Until program code can be implemented using the web interface and run securly in a sandbox, DTML will continue to be abused. ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From michel@digicool.com Thu Nov 11 23:53:18 1999 From: michel@digicool.com (Michel Pelletier) Date: Thu, 11 Nov 1999 18:53:18 -0500 Subject: [Zope-dev] Best way to do access logging? References: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> Message-ID: <382B56EE.767781F0@digicool.com> Andrew Wilcox wrote: > > I'm interested in doing some access logging for my Zope site -- a record > that such and such an authenticated user accessed such and such a page. > > Anybody have an access log product already? Somebody wrote a tag, check out the Products section. -Michel From s341625@student.uq.edu.au Thu Nov 11 23:00:29 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Fri, 12 Nov 1999 09:00:29 +1000 (GMT+1000) Subject: [Zope-dev] Zope 2.1.0 beta 1 caution - please read In-Reply-To: <613145F79272D211914B0020AFF6401914DD47@gandalf.digicool.com> Message-ID: On Thu, 11 Nov 1999, Brian Lloyd wrote: > Hi all - > > We (DC) have run across a bug in the 2.1.0 beta that has > given us some grief on the zope.org site, and I wanted to > post a caution to those folks currently using the beta. Oh dear - so that's what I did! To provide further info on this bug - it occurs when a Python base class defines an attribute the same name as an attribute / property of the ZClass based on it. What *appears* to happen is that it attempts to pickle the base Class attribute with the result that the database is corrupted. The following methods of recovering data don't work: * UNDO the transation - either I packed it or it packed it for me * DELETE the instances - Zope segfaults * ACCESS the instances - Zope segfaults * RECOVER (by shifting dates or whatever) the data - doesn't work So, how do I fix my database?? Cheers, Anthony Pfrunder From alex@gabuzomeu.net Thu Nov 11 22:20:42 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Thu, 11 Nov 1999 23:20:42 +0100 Subject: [Zope-dev] Character codes In-Reply-To: <001e01bf2c79$878616c0$740100c0@ishop.ramax.spb.ru> Message-ID: <4.2.0.58.19991111231156.00b16710@192.168.0.2> Hi Sergei, Thanks for your tip. Is this the same as setting "LOCALE_ID=" in z2.py or using the -L command line switch in Zope 2.1.0b? What are the consequences of this change on character display? I understand that setting the locale will enhance ZCatalog searches for words with extended chars. Cheers. Alexandre At 22:18 11/11/1999 +0300, you wrote: >add in z2.py > >#z2.py >import locale >locale.setlocale(locale.LC_ALL, "fr") (...) From ratti@dial.oleane.com Thu Nov 11 22:10:19 1999 From: ratti@dial.oleane.com (Alexandre Ratti) Date: Thu, 11 Nov 1999 23:10:19 +0100 Subject: [Zope-dev] Character codes In-Reply-To: <199911111857.KAA03609@zope.codeit.com> Message-ID: <4.2.0.58.19991111230738.00a99460@192.168.0.2> Hi Hannu, Thanks for this information. I didn't notice it was ASCII char value in octal form. Cheers. Alexandre At 10:57 11/11/1999 -0800, you wrote: >Date: Thu, 11 Nov 1999 20:49:04 +0200 >From: Hannu Krosing >To: Alexandre Ratti >Cc: zope-dev@zope.org >Subject: Re: [Zope-dev] Character codes > >Alexandre Ratti wrote: (snip) >I guess it is called iso-8559-1 ? > >what you see are octal (NON)ASCII codes for the characters. > >The list is composed of 4 one-character strings, each shown as its octal >code if outside the range 32 <= x < 127 From pje@telecommunity.com Thu Nov 11 23:47:11 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Thu, 11 Nov 1999 18:47:11 -0500 Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <942356052.146845@fezzik.endicor.com> References: <382B335F.3160393A@digicool.com> Message-ID: <3.0.5.32.19991111184711.0132deb0@telecommunity.com> At 09:34 PM 11/11/99 GMT, Ty Sarna wrote: >In article <382B335F.3160393A@digicool.com>, >Michel Pelletier wrote: >> >> I suspect jim would frown on another hook, we're trying to avoid as many >> new hooks as possible, especialy ones that may have a per hit or per >> traversal penalty. Perhaps I haven't thought about your idea enough >> though. > >Right. I'm just saying that if there does have to be a gross hack, I >could accept that. It would be nice if it were simply possible to >override __getattr__ in the usual manner. Or in an unusual manner, for >that matter :-). So long as there's some way, I'm happy :-) > Actually, here's an unusual manner in which you can do what you want (mostly). :) If you want a Persistent object that does __getattr__, all you need to do is redefine its __of__ method thusly: def __of__(self,context): me = Acquisiton.ImplicitAcquisitonWrapper(self,context) # normal self return Acquisiton.ImplicitAcquisitonWrapper(GetAttrWrapper(me),context) and define GetAttrWrapper thusly: class GetAttrWrapper(Acquisition.Implicit): def __init__(self,other): self._other = other def __getattr__(self,attr): other = self.__dict__['_other'] try: return other[attr] except KeyError: return getattr(other,attr) def __setattr__(self,attr,value): setattr(self.__dict__['_other'],attr,value) This is a very ugly kludge, and there are aspects that may not work 100% correctly. What it does is stick a wrapper around your persistent object which converts __getattr__ to try __getitem__ first. The kludgy part is that methods bound to the inner self will NOT have this getattr, as they will not be bound to the wrapper, and thus during execution of such a method, one must perform self[] calls to access these extended attributes. This could be overcome with more coding to check for PythonMethod objects and rebinding them as Acquisition.c does, but this is too complicated for me to do off the top of my head in this e-mail. :) From circle@gwi.net Fri Nov 12 00:13:11 1999 From: circle@gwi.net (Andrew Wilcox) Date: Thu, 11 Nov 1999 19:13:11 -0500 Subject: [Zope-dev] Best way to do access logging? In-Reply-To: <382B56EE.767781F0@digicool.com> References: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> Message-ID: <3.0.6.32.19991111191311.007cf900@mail.gwi.net> >> Anybody have an access log product already? > >Somebody wrote a tag, check out the Products section. Yes, I saw that, thanks, but I would want to store it as a structured record, not mix it up with other Zope server logging. Also I would prefer not to have to add a tag or method call to *every* page on the site. Maybe I could subclass a Folder? Wouldn't one of its methods get called during the URL walk, I would think, and that might be a good point to capture access information. Then I would have a "Access Logging Folder" that would record authenticated user and URL path info when child objects were accessed. From circle@gwi.net Fri Nov 12 00:15:22 1999 From: circle@gwi.net (Andrew Wilcox) Date: Thu, 11 Nov 1999 19:15:22 -0500 Subject: [Zope-dev] Best way to do access logging? In-Reply-To: <382B4194.32DDA8C3@ibm.net> References: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> Message-ID: <3.0.6.32.19991111191522.007b3970@mail.gwi.net> At 12:22 AM 11/12/99 +0200, Itamar Shtull-Trauring wrote: >Andrew Wilcox wrote: >> >> I'm interested in doing some access logging for my Zope site -- a record >> that such and such an authenticated user accessed such and such a page. > >We're starting to work on just that next week, or at least logging changes >done by authenticated users. > >We're going to use SQL - we want to add a workflow tab (together with a >record of who did what when) to lots of ZClasses, and we don't want to have >to subclass them from a Workflow class. So we'll use a workflow object >that'll be a method of the ZClasses, storing data in an external SQL >database, 'cause the properties of the method will be in the class, not the >instances. And I'd rather not keep this kind of data in Zope anyway. Sounds neat! Are you planning to release the code? What factors lead to your decision to store the records in SQL instead of in Zope? Andrew From petrilli@digicool.com Fri Nov 12 00:57:03 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Thu, 11 Nov 1999 19:57:03 -0500 Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: Message-ID: On 11/11/99 5:35 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > Magic sequence- variables need to have aliases of sequence_ (everyone > rabidly agrees on this) Strangely enough no one has owned up to > actually implementing the '-' variables, most likely as they are > afraid of being lynched. I looked at this today, it's not going into 2.1 most likely, it's a LOT of work to make sure it works, *and* doesn't have any negative performance impact. Since it will by its nature, I'll need to balance that with a performance enhancement somewhere :-) > Program code should not be embedded in the Reporting language. Amen. > DTML sucks when used beyond its intended scope as a Reporting language. > The ability to program in DTML should be discouraged or possibly > depricated. Discouraged, but that's all we can really do in reality. > DTML is constantly being used beyond its intended scope, as there > is no way to program Zope without resorting to External methods or > Python Products with their various caveats. In particular, there > is no way of running program code in a sandbox without using DTML > which means all Zope programmers need to be given effective full > control over the Zope installation. This is why we're a bit skeptical of new tags which encourage this... > PythonMethods is available now and could fill the void if it is > integrated with the Zope distribution. Work will need to be > done proving that Python Methods opens no security concerns not > already valid with DTML. This is being done, I think... it *will* introduce new security concerns, but we hope to quantify and mitigate them wherever possible. More power always comes with more danger. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From s341625@student.uq.edu.au Fri Nov 12 01:00:58 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Fri, 12 Nov 1999 11:00:58 +1000 (GMT+1000) Subject: [Zope-dev] Best way to do access logging? In-Reply-To: <3.0.6.32.19991111191522.007b3970@mail.gwi.net> Message-ID: On Thu, 11 Nov 1999, Andrew Wilcox wrote: > What factors lead to your decision to store the records in SQL instead of > in Zope? So that you can perform queries and get treads from the usage of your website. Also, if you have a server farm you can point them all to the same SQL server and run a python script to process them on another machine and use XML-rpc to send a summary back to the Zope server. Cheers, Anthony Pfrunder From lalo@webcom.com Fri Nov 12 01:05:23 1999 From: lalo@webcom.com (Lalo Martins) Date: Thu, 11 Nov 1999 23:05:23 -0200 Subject: [Zope-dev] Best way to do access logging? In-Reply-To: <3.0.6.32.19991111191311.007cf900@mail.gwi.net> References: <3.0.6.32.19991111165651.007cc300@mail.gwi.net> <382B56EE.767781F0@digicool.com> <3.0.6.32.19991111191311.007cf900@mail.gwi.net> Message-ID: <19991111230523.A26030@webcom.com> On Thu, Nov 11, 1999 at 07:13:11PM -0500, Andrew Wilcox wrote: > >> Anybody have an access log product already? > > > >Somebody wrote a tag, check out the Products section. > > Yes, I saw that, thanks, but I would want to store it as a structured > record, not mix it up with other Zope server logging. Also I would prefer > not to have to add a tag or method call to *every* page on the site. You could try the SiteAccess product, the Acces Rule is called for _every_ request under the folder where it resides. []s, |alo +---- -- I am Lalo of deB-org. You will be freed. Resistance is futile. http://www.webcom.com/lalo mailto:lalo@webcom.com pgp key in the web page Debian GNU/Linux --- http://www.debian.org Brazil of Darkness - http://www.webcom.com/lalo/BroDar From zen@cs.rmit.edu.au Fri Nov 12 02:09:51 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 12 Nov 1999 13:09:51 +1100 (EST) Subject: [Zope-dev] Zcatalog q: howto do a NOT? In-Reply-To: Message-ID: On Thu, 11 Nov 1999, Jos Yule wrote: > I want to do a ZCatalog search on this property, excluding all Objects which > have a certain value some where in the list property... > How the heck do i do this? > How do i do a plain > ? I can't figure out the proper DTML syntax... I think you will need to retrieve all all results, and skip items that you don't want: Select everything Something With the syntax errors fixed of course :-) ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From bill.anderson@libc.org Fri Nov 12 19:25:25 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Fri, 12 Nov 1999 12:25:25 -0700 Subject: [Zope-dev] Re: [Zope] Setting SERVER_NAME for ZServer References: <38299B78.B1076F91@ibm.net> Message-ID: <382C69A5.CCA15B18@libc.org> Itamar Shtull-Trauring wrote: > > The ZServer SERVER_NAME can be set by editing ZServer/medusa/http_server.py, > and adding > > server.server_name = "www.example.com" > > at line 554, right before server_port is set but after the unwanted > server_name is set, so the new value replaces the unwanted one. > Any reason the following code: ---------------------------------------- if not ip: self.log_info('Computing default hostname', 'warning') ip = socket.gethostbyname (socket.gethostname()) try: self.server_name = socket.gethostbyaddr (ip)[0] except socket.error: self.log_info('Cannot do reverse lookup', 'warning') self.server_name = ip # use the IP address as the "hostname" ---------------------------------------- can't be replaced with: ---------------------------------------- if not ip: self.log_info('Computing default hostname', 'warning') ip = socket.gethostbyname (socket.gethostname()) try: self.server_name = os.environ['SERVER_NAME'] except KeyError: self.server_name = socket.gethostbyaddr (ip)[0] except socket.error: self.log_info('Cannot do reverse lookup', 'warning') self.server_name = ip # use the IP address as the "hostname" --------------------------------------- And then the start script (or Zope.pcgi) could then set SERVER_NAME prior to calling the server proper? Just curious ... Bill -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From Victor.Zhai@ogilvy.com Fri Nov 12 02:43:45 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Fri, 12 Nov 1999 10:43:45 +0800 Subject: [Zope-dev] What can I do of Changing a web site to Zope! Message-ID: Hi I want to change my existing web site to Zope,But I donnot how to do it.Can any one help me.Or give me some advice about that. Best regard. Victor zhai. "WorldSecure Server " made the following annotations on 11/11/99 21:50:05 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From dsh@magma-da.com Fri Nov 12 02:57:13 1999 From: dsh@magma-da.com (David S. Harrison) Date: Thu, 11 Nov 1999 18:57:13 -0800 Subject: [Zope-dev] Writing results directly back to browser References: Message-ID: <382B8209.94342E55@magma-da.com> Pavlos is correct. What I didn't realize is that Zope treats the return value from an external method as the actual content that will be returned by the server (not the name of the content). As long as my routine can write the image into a Python string, it is easy to return that data correctly for use in DTML. The only trick is to make sure the content type is set appropriately: def GenerateImage(self, RESPONSE): # Image bits is a string containing the bytes of the image. imageBits = computeImage() RESPONSE.setHeader('content-type', 'image/png') return imageBits In the DTML, I can use a simple image tag to get access to this image:

    This is the Document. Below is a computed image:

    All in all, it looks like this is easier than I expected. I am certainly glad I don't have to worry about writing the images to disk. Figuring out when those files expire is always a nightmare. David S. Harrison (dsh@magma-da.com) Pavlos Christoforou wrote: > > > > > > def gen_im(self): > > > imag= > > > return imag > > > > From bill.anderson@libc.org Fri Nov 12 20:03:36 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Fri, 12 Nov 1999 13:03:36 -0700 Subject: [Zope-dev] Re: [Zope] Setting SERVER_NAME for ZServer References: <38299B78.B1076F91@ibm.net> Message-ID: <382C7298.315CDBD4@libc.org> Itamar Shtull-Trauring wrote: > > The ZServer SERVER_NAME can be set by editing ZServer/medusa/http_server.py, > and adding > > server.server_name = "www.example.com" > > at line 554, right before server_port is set but after the unwanted > server_name is set, so the new value replaces the unwanted one. > Any reason the following code: ---------------------------------------- if not ip: self.log_info('Computing default hostname', 'warning') ip = socket.gethostbyname (socket.gethostname()) try: self.server_name = socket.gethostbyaddr (ip)[0] except socket.error: self.log_info('Cannot do reverse lookup', 'warning') self.server_name = ip # use the IP address as the "hostname" ---------------------------------------- can't be replaced with: ---------------------------------------- if not ip: self.log_info('Computing default hostname', 'warning') ip = socket.gethostbyname (socket.gethostname()) try: self.server_name = os.environ['SERVER_NAME'] except KeyError: self.server_name = socket.gethostbyaddr (ip)[0] except socket.error: self.log_info('Cannot do reverse lookup', 'warning') self.server_name = ip # use the IP address as the "hostname" --------------------------------------- And then the start script (or Zope.pcgi) could then set SERVER_NAME prior to calling the server proper? Just curious ... Bill -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From lalo@webcom.com Fri Nov 12 02:55:10 1999 From: lalo@webcom.com (Lalo Martins) Date: Fri, 12 Nov 1999 00:55:10 -0200 Subject: [Zope-dev] Performance? Message-ID: <19991112005509.B26030@webcom.com> A friend (owner of the site where we will plug our Zope machine) has being conducting some benchmarks and found Zope+Apache to be a lot faster than Zope-z2. Why? Is there any way to improve it? Is there any other webserver that is not so much of a pain to configure and overkill to run, that can make Zope run faster? Hmm... this should be on zope, not zope-dev :-) let's fix it: Is there anything we can do to improve z2? Or to make Zope work nicely with one of the ``lightspeed'' webservers such as boa? []s, |alo +---- -- I am Lalo of deB-org. You will be freed. Resistance is futile. http://www.webcom.com/lalo mailto:lalo@webcom.com pgp key in the web page Debian GNU/Linux --- http://www.debian.org Brazil of Darkness - http://www.webcom.com/lalo/BroDar From hyakugei@theorganization.net" And, again, questions... lets say i have some properties that i want to concatenate. they are both int's (or not, i'm sure i will want to do this with strings too at some point) that i would like to cast to strings. propA = 1 propB = 2 lets say that i want to be able to do something like propC = string(propA) + string(propB) which should result in propC = "12" I've *read* about string.join() but am unable to make it work... Any help would be great!!! thanks again! j From hyakugei@theorganization.net" Once again, i have managed to answer my own question - here you go if you were wondering. Integer addition. gives you 3 string addition gives you 12 got it? From andrew@eventera.com Fri Nov 12 04:46:59 1999 From: andrew@eventera.com (Andrew) Date: Thu, 11 Nov 1999 23:46:59 -0500 Subject: [Zope-dev] Photo Product Release Message-ID: <382B9BC3.B34ABA18@eventera.com> The Photo product allows the user to view an image at their preferred display size. The Photo product also automatically produces a thumbnail. The Photo product works by resizing the image after upload using PIL. Thereafter, the user can set their optimum display size as a parameter in the URL. The default display sizes correspond to all popular display sizes, including webtv. Displays can be added, removed and resized using DTML. This release of the Photo product is an alpha version and is intended for developers only. The DTML methods, web management screens and properties may all change before the first stable release. An upgrade path may not be provided. Please send comments and feedback to andrew@apl-software.com Drew From andrew@eventera.com Fri Nov 12 04:48:41 1999 From: andrew@eventera.com (Andrew) Date: Thu, 11 Nov 1999 23:48:41 -0500 Subject: [Zope-dev] Photo Release, Part II Message-ID: <382B9C29.170F89FE@eventera.com> And, uh, yeah... The URL is http://www.zope.org/Members/Drew/Photo later, Drew From zen@cs.rmit.edu.au Fri Nov 12 05:18:54 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 12 Nov 1999 16:18:54 +1100 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-748104835-942383934=:10674 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 11 Nov 1999, Christopher Petrilli wrote: > On 11/11/99 5:35 PM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > > Magic sequence- variables need to have aliases of sequence_ (everyone > > rabidly agrees on this) Strangely enough no one has owned up to > > actually implementing the '-' variables, most likely as they are > > afraid of being lynched. > > I looked at this today, it's not going into 2.1 most likely, it's a LOT of > work to make sure it works, *and* doesn't have any negative performance > impact. Since it will by its nature, I'll need to balance that with a > performance enhancement somewhere :-) Is this any good as a temporary fix? *** DT_InSV.py.org Fri Nov 12 15:26:50 1999 --- DT_InSV.py Fri Nov 12 16:06:51 1999 *************** *** 88,94 **** $Id: DT_InSV.py,v 1.16 1999/11/02 16:51:32 brian Exp $''' __version__='$Revision: 1.16 $'[11:-2] ! from string import lower, rfind, split, join from math import sqrt TupleType=type(()) try: --- 88,95 ---- $Id: DT_InSV.py,v 1.16 1999/11/02 16:51:32 brian Exp $''' __version__='$Revision: 1.16 $'[11:-2] ! from UserDict import UserDict ! from string import lower, rfind, split, join, replace from math import sqrt TupleType=type(()) try: *************** *** 96,101 **** --- 97,122 ---- mv=Missing.Value except: mv=None + def _transkey(key): + if key[:13] == 'sequence-var-': + # Only translate the first 2 '-' characters in a sequence-var- + return replace(key,'-','_',2) + else: + return replace(key,'-','_') + + class sequence_kwdict(UserDict): + '''This class is used to implement the dictionary in sequence_variables + It duplicates keys containing '-' characters to a corresponding entry + with a key mapping all the first two '-' characters to '_' characters. + This will greatly improve DTML readability.''' + + def __setitem__(self,key,value): + self.data[key] = value + self.data[_transkey(key)] = value + + def __delitem__(self,key,value): + del self.data[key] + del self.data[_transkey(key)] class sequence_variables: *************** *** 105,116 **** self.query_string=query_string self.start_name_re=start_name_re ! self.data=data={ 'previous-sequence': 0, 'next-sequence': 0, 'sequence-start': 1, 'sequence-end': 0, ! } def number(self,index): return index+1 --- 126,137 ---- self.query_string=query_string self.start_name_re=start_name_re ! self.data=data=sequence_kwdict({ 'previous-sequence': 0, 'next-sequence': 0, 'sequence-start': 1, 'sequence-end': 0, ! }) def number(self,index): return index+1 ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen ---559023410-748104835-942383934=:10674 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="DT_InSV.py" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="DT_InSV.py" KioqIERUX0luU1YucHkub3JnCUZyaSBOb3YgMTIgMTU6MjY6NTAgMTk5OQ0K LS0tIERUX0luU1YucHkJRnJpIE5vdiAxMiAxNjowNjo1MSAxOTk5DQoqKioq KioqKioqKioqKioNCioqKiA4OCw5NCAqKioqDQogICRJZDogRFRfSW5TVi5w eSx2IDEuMTYgMTk5OS8xMS8wMiAxNjo1MTozMiBicmlhbiBFeHAgJCcnJw0K ICBfX3ZlcnNpb25fXz0nJFJldmlzaW9uOiAxLjE2ICQnWzExOi0yXQ0KICAN CiEgZnJvbSBzdHJpbmcgaW1wb3J0IGxvd2VyLCByZmluZCwgc3BsaXQsIGpv aW4NCiAgZnJvbSBtYXRoIGltcG9ydCBzcXJ0DQogIFR1cGxlVHlwZT10eXBl KCgpKQ0KICB0cnk6DQotLS0gODgsOTUgLS0tLQ0KICAkSWQ6IERUX0luU1Yu cHksdiAxLjE2IDE5OTkvMTEvMDIgMTY6NTE6MzIgYnJpYW4gRXhwICQnJycN CiAgX192ZXJzaW9uX189JyRSZXZpc2lvbjogMS4xNiAkJ1sxMTotMl0NCiAg DQohIGZyb20gVXNlckRpY3QgaW1wb3J0IFVzZXJEaWN0DQohIGZyb20gc3Ry aW5nIGltcG9ydCBsb3dlciwgcmZpbmQsIHNwbGl0LCBqb2luLCByZXBsYWNl DQogIGZyb20gbWF0aCBpbXBvcnQgc3FydA0KICBUdXBsZVR5cGU9dHlwZSgo KSkNCiAgdHJ5Og0KKioqKioqKioqKioqKioqDQoqKiogOTYsMTAxICoqKioN Ci0tLSA5NywxMjIgLS0tLQ0KICAgICAgbXY9TWlzc2luZy5WYWx1ZQ0KICBl eGNlcHQ6IG12PU5vbmUNCiAgDQorIGRlZiBfdHJhbnNrZXkoa2V5KToNCisg ICAgIGlmIGtleVs6MTNdID09ICdzZXF1ZW5jZS12YXItJzoNCisgCSMgT25s eSB0cmFuc2xhdGUgdGhlIGZpcnN0IDIgJy0nIGNoYXJhY3RlcnMgaW4gYSBz ZXF1ZW5jZS12YXItDQorIAlyZXR1cm4gcmVwbGFjZShrZXksJy0nLCdfJywy KSANCisgICAgIGVsc2U6DQorIAlyZXR1cm4gcmVwbGFjZShrZXksJy0nLCdf JykNCisgDQorIGNsYXNzIHNlcXVlbmNlX2t3ZGljdChVc2VyRGljdCk6DQor ICAgICAnJydUaGlzIGNsYXNzIGlzIHVzZWQgdG8gaW1wbGVtZW50IHRoZSBk aWN0aW9uYXJ5IGluIHNlcXVlbmNlX3ZhcmlhYmxlcw0KKyAgICAgICAgSXQg ZHVwbGljYXRlcyBrZXlzIGNvbnRhaW5pbmcgJy0nIGNoYXJhY3RlcnMgdG8g YSBjb3JyZXNwb25kaW5nIGVudHJ5DQorICAgICAgICB3aXRoIGEga2V5IG1h cHBpbmcgYWxsIHRoZSBmaXJzdCB0d28gJy0nIGNoYXJhY3RlcnMgdG8gJ18n IGNoYXJhY3RlcnMuIA0KKyAgICAgICAgVGhpcyB3aWxsIGdyZWF0bHkgaW1w cm92ZSBEVE1MIHJlYWRhYmlsaXR5LicnJw0KKyANCisgICAgIGRlZiBfX3Nl dGl0ZW1fXyhzZWxmLGtleSx2YWx1ZSk6DQorIAlzZWxmLmRhdGFba2V5XSA9 IHZhbHVlDQorIAlzZWxmLmRhdGFbX3RyYW5za2V5KGtleSldID0gdmFsdWUN CisgDQorICAgICBkZWYgX19kZWxpdGVtX18oc2VsZixrZXksdmFsdWUpOg0K KyAJZGVsIHNlbGYuZGF0YVtrZXldDQorIAlkZWwgc2VsZi5kYXRhW190cmFu c2tleShrZXkpXQ0KICANCiAgY2xhc3Mgc2VxdWVuY2VfdmFyaWFibGVzOg0K ICANCioqKioqKioqKioqKioqKg0KKioqIDEwNSwxMTYgKioqKg0KICAgICAg ICAgIHNlbGYucXVlcnlfc3RyaW5nPXF1ZXJ5X3N0cmluZw0KICAgICAgICAg IHNlbGYuc3RhcnRfbmFtZV9yZT1zdGFydF9uYW1lX3JlDQogIA0KISAgICAg ICAgIHNlbGYuZGF0YT1kYXRhPXsNCiAgICAgICAgICAgICAgJ3ByZXZpb3Vz LXNlcXVlbmNlJzogMCwNCiAgICAgICAgICAgICAgJ25leHQtc2VxdWVuY2Un OiAwLA0KICAgICAgICAgICAgICAnc2VxdWVuY2Utc3RhcnQnOiAxLA0KICAg ICAgICAgICAgICAnc2VxdWVuY2UtZW5kJzogMCwNCiEgICAgICAgICAgICAg fQ0KICANCiAgDQogICAgICBkZWYgbnVtYmVyKHNlbGYsaW5kZXgpOiByZXR1 cm4gaW5kZXgrMQ0KLS0tIDEyNiwxMzcgLS0tLQ0KICAgICAgICAgIHNlbGYu cXVlcnlfc3RyaW5nPXF1ZXJ5X3N0cmluZw0KICAgICAgICAgIHNlbGYuc3Rh cnRfbmFtZV9yZT1zdGFydF9uYW1lX3JlDQogIA0KISAgICAgICAgIHNlbGYu ZGF0YT1kYXRhPXNlcXVlbmNlX2t3ZGljdCh7DQogICAgICAgICAgICAgICdw cmV2aW91cy1zZXF1ZW5jZSc6IDAsDQogICAgICAgICAgICAgICduZXh0LXNl cXVlbmNlJzogMCwNCiAgICAgICAgICAgICAgJ3NlcXVlbmNlLXN0YXJ0Jzog MSwNCiAgICAgICAgICAgICAgJ3NlcXVlbmNlLWVuZCc6IDAsDQohICAgICAg ICAgICAgIH0pDQogIA0KICANCiAgICAgIGRlZiBudW1iZXIoc2VsZixpbmRl eCk6IHJldHVybiBpbmRleCsxDQo= ---559023410-748104835-942383934=:10674-- From zen@cs.rmit.edu.au Fri Nov 12 05:36:37 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 12 Nov 1999 16:36:37 +1100 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1053718679-942384997=:10674 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 12 Nov 1999, Stuart 'Zen' Bishop wrote: > Is this any good as a temporary fix? Grr... just found an obvious flaw. Lets try take 2 at embarassing myself. *** DT_InSV.py.org Fri Nov 12 15:26:50 1999 --- DT_InSV.py Fri Nov 12 16:29:56 1999 *************** *** 88,94 **** $Id: DT_InSV.py,v 1.16 1999/11/02 16:51:32 brian Exp $''' __version__='$Revision: 1.16 $'[11:-2] ! from string import lower, rfind, split, join from math import sqrt TupleType=type(()) try: --- 88,95 ---- $Id: DT_InSV.py,v 1.16 1999/11/02 16:51:32 brian Exp $''' __version__='$Revision: 1.16 $'[11:-2] ! from UserDict import UserDict ! from string import lower, rfind, split, join, replace from math import sqrt TupleType=type(()) try: *************** *** 96,101 **** --- 97,127 ---- mv=Missing.Value except: mv=None + def _transkey(key): + if key[:13] == 'sequence-var-': + # Only translate the first 2 '-' characters in a sequence-var- + return replace(key,'-','_',2) + else: + return replace(key,'-','_') + + class sequence_kwdict(UserDict): + '''This class is used to implement the dictionary in sequence_variables + It duplicates keys containing '-' characters to a corresponding entry + with a key mapping all the first two '-' characters to '_' characters. + This will greatly improve DTML readability.''' + + def __init__(self,data): + self.data = data + for i in data.items(): + data[_transkey(i[0])] = i[1] + + def __setitem__(self,key,value): + self.data[key] = value + self.data[_transkey(key)] = value + + def __delitem__(self,key,value): + del self.data[key] + del self.data[_transkey(key)] class sequence_variables: *************** *** 105,116 **** self.query_string=query_string self.start_name_re=start_name_re ! self.data=data={ 'previous-sequence': 0, 'next-sequence': 0, 'sequence-start': 1, 'sequence-end': 0, ! } def number(self,index): return index+1 --- 131,142 ---- self.query_string=query_string self.start_name_re=start_name_re ! self.data=data=sequence_kwdict({ 'previous-sequence': 0, 'next-sequence': 0, 'sequence-start': 1, 'sequence-end': 0, ! }) def number(self,index): return index+1 ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen ---559023410-1053718679-942384997=:10674 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="DT_InSV.py" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="DT_InSV.py" IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjDQojIA0KIyBab3Bl IFB1YmxpYyBMaWNlbnNlIChaUEwpIFZlcnNpb24gMS4wDQojIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiMgDQojIENvcHlyaWdo dCAoYykgRGlnaXRhbCBDcmVhdGlvbnMuICBBbGwgcmlnaHRzIHJlc2VydmVk Lg0KIyANCiMgVGhpcyBsaWNlbnNlIGhhcyBiZWVuIGNlcnRpZmllZCBhcyBP cGVuIFNvdXJjZSh0bSkuDQojIA0KIyBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNl IGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQN CiMgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQg dGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZQ0KIyBtZXQ6DQojIA0KIyAx LiBSZWRpc3RyaWJ1dGlvbnMgaW4gc291cmNlIGNvZGUgbXVzdCByZXRhaW4g dGhlIGFib3ZlIGNvcHlyaWdodA0KIyAgICBub3RpY2UsIHRoaXMgbGlzdCBv ZiBjb25kaXRpb25zLCBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLg0K IyANCiMgMi4gUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3Qg cmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQNCiMgICAgbm90aWNlLCB0 aGlzIGxpc3Qgb2YgY29uZGl0aW9ucywgYW5kIHRoZSBmb2xsb3dpbmcgZGlz Y2xhaW1lciBpbg0KIyAgICB0aGUgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3Ro ZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlDQojICAgIGRpc3RyaWJ1 dGlvbi4NCiMgDQojIDMuIERpZ2l0YWwgQ3JlYXRpb25zIHJlcXVlc3RzIHRo YXQgYXR0cmlidXRpb24gYmUgZ2l2ZW4gdG8gWm9wZQ0KIyAgICBpbiBhbnkg bWFubmVyIHBvc3NpYmxlLiBab3BlIGluY2x1ZGVzIGEgIlBvd2VyZWQgYnkg Wm9wZSINCiMgICAgYnV0dG9uIHRoYXQgaXMgaW5zdGFsbGVkIGJ5IGRlZmF1 bHQuIFdoaWxlIGl0IGlzIG5vdCBhIGxpY2Vuc2UNCiMgICAgdmlvbGF0aW9u IHRvIHJlbW92ZSB0aGlzIGJ1dHRvbiwgaXQgaXMgcmVxdWVzdGVkIHRoYXQg dGhlDQojICAgIGF0dHJpYnV0aW9uIHJlbWFpbi4gQSBzaWduaWZpY2FudCBp bnZlc3RtZW50IGhhcyBiZWVuIHB1dA0KIyAgICBpbnRvIFpvcGUsIGFuZCB0 aGlzIGVmZm9ydCB3aWxsIGNvbnRpbnVlIGlmIHRoZSBab3BlIGNvbW11bml0 eQ0KIyAgICBjb250aW51ZXMgdG8gZ3Jvdy4gVGhpcyBpcyBvbmUgd2F5IHRv IGFzc3VyZSB0aGF0IGdyb3d0aC4NCiMgDQojIDQuIEFsbCBhZHZlcnRpc2lu ZyBtYXRlcmlhbHMgYW5kIGRvY3VtZW50YXRpb24gbWVudGlvbmluZw0KIyAg ICBmZWF0dXJlcyBkZXJpdmVkIGZyb20gb3IgdXNlIG9mIHRoaXMgc29mdHdh cmUgbXVzdCBkaXNwbGF5DQojICAgIHRoZSBmb2xsb3dpbmcgYWNrbm93bGVk Z2VtZW50Og0KIyANCiMgICAgICAiVGhpcyBwcm9kdWN0IGluY2x1ZGVzIHNv ZnR3YXJlIGRldmVsb3BlZCBieSBEaWdpdGFsIENyZWF0aW9ucw0KIyAgICAg IGZvciB1c2UgaW4gdGhlIFogT2JqZWN0IFB1Ymxpc2hpbmcgRW52aXJvbm1l bnQNCiMgICAgICAoaHR0cDovL3d3dy56b3BlLm9yZy8pLiINCiMgDQojICAg IEluIHRoZSBldmVudCB0aGF0IHRoZSBwcm9kdWN0IGJlaW5nIGFkdmVydGlz ZWQgaW5jbHVkZXMgYW4NCiMgICAgaW50YWN0IFpvcGUgZGlzdHJpYnV0aW9u ICh3aXRoIGNvcHlyaWdodCBhbmQgbGljZW5zZSBpbmNsdWRlZCkNCiMgICAg dGhlbiB0aGlzIGNsYXVzZSBpcyB3YWl2ZWQuDQojIA0KIyA1LiBOYW1lcyBh c3NvY2lhdGVkIHdpdGggWm9wZSBvciBEaWdpdGFsIENyZWF0aW9ucyBtdXN0 IG5vdCBiZSB1c2VkIHRvDQojICAgIGVuZG9yc2Ugb3IgcHJvbW90ZSBwcm9k dWN0cyBkZXJpdmVkIGZyb20gdGhpcyBzb2Z0d2FyZSB3aXRob3V0DQojICAg IHByaW9yIHdyaXR0ZW4gcGVybWlzc2lvbiBmcm9tIERpZ2l0YWwgQ3JlYXRp b25zLg0KIyANCiMgNi4gTW9kaWZpZWQgcmVkaXN0cmlidXRpb25zIG9mIGFu eSBmb3JtIHdoYXRzb2V2ZXIgbXVzdCByZXRhaW4NCiMgICAgdGhlIGZvbGxv d2luZyBhY2tub3dsZWRnbWVudDoNCiMgDQojICAgICAgIlRoaXMgcHJvZHVj dCBpbmNsdWRlcyBzb2Z0d2FyZSBkZXZlbG9wZWQgYnkgRGlnaXRhbCBDcmVh dGlvbnMNCiMgICAgICBmb3IgdXNlIGluIHRoZSBaIE9iamVjdCBQdWJsaXNo aW5nIEVudmlyb25tZW50DQojICAgICAgKGh0dHA6Ly93d3cuem9wZS5vcmcv KS4iDQojIA0KIyAgICBJbnRhY3QgKHJlLSlkaXN0cmlidXRpb25zIG9mIGFu eSBvZmZpY2lhbCBab3BlIHJlbGVhc2UgZG8gbm90DQojICAgIHJlcXVpcmUg YW4gZXh0ZXJuYWwgYWNrbm93bGVkZ2VtZW50Lg0KIyANCiMgNy4gTW9kaWZp Y2F0aW9ucyBhcmUgZW5jb3VyYWdlZCBidXQgbXVzdCBiZSBwYWNrYWdlZCBz ZXBhcmF0ZWx5IGFzDQojICAgIHBhdGNoZXMgdG8gb2ZmaWNpYWwgWm9wZSBy ZWxlYXNlcy4gIERpc3RyaWJ1dGlvbnMgdGhhdCBkbyBub3QNCiMgICAgY2xl YXJseSBzZXBhcmF0ZSB0aGUgcGF0Y2hlcyBmcm9tIHRoZSBvcmlnaW5hbCB3 b3JrIG11c3QgYmUgY2xlYXJseQ0KIyAgICBsYWJlbGVkIGFzIHVub2ZmaWNp YWwgZGlzdHJpYnV0aW9ucy4gIE1vZGlmaWNhdGlvbnMgd2hpY2ggZG8gbm90 DQojICAgIGNhcnJ5IHRoZSBuYW1lIFpvcGUgbWF5IGJlIHBhY2thZ2VkIGlu IGFueSBmb3JtLCBhcyBsb25nIGFzIHRoZXkNCiMgICAgY29uZm9ybSB0byBh bGwgb2YgdGhlIGNsYXVzZXMgYWJvdmUuDQojIA0KIyANCiMgRGlzY2xhaW1l cg0KIyANCiMgICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIERJR0lU QUwgQ1JFQVRJT05TIGBgQVMgSVMnJyBBTkQgQU5ZDQojICAgRVhQUkVTU0VE IE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJ TUlURUQgVE8sIFRIRQ0KIyAgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJD SEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUg0KIyAg IFBVUlBPU0UgQVJFIERJU0NMQUlNRUQuICBJTiBOTyBFVkVOVCBTSEFMTCBE SUdJVEFMIENSRUFUSU9OUyBPUiBJVFMNCiMgICBDT05UUklCVVRPUlMgQkUg TElBQkxFIEZPUiBBTlkgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwN CiMgICBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFN QUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UDQojICAgTElNSVRFRCBUTywgUFJP Q1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUzsgTE9T UyBPRg0KIyAgIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1Mg SU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkQNCiMgICBPTiBBTlkg VEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RS SUNUIExJQUJJTElUWSwNCiMgICBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElH RU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQNCiMg ICBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNF RCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YNCiMgICBTVUNIIERBTUFHRS4NCiMg DQojIA0KIyBUaGlzIHNvZnR3YXJlIGNvbnNpc3RzIG9mIGNvbnRyaWJ1dGlv bnMgbWFkZSBieSBEaWdpdGFsIENyZWF0aW9ucyBhbmQNCiMgbWFueSBpbmRp dmlkdWFscyBvbiBiZWhhbGYgb2YgRGlnaXRhbCBDcmVhdGlvbnMuICBTcGVj aWZpYw0KIyBhdHRyaWJ1dGlvbnMgYXJlIGxpc3RlZCBpbiB0aGUgYWNjb21w YW55aW5nIGNyZWRpdHMgZmlsZS4NCiMgDQojIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMNCl9fZG9jX189JycnU2VxdWVuY2UgdmFyaWFibGVz IHN1cHBvcnQNCg0KDQokSWQ6IERUX0luU1YucHksdiAxLjE2IDE5OTkvMTEv MDIgMTY6NTE6MzIgYnJpYW4gRXhwICQnJycNCl9fdmVyc2lvbl9fPSckUmV2 aXNpb246IDEuMTYgJCdbMTE6LTJdDQoNCmZyb20gVXNlckRpY3QgaW1wb3J0 IFVzZXJEaWN0DQpmcm9tIHN0cmluZyBpbXBvcnQgbG93ZXIsIHJmaW5kLCBz cGxpdCwgam9pbiwgcmVwbGFjZQ0KZnJvbSBtYXRoIGltcG9ydCBzcXJ0DQpU dXBsZVR5cGU9dHlwZSgoKSkNCnRyeToNCiAgICBpbXBvcnQgTWlzc2luZw0K ICAgIG12PU1pc3NpbmcuVmFsdWUNCmV4Y2VwdDogbXY9Tm9uZQ0KDQpkZWYg X3RyYW5za2V5KGtleSk6DQogICAgaWYga2V5WzoxM10gPT0gJ3NlcXVlbmNl LXZhci0nOg0KCSMgT25seSB0cmFuc2xhdGUgdGhlIGZpcnN0IDIgJy0nIGNo YXJhY3RlcnMgaW4gYSBzZXF1ZW5jZS12YXItDQoJcmV0dXJuIHJlcGxhY2Uo a2V5LCctJywnXycsMikgDQogICAgZWxzZToNCglyZXR1cm4gcmVwbGFjZShr ZXksJy0nLCdfJykNCg0KY2xhc3Mgc2VxdWVuY2Vfa3dkaWN0KFVzZXJEaWN0 KToNCiAgICAnJydUaGlzIGNsYXNzIGlzIHVzZWQgdG8gaW1wbGVtZW50IHRo ZSBkaWN0aW9uYXJ5IGluIHNlcXVlbmNlX3ZhcmlhYmxlcw0KICAgICAgIEl0 IGR1cGxpY2F0ZXMga2V5cyBjb250YWluaW5nICctJyBjaGFyYWN0ZXJzIHRv IGEgY29ycmVzcG9uZGluZyBlbnRyeQ0KICAgICAgIHdpdGggYSBrZXkgbWFw cGluZyBhbGwgdGhlIGZpcnN0IHR3byAnLScgY2hhcmFjdGVycyB0byAnXycg Y2hhcmFjdGVycy4gDQogICAgICAgVGhpcyB3aWxsIGdyZWF0bHkgaW1wcm92 ZSBEVE1MIHJlYWRhYmlsaXR5LicnJw0KDQogICAgZGVmIF9faW5pdF9fKHNl bGYsZGF0YSk6DQoJc2VsZi5kYXRhID0gZGF0YQ0KCWZvciBpIGluIGRhdGEu aXRlbXMoKToNCgkgICAgZGF0YVtfdHJhbnNrZXkoaVswXSldID0gaVsxXQ0K DQogICAgZGVmIF9fc2V0aXRlbV9fKHNlbGYsa2V5LHZhbHVlKToNCglzZWxm LmRhdGFba2V5XSA9IHZhbHVlDQoJc2VsZi5kYXRhW190cmFuc2tleShrZXkp XSA9IHZhbHVlDQoNCiAgICBkZWYgX19kZWxpdGVtX18oc2VsZixrZXksdmFs dWUpOg0KCWRlbCBzZWxmLmRhdGFba2V5XQ0KCWRlbCBzZWxmLmRhdGFbX3Ry YW5za2V5KGtleSldDQoNCmNsYXNzIHNlcXVlbmNlX3ZhcmlhYmxlczoNCg0K ICAgIGRlZiBfX2luaXRfXyhzZWxmLGl0ZW1zPU5vbmUscXVlcnlfc3RyaW5n PScnLHN0YXJ0X25hbWVfcmU9Tm9uZSk6DQogICAgICAgIA0KICAgICAgICBz ZWxmLml0ZW1zPWl0ZW1zDQogICAgICAgIHNlbGYucXVlcnlfc3RyaW5nPXF1 ZXJ5X3N0cmluZw0KICAgICAgICBzZWxmLnN0YXJ0X25hbWVfcmU9c3RhcnRf bmFtZV9yZQ0KDQogICAgICAgIHNlbGYuZGF0YT1kYXRhPXNlcXVlbmNlX2t3 ZGljdCh7DQogICAgICAgICAgICAncHJldmlvdXMtc2VxdWVuY2UnOiAwLA0K ICAgICAgICAgICAgJ25leHQtc2VxdWVuY2UnOiAwLA0KICAgICAgICAgICAg J3NlcXVlbmNlLXN0YXJ0JzogMSwNCiAgICAgICAgICAgICdzZXF1ZW5jZS1l bmQnOiAwLA0KICAgICAgICAgICAgfSkNCg0KDQogICAgZGVmIG51bWJlcihz ZWxmLGluZGV4KTogcmV0dXJuIGluZGV4KzENCiAgICBkZWYgZXZlbihzZWxm LGluZGV4KTogcmV0dXJuIGluZGV4JTIgPT0gMA0KICAgIGRlZiBvZGQoc2Vs ZixpbmRleCk6IHJldHVybiBpbmRleCUyDQogICAgZGVmIGxldHRlcihzZWxm LGluZGV4KTogcmV0dXJuIGNocihvcmQoJ2EnKStpbmRleCkNCiAgICBkZWYg TGV0dGVyKHNlbGYsaW5kZXgpOiByZXR1cm4gY2hyKG9yZCgnQScpK2luZGV4 KQ0KICAgIGRlZiBrZXkoc2VsZixpbmRleCk6ICAgIHJldHVybiBzZWxmLml0 ZW1zW2luZGV4XVswXQ0KICAgIGRlZiBpdGVtKHNlbGYsaW5kZXgsIHR0PXR5 cGUoKCkpKToNCiAgICAgICAgaT1zZWxmLml0ZW1zW2luZGV4XQ0KICAgICAg ICBpZiB0eXBlKGkpIGlzIHR0IGFuZCBsZW4oaSk9PTI6IHJldHVybiBpWzFd DQogICAgICAgIHJldHVybiBpDQoNCiAgICBkZWYgcm9tYW4oc2VsZixpbmRl eCk6IHJldHVybiBsb3dlcihzZWxmLlJvbWFuKGluZGV4KSkNCg0KICAgIGRl ZiBSb21hbihzZWxmLG51bSk6DQogICAgICAgICMgRm9yY2UgbnVtYmVyIHRv IGJlIGFuIGludGVnZXIgdmFsdWUNCiAgICAgICAgbnVtID0gaW50KG51bSkr MQ0KDQogICAgICAgICMgSW5pdGlhbGl6ZSByb21hbiBhcyBhbiBlbXB0eSBz dHJpbmcNCiAgICAgICAgcm9tYW4gPSAnJw0KDQogICAgICAgIHdoaWxlIG51 bSA+PSAxMDAwOg0KICAgICAgICAgICAgICAgIG51bSA9IG51bSAtIDEwMDAN CiAgICAgICAgICAgICAgICByb21hbiA9ICclc00nICUgcm9tYW4NCg0KICAg ICAgICB3aGlsZSBudW0gPj0gNTAwOg0KICAgICAgICAgICAgICAgIG51bSA9 IG51bSAtIDUwMA0KICAgICAgICAgICAgICAgIHJvbWFuID0gJyVzRCcgJSBy b21hbg0KDQogICAgICAgIHdoaWxlIG51bSA+PSAxMDA6DQogICAgICAgICAg ICAgICAgbnVtID0gbnVtIC0gMTAwDQogICAgICAgICAgICAgICAgcm9tYW4g PSAnJXNDJyAlIHJvbWFuDQoNCiAgICAgICAgd2hpbGUgbnVtID49IDUwOg0K ICAgICAgICAgICAgICAgIG51bSA9IG51bSAtIDUwDQogICAgICAgICAgICAg ICAgcm9tYW4gPSAnJXNMJyAlIHJvbWFuDQoNCiAgICAgICAgd2hpbGUgbnVt ID49IDEwOg0KICAgICAgICAgICAgICAgIG51bSA9IG51bSAtIDEwDQogICAg ICAgICAgICAgICAgcm9tYW4gPSAnJXNYJyAlIHJvbWFuICAgICAgICAgICAg ICAgICANCg0KICAgICAgICB3aGlsZSBudW0gPj0gNToNCiAgICAgICAgICAg ICAgICBudW0gPSBudW0gLSA1DQogICAgICAgICAgICAgICAgcm9tYW4gPSAn JXNWJyAlIHJvbWFuDQoNCiAgICAgICAgd2hpbGUgbnVtIDwgNSBhbmQgbnVt ID49IDE6DQogICAgICAgICAgICAgICAgbnVtID0gbnVtIC0gMQ0KICAgICAg ICAgICAgICAgIHJvbWFuID0gJyVzSScgJSByb21hbg0KDQogICAgICAgICMg UmVwbGFjZXMgc3BlY2lhbCBjYXNlcyBpbiBSb21hbiBOdW1lcmFscw0KICAg ICAgICANCiAgICAgICAgcm9tYW4gPSBzdWIoJ0RDQ0NDJywgJ0NNJywgcm9t YW4pDQogICAgICAgIHJvbWFuID0gc3ViKCdDQ0NDJywgJ0NEJywgcm9tYW4p DQogICAgICAgIHJvbWFuID0gc3ViKCdMWFhYWCcsICdYQycsIHJvbWFuKQ0K ICAgICAgICByb21hbiA9IHN1YignWFhYWCcsICdYTCcsIHJvbWFuKQ0KICAg ICAgICByb21hbiA9IHN1YignVklJSUknLCAnSVgnLCByb21hbikNCiAgICAg ICAgcm9tYW4gPSBzdWIoJ0lJSUknLCAnSVYnLCByb21hbikNCg0KICAgICAg ICByZXR1cm4gcm9tYW4NCg0KDQogICAgZGVmIHZhbHVlKHNlbGYsaW5kZXgs bmFtZSk6DQogICAgICAgIGRhdGE9c2VsZi5kYXRhDQogICAgICAgIGl0ZW09 c2VsZi5pdGVtc1tpbmRleF0NCiAgICAgICAgaWYgdHlwZShpdGVtKT09VHVw bGVUeXBlIGFuZCBsZW4oaXRlbSk9PTI6DQogICAgICAgICAgICBpdGVtPWl0 ZW1bMV0NCiAgICAgICAgaWYgZGF0YVsnbWFwcGluZyddOiByZXR1cm4gaXRl bVtuYW1lXQ0KICAgICAgICByZXR1cm4gZ2V0YXR0cihpdGVtLG5hbWUpDQoN CiAgICBkZWYgZmlyc3Qoc2VsZixuYW1lLGtleT0nJyk6DQogICAgICAgIGRh dGE9c2VsZi5kYXRhDQogICAgICAgIGlmIGRhdGFbJ3NlcXVlbmNlLXN0YXJ0 J106IHJldHVybiAxDQogICAgICAgIGluZGV4PWRhdGFbJ3NlcXVlbmNlLWlu ZGV4J10NCiAgICAgICAgcmV0dXJuIHNlbGYudmFsdWUoaW5kZXgsbmFtZSkg IT0gc2VsZi52YWx1ZShpbmRleC0xLG5hbWUpDQoNCiAgICBkZWYgbGFzdChz ZWxmLG5hbWUsa2V5PScnKToNCiAgICAgICAgZGF0YT1zZWxmLmRhdGENCiAg ICAgICAgaWYgZGF0YVsnc2VxdWVuY2UtZW5kJ106IHJldHVybiAxDQogICAg ICAgIGluZGV4PWRhdGFbJ3NlcXVlbmNlLWluZGV4J10NCiAgICAgICAgcmV0 dXJuIHNlbGYudmFsdWUoaW5kZXgsbmFtZSkgIT0gc2VsZi52YWx1ZShpbmRl eCsxLG5hbWUpDQoNCiAgICBkZWYgbGVuZ3RoKHNlbGYsIGlnbm9yZWQpOg0K ICAgICAgICBsPXNlbGYuZGF0YVsnc2VxdWVuY2UtbGVuZ3RoJ109bGVuKHNl bGYuaXRlbXMpDQogICAgICAgIHJldHVybiBsDQoNCiAgICBkZWYgcXVlcnko c2VsZiwgKmlnbm9yZWQpOg0KICAgICAgICBpZiBzZWxmLnN0YXJ0X25hbWVf cmUgaXMgTm9uZTogcmFpc2UgS2V5RXJyb3IsICdzZXF1ZW5jZS1xdWVyeScN CiAgICAgICAgcXVlcnlfc3RyaW5nPXNlbGYucXVlcnlfc3RyaW5nDQogICAg ICAgIHdoaWxlIHF1ZXJ5X3N0cmluZyBhbmQgcXVlcnlfc3RyaW5nWzoxXSBp biAnPyYnOg0KICAgICAgICAgICAgcXVlcnlfc3RyaW5nPXF1ZXJ5X3N0cmlu Z1sxOl0NCiAgICAgICAgd2hpbGUgcXVlcnlfc3RyaW5nWy0xOl0gPT0gJyYn Og0KICAgICAgICAgICAgcXVlcnlfc3RyaW5nPXF1ZXJ5X3N0cmluZ1s6LTFd DQogICAgICAgIGlmIHF1ZXJ5X3N0cmluZzoNCiAgICAgICAgICAgIHF1ZXJ5 X3N0cmluZz0nJiVzJicgJSBxdWVyeV9zdHJpbmcgICAgICAgICAgICAgICAg ICANCiAgICAgICAgICAgIHJlPXNlbGYuc3RhcnRfbmFtZV9yZQ0KICAgICAg ICAgICAgbD1yZS5zZWFyY2hfZ3JvdXAocXVlcnlfc3RyaW5nLCAoMCwpKQ0K ICAgICAgICAgICAgaWYgbDoNCiAgICAgICAgICAgICAgICB2PWxbMV0NCiAg ICAgICAgICAgICAgICBsPWxbMF0NCiAgICAgICAgICAgICAgICBxdWVyeV9z dHJpbmc9KHF1ZXJ5X3N0cmluZ1s6bF0rDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBxdWVyeV9zdHJpbmdbbCtsZW4odiktMTpdKQ0KICAgICAg ICAgICAgcXVlcnlfc3RyaW5nPSc/JytxdWVyeV9zdHJpbmdbMTpdDQogICAg ICAgIGVsc2U6IHF1ZXJ5X3N0cmluZz0nPycNCiAgICAgICAgc2VsZi5kYXRh WydzZXF1ZW5jZS1xdWVyeSddPXF1ZXJ5X3N0cmluZw0KICAgICAgICByZXR1 cm4gcXVlcnlfc3RyaW5nDQogICAgICAgIA0KDQogICAgc3RhdGlzdGljX25h bWVzPSgNCiAgICAgICAgJ3RvdGFsJywgJ2NvdW50JywgJ21pbicsICdtYXgn LCAnbWVkaWFuJywgJ21lYW4nLA0KICAgICAgICAndmFyaWFuY2UnLCAndmFy aWFuY2UtbicsJ3N0YW5kYXJkLWRldmlhdGlvbicsICdzdGFuZGFyZC1kZXZp YXRpb24tbicsDQogICAgICAgICkNCg0KICAgIGRlZiBzdGF0aXN0aWNzKHNl bGYsbmFtZSxrZXkpOg0KICAgICAgICBpdGVtcz1zZWxmLml0ZW1zDQogICAg ICAgIGRhdGE9c2VsZi5kYXRhDQogICAgICAgIG1hcHBpbmc9ZGF0YVsnbWFw cGluZyddDQogICAgICAgIGNvdW50PXN1bT1zdW1zcT0wDQogICAgICAgIG1p bj1tYXg9Tm9uZQ0KICAgICAgICBzY291bnQ9c21pbj1zbWF4PU5vbmUNCiAg ICAgICAgdmFsdWVzPVtdDQogICAgICAgIHN2YWx1ZXM9W10NCiAgICAgICAg Zm9yIGl0ZW0gaW4gaXRlbXM6DQogICAgICAgICAgICB0cnk6DQogICAgICAg ICAgICAgICAgaWYgbWFwcGluZzogaXRlbT1pdGVtW25hbWVdDQogICAgICAg ICAgICAgICAgZWxzZTogaXRlbT1nZXRhdHRyKGl0ZW0sbmFtZSkNCiAgICAg ICAgICAgICAgICB0cnk6DQogICAgICAgICAgICAgICAgICAgIGlmIGl0ZW0g aXMgbXY6DQogICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gTm9uZQ0K ICAgICAgICAgICAgICAgICAgICBzPWl0ZW0qaXRlbQ0KICAgICAgICAgICAg ICAgICAgICBzdW09c3VtK2l0ZW0NCiAgICAgICAgICAgICAgICAgICAgc3Vt c3E9c3Vtc3Ercw0KICAgICAgICAgICAgICAgICAgICB2YWx1ZXMuYXBwZW5k KGl0ZW0pDQogICAgICAgICAgICAgICAgICAgIGlmIG1pbiBpcyBOb25lOg0K ICAgICAgICAgICAgICAgICAgICAgICAgbWluPW1heD1pdGVtDQogICAgICAg ICAgICAgICAgICAgIGVsc2U6DQogICAgICAgICAgICAgICAgICAgICAgICBp ZiBpdGVtIDwgbWluOiBtaW49aXRlbQ0KICAgICAgICAgICAgICAgICAgICAg ICAgaWYgaXRlbSA+IG1heDogbWF4PWl0ZW0NCiAgICAgICAgICAgICAgICBl eGNlcHQ6DQogICAgICAgICAgICAgICAgICAgIGlmIGl0ZW0gaXMgbm90IE5v bmUgYW5kIGl0ZW0gaXMgbm90IG12Og0KICAgICAgICAgICAgICAgICAgICAg ICAgaWYgc21pbiBpcyBOb25lOiBzbWluPXNtYXg9aXRlbQ0KICAgICAgICAg ICAgICAgICAgICAgICAgZWxzZToNCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpZiBpdGVtIDwgc21pbjogc21pbj1pdGVtDQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgaWYgaXRlbSA+IHNtYXg6IHNtYXg9aXRlbQ0KICAg ICAgICAgICAgICAgICAgICAgICAgc3ZhbHVlcy5hcHBlbmQoaXRlbSkNCiAg ICAgICAgICAgIGV4Y2VwdDogcGFzcw0KDQogICAgICAgICMgSW5pdGlhbGl6 ZSBhbGwgc3RhdHMgdG8gZW1wdHkgc3RyaW5nczoNCiAgICAgICAgZm9yIHN0 YXQgaW4gc2VsZi5zdGF0aXN0aWNfbmFtZXM6IGRhdGFbJyVzLSVzJyAlIChz dGF0LG5hbWUpXT0nJw0KDQogICAgICAgIGNvdW50PWxlbih2YWx1ZXMpDQog ICAgICAgIHRyeTogIyBOdW1lcmljIHN0YXRpc3RpY3MNCiAgICAgICAgICAg IG49ZmxvYXQoY291bnQpDQogICAgICAgICAgICBtZWFuPXN1bS9uDQogICAg ICAgICAgICBzdW1zcT1zdW1zcS9uIC0gbWVhbiptZWFuDQogICAgICAgICAg ICBkYXRhWydtZWFuLSVzJyAlIG5hbWVdPW1lYW4NCiAgICAgICAgICAgIGRh dGFbJ3RvdGFsLSVzJyAlIG5hbWVdPXN1bQ0KICAgICAgICAgICAgZGF0YVsn dmFyaWFuY2Utbi0lcycgJSBuYW1lXT1zdW1zcQ0KICAgICAgICAgICAgZGF0 YVsnc3RhbmRhcmQtZGV2aWF0aW9uLW4tJXMnICUgbmFtZV09c3FydChzdW1z cSkNCiAgICAgICAgICAgIGlmIGNvdW50ID4gMToNCiAgICAgICAgICAgICAg ICBzdW1zcT1zdW1zcSpuLyhuLTEpDQogICAgICAgICAgICAgICAgZGF0YVsn dmFyaWFuY2UtJXMnICUgbmFtZV09c3Vtc3ENCiAgICAgICAgICAgICAgICBk YXRhWydzdGFuZGFyZC1kZXZpYXRpb24tJXMnICUgbmFtZV09c3FydChzdW1z cSkgICAgICAgICAgICANCiAgICAgICAgICAgIGVsc2U6DQogICAgICAgICAg ICAgICAgZGF0YVsndmFyaWFuY2UtJXMnICUgbmFtZV09JycNCiAgICAgICAg ICAgICAgICBkYXRhWydzdGFuZGFyZC1kZXZpYXRpb24tJXMnICUgbmFtZV09 JycNCiAgICAgICAgZXhjZXB0Og0KICAgICAgICAgICAgaWYgbWluIGlzIE5v bmU6IG1pbixtYXgsdmFsdWVzPXNtaW4sc21heCxzdmFsdWVzDQogICAgICAg ICAgICBlbHNlOg0KICAgICAgICAgICAgICAgIGlmIHNtaW4gPCBtaW46IG1p bj1zbWluDQogICAgICAgICAgICAgICAgaWYgc21heCA+IG1heDogbWF4PXNt YXgNCiAgICAgICAgICAgICAgICB2YWx1ZXM9dmFsdWVzK3N2YWx1ZXMNCiAg ICAgICAgICAgIGNvdW50PWxlbih2YWx1ZXMpDQoNCiAgICAgICAgZGF0YVsn Y291bnQtJXMnICUgbmFtZV09Y291bnQNCiAgICAgICAgIyBkYXRhWydfdmFs dWVzJ109dmFsdWVzDQogICAgICAgIGlmIG1pbiBpcyBub3QgTm9uZToNCiAg ICAgICAgICAgIGRhdGFbJ21pbi0lcycgJSBuYW1lXT1taW4NCiAgICAgICAg ICAgIGRhdGFbJ21heC0lcycgJSBuYW1lXT1tYXgNCiAgICAgICAgICAgIHZh bHVlcy5zb3J0KCkNCiAgICAgICAgICAgIGlmIGNvdW50PT0xOg0KICAgICAg ICAgICAgICAgIGRhdGFbJ21lZGlhbi0lcycgJSBuYW1lXT1taW4NCiAgICAg ICAgICAgIGVsc2U6DQogICAgICAgICAgICAgICAgbj1jb3VudCsxDQogICAg ICAgICAgICAgICAgaWYgbi8yKjI9PW46IGRhdGFbJ21lZGlhbi0lcycgJSBu YW1lXT12YWx1ZXNbbi8yLTFdDQogICAgICAgICAgICAgICAgZWxzZToNCiAg ICAgICAgICAgICAgICAgICAgbj1uLzINCiAgICAgICAgICAgICAgICAgICAg dHJ5OiBkYXRhWydtZWRpYW4tJXMnICUgbmFtZV09KHZhbHVlc1tuXSt2YWx1 ZXNbbi0xXSkvMg0KICAgICAgICAgICAgICAgICAgICBleGNlcHQ6DQogICAg ICAgICAgICAgICAgICAgICAgICB0cnk6IGRhdGFbJ21lZGlhbi0lcycgJSBu YW1lXT0oDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgImJldHdlZW4g JXMgYW5kICVzIiAlICh2YWx1ZXNbbl0sdmFsdWVzW24tMV0pKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgZXhjZXB0OiBwYXNzDQoNCiAgICAgICAgcmV0 dXJuIGRhdGFba2V5XQ0KDQogICAgZGVmIG5leHRfYmF0Y2hlcyhzZWxmLCBz dWZmaXg9J2JhdGNoZXMnLGtleT0nJyk6DQogICAgICAgIGlmIHN1ZmZpeCAh PSAnYmF0Y2hlcyc6IHJhaXNlIEtleUVycm9yLCBrZXkNCiAgICAgICAgZGF0 YT1zZWxmLmRhdGENCiAgICAgICAgc2VxdWVuY2U9c2VsZi5pdGVtcw0KICAg ICAgICB0cnk6DQogICAgICAgICAgICBpZiBub3QgZGF0YVsnbmV4dC1zZXF1 ZW5jZSddOiByZXR1cm4gKCkNCiAgICAgICAgICAgIHN6PWRhdGFbJ3NlcXVl bmNlLXN0ZXAtc2l6ZSddDQogICAgICAgICAgICBzdGFydD1kYXRhWydzZXF1 ZW5jZS1zdGVwLXN0YXJ0J10NCiAgICAgICAgICAgIGVuZD1kYXRhWydzZXF1 ZW5jZS1zdGVwLWVuZCddDQogICAgICAgICAgICBsPWxlbihzZXF1ZW5jZSkN CiAgICAgICAgICAgIG9ycGhhbj1kYXRhWydzZXF1ZW5jZS1zdGVwLW9ycGhh biddDQogICAgICAgICAgICBvdmVybGFwPWRhdGFbJ3NlcXVlbmNlLXN0ZXAt b3ZlcmxhcCddDQogICAgICAgIGV4Y2VwdDogQXR0cmlidXRlRXJyb3IsICdu ZXh0LWJhdGNoZXMnDQogICAgICAgIHI9W10NCiAgICAgICAgd2hpbGUgZW5k IDwgbDoNCiAgICAgICAgICAgIHN0YXJ0LGVuZCxzcGFtPW9wdChlbmQrMS1v dmVybGFwLDAsc3osb3JwaGFuLHNlcXVlbmNlKQ0KICAgICAgICAgICAgdj1z ZXF1ZW5jZV92YXJpYWJsZXMoc2VsZi5pdGVtcywNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHNlbGYucXVlcnlfc3RyaW5nLHNlbGYuc3Rh cnRfbmFtZV9yZSkNCiAgICAgICAgICAgIGQ9di5kYXRhDQogICAgICAgICAg ICBkWydiYXRjaC1zdGFydC1pbmRleCddPXN0YXJ0LTENCiAgICAgICAgICAg IGRbJ2JhdGNoLWVuZC1pbmRleCddPWVuZC0xDQogICAgICAgICAgICBkWydi YXRjaC1zaXplJ109ZW5kKzEtc3RhcnQNCiAgICAgICAgICAgIGRbJ21hcHBp bmcnXT1kYXRhWydtYXBwaW5nJ10NCiAgICAgICAgICAgIHIuYXBwZW5kKHYp DQogICAgICAgIGRhdGFbJ25leHQtYmF0Y2hlcyddPXINCiAgICAgICAgcmV0 dXJuIHINCg0KICAgIGRlZiBwcmV2aW91c19iYXRjaGVzKHNlbGYsIHN1ZmZp eD0nYmF0Y2hlcycsa2V5PScnKToNCiAgICAgICAgaWYgc3VmZml4ICE9ICdi YXRjaGVzJzogcmFpc2UgS2V5RXJyb3IsIGtleQ0KICAgICAgICBkYXRhPXNl bGYuZGF0YQ0KICAgICAgICBzZXF1ZW5jZT1zZWxmLml0ZW1zDQogICAgICAg IHRyeToNCiAgICAgICAgICAgIGlmIG5vdCBkYXRhWydwcmV2aW91cy1zZXF1 ZW5jZSddOiByZXR1cm4gKCkNCiAgICAgICAgICAgIHN6PWRhdGFbJ3NlcXVl bmNlLXN0ZXAtc2l6ZSddDQogICAgICAgICAgICBzdGFydD1kYXRhWydzZXF1 ZW5jZS1zdGVwLXN0YXJ0J10NCiAgICAgICAgICAgIGVuZD1kYXRhWydzZXF1 ZW5jZS1zdGVwLWVuZCddDQogICAgICAgICAgICBsPWxlbihzZXF1ZW5jZSkN CiAgICAgICAgICAgIG9ycGhhbj1kYXRhWydzZXF1ZW5jZS1zdGVwLW9ycGhh biddDQogICAgICAgICAgICBvdmVybGFwPWRhdGFbJ3NlcXVlbmNlLXN0ZXAt b3ZlcmxhcCddDQogICAgICAgIGV4Y2VwdDogQXR0cmlidXRlRXJyb3IsICdw cmV2aW91cy1iYXRjaGVzJw0KICAgICAgICByPVtdDQogICAgICAgIHdoaWxl IHN0YXJ0ID4gMToNCiAgICAgICAgICAgIHN0YXJ0LGVuZCxzcGFtPW9wdCgw LHN0YXJ0LTErb3ZlcmxhcCxzeixvcnBoYW4sc2VxdWVuY2UpDQogICAgICAg ICAgICB2PXNlcXVlbmNlX3ZhcmlhYmxlcyhzZWxmLml0ZW1zLA0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5xdWVyeV9zdHJpbmcs c2VsZi5zdGFydF9uYW1lX3JlKQ0KICAgICAgICAgICAgZD12LmRhdGENCiAg ICAgICAgICAgIGRbJ2JhdGNoLXN0YXJ0LWluZGV4J109c3RhcnQtMQ0KICAg ICAgICAgICAgZFsnYmF0Y2gtZW5kLWluZGV4J109ZW5kLTENCiAgICAgICAg ICAgIGRbJ2JhdGNoLXNpemUnXT1lbmQrMS1zdGFydA0KICAgICAgICAgICAg ZFsnbWFwcGluZyddPWRhdGFbJ21hcHBpbmcnXQ0KICAgICAgICAgICAgci5h cHBlbmQodikNCiAgICAgICAgci5yZXZlcnNlKCkNCiAgICAgICAgZGF0YVsn cHJldmlvdXMtYmF0Y2hlcyddPXINCiAgICAgICAgcmV0dXJuIHINCg0KDQog ICAgc3BlY2lhbF9wcmVmaXhlcz17DQogICAgICAgICdmaXJzdCc6IGZpcnN0 LA0KICAgICAgICAnbGFzdCc6IGxhc3QsDQogICAgICAgICdwcmV2aW91cyc6 IHByZXZpb3VzX2JhdGNoZXMsDQogICAgICAgICduZXh0JzogbmV4dF9iYXRj aGVzLA0KICAgICAgICAjIFRoZXNlIHR3byBhcmUgZm9yIGJhY2t3YXJkIGNv bXBhdGFiaWxpdHkgd2l0aCBhIG1pc3NmZWF0dXJlOg0KICAgICAgICAnc2Vx dWVuY2UtaW5kZXgnOiBsYW1iZGEgc2VsZiwgc3VmZml4LCBrZXk6IHNlbGZb J3NlcXVlbmNlLScrc3VmZml4XSwNCiAgICAgICAgJ3NlcXVlbmNlLWluZGV4 LWlzJzogbGFtYmRhIHNlbGYsIHN1ZmZpeCwga2V5OiBzZWxmWydzZXF1ZW5j ZS0nK3N1ZmZpeF0sDQogICAgICAgIH0NCiAgICBmb3IgbiBpbiBzdGF0aXN0 aWNfbmFtZXM6IHNwZWNpYWxfcHJlZml4ZXNbbl09c3RhdGlzdGljcw0KDQog ICAgZGVmIF9fZ2V0aXRlbV9fKHNlbGYsa2V5LA0KICAgICAgICAgICAgICAg ICAgICBzcGVjaWFsX3ByZWZpeGVzPXNwZWNpYWxfcHJlZml4ZXMsDQogICAg ICAgICAgICAgICAgICAgIHNwZWNpYWxfcHJlZml4PXNwZWNpYWxfcHJlZml4 ZXMuaGFzX2tleQ0KICAgICAgICAgICAgICAgICAgICApOg0KICAgICAgICBk YXRhPXNlbGYuZGF0YQ0KICAgICAgICBpZiBkYXRhLmhhc19rZXkoa2V5KTog cmV0dXJuIGRhdGFba2V5XQ0KDQogICAgICAgIGw9cmZpbmQoa2V5LCctJykN CiAgICAgICAgaWYgbCA8IDA6IHJhaXNlIEtleUVycm9yLCBrZXkNCg0KICAg ICAgICBzdWZmaXg9a2V5W2wrMTpdDQogICAgICAgIHByZWZpeD1rZXlbOmxd DQoNCiAgICAgICAgaWYgaGFzYXR0cihzZWxmLCBzdWZmaXgpOg0KICAgICAg ICAgICAgdHJ5OiB2PWRhdGFbcHJlZml4KyctaW5kZXgnXQ0KICAgICAgICAg ICAgZXhjZXB0OiBwYXNzDQogICAgICAgICAgICBlbHNlOiByZXR1cm4gZ2V0 YXR0cihzZWxmLHN1ZmZpeCkodikNCg0KICAgICAgICBpZiBzcGVjaWFsX3By ZWZpeChwcmVmaXgpOg0KICAgICAgICAgICAgcmV0dXJuIHNwZWNpYWxfcHJl Zml4ZXNbcHJlZml4XShzZWxmLCBzdWZmaXgsIGtleSkNCg0KICAgICAgICBp ZiBwcmVmaXhbLTQ6XT09Jy12YXInOg0KICAgICAgICAgICAgcHJlZml4PXBy ZWZpeFs6LTRdDQogICAgICAgICAgICB0cnk6IHJldHVybiBzZWxmLnZhbHVl KGRhdGFbcHJlZml4KyctaW5kZXgnXSxzdWZmaXgpDQogICAgICAgICAgICBl eGNlcHQ6IHBhc3MNCg0KICAgICAgICBpZiBrZXk9PSdzZXF1ZW5jZS1xdWVy eSc6IHJldHVybiBzZWxmLnF1ZXJ5KCkNCiAgICAgICAgICAgIA0KICAgICAg ICByYWlzZSBLZXlFcnJvciwga2V5DQoNCg0KZGVmIHN1YihzMSwgczIsIHNy Yyk6DQogICAgcmV0dXJuIGpvaW4oc3BsaXQoc3JjLCBzMSksIHMyKQ0KDQpk ZWYgb3B0KHN0YXJ0LGVuZCxzaXplLG9ycGhhbixzZXF1ZW5jZSk6DQogICAg aWYgc2l6ZSA8IDE6DQogICAgICAgIGlmIHN0YXJ0ID4gMCBhbmQgZW5kID4g MCBhbmQgZW5kID49IHN0YXJ0Og0KICAgICAgICAgICAgc2l6ZT1lbmQrMS1z dGFydA0KICAgICAgICBlbHNlOiBzaXplPTcNCg0KICAgIGlmIHN0YXJ0ID4g MDoNCg0KICAgICAgICB0cnk6IHNlcXVlbmNlW3N0YXJ0LTFdDQogICAgICAg IGV4Y2VwdDogc3RhcnQ9bGVuKHNlcXVlbmNlKQ0KICAgICAgICAjIGlmIHN0 YXJ0ID4gbDogc3RhcnQ9bA0KDQogICAgICAgIGlmIGVuZCA+IDA6DQogICAg ICAgICAgICBpZiBlbmQgPCBzdGFydDogZW5kPXN0YXJ0DQogICAgICAgIGVs c2U6DQogICAgICAgICAgICBlbmQ9c3RhcnQrc2l6ZS0xDQogICAgICAgICAg ICB0cnk6IHNlcXVlbmNlW2VuZCtvcnBoYW4tMV0NCiAgICAgICAgICAgIGV4 Y2VwdDogZW5kPWxlbihzZXF1ZW5jZSkNCiAgICAgICAgICAgICMgaWYgbCAt IGVuZCA8IG9ycGhhbjogZW5kPWwNCiAgICBlbGlmIGVuZCA+IDA6DQogICAg ICAgIHRyeTogc2VxdWVuY2VbZW5kLTFdDQogICAgICAgIGV4Y2VwdDogZW5k PWxlbihzZXF1ZW5jZSkNCiAgICAgICAgIyBpZiBlbmQgPiBsOiBlbmQ9bA0K ICAgICAgICBzdGFydD1lbmQrMS1zaXplDQogICAgICAgIGlmIHN0YXJ0IC0g MSA8IG9ycGhhbjogc3RhcnQ9MQ0KICAgIGVsc2U6DQogICAgICAgIHN0YXJ0 PTENCiAgICAgICAgZW5kPXN0YXJ0K3NpemUtMQ0KICAgICAgICB0cnk6IHNl cXVlbmNlW2VuZCtvcnBoYW4tMV0NCiAgICAgICAgZXhjZXB0OiBlbmQ9bGVu KHNlcXVlbmNlKQ0KICAgICAgICAjIGlmIGwgLSBlbmQgPCBvcnBoYW46IGVu ZD1sDQogICAgcmV0dXJuIHN0YXJ0LGVuZCxzaXplDQo= ---559023410-1053718679-942384997=:10674-- From evan@4-am.com Fri Nov 12 06:17:17 1999 From: evan@4-am.com (Evan Simpson) Date: Fri, 12 Nov 1999 06:17:17 +0000 Subject: [Zope-dev] DTML Syntax contd. + rant + summary References: Message-ID: <382BB0EC.E5B67233@4-am.com> Stuart 'Zen' Bishop wrote: > Is this using r_exec and Bastion from Python? Or do you have to roll > your own? Since PythonMethods live and work entirely within Zope, they aren't allowed to import anything, and get the same restricted set of builtins as DTML, so r_exec and Bastion are irrelevant. All that remains is to prevent damage or improper access to objects passed into a PM. That's where zbytecodehacks come in. The compiled bytecode is scanned for forbidden operations and munged to call secured versions of other operations. > My summary of the thread so far would be along the lines of: > > [snip] > > Until program code can be implemented using the web interface and > run securly in a sandbox, DTML will continue to be abused. Even this won't be really satisfactory. What everyone (myself included) seems to want is the ability to use DTML or similar tags in their simplest form -- no expressions, more declarative than procedural -- and have complex logic live separately, written in nice normal Python. Unfortunately, even a moderately complex case will make you either calculate *everything* up front, and pass it to the DTML for rendering, or else fragment the logic into a swarm of little mini-methods. I do all of my web work with my wife, who's a designer. She uses Dreamweaver and other nice Whizzywig tools to produce pretty, friendly pages, and then I install the engine. I've been able to come up with code and procedures which make the DW-Zope partnership tolerable, but it still isn't nice *at all*. As long as we're careful, DW doesn't mess up DTML tags or get confused, but we're still using a visual tool to edit what is essentially a *program* rather than a *template*. My ideal, as near as I can express it, is something like this: The Title

    This whole section is a placeholder for visual editing. It gets replaced with standard_html_header.

    Item #&Z-number; Qty: &Z-qty; Price: &Z-price; Total: &Z-total;
    Give or take the legality of the syntax and the reaction of editors other than Dreamweaver to the "bonus" attributes and entities, what we have here is a perfectly well-formed, intelligible HTML page. The source isn't too hard to read, and a browser (well, NS4.61 for Linux, anyway) renders it nicely, acting as a sort of mock-up of the dynamic page-to-be. Now imagine that there's a block of code joined to this page, something like this: Z.item_list = SQL_get_items() for item in Z.item_list: item.set('total', item.qty * item.price) Z.relative_form.set('action', '/here/there/everywhere') Z.bob.set('value', 'Bob') if uncle_default: Z.uncle_q.set('CHECKED') if not choose_name: Z.bob = 'Bob' # Replace the entire tag with this fixed string. Here, 'Z' is a magic object like '_' in DTML. It holds the values which will replace the &Z-entities; and allows attributes of Z-named tags to be set or cleared. Tags with Z-in attributes are repeated using the named value, much like . Well, I'm done rambling now. This is all ill-defined (how are code and page joined?), hard to code, and quite possibly a bad idea, but I had to share it. Thanks, Evan @ 4-am From zen@cs.rmit.edu.au Fri Nov 12 07:24:54 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 12 Nov 1999 18:24:54 +1100 (EST) Subject: [Zope-dev] Correct place to initialize _v_ attributes Message-ID: Is there a method I can initialize _v_ attributes in? __init__ is only called on initial object creation, but I also need to initialize variables when the object is instantiated from ZODB ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From sergey2b@mail.ru Fri Nov 12 07:28:51 1999 From: sergey2b@mail.ru (sergey2b) Date: Fri, 12 Nov 1999 10:28:51 +0300 Subject: [Zope-dev] Character codes Message-ID: <008e01bf2cdf$925a8c00$740100c0@ishop.ramax.spb.ru> Kind day. Excuse for bad language of the letter. >using the -L command line switch in Zope 2.1.0b? I do not know. >What are the consequences of this change on character display? I understand >that setting the locale will enhance ZCatalog searches for words with >extended chars. In UNIX yes works well, in Windows NT not always. For Russian not correctly (my opinion is problems Windows). Sergey -----Original Message----- From: Alexandre Ratti To: sergey2b Cc: zope-dev@zope.org Date: 12 ÎÏÑÂÒÑ 1999 Ç. 2:08 Subject: Re: [Zope-dev] Character codes >Hi Sergei, > > >Thanks for your tip. Is this the same as setting "LOCALE_ID=" in z2.py or >using the -L command line switch in Zope 2.1.0b? > >What are the consequences of this change on character display? I understand >that setting the locale will enhance ZCatalog searches for words with >extended chars. > > >Cheers. > >Alexandre > > >At 22:18 11/11/1999 +0300, you wrote: >>add in z2.py >> >>#z2.py >>import locale >>locale.setlocale(locale.LC_ALL, "fr") >(...) > > From adonis@egsx.com Fri Nov 12 09:16:28 1999 From: adonis@egsx.com (Adonis El Fakih) Date: Fri, 12 Nov 1999 04:16:28 -0500 (EST) Subject: [Zope-dev] Re: [Zope] tree alignment In-Reply-To: Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1120801521-1050905982-942398188=:27742 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, I made some modifications to the TreeTag.py module to allow the user control over the alignment of the cells created by the moodule. Since this is my first time using python ( my background is Perl and PHP) I made it very simple. If you set a flag align=1 in the dtml-tree tag it will use the ALIGN="LEFT" used in Zope 2.0.1, otherwise it will not insert an ALIGN tag in the tag. The solution is good enough for us, and I would like to pass this by you for comments, also I would like to ask for this change to be inserted in the Zope distribution. This will us one step closer to being internationalization friendly. Best regards, Adonis On Fri, 12 Nov 1999, Adonis El Fakih wrote: > Date: Fri, 12 Nov 1999 03:19:58 -0500 (EST) > From: Adonis El Fakih > To: zope@zope.org > Subject: [Zope] tree alignment > > Hi, > > I am facing an interesting challenge. > > I want to use the dtml-tree tag in document that uses right to left > alignment (Arabic). In HTML we can define the DIR=RTL tag in the > tag and all tables within a document will be flipped as to > accomodate for the RTL behaviour. Unfortunalty the dtml-tree explicitly > sets the alignment of the id/titles to the left, making the dtml-tree > useless for these pages. Is there a way to tell the object the alignment > required? Or do I have to dig into zope's code to see how to change > this? > > Thanks in advance. > > Adonis > > -- > Adonis El Fakih - President, CEO > Engineering Graphical Solutions, Inc. (EGS) > 70 Boston Road, Suite A301, Chelmsford MA 01824 USA > Fax (978) 244-0544 - adonis@egsx.com > > > _______________________________________________ > 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 ) > -- Adonis El Fakih - President, CEO Engineering Graphical Solutions, Inc. (EGS) 70 Boston Road, Suite A301, Chelmsford MA 01824 USA Fax (978) 244-0544 - adonis@egsx.com --1120801521-1050905982-942398188=:27742 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="tree.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: MTE0YTExNQ0KPiAJCQkgIGFsaWduPTEsDQo0MDFhNDAzLDQxMA0KPiAgICAg ICAgICMgZGVmaW5lIHRoZSBhbGlnbm1lbnQNCj4gCWlmICAgYXJncy5oYXNf a2V5KCdhbGlnbicpIGFuZCBhcmdzWydhbGlnbiddOg0KPiAJCXRhYmxlQWxp Z249J0FMSUdOPSJMRUZUIicNCj4gCWVsc2UgOiANCj4gCQl0YWJsZUFsaWdu PScgJw0KPiANCj4gDQo+IA0KNDA0YzQxMw0KPCAgICAgICAgIG91dHB1dCgn PFREJXMlcyBWQUxJR049IlRPUCIgQUxJR049IkxFRlQiPicgJQ0KLS0tDQo+ ICAgICAgICAgb3V0cHV0KCc8VEQlcyVzIFZBTElHTj0iVE9QIiAlcz4nICUN CjQwNmM0MTUsNDE2DQo8ICAgICAgICAgICAgICAgIChoYXZlX2FyZygnbm93 cmFwJykgYW5kIGFyZ3NbJ25vd3JhcCddIGFuZCAnIE5PV1JBUCcgb3IgJycp KQ0KLS0tDQo+ICAgICAgICAgICAgICAgIChoYXZlX2FyZygnbm93cmFwJykg YW5kIGFyZ3NbJ25vd3JhcCddIGFuZCAnIE5PV1JBUCcgb3IgJycpLA0KPiAg ICAgICAgICAgICAgICB0YWJsZUFsaWduKQ0K --1120801521-1050905982-942398188=:27742-- From s341625@student.uq.edu.au Fri Nov 12 10:44:18 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Fri, 12 Nov 1999 20:44:18 +1000 (GMT+1000) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: <382BB0EC.E5B67233@4-am.com> Message-ID: On Fri, 12 Nov 1999, Evan Simpson wrote: > Stuart 'Zen' Bishop wrote: > > The Title > >

    This whole section is a placeholder for visual editing. It gets replaced with > standard_html_header.

    >
    > > > > > > > >
    Item #&Z-number;Qty: &Z-qty;Price: &Z-price;Total: &Z-total;
    >
    > > > >
    > > > That's a great idea! It just so happens that the backend part of VisualZope (the bit that doesn't need behaviours and associated mungled Python Methods) is stable (has been for a month) and does that. Watching the www.python.org here is a solution to the DTML conflict: * Store the "template" in XML with pseudo-namespaces as above for breaking it into different parts: Z-PM: Python Methods Z-XSLT: http://fourthought.com/4Suite/4XSLT - the SAX XSLT language (Its a new standard for XML stylesheets and MS IE implements it) Then, make new widgets for each tag-type which implement: prender - for rearranging the XML layout render - for rendering the result into HTML (if no method by this name it is automagically rendered to pure HTML for you) * Replace the existing widget and follow its prender method. DO NOT forget to follow the XML modification HOW-TO when applying ZDOM methods to the clone (currently, subclassed widgets are not found due to a current re-organisation of the widgetfinder so just use the existing meta-type. Fix is easy - edit vz.py to check for the VisualZopeComponent attribute instead of the meta-type) The tricky bit is then getting the prender code to convert CLONE to XML text, feed it, along with the XSLT code to 4thoughts engine and then piping it back into the Form. This ignores caching and performance issues but will do for proof of concept. (I'll have a bash at this next week once my database is recovered.) Then, place instances of these with the appropiate id in the acquisition path of the Form and view the Form - voila! instant scripting with user-selectable scripting. The VisualZope (development) code is at: http://www.zope.org/Members/NoneToBe/VisualStudio/new_html. It is a straight dump of my code to allow people to use it so beware! (yes, no demo code is up yet - that was the corrupted bit in my database) Cheers, Anthony Pfrunder From tsarna@endicor.com Fri Nov 12 14:39:51 1999 From: tsarna@endicor.com (Ty Sarna) Date: 12 Nov 1999 14:39:51 GMT Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <3.0.5.32.19991111184711.0132deb0@telecommunity.com> Message-ID: <942417591.616060@fezzik.endicor.com> In article <3.0.5.32.19991111184711.0132deb0@telecommunity.com>, Phillip J. Eby wrote: > Actually, here's an unusual manner in which you can do what you want > (mostly). :) [snip __of__'ing a wrapper trick] > This is a very ugly kludge, and there are aspects that may not work 100% > correctly. What it does is stick a wrapper around your persistent object > which converts __getattr__ to try __getitem__ first. The kludgy part is What worries me about thich technique is that other code may break, assuming that it's dealing with the true object (or an acquisition wrapper, which presumably all Zope code already takes into account ;-) From pje@telecommunity.com Fri Nov 12 14:52:52 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Fri, 12 Nov 1999 09:52:52 -0500 Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <942417591.616060@fezzik.endicor.com> References: <3.0.5.32.19991111184711.0132deb0@telecommunity.com> Message-ID: <199911121453.GAA17603@zope.codeit.com> At 02:39 PM 11/12/99 +0000, Ty Sarna wrote: >In article <3.0.5.32.19991111184711.0132deb0@telecommunity.com>, >Phillip J. Eby wrote: >> Actually, here's an unusual manner in which you can do what you want >> (mostly). :) > >[snip __of__'ing a wrapper trick] > >> This is a very ugly kludge, and there are aspects that may not work 100% >> correctly. What it does is stick a wrapper around your persistent object >> which converts __getattr__ to try __getitem__ first. The kludgy part is > >What worries me about thich technique is that other code may break, >assuming that it's dealing with the true object (or an acquisition >wrapper, which presumably all Zope code already takes into account ;-) > Not really, since this is the "true object", it just is a bit more complex than usual. :) If another object stores a reference to it, however, they may not get exactly what they intended upon later un-pickling. :( From petrilli@digicool.com Fri Nov 12 14:54:15 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Fri, 12 Nov 1999 09:54:15 -0500 Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: Message-ID: On 11/12/99 12:36 AM, Stuart 'Zen' Bishop at zen@cs.rmit.edu.au wrote: > > Grr... just found an obvious flaw. Lets try take 2 at embarassing myself. At this point it's enough change that we don't want to put it into 2.1 because it's not really a big. We can revisit this when 2.1 is released, and it can be queued for 2.2. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From michel@digicool.com Fri Nov 12 16:46:20 1999 From: michel@digicool.com (Michel Pelletier) Date: Fri, 12 Nov 1999 11:46:20 -0500 Subject: [Zope-dev] Correct place to initialize _v_ attributes References: Message-ID: <382C445C.EAA3F5E7@digicool.com> Stuart 'Zen' Bishop wrote: > > Is there a method I can initialize _v_ attributes in? __init__ is > only called on initial object creation, but I also need to initialize > variables when the object is instantiated from ZODB Define a __setstate__. This is called when the object is activated (brought into memory from the object store). Here is an example of how Catalog wakes up: def __setstate__(self, state): """ initialize your brains. This method is called when the catalog is first activated (from the persistent storage) """ Persistent.__setstate__(self, state) self.useBrains(self._v_brains) if not hasattr(self, 'lexicon'): self.lexicon = Lexicon() There are a couple things going on here, first, the Persistence machinery is fired up (your object must subclass Persistent, of course), second useBrains() initializes the default record class for catalog result records. third, 'self.lexicon' was added to Catalog in this beta release, so everyone's old 2.0 Catalogs do not contains lexicons. By checking for the attr in setstate, you can evolve your objects to contain new components and attributes. You can also add a class attribute, of course. -Michel > ___ > // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au > // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au > //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen > > _______________________________________________ > 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 ) From tsarna@endicor.com Fri Nov 12 15:46:53 1999 From: tsarna@endicor.com (Ty Sarna) Date: 12 Nov 1999 15:46:53 GMT Subject: [Zope-dev] ObjectManagers and their children In-Reply-To: <199911121453.GAA17603@zope.codeit.com> Message-ID: <942421613.434890@fezzik.endicor.com> In article <199911121453.GAA17603@zope.codeit.com>, Phillip J. Eby wrote: > Not really, since this is the "true object", it just is a bit more complex > than usual. :) If another object stores a reference to it, however, they > may not get exactly what they intended upon later un-pickling. :( That's what I meant :) From jacobsl001@hawaii.rr.com Fri Nov 12 17:25:59 1999 From: jacobsl001@hawaii.rr.com (David Jacobs) Date: Fri, 12 Nov 1999 07:25:59 -1000 Subject: [Zope-dev] DTML Syntax contd. + rant + summary References: Message-ID: <002801bf2d32$fc980860$9f6dd2cc@hawaii.rr.com> Just thought I'd throw another permutation into the mix. I always thought it would be nice to have a python subroutines page associated with a DTML page. It would be limited in capability like PythonMethods and would be scoped to the page. Since this would greatly simplify the addition of small Python subroutines, it would ease the demand on DTML to perform so much logic processing and allow it to focus on presentation. Comments? David Jacobs From dsh@magma-da.com Fri Nov 12 19:40:07 1999 From: dsh@magma-da.com (David S. Harrison) Date: Fri, 12 Nov 1999 11:40:07 -0800 Subject: [Zope-dev] Generated Images Again Message-ID: <382C6D17.E7BEB60@magma-da.com> As you might recall, I am on a quest to get Zope to serve up automatically generated images. I am nearly there. In a simple example, my DTML looks like the following:

    My external method kind of looks like this: def GenerateImage(self, RESPONSE): bits = functionThatWritesImageIntoAString() RESPONSE.setHeader('content-type', 'image/png') return bits This works fine. However, functionThatWritesImageIntoAString() actually takes arguments. So, I attempted the following: def GenerateImage(self, RESPONSE, arg): Then I tried several possibilities in DTML: I tried permuting arguments. I can't convince it to work. It appears that I don't know the magic to tell Zope to pass arguments to the external method. I am looking for suggestions. There is a really nasty workaround: I could use before the tag to pass arguments implcitly (through globals) to the GenerateImage method. But this seems really ugly. I am looking for a more graceful solution. David S. Harrison (dsh@magma-da.com) From dsh@magma-da.com Fri Nov 12 19:48:33 1999 From: dsh@magma-da.com (David S. Harrison) Date: Fri, 12 Nov 1999 11:48:33 -0800 Subject: [Zope-dev] Generated Images Again References: <382C6D17.E7BEB60@magma-da.com> <14380.28078.638763.552420@amarok.cnri.reston.va.us> Message-ID: <382C6F11.C490CF26@magma-da.com> "Andrew M. Kuchling" wrote: > This isn't invoking your function; read the DTML manual about > . Instead, try this: > > "> Well, this successfully calls the function but substitutes the bits from the PNG image directly into the tag. I mean the image tag becomes: '' where the garbage is the bits from the image. The browser barfs on this in a major way. Looks like it is still not quite there. David S. Harrison (dsh@magma-da.com) From andrew@apl-software.com Fri Nov 12 23:43:31 1999 From: andrew@apl-software.com (Andrew) Date: Fri, 12 Nov 1999 15:43:31 -0800 Subject: [Zope-dev] Generated Images Again References: <382C6D17.E7BEB60@magma-da.com> <14380.28078.638763.552420@amarok.cnri.reston.va.us> <382C6F11.C490CF26@magma-da.com> Message-ID: <001701bf2d67$c8064a00$0201a8c0@net.home> Take a look at the poll product. It does exactly what you want to do. You might also want to look at my new Photo product which does something similiar. http://www.zope.org/Members/Drew/Photo In essence, your DTML should reference a method that returns an image object. Where the image object has a method named dynamic that might look like this: def dynamic(self, arg) ...PIL stuff, gd stuff or Imagemagik stuff... return StringIO(image_file) #image file doesn't need to be a file on the disk #but the image should be returned as a string. I hope that this short explaination is clear. Drew ----- Original Message ----- From: David S. Harrison To: Andrew M. Kuchling Cc: Sent: Friday, November 12, 1999 11:48 AM Subject: Re: [Zope-dev] Generated Images Again > > > "Andrew M. Kuchling" wrote: > > This isn't invoking your function; read the DTML manual about > > . Instead, try this: > > > > "> > > Well, this successfully calls the function but substitutes > the bits from the PNG image directly into the tag. > I mean the image tag becomes: '' > where the garbage is the bits from the image. The browser barfs > on this in a major way. Looks like it is still not quite there. > > David S. Harrison > (dsh@magma-da.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 ) > > From Jeff K. Hoffman" Hello, everyone. I am trying to write a new subclass of OFS.Folder (as a python product) to do the following: When a user requests /myFolder/index_html, myFolder will search itself, then its list of 'parents', returning the attribute from one of them if they have it, and raising an AttributeError if not. I have had some moderate success by overloading __getattr__ as follows: def __getattr__(self, name): try: return OFS.Folder.Folder.__getattr__(self, name) except: for parent in self.parentList: try: return getattr(parent, name) except AttributeError: pass raise AttributeError, name This works, in the sense that I can "inherit" features from the parents, but I think there are some fundamental flaws in my approach for the following reasons: o I would like for the user to still be able to create attributes in my folder with the same name as one of the attributes in the parents. This does not work, currently. If I define index_html in a "parent" folder and attempt to do the same in a "child", I get a 'The id index_html is invalid - it is already in use.' error. o Whenever I click on a folder which has one or more "parents" in the top-level management interface (http://localhost/manage), I get a NameError for 'n_'. This does not occur, however, when I manage my folder via http://localhost/myFolder/manage. So, my question is, is there any way for me to achieve this behavior without causing the problems above? I am thinking there must be a way to search the parents if AND ONLY IF it is for an incoming web request. I have posted the code to zope.org at: http://www.zope.org/Members/jkhoffman/TransFolder.tgz Once you install the product, click the 'Parents' tab to assign a parent. This thing is barely working, and is one of my first python products, so please don't laugh at me too much. :) If anyone can give me a push in the right direction I would be extremely grateful. --Jeff From petrilli@digicool.com Fri Nov 12 21:02:57 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Fri, 12 Nov 1999 16:02:57 -0500 Subject: [Zope-dev] Overriding __getattr__ for requests only. In-Reply-To: Message-ID: On 11/12/99 3:57 PM, Jeff K. Hoffman at jkhoffman@carolina.rr.com wrote: > I am trying to write a new subclass of OFS.Folder (as a python product) to > do the following: When a user requests /myFolder/index_html, myFolder > will search itself, then its list of 'parents', returning the attribute > from one of them if they have it, and raising an AttributeError if not. Pardon my ignorance, but what exactly does this accomplish that isn't accomplished by Acquisition? Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From jkhoffman@carolina.rr.com Fri Nov 12 21:14:34 1999 From: jkhoffman@carolina.rr.com (Jeff K. Hoffman) Date: Fri, 12 Nov 1999 16:14:34 -0500 (EST) Subject: [Zope-dev] Overriding __getattr__ for requests only. In-Reply-To: Message-ID: On Fri, 12 Nov 1999, Christopher Petrilli wrote: > On 11/12/99 3:57 PM, Jeff K. Hoffman at jkhoffman@carolina.rr.com wrote: > > > I am trying to write a new subclass of OFS.Folder (as a python product) to > > do the following: When a user requests /myFolder/index_html, myFolder > > will search itself, then its list of 'parents', returning the attribute > > from one of them if they have it, and raising an AttributeError if not. > > Pardon my ignorance, but what exactly does this accomplish that isn't > accomplished by Acquisition? I am trying to build a site as follows: --- / baseline/ index_html content/ paragraph_a paragraph_b images/ image_a image_b variant1/ content/ paragraph_a images/ image_b variant2/ content/ paragraph_b images/ image_a --- Such that navigating to /baseline/index_html shows paragraph_a, paragraph_b, image_a, and image_b. I also need to be able to navigate to /baseline/variant1 and see the same index_html, this time referencing the "overloaded" paragraph_a and image_b. The same for variant2, with paragraph_b and image_a. I have found no obvious way to do this, using acquisition, without flatting my folder hierarchy out as such: --- / baseline/ paragraph_a paragraph_b image_a image_b variant1/ paragraph_a image_b variant2/ paragraph_b image_a --- This is unacceptable, because there are a LOT of paragraph's and images, and I want to divide them up logically using folders. I am evaluating Zope in the hopes of transitioning one of our major web assets (which is currently built on top of our proprietary web development platform, which supports inheritance) to Zope and dropping development on our platform. I am finding it hard to move from an inheritance based model to a purely acquisition based model without making major sacrifices in the design of our site. Am I stupid? Please tell me I'm missing something obvious. > Chris --Jeff From zen@cs.rmit.edu.au Fri Nov 12 22:25:33 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Sat, 13 Nov 1999 09:25:33 +1100 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: <002801bf2d32$fc980860$9f6dd2cc@hawaii.rr.com> Message-ID: On Fri, 12 Nov 1999, David Jacobs wrote: > I always thought it would be nice to have a python subroutines page > associated with a DTML page. It would be limited in capability like > PythonMethods and would be scoped to the page. Since this would greatly > simplify the addition of small Python subroutines, it would ease the demand > on DTML to perform so much logic processing and allow it to focus on > presentation. I like this - the problem I see with seperating layout and programming is that the programmers will just lump all their layout in the program code. In this way they just have to maintain one page rather than a DTML page and 'n' PythonMethods/External Methods. Hmm.... If I could take the following code: def hello(): print "Hello" def world(): print "World!" Could I add it to the current namespace (using existing DTML paradigm)? Or dtml-width if you prefer ie. a 'library' object will return a map of callable objects. This would probably have to be seperate to a 'code' object which would be executed and stdout being its rendered version. ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From pavlos@gaaros.msrc.sunysb.edu Fri Nov 12 22:30:30 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Fri, 12 Nov 1999 17:30:30 -0500 (EST) Subject: [Zope-dev] Overriding __getattr__ for requests only. In-Reply-To: Message-ID: On Fri, 12 Nov 1999, Jeff K. Hoffman wrote: > / > baseline/ > index_html > content/ > paragraph_a > paragraph_b > images/ > image_a > image_b > variant1/ > content/ > paragraph_a > images/ > image_b > variant2/ > content/ > paragraph_b > images/ > image_a > --- > > Such that navigating to /baseline/index_html shows paragraph_a, > paragraph_b, image_a, and image_b. I also need to be able to navigate to > /baseline/variant1 and see the same index_html, this time referencing the > "overloaded" paragraph_a and image_b. The same for variant2, with > paragraph_b and image_a. Assuming index_html is a *DTML Method* I think something like this might work: similarly for image. Have-a-feeling-I-missed-the-point'ly Pavlos From akuchlin@mems-exchange.org Fri Nov 12 22:41:36 1999 From: akuchlin@mems-exchange.org (Andrew M. Kuchling) Date: Fri, 12 Nov 1999 17:41:36 -0500 (EST) Subject: [Zope-dev] DTML Syntax contd. + rant + summary In-Reply-To: References: <002801bf2d32$fc980860$9f6dd2cc@hawaii.rr.com> Message-ID: <14380.38816.794502.511342@amarok.cnri.reston.va.us> Stuart 'Zen' Bishop quoted: >On Fri, 12 Nov 1999, David Jacobs wrote: >> I always thought it would be nice to have a python subroutines page >> associated with a DTML page. It would be limited in capability like >> PythonMethods and would be scoped to the page. Since this would greatly >> simplify the addition of small Python subroutines, it would ease the demand >> on DTML to perform so much logic processing and allow it to focus on >> presentation. I did something similar for the American Greetings site; you had a .pd page containing the HTML and a .py file containing Python code. The .py file would be executed to set up a bunch of variables, and then their values would be substituted into the .pd. For example, to show the current time, you would do: page.py: from time import * now = asctime(localtime(time() )) page.pd: The time is [now]. The templating system grew in an ugly way; first it did only variable substitution, then I needed conditionals and hacked them in, then I need to loop over lists and hacked that in, etc. -- very bad code, in the end. Another problem is that I still sometimes embedded HTML in my Python code; one .pd page couldn't easily call another in the way that DTML methods can. If doing it today, I'd use DTML, because DTML's better structure, and the ability to easily call DTML submethods, would make this much neater. -- A.M. Kuchling http://starship.python.net/crew/amk/ Thanks. The sooner I get discouraged and quit, the more time I'll save overall. -- Frank Sergeant, 28 Mar 1999 From Jeff Rush" On Fri, 12 Nov 1999 11:48:33 -0800, David S. Harrison wrote: >Well, this successfully calls the function but substitutes >the bits from the PNG image directly into the tag. >I mean the image tag becomes: '' >where the garbage is the bits from the image. The browser barfs >on this in a major way. Looks like it is still not quite there. You need to look at it as two transactions -- one to generate the HTML and another when the browser _comes back_ and gets the image. Now since you can't easily cache the image btw those two times, you need to defer generation of the image until the browser asks for it. So in your DTML code, you need to return a URL indicating _where_ to get the image and _what parameters_ to use when doing so. > And then create an external method named "GenerateImage" that looks like: def GenerateImage(self, xsize=800, ysize=600, colors=256, REQUEST=None, RESPONSE=None): # Spin the Pixels -now- ..... if REQUEST and 'image/png' in map(strip, split(REQUEST.get_header('Accept', ''), ',')): outformat = 'PNG'; outmime = 'image/png' else: outformat = 'GIF'; outmime = 'image/gif' if RESPONSE: RESPONSE.setHeader('content-type', outmime) ofd = StringIO() ; im.save(ofd, outformat) return ofd.getvalue() From s341625@student.uq.edu.au Sat Nov 13 05:09:28 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Sat, 13 Nov 1999 15:09:28 +1000 (GMT+1000) Subject: [Zope-dev] Overriding __getattr__ for requests only. In-Reply-To: Message-ID: On Fri, 12 Nov 1999, Christopher Petrilli wrote: > On 11/12/99 3:57 PM, Jeff K. Hoffman at jkhoffman@carolina.rr.com wrote: > > > I am trying to write a new subclass of OFS.Folder (as a python product) to > > do the following: When a user requests /myFolder/index_html, myFolder > > will search itself, then its list of 'parents', returning the attribute > > from one of them if they have it, and raising an AttributeError if not. > > Pardon my ignorance, but what exactly does this accomplish that isn't > accomplished by Acquisition? Basically, it lets you acquire from a fixed set of parents instead of the entire aquisition path. I'm battling this out for behaviours as well. Another way to think of this is mix-in classes working within the user-space instead of zclass space. Cheers, Anthony Pfrunder From s341625@student.uq.edu.au Sat Nov 13 05:13:50 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Sat, 13 Nov 1999 15:13:50 +1000 (GMT+1000) Subject: [Zope-dev] Overriding __getattr__ for requests only. In-Reply-To: Message-ID: On Fri, 12 Nov 1999, Jeff K. Hoffman wrote: > Hello, everyone. > > So, my question is, is there any way for me to achieve this behavior > without causing the problems above? I am thinking there must be a way to > search the parents if AND ONLY IF it is for an incoming web request. I'm in the middle of doing this too. I have found that it is better to append / delete from the _ namespace instead of overriding the __getattr__. This way, your meta-dictionary (_ namespace) can perform the right action. Also, it can ignore "writes" and hence avoid the addition problem. I'll post my code once I get it working correctly. BIG WARNING: don't make an attribute in your base class the same name as an exisiting one in the ZClass or you'll run into big problems. Cheers, Anthony Pfrunder From lfalse@cs.rutgers.edu Sat Nov 13 07:16:51 1999 From: lfalse@cs.rutgers.edu (Stefan Langerman) Date: Sat, 13 Nov 1999 02:16:51 -0500 (EST) Subject: [Zope-dev] Adding a Control Panel? Message-ID: Hi, I am getting tired of manually downloading packages, esp. since I access my server remotely, and it's a pain to have to telnet to do the job, so I thought it would be a good idea to make a control panel to download and install products automatically. You would just provide the URL of the product tarball, and that would be it. If this thing works, then what about adding an automatic install button on the zope Products pages. Your Zope member info could contain the name(s) of your server(s), and the install button would just link to something of the kind: http://yourserver.org/install?http://www.zope.org/.../stuff.tgz Wouldn't that be cool? Anyway, I am trying to do this, but since this is my first serious Zope thing, I would need some help. Here are my questions: - Can I add something to the ApplicationManager? How do I do this? - Another way would be to add an entry to the manage_options of the ProductFolder, but again, I have no clue on how to do that. - How should I package my thing? In a Product or some external method or something else? Product seems to be cleaner, but I really haven't seen anything like what I want to do... Any suggestions are welcome. Altough I am a newbie, I am good at learning from examples, so feel free to throw sample code at me from similar projects, or just give me some pointers to code/doc/faq. Thanks, Stefan. From bill.anderson@libc.org Sun Nov 14 00:51:07 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Sat, 13 Nov 1999 17:51:07 -0700 Subject: [Zope-dev] Patch Submitted: Setting SERVER_NAME through the environment Message-ID: <382E077B.ADC32DF7@libc.org> Just thought I'd let everyone know that I submited a patch to teh collector to allow you to set an environment variable SERVER_NAME for zope, rather than having to manually hardcode on into Zserver/medusa/http_server.py as mentioned earlier. It is a simple patch that seems to work fine for me. I don't believe anything breaks, YMMV ;-) On a related note, are you guys at Digicool notified when someone submits a bugrep/reaturereq _with_ patch, making these kind of announcements really unneccesary? Another note: It would be nice if we could have a file upload option for the patch, as opposed to copy-pasting into a small field window :-) Well, off for more Zoping around .. :-) -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From s341625@student.uq.edu.au Sat Nov 13 09:49:54 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Sat, 13 Nov 1999 19:49:54 +1000 (GMT+1000) Subject: [Zope-dev] ZDOM BUGS: Anyone know a workaround? Message-ID: Hi, I've found two bugs in the ZDOM (Zope/Lib/Python/Ofs/ZDOM.py) and was wondering if someone knew a workaround. 1 - getAttributes() only returns attributes of type string, not tokens, selections etc. Example: * Add some properties of various types to a ZClass instance * Add the following to a Python Method of the ZClass: parameters: self, REQUEST t = '' for i in self.getAttributes(): t = t + i.getNodeName() + ',' + i.getNodeValue() return t * View the Python Method of the zclass instance (ie tryit) 2 - REQUEST throws "Unauthorized access" for objects stuffed into it. Even as superuser you get the unauthorized message. Example: * Create an XML document (myxml) in the ZClass * Create a Python Method: parameters: self, REQUEST REQUEST.set('node', self.myxml.getFirstNode()) return self.dump(REQUEST) * Create a DTML Method (dump): * View the Python Method of the ZClass (ie TryIt) Anyone? Anthony Pfrunder From akuchlin@mems-exchange.org Sat Nov 13 18:13:08 1999 From: akuchlin@mems-exchange.org (Andrew M. Kuchling) Date: Sat, 13 Nov 1999 13:13:08 -0500 (EST) Subject: [Zope-dev] Post Zope 2.1 roadmap? Message-ID: <199911131813.NAA02568@amarok.cnri.reston.va.us> My curiosity has been roused, after debugging yet another hack of mine to make a Zope package coexist with an outside extension of the same name: what's the roadmap for packagizing Zope, which I understood to be a long-term aim? Not in 2.1, obviously; 2.2, maybe? -- A.M. Kuchling http://starship.python.net/crew/amk/ Once you accept that the world is a giant computer run by white mice, all other movies fade into insignificance. -- Mutsumi Takahashi, on _The Hitch-hiker's Guide to the Galaxy_ From mindlace@majordomo.net Sat Nov 13 16:39:28 1999 From: mindlace@majordomo.net (Ethan Fremen) Date: Sat, 13 Nov 1999 16:39:28 +0000 Subject: [Zope-dev] Re: [Zope] DTML Syntax contd. + rant References: Message-ID: <382D9440.E4CF596@majordomo.net> Here's my take: When my bid was accepted to redesign the site I'm working on, I settled on Zope instead of PHP (it compiled without error.) I knew nothing about Python or Zope. Now I'm happily using Zope and I just got Learning Python. I'm not very far into it, but just learning some of the basics I'm starting to realize how close to the surface Python is. I would love to see Python Methods take over more of the "engine" behavior from DTML. I assume, however, that ngDTML would still include things like , otherwise I'll pull my hair out. I also think there's some things that can/should be pushed elsewhere- REQUEST.set is a good example- I get a content-type for images, why not let me do that with other objects? Maybe the drop-down list of properties could be like the object-selection, so you could add new property types (content-type, tinytable...) Simultaneously, the last thing I want to see is for HTML to get imbedded in python. I used a Perl module where I built forms programmatically, and I don't want to go back to that. I've spent most of my time on this project getting out from under some developer who thought implementing HTML in javascript was a good idea. I'm also frustrated with things like TreeTag.py that imbed HTML into them, not allowing me to change their output to fit my fancy. I don't really have a problem with PythonMethods being scattered throuought my hierarchy: indeed, if they live with aquisition the same as everybody else, this could be quite useful. (as an aside, I'd like to be able to use factories like this, so that certain objects are only creatable at certain places in the hierarchy) Perhaps if DTML has a consistent method of dealing with things passed to/from npythonMethods, and a way of invoking them (dtml-call?), they would be more used. I know I stay as far away from the _ stuff as I can. If I have to use one of those _[blarg._['foo']] things, i copy it from someone else and hope that it works. It sure reminds me of something somebody called another language- "executable line noise". anyway, python seems to me to be a transparent enough language that there's no compelling need to obfuscate it for things it does well enough already. Plus, the "closer" python is in the upgrade path from content manager -> developer -> zope source contributor, the sooner you'll have more of the latter. wannabe zope hacker, -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology. From s341625@student.uq.edu.au Sun Nov 14 05:52:29 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Sun, 14 Nov 1999 15:52:29 +1000 (GMT+1000) Subject: [Zope-dev] ANN: VisualZope 0.1alpha Message-ID: Hi, VisualZope 0.1a is now available! It has the following features: * Included "GeoCities" watermark example widget * Two behaviours - draggable and resizeable (resizing may not occur) * Extensive code streamlining and documentation in tutorial format (the README_txt files) It should be easy to create simple floating and inline widgets with this version. A static (non-active) version of the UI is provided under the Editor tag. Note, behaviours cannot be recursive at the moment. Further info is available at: http://163.182.196.200/zwiki/VisualZope (download via the "available" link) Cheers, Anthony Pfrunder From petrilli@digicool.com Sun Nov 14 16:15:42 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Sun, 14 Nov 1999 11:15:42 -0500 Subject: [Zope-dev] Post Zope 2.1 roadmap? In-Reply-To: <199911131813.NAA02568@amarok.cnri.reston.va.us> Message-ID: On 11/13/99 1:13 PM, Andrew M. Kuchling at akuchlin@mems-exchange.org wrote: > My curiosity has been roused, after debugging yet another hack of mine > to make a Zope package coexist with an outside extension of the same > name: what's the roadmap for packagizing Zope, which I understood to > be a long-term aim? Not in 2.1, obviously; 2.2, maybe? I'd guess more 3.xish honestly. This would be a pretty substantial modification to the code, and would not be something I would consider a "feature" release as it would be backward incompatible at some level. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From petrilli@digicool.com Sun Nov 14 16:44:06 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Sun, 14 Nov 1999 11:44:06 -0500 Subject: [Zope-dev] Patch Submitted: Setting SERVER_NAME through the environment In-Reply-To: <382E077B.ADC32DF7@libc.org> Message-ID: On 11/13/99 7:51 PM, Bill Anderson at bill.anderson@libc.org wrote: > On a related note, are you guys at Digicool notified when someone > submits a bugrep/reaturereq _with_ patch, making these kind of > announcements really unneccesary? we are notified on ANYTHING added to the collector, or any change in status :-) Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From s341625@student.uq.edu.au Mon Nov 15 02:50:21 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Mon, 15 Nov 1999 12:50:21 +1000 (GMT+1000) Subject: [Zope-dev] VisualZope correction & Zwiki question Message-ID: Hi, The available link on Zwiki for VisualZope should be ok now. What mode should I use for the way it used to work? URL's go all funny now :( Cheers, Anthony Pfrunder From d_lance@email.msn.com Mon Nov 15 03:54:17 1999 From: d_lance@email.msn.com (Dale Lance) Date: Sun, 14 Nov 1999 21:54:17 -0600 Subject: [Zope-dev] RE: ANN: VisualZope 0.1alpha References: <199911142000.MAA19288@zope.codeit.com> Message-ID: <008301bf2f1d$17f5b940$bcb71b3f@home> VisualZope sounds cool! But alas, I tried following your instructions and get the following upon trying to view the examples. Any help available? Dale Lance Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: aq_base ---------------------------------------------------------------------------- ---- Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 214, in publish_module File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 179, in publish File C:\Program Files\WebSite\lib\python\Zope\__init__.py, line 201, in zpublisher_exception_hook (Object: ElementWithAttributes) File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 165, in publish File C:\Program Files\WebSite\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\ZPublisher\Publish.py, line 102, in call_object (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 49, in __call__ (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\OFS\DTMLMethod.py, line 145, in __call__ (Object: view) File C:\Program Files\WebSite\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: view) File C:\Program Files\WebSite\lib\python\DocumentTemplate\DT_Util.py, line 321, in eval (Object: dorender(getDocumentElement(), REQUEST)) File , line 0, in ? File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 56, in dorender (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 70, in prender (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 70, in prender (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 70, in prender (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vzManager.py, line 72, in prender (Object: XMLWidgetManagerBase) File C:\Program Files\WebSite\lib\python\Products\VisualZope\vz.py, line 58, in prender File C:\Program Files\WebSite\lib\python\Products\PythonMethod\PythonMethod.py, line 168, in __call__ (Object: prender) (Info: ((,
    , ,

    form

    cookies

    tree-seJyLjlZ3hANPW/XYWAAtiQTP
    dtpref_rows20
    dtpref_cols80

    other

    typewatermarkdtpref_rows20inherited#mywatermarkResizeButton position: absolute; top: 80px; left: 80px; width: 20px; height: 20px; clip:rect(0px 100px 100px 0px); }BASE4http://127.0.0.1:8080/VZexamples/VisualZope/i ndex_htmldtpref_cols80BASE3http://127.0.0.1:8080/VZexamples/VisualZopeinitdocument.onmousedown = mouseDown document.onmousemove = mouseMove document.onmouseup = mouseUp if (ns4) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP) mywatermark.activate() behaviourmode0BASE0http://127.0.0.1:8080URL1http://127.0.0.1:8080/VZexamples/VisualZopeSERVER_URLhttp://127.0.0.1:8080scriptnamemywatermarktree-seJyLjlZ3hANPW/XYWAAtiQTPAUTHENTICATION_PATHURL3http://127.0.0.1:8080URL0http://127.0.0.1:8080/VZexamples/VisualZope/in dex_htmlURL2http://127.0.0.1:8080/VZexamplescloneintURLhttp://127.0.0.1:8080/VZexamples/VisualZope/ind ex_htmlBASE2http://127.0.0.1:8080/VZexamplesBASE1http://127.0.0.1:8080AUTHENTICATED_USERDalenodeURL0http://127.0.0.1:8080/VZexamples/VisualZope/in dex_htmlURL1http://127.0.0.1:8080/VZexamples/VisualZopeURL2http://127.0.0.1:8080/VZexamplesURL3http://127.0.0.1:8080BASE0http://127.0.0.1:8080BASE1http://127.0.0.1:8080BASE2http://127.0.0.1:8080/VZexamplesBASE3http://127.0.0.1:8080/VZexamples/VisualZopeBASE4http://127.0.0.1:8080/VZexamples/VisualZope/i ndex_html

    environ

    HTTP_ACCEPT_ENCODINGgzip, deflate
    channel.creation_time942637129
    SERVER_PROTOCOL1.1
    SERVER_PORT8080
    PATH_INFO/VZexamples/VisualZope/index_html
    HTTP_HOST127.0.0.1:8080
    REQUEST_METHODGET
    PATH_TRANSLATED\VZexamples\VisualZope\index_html
    HTTP_COOKIEdtpref_rows="20"; dtpref_cols="80"; tree-s="eJyLjlZ3hANPW/XYWAAtiQTP"
    SCRIPT_NAME
    SERVER_SOFTWAREZope/Zope 2.0.0 (binary release, python 1.5.2, win32-x86) ZServer/1.1b1
    HTTP_ACCEPT_LANGUAGEen-us
    HTTP_ACCEPTimage/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    REMOTE_ADDR127.0.0.1
    HTTP_REFERERhttp://127.0.0.1:8080/VZexamples/Visua lZope/manage_main
    SERVER_NAME1Cust188.tnt18.dfw5.da.uu.net
    GATEWAY_INTERFACECGI/1.1
    HTTP_USER_AGENTMozilla/4.0 (compatible; MSIE 5.0; MSN 2.5; Windows 98; DigExt)
    CONNECTION_TYPEKeep-Alive
    ), {}, None)) File , line 27, in prender (Object: ElementWithAttributes) File C:\Program Files\WebSite\lib\python\Products\XMLDocument\Node.py, line 690, in setAttribute (Object: Manageable) File C:\Program Files\WebSite\lib\python\OFS\PropertyManager.py, line 206, in _setProperty (Object: Manageable) File C:\Program Files\WebSite\lib\python\OFS\PropertyManager.py, line 182, in valid_property_id (Object: Manageable) AttributeError: (see above) > Date: Sun, 14 Nov 1999 15:52:29 +1000 (GMT+1000) > From: Anthony Pfrunder > To: zope-dev@zope.org > Subject: [Zope-dev] ANN: VisualZope 0.1alpha > > Hi, > > VisualZope 0.1a is now available! It has the following features: > * Included "GeoCities" watermark example widget > * Two behaviours - draggable and resizeable (resizing may not occur) > * Extensive code streamlining and documentation in tutorial format > (the README_txt files) > > It should be easy to create simple floating and inline widgets with this > version. A static (non-active) version of the UI is provided under the > Editor tag. Note, behaviours cannot be recursive at the moment. > > Further info is available at: http://163.182.196.200/zwiki/VisualZope > (download via the "available" link) > > Cheers, > > Anthony Pfrunder > From simon@joyful.com Mon Nov 15 04:19:31 1999 From: simon@joyful.com (Simon Michael) Date: 14 Nov 1999 20:19:31 -0800 Subject: [Zope-dev] VisualZope correction & Zwiki question In-Reply-To: Anthony Pfrunder's message of "Mon, 15 Nov 1999 12:50:21 +1000 (GMT+1000)" References: Message-ID: <874seo4ca4.fsf@readymix.joyful.com> Anthony Pfrunder writes: > The available link on Zwiki for VisualZope should be ok now. What mode > should I use for the way it used to work? URL's go all funny now :( Hi Anthony, I installed new code today which causes old pages to be rendered as structured text. Switch to HTML/DTML to get the old behaviour, if you're still having trouble. I should have written some code to switch all the old pages over but it was too much hassle. -Simon From mo@local2me.com Mon Nov 15 06:36:48 1999 From: mo@local2me.com (Michael Olivier) Date: Sun, 14 Nov 1999 22:36:48 -0800 Subject: [Zope-dev] getting Zap to work with cgi-bin directory Message-ID: <382FAA00.57BB299@local2me.com> Hi folks, We've got Zope and Zap running but are having trouble with Zap's cgi-bin directory. Specifically, we're wanting to run some pcgi/bobo stuff but can't get even the perl test scripts (printenv, test-cgi) to work. From the error log I can see that it's mapping /localhost/cgi-bin to /usr/local/zope/Zap/htdocs/cgi-bin/ -- it's looking for cgi-bin below htdocs. I'd like to have it as a sibling directory with htdocs. If I actually put it inside htdocs (htdocs/cgi-bin), it displays the scripts but doesn't execute them. I tried adding this to the zap.conf file: AllowOverride None Options ExecCGI ...but this didn't seem to have any effect... Can someone advise please on how to debug this situation? Doesn't zap come preconfigured for cgi-bin use, or not? Many thanks, Michael From Victor.Zhai@ogilvy.com Mon Nov 15 07:20:47 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Mon, 15 Nov 1999 15:20:47 +0800 Subject: [Zope-dev] getting Zap to work with cgi-bin directory Message-ID: Hi . I have encounter the problerm the same as me.When I changed my project from the normal platform to Zope.The Path is a big problerm. I have defined a global parameter in Zope to replace the existing one.But it seems too fool.Can anyone help me ? Many thanks, Victor zhai. "WorldSecure Server " made the following annotations on 11/15/99 02:54:15 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From s341625@student.uq.edu.au Mon Nov 15 10:11:47 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Mon, 15 Nov 1999 20:11:47 +1000 (GMT+1000) Subject: [Zope-dev] RE: ANN: VisualZope 0.1alpha In-Reply-To: <008301bf2f1d$17f5b940$bcb71b3f@home> Message-ID: Hi, Turns out the XML Document I was using was a CVS version. On the download page I've added a copy of the replacement file (Node.py). Install this and it should work. crossing-my-fingers-ly, Anthony Pfrunder From robin@jessikat.demon.co.uk Mon Nov 15 11:29:23 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Mon, 15 Nov 1999 11:29:23 +0000 Subject: [Zope-dev] making an NT service Message-ID: <574zzLAT6+L4EwlH@jessikat.demon.co.uk> My colleague and I migrated a working system from win98 to winnt 4.0 sp5. I there an easy way to set up the installation as a service. I looked at ZService.py and it seems to need some co-operation from the installer. -- Robin Becker From robin@jessikat.demon.co.uk Mon Nov 15 12:33:53 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Mon, 15 Nov 1999 12:33:53 +0000 Subject: [Zope-dev] ftp_serever problems Message-ID: following advice from Sam Rushing I managed to check the active sockets list and it seems as though the current ftp server doesn't recover sockets for suddenly aborted clients. He posted a modified ftp_server.py, but I'm pretty sure it doesn't handle this problem. -- Robin Becker From itamars@ibm.net Mon Nov 15 16:41:48 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Mon, 15 Nov 1999 18:41:48 +0200 Subject: [Zope-dev] Passing parameters to __str__ Message-ID: <383037CC.612D7661@ibm.net> I'm trying to have an object that returns different data based on if it's called from or on its own, so I defined a __str__ function. I need to pass REQUEST to __str__, but apparently __str__ doesn't get any parameters passed when it gets called. How do I correct this? -- Itamar - itamars@ibm.net ---------------------------o----------------------------------------------o Perl/Gimp Greeting Cards | Trust? Ha! The US dollar is backed by ICBMs! | http://www.sealingwax.com | --Anonymous Coward, Slashdot | From michel@digicool.com Mon Nov 15 17:52:43 1999 From: michel@digicool.com (Michel Pelletier) Date: Mon, 15 Nov 1999 12:52:43 -0500 Subject: [Zope-dev] Passing parameters to __str__ Message-ID: <613145F79272D211914B0020AFF640192762BC@gandalf.digicool.com> > -----Original Message----- > From: Itamar Shtull-Trauring [mailto:itamars@ibm.net] > Sent: Monday, November 15, 1999 11:42 AM > To: zope-dev@zope.org > Subject: [Zope-dev] Passing parameters to __str__ > > > I'm trying to have an object that returns different data > based on if it's > called from or on its own, so I defined a __str__ function. > > I need to pass REQUEST to __str__, but apparently __str__ > doesn't get any > parameters passed when it gets called. How do I correct this? You can acquire REQUEST: def __str__(self): req = self.REQUEST before using the __str__ of your object, stuff what your looking for in REQUEST (it it's not allready in there). -Michel From sgendler@teknolojix.com Mon Nov 15 19:01:27 1999 From: sgendler@teknolojix.com (Sam Gendler) Date: Mon, 15 Nov 1999 11:01:27 -0800 Subject: [Zope-dev] Re: [Zope] Cheap LINUX Zope host? References: Message-ID: <38305887.EF10B755@teknolojix.com> The biggest issue with SCSI is not so much performance any longer, but reliability. IDE drives have been traditionally targeted at the consumer market, while SCSI drives are aimed at the professional/server market. If you look at the Mean Time Between Failures numbers for the two types, SCSI tends to have been designed for higher reliability. That said, however, I have only ever had 2 IDE drives go south on me, with 0 scsi over the course of about 10 years. Those numbers are close enough for me, usually. Drive throughput tends to not be a huge issue with webservers, since servers spend most of their time seeking from one small object to another, not streaming enormous files to a network socket. With seek times anywhere between 8-14ms, and average object size somewhere around 8-15KB, if every object requires only one seek and one read from the disk, you can still only get about 70 transactions/second (assuming the read is instantaneous, which it isn't), which is only about 1 MB/second throughput. Therefore, it is much better to use multiple, slower drives, and distribute objects across multiple machines. Unfortunately, the data in zope is all stored in a single file, so this cannot be done. RAID is not much of a win, either, since raid increases throughput, but does nothing to improve seek time (it might even make it worse). You will be MUCH better off with more memory for buffering objects, to prevent disk access at all, rather than a fast drive. On a zope-dev note, I have a variety of solutions that would allow zope to distribute objects across multiple physical hard drives, that should not be too difficult to implement, if anyone is interested. I don't have time to play with such concepts myself until next year. --sam tommy_b@my-deja.com wrote: > Oops, I'm going to use LINUX as the host OS. > > I've done a bit of research on using SCSI. IWill & Tekram put out SCSI3 cards under $70 (according to http://www.pricewatch.com). Anyone use these guys? However, I'm not sure a cheap/close-out SCSI drive will match the performance-to-value ratio to a new ATA-66. http://www.storagereview.com has lots of drive tests that leads me to this thought. If I was spending more than $1000 for a new system, I'd go SCSI for sure. I need to keep below $700, but SCSI is one of my first planned upgrades. Is SCSI worth me getting a old used system with 64MB of RAM & slapping a SCSI card into it, or should I go for a new (dual) Celeron with 128MB? > > Has anyone actually done performce tests with Zope & SQL to compare what component has the most impact for a _cheap_ system: CPU, memory, or HD throughput (ATA vs SCSI)? > > Thanks for Stephan, Jim, & Nitin for the replies! > -- > > On Sun, 14 Nov 1999 18:28:56 Nitin Borwankar wrote in "Re: [Zope] What to buy for cheap Zope host?": > >tommy_b@my-deja.com wrote: > >> I'm building a computer to train & test Zope. I hope to use PostgreSQL or MySQL for storing a good-sized database. Zope would be used for allowing users to enter data & for output of formated querries. > >> I wish to spend no more than $700 on this new computer I'm building (not including sound & video card + monitor). What should I spend the most money on, CPU, memory, HD, or a balance? > >> I'm leaning towards a PPGA Celeron 366 (possibly overclocked), buying a 128MB stick of P100 RAM, and the fastest ATA drive $120 can buy. Is this the right direction? Ram's rather expencive now, or else I'd get 256MB right away. > > > >In either case spending some money and getting a SCSI controller and drive gives a measurable contribution to performance. However this may take you into the next price point segment ~1000$. I have found there are good bargains on SCSI drives to be had on eBay and ONSALE auctions - go for new and 7200RPM or more. > > --== Sent via Deja.com http://www.deja.com/ ==-- > Share what you know. Learn what you don't. > > --------- End Forwarded Message --------- > > --== Sent via Deja.com http://www.deja.com/ ==-- > Share what you know. Learn what you don't. > > _______________________________________________ > 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 ) From sboyd@futures.com Mon Nov 15 20:03:41 1999 From: sboyd@futures.com (Scott Boyd) Date: Mon, 15 Nov 1999 12:03:41 -0800 (PST) Subject: [Zope-dev] Re: [Zope] Cheap LINUX Zope host? In-Reply-To: <38305887.EF10B755@teknolojix.com> Message-ID: The SCSI TekRAM cards work great. I've been using them quite a bit over the last few months. Linux supports them very well, they support tagged queueing, and are very reliable. You can get better performance out of single DB storage systems like Zope, by striping the DB across multiple drives. You are basically limited to only 2 drives on IDE, because of the master/slave limitations. Redundancy, can also be added by mirroring across the striped drives. You can stripe across SCSI disks more efficiently. I've done some simple IDE RAID 1+0 mirrors and they do help the read performance, if the drives are on seperate IDE interfaces (both masters), but you pay on the writes, since you need to write to two drives instead of one. Scott Boyd On Mon, 15 Nov 1999, Sam Gendler wrote: > The biggest issue with SCSI is not so much performance any longer, but reliability. IDE drives have been traditionally targeted at the consumer market, while SCSI drives are aimed at the professional/server market. If you look at the Mean Time Between Failures numbers for the two types, SCSI tends to have been designed for higher reliability. That said, however, I have only ever had 2 IDE drives go south on me, with 0 scsi over the course of about 10 years. Those numbers are close enough for me, usually. Drive throughput tends to not be a huge issue with webservers, since servers spend most of their time seeking from one small object > to another, not streaming enormous files to a network socket. With seek times anywhere between 8-14ms, and average object size somewhere around 8-15KB, if every object requires only one seek and one read from the disk, you can still only get about 70 transactions/second (assuming the read is instantaneous, which it isn't), which is only about 1 MB/second throughput. Therefore, it is much better to use multiple, slower drives, and distribute objects across multiple machines. Unfortunately, the data in zope is all stored in a single file, so this cannot be done. RAID is not much of a win, either, since raid increases throughput, but does > nothing to improve seek time (it might even make it worse). You will be MUCH better off with more memory for buffering objects, to prevent disk access at all, rather than a fast drive. > > On a zope-dev note, I have a variety of solutions that would allow zope to distribute objects across multiple physical hard drives, that should not be too difficult to implement, if anyone is interested. I don't have time to play with such concepts myself until next year. > > --sam > > tommy_b@my-deja.com wrote: > > > Oops, I'm going to use LINUX as the host OS. > > > > I've done a bit of research on using SCSI. IWill & Tekram put out SCSI3 cards under $70 (according to http://www.pricewatch.com). Anyone use these guys? However, I'm not sure a cheap/close-out SCSI drive will match the performance-to-value ratio to a new ATA-66. http://www.storagereview.com has lots of drive tests that leads me to this thought. If I was spending more than $1000 for a new system, I'd go SCSI for sure. I need to keep below $700, but SCSI is one of my first planned upgrades. Is SCSI worth me getting a old used system with 64MB of RAM & slapping a SCSI card into it, or should I go for a new (dual) Celeron with 128MB? > > > > Has anyone actually done performce tests with Zope & SQL to compare what component has the most impact for a _cheap_ system: CPU, memory, or HD throughput (ATA vs SCSI)? > > > > Thanks for Stephan, Jim, & Nitin for the replies! > > -- > > > > On Sun, 14 Nov 1999 18:28:56 Nitin Borwankar wrote in "Re: [Zope] What to buy for cheap Zope host?": > > >tommy_b@my-deja.com wrote: > > >> I'm building a computer to train & test Zope. I hope to use PostgreSQL or MySQL for storing a good-sized database. Zope would be used for allowing users to enter data & for output of formated querries. > > >> I wish to spend no more than $700 on this new computer I'm building (not including sound & video card + monitor). What should I spend the most money on, CPU, memory, HD, or a balance? > > >> I'm leaning towards a PPGA Celeron 366 (possibly overclocked), buying a 128MB stick of P100 RAM, and the fastest ATA drive $120 can buy. Is this the right direction? Ram's rather expencive now, or else I'd get 256MB right away. > > > > > >In either case spending some money and getting a SCSI controller and drive gives a measurable contribution to performance. However this may take you into the next price point segment ~1000$. I have found there are good bargains on SCSI drives to be had on eBay and ONSALE auctions - go for new and 7200RPM or more. > > > > --== Sent via Deja.com http://www.deja.com/ ==-- > > Share what you know. Learn what you don't. > > > > --------- End Forwarded Message --------- > > > > --== Sent via Deja.com http://www.deja.com/ ==-- > > Share what you know. Learn what you don't. > > > > _______________________________________________ > > 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 ) > From circle@gwi.net Mon Nov 15 20:07:19 1999 From: circle@gwi.net (Andrew Wilcox) Date: Mon, 15 Nov 1999 15:07:19 -0500 Subject: [Zope-dev] Possible to share zclass properties by subclassing? Message-ID: <3.0.6.32.19991115150719.007d82e0@mail.gwi.net> I have several ZClasses I'm creating, and they share a number of common properties. Oh, I said, why don't I make an abstract ZClass for the common properties, and subclass my other ZClasses from that? But, oh well, the superclass view doesn't show up in the subclass manage screen, and I don't see the superclass property sheet as an option to select in the subclass "Views" tab. Am I off base here? Is there a way to share common properties? How should I do this? Thanks! Andrew From tmarsh@point-one.net Mon Nov 15 23:56:19 1999 From: tmarsh@point-one.net (Thomas Marsh) Date: Mon, 15 Nov 1999 17:56:19 -0600 Subject: [Zope-dev] Namespace funkiness Message-ID: <19991115175619.A27965@point-one.net> Hi Zope-dev, I have a dtml method, "A", that calls another dtml method, "B". Now, B has some calls in it. B works fine on its own, but when A calls B, for some reason B cannot see blah (a property set in the root folder). I see this behaviour a lot. Can anyone explain it? --thomas -- Thomas Marsh Email: tmarsh@point-one.net Phone: (512) 381-6457 From circle@gwi.net Tue Nov 16 00:07:47 1999 From: circle@gwi.net (Andrew Wilcox) Date: Mon, 15 Nov 1999 19:07:47 -0500 Subject: [Zope-dev] Deleting a role doesn't remove associated permissions Message-ID: <3.0.6.32.19991115190747.007cebb0@mail.gwi.net> Yikes! Delete a role, and the permissions grants to users who are in that role remain. But the role or the permissions are no longer displayed, so the fact that someone has permission for a resource is hidden! From Anthony Baxter Tue Nov 16 01:13:19 1999 From: Anthony Baxter (Anthony Baxter) Date: Tue, 16 Nov 1999 12:13:19 +1100 Subject: [Zope-dev] Namespace funkiness In-Reply-To: Message from Thomas Marsh of "Mon, 15 Nov 1999 17:56:19 MDT." <19991115175619.A27965@point-one.net> Message-ID: <199911160113.MAA04684@mbuna.arbhome.com.au> >>> Thomas Marsh wrote > I have a dtml method, "A", that calls another dtml method, "B". Now, B > has some calls in it. B works fine on its own, but when A > calls B, for some reason B cannot see blah (a property set in the root > folder). I see this behaviour a lot. Can anyone explain it? How does it call it - with ? Or with ? If the latter, you'll need to pass the request and namespace through to it. Something like Anthony From s341625@student.uq.edu.au Tue Nov 16 01:28:27 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Tue, 16 Nov 1999 11:28:27 +1000 (GMT+1000) Subject: [Zope-dev] Namespace funkiness In-Reply-To: <19991115175619.A27965@point-one.net> Message-ID: On Mon, 15 Nov 1999, Thomas Marsh wrote: > Hi Zope-dev, > > I have a dtml method, "A", that calls another dtml method, "B". Now, B > has some calls in it. B works fine on its own, but when A > calls B, for some reason B cannot see blah (a property set in the root > folder). I see this behaviour a lot. Can anyone explain it? I *think* it is a bug somewhere. I've noticed that if A & C were a Python Method such that: A calls B and B calls c and: class something: def A() def B() where B is a DTML Method A needs to call B like this: self.B(self, x, y, z) instead of: self.B(x, y, z) If you don't do this, properties listed *as strings only* are acccessable but other properties and functions called within B say: unauthorized access -- even as superuser. or Resource not found I don't know why stuffing self in twice works - it just does ;) Cheers, Anthony Pfrunder From pavlos@gaaros.msrc.sunysb.edu Tue Nov 16 13:00:45 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Tue, 16 Nov 1999 08:00:45 -0500 (EST) Subject: [Zope-dev] Re: [Zope] [ANN] ZpdfDocument-0-0-1 In-Reply-To: <38311BC3.45009DFE@tm.ee> Message-ID: Hi Hannu I have moved this discussion on the zope-dev list ... On Tue, 16 Nov 1999, Hannu Krosing wrote: > > The _right_ (tm) approach would be to implement support for CSS2 (and test it > on > something really complex like MSWord2000 MS-XML-(X)HTML docs ;) I was afraid you or someone else would say something like this ;-). Eventually it is the right way to go. > > The one that actually can be done in reasonable amount of time would be a > minimal > set of additional tags (maybe only ) an some attributes for some tags - > page_break_before, page_break_after with their counterparts no_ page_break_xxx > to > override style defaults. And a possibility to set such style defaults. This is what I am thinking too. If I get some time next weekend I might try to add them. > > I will also need to disable page headers and footers (my current need is > printing > exactly positioned addresses on postcards) and next I will add a feature to > make > them optional (unless this already exists ?) No, I did not give the option to remove them. I should have them by next release. Thanks for the feedback Hannu Pavlos From dan@remote.control.com Tue Nov 16 17:47:19 1999 From: dan@remote.control.com (Dan Pierson) Date: Tue, 16 Nov 1999 12:47:19 -0500 Subject: [Zope-dev] RE: [Zope] xmlrpc calls require string results? Message-ID: <92C80F6CEAB6D1118DCB00609754111A72AA37@remote.control.com> > It doesn't have a doc string, and ZPublisher will not publish a method > that does not have one. Looks like I missed this, as several people were kind enough to point out. I've sent mail to Butch asking him if he'd like a patch for Squishdot or would prefer to add doc strings himself. > XML-RPC should have better error messages, but it doesn't. We didn't > put XML-RPC support into Zope, so you would need to talk to > the original > author, Eric Kidd of Userland (http://linux.userland.com/)?, > or send us > some patches. It looks like XML-RPC is trying to do something kind of useful with error messages. It would be better if its exception method didn't throw away the exception type, but that's a minor issue (that I may come up with a patch for later). But the exception method always returns an XML-RPC Fault object -- I'm getting back ProtocolError objects. Looking at the sources gives me a hint: ZPublisher/Publish.py defines two methods: - 'publish_module' catches an exception and uses the response object's exception methods to handle it. - 'publish' catches an exception and looks for an 'err_hook' method in the module_info. Is it possible that publish is being used where the author of xmlrpc.py expected publish_module? If so, what/where would need to be changed to create an err_hook to handle this? From Victor.Zhai@ogilvy.com Tue Nov 16 03:57:05 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Tue, 16 Nov 1999 11:57:05 +0800 Subject: [Zope-dev] What's the problerm? Message-ID: Hi, I have replace my old zope system to Zope-2.0.1,And then appear some problerm. A user have been set up in the Root directory "acl_users" and I want to ftp to ZServer with it.But when pass the Username and Password.It cannot list the root dirctory.(Permission denied). I give this Local Role the Manager's above Owner right. But It can work properly within the first ZOpe version. Can some one help me. Thanks a lot. Victor zhai "WorldSecure Server " made the following annotations on 11/16/99 13:46:32 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From Brian@digicool.com Tue Nov 16 19:46:21 1999 From: Brian@digicool.com (Brian Lloyd) Date: Tue, 16 Nov 1999 14:46:21 -0500 Subject: [Zope-dev] Zope 2.1.0 beta 2 has been released Message-ID: <613145F79272D211914B0020AFF6401914DD60@gandalf.digicool.com> Hi all, Zope 2.1.0 beta 2 has been released. This release includes fixes for issues found in beta 1, an updated load_site.py script and Martijn Pieters' patches to implement try/except/else and try/finally constructs in DTML. Unless something major comes up, this will be the final beta before 2.1.0 final. You can download binary and source distribution of Zope 2.1.0 beta 2 from the Zope.org website: http://www.zope.org/Products/Zope/2.1.0b2/ Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From gabor.melis@essnet.se Tue Nov 16 19:54:32 1999 From: gabor.melis@essnet.se (Melis Gábor) Date: Tue, 16 Nov 1999 21:54:32 +0200 Subject: [Zope-dev] XMLDocument development Message-ID: <199911161954.UAA18157@hun46ux.essnet.se> Hi Is there developement underway for XMLDocument? I looked at the cvs and couldn't find it there. Is 1.0a2 the latest version? If not, where can I find it? Thanks, Gabor Melis From robert@leftfieldcorp.com Tue Nov 16 23:46:33 1999 From: robert@leftfieldcorp.com (Robert Leftwich) Date: Wed, 17 Nov 1999 10:46:33 +1100 Subject: [Zope-dev] Catalog Awareness In-Reply-To: <199911161954.UAA18157@hun46ux.essnet.se> Message-ID: Is anyone using the CatalogAware mixin from CatalogAwareness.py ? I am just in the process of adding catalog awareness to my project and have found a couple of problems with it. (Note that this file has not changed since the 14th of September as of the 2.1.0 beta 2 release.) Firstly, you need to import aq_base from somewhere if (as in my case) you are using python classes that are not ZClasses. from OFS.PropertySheets import aq_base Secondly the reindex_all function has a problem. Here is the original function : def reindex_all(self, obj=None): """ """ if obj is None: obj=self if hasattr(aq_base(obj), 'index_object'): obj.index_object() if hasattr(aq_base(obj), 'objectValues'): sub=obj.objectValues() for item in obj.objectValues(): reindex_all(self, item) return 'done!' Note the call to reindex_all( self, item ), which fails in my environment. Here is my replacement (which also uses the sub variable which was initialised but not used in the original) : def reindex_all(self, obj=None): """ """ if obj is None: obj=self if hasattr(aq_base(obj), 'index_object'): obj.index_object() if hasattr(aq_base(obj), 'objectValues'): sub=obj.objectValues() for item in sub: self.reindex_all(item) return 'done!' Should this function be renamed to index_all, as it only indexes the object, not reindexes it ? I will post this to the collector if there are no other changes or objections. Robert Leftwich From Sascha Matzke Wed Nov 17 00:40:47 1999 From: Sascha Matzke (Sascha Matzke) Date: Wed, 17 Nov 1999 01:40:47 +0100 Subject: [Zope-dev] ZSybaseDA Message-ID: <19991117014047.A6722@bespin.escape.de> Hello, I couldn't find any reference to the ZSybaseDA on www.zope.org (but I know there where a version 1.0.1 once). Why is it gone? Sascha -- .-> Sascha Matzke - sascha@bespin.de - http://www.bespin.de -. | I wanna be the mover to real anarchy !!!!!!! | | ATR | `-- On this earth for 24 years, 34 days <----------------' From s341625@student.uq.edu.au Wed Nov 17 00:54:14 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 17 Nov 1999 10:54:14 +1000 (GMT+1000) Subject: [Zope-dev] XMLDocument development In-Reply-To: <199911161954.UAA18157@hun46ux.essnet.se> Message-ID: On Tue, 16 Nov 1999, Melis Gábor wrote: > Hi > > Is there developement underway for XMLDocument? I looked at the cvs and > couldn't find it there. Is 1.0a2 the latest version? If not, where > can I find it? It is under development somewhere but am not sure where. The 1.0a2 release is the latest but needs a patched Node.py to be applied. You can get this file from either XML Widgets or VisualZope (development release) Cheers, Anthony Pfrunder From s341625@student.uq.edu.au Wed Nov 17 01:45:49 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 17 Nov 1999 11:45:49 +1000 (GMT+1000) Subject: [Zope-dev] Javascript wizards wanted for Zope project Message-ID: Hi, I'm working on the VisualZope project and have run into some problems with javascript. Since it isn't my native language (python is) I was wondering if some javascript wizards are interested in getting their names in the credits. The problem is: how do I get a form to talk to an object in another frame? ie: Message-ID: <199911170300.TAA29355@zope.codeit.com> At 11:45 AM 11/17/99 +1000, Anthony Pfrunder wrote: > >The problem is: how do I get a form to talk to an object in another frame? >ie: > > >function jsZDOMsetAttribute(name, value){ > call("getWidget/setAttribute?name=name&value=value") >} Create a "hidden" frame, i.e., one that is either zero width or zero height. Set the document.location.href of this frame to the URL you want to call. Note that this is asynchronous, however, and to find out if the page has been loaded, you'll need to make that page have an onLoad function to call back the original frame and say it's loaded (if you need it to do that). Depending on the complexity of your app, you may want/have to also have the caller implement a timeout to catch errors, and/or set up your Zope error page to have Javascript in it that signals an error back to that page. (Whew.) From jsanford@atinucleus.com Wed Nov 17 04:48:47 1999 From: jsanford@atinucleus.com (Jim Sanford) Date: Tue, 16 Nov 1999 22:48:47 -0600 Subject: [Zope-dev] Javascript wizards wanted for Zope project References: Message-ID: <00ed01bf30b7$0ba6ea60$04fea8c0@sanwinmain> The following example works in IE 4 and 5. Our company has standardized on IE so I have not yet tested this with Netscape but it should work there too. This is a a variation on a line out of an active page.: onChange="opener.document.ContactForm.address.value=this.value"> This updates a field in the browser window that opened the window this code is in. Have also used nothing but javascipt in a child window to update fields in a parent window. The child form on load updates all the fields in the window that called it and then closes itself. This is handy when you have a complex data entry form with a lot of javascript functions (money formatting, autocalcs, ...)and a number of large select lists (some with 100 plus items). Using this routine, when you save a change to the form, you don't have to waste pipe space reloading the form, you just update the data. __________________________________________________________________ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \ Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: jsanford@atinucleus.com Web: http://www.atinucleus.com Source Code, No Royalties, Any CPU...It just make sense ! __________________________________________________________________ ----- Original Message ----- From: Anthony Pfrunder To: ; Sent: Tuesday, November 16, 1999 7:45 PM Subject: [Zope-dev] Javascript wizards wanted for Zope project > Hi, > > I'm working on the VisualZope project and have run into some problems with > javascript. Since it isn't my native language (python is) I was wondering > if some javascript wizards are interested in getting their names in the > credits. > > The problem is: how do I get a form to talk to an object in another frame? > ie: > > > function jsZDOMsetAttribute(name, value){ > call("getWidget/setAttribute?name=name&value=value") > } > > For further information on this problem please see > http://163.182.196.200/zwiki/VisualZope - jsZDOM reflecter part. > > Thanks in advance, > > Anthony Pfrunder > > > _______________________________________________ > 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 ) > > From pje@telecommunity.com Wed Nov 17 04:58:48 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Tue, 16 Nov 1999 23:58:48 -0500 Subject: [Zope-dev] Suggestions towards implementing an experimental protocol for cross-database persistent object references and multi-database Zopelications cross-database persistent object references and multi-database Zopelications In-Reply-To: Message-ID: <199911170459.UAA30730@zope.codeit.com> After studying Jeffrey Shell's ZLDAP package, and the current ZODB system, in the light of recent conversations with Jim Fulton, a few lightbulbs went on with respect to the usefulness of multi-database Zopelications. For example, wouldn't it be keen if regular Zope objects could 'store' object attributes that were actually LDAP entries? Or SQL database records? That would be pretty awesome. The cool thing about the ZLDAP stuff is that the LDAP Connection object, itself a database, is actually a persistent object stored in the regular ZODB. That suggests a clean and sensible way to integrate multi-database Zopes: any given Zope installation must store connections to other databases as persistent objects within its "root" database. That is, any Persistent object in a particular Zopelication should have a _p_jar attribute which either points to the REQUEST-owned Connection, or to an jar which meets this criterion (recursively). This means that one could, at least in theory, reach any database in a multidatabase system by following an ever-expanding tree of database references. Now, if this property is followed, then it is possible for an object in any database to refer to any object which is located "downstream" in the tree. That is, an object O1 in database DB1 can reference object O2 in database DB2 so long as DB2 is reached by way of a persistent object stored in DB1, or a database thus referenced by DB1, recursively. (Upstream references are not possible without a global database naming system; however, there is nothing about my suggested implementation that prevents a global naming scheme from later being used either together with, or in place of, this model.) Due to this tree-oriented nature, this multidatabase model is most appropriate to Zopelications which provide for local needs in a local database, but need to reference other, shared databases or legacy systems. (Note: this model does not support multi-database undo, which requires a global naming mechanism for databases and transactions, so that data integrity can be maintained by refusing to undo transactions unless all databases which were involved can undo it.) Anyway... making references work. Initially, to test this concept, a simple mode of implementation at the application level is to provide a getReference function. If I want to store an object in one of my attributes, I would say: self.attribute = getReference(self,object) The function would look something like: def getReference(source,target): tgt_jar = target._p_jar # note: fails if we can't make reference if tgt_jar is source._p_jar or tgt_jar is None: return target return RemoteReference(getReference(source,tgt_jar),target._p_oid) This recursively builds a dereferencing object which, when retrieved from my self.attribute later, will return the object from the correct database. The RemoteReference class is as follows (or equivalent in C): class RemoteReference(ExtensionClass.Base): def __init__(self,jar,oid): self.jar, self.oid = jar,oid def __of__(self,parent): object = self.jar[self.oid] if hasattr(object,'__of__'): return object.__of__(parent) return object The RemoteReference class simply refers to a jar (which must be a persistent object) and an oid to be retrieved from the jar. When a RemoteReference is retrieved from an object, it will replace itself with the result of retrieving that oid from that jar, and call __of__ on that result. (Note that if the jar itself can be referenced by a RemoteReference, and it will be unpacked when we do self.jar to use it. Thus, a reference "two databases deep" (or more) will be properly unpacked.) Notice that this works even if a portion of a database tree is isolated and used as a root unto itself, since anything stored in a given database can only reference objects in itself, or in databases referenced from it. In order for this protocol to work, one need only do two things: * Any database which wishes to be referenceable must be able to have Connection-like objects stored as Persistent objects. * When storing a reference to another object, one must call getReference(self,object) and store the result, AND, self must already be assigned a _p_jar. The first requirement burdens database implementors, but it is not that far out of the question. It merely needs a Persistent object which can delegate its behavior to a "real" Connection object of some kind. The second requirement burdens those who would store foreign references, and seems a bit more severe, although it seems that often one will know when one is trying to do this. This application-level restriction could be eased by extending databases' persistent_id mechanism (used w/cPickle) to return a RemoteReference as the oid of an object stored in a foreign jar. When they are asked for an object whose oid is a RemoteReference object, they can simply return the RemoteReference itself, or automatically dereference it. The latter has the potential problem of perhaps unnecesarily waking up currently dormant databases, but I suspect it is unlikely to be a real problem in practice. (Note that any such waking-up will be bounded by the depth of the database tree which is currently in use, and also that this mechanism does not preclude the future use of RemoteReferences based on a global naming scheme, or of cyclical references under such a scheme.) To sum up, this seems like a reasonably workable approach to cross-database references in Zope where such references proceed from private "roots" to shared "leaves" of a database tree. It is incrementally implementable, and does not initially require changing any part of the existing Zope framework. But, with additional effort, it can be scaled up to provide better ease-of-use and generality. Creating a "database" that can take advantage of the protocol could be almost as simple as making a Persistent object whose __getitem__ method calls an SQL method to retrieve something from a database, then sets object._p_jar=self and object._p_oid=retrieval_key. Presto, you now have an SQL record which can be "pointed to" by ZODB objects, which need not concern themselves with the details of SQL involved. At this point, all sorts of application ideas begin bubbling through my head, ranging from having counter-type objects stored in suitable storages, to having "storage-managed object pools", a concept Ty and I have been batting around for some time as a means of reducing certain types of write-contention in large applications, and for taking advantage of BerkeleyDB and other databases' native indexing facilities. Anyway, further applications are left as an exercise for the reader. :) Comments? From jsanford@atinucleus.com Wed Nov 17 04:58:38 1999 From: jsanford@atinucleus.com (Jim Sanford) Date: Tue, 16 Nov 1999 22:58:38 -0600 Subject: [Zope-dev] Javascript wizards wanted for Zope project References: <00ed01bf30b7$0ba6ea60$04fea8c0@sanwinmain> Message-ID: <011101bf30b8$6c2bf8c0$04fea8c0@sanwinmain> OOPS. Should have been: ...value=""... From s341625@student.uq.edu.au Wed Nov 17 05:51:55 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 17 Nov 1999 15:51:55 +1000 (GMT+1000) Subject: [Zope-dev] RE:Javascript help Message-ID: Wow! Thanks to all you kind souls. I've got enough information to go from here and will let you know of my progress. I'll release the jsZDOM in a separate product as I think it is a generally useful thing to be able to remotely cause updating of Zope without causing a reload of an expensive (processing wise) page. (Never ceases to amaze me the speed and quality of the work that goes on in the Zope world - back from lunch and I have a written step by step set of instructions ;) Thanks all, Anthony Pfrunder PS: Monitor the Zwiki site for the scratch-pads of other interesting projects. I'm sure DC will move Zwiki onto the main Zope site fairly soon (hint hint) as it is a GREAT way to discuss projects. From mail-zope@fizbin.com Wed Nov 17 07:09:32 1999 From: mail-zope@fizbin.com (Harry) Date: Tue, 16 Nov 1999 23:09:32 -0800 Subject: [Zope-dev] RewriteRules problems and broken image links In-Reply-To: Message-ID: Here's the issue I'm dealing with: I have an installation, linux box, running apapche, with Zope and PCGI installed. The box is running several virtual servers under the main IP, using apache's VirtualHost directive. One of them is my Zope enabled Squishdot site. I have a Squishdot installation configured, and it's working. I needed specific URLs and Paths to work, so Jeff Rush helped me out with some rewriterules that worked -- about 90%. Here's where things get tricky: My site is reachable under: http://www.ourlife.com/OurLife/ as well as http://www.ourlife.com/OurLife First of all, the two Zope provided images at the bottom of the page are broken. Next, if you go to the manage admin screen" http://www.ourlife.com/OurLife/manage The proper screen comes up, but ALL of the image links are broken. Upon inspection of the HTML source, it appears that all local (to Squishdot) links are properly resolved, while all Zope specific links are missing a part of the URL pointing to the right directory, e.g.: img src="http://www.ourlife.com/p_/ZopeButton instead of img src="http://www.ourlife.com/Zope/p_/ZopeButton Where the graphics reside. Now, going to: http://www.ourlife.com/Zope/OurLife/ http://www.ourlife.com/Zope/OurLife/manage and everything wroks exactly like it should, except that this is not the URL I want it to be reachable at. I'll include my RewriteRules at the end of this, but it appears that I'm either missing something, or am failing to specify a rule that addresses the Zope specific items, or something else (of course. Either way, I've raked my brain over this weekend, and hopefully someone out there has a better grip on this kind of situation than me, and can help out here...please. The rewriteRules are INSIDE the VirtualHost directive, and are as follows: RewriteEngine on RewriteRule ^/cgi-bin/(.*) /home/httpd/cgi-bin/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/OurLife(.*) /home/httpd/cgi-bin/Zope/OurLife$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/Zope(.*) /home/httpd/cgi-bin/Zope$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/(.*) /home/ourlife/$1 [l] If anything else is needed in the pursuit to fix this, just let me know, and any solution will be welcomed with open arms... Harry From zen@cs.rmit.edu.au Wed Nov 17 07:42:56 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Wed, 17 Nov 1999 18:42:56 +1100 (EST) Subject: [Zope-dev] GenericUserFolder available for beta Message-ID: I've uploaded GenericUserFolder for testing, feedback and general mirth. http://www.zope.org/Members/Zen/GenericUserFolder/ I won't be requesting it to be cataloged until I get some feedback from people playing with it - authentication is fairly complex task, and although I have done testing here, I'd rather get some external feedback before it ends up reducing production sites to smoking rubble. People may also be interested in ZRadius (which is cataloged). This product just handles bare-bones authentication at this stage - all that I need. I'll probably depricate it if any fuller Radius products become available. It has only been tested on my Merit radius servers. Brave souls should look at the source code, in particular the comments in validate() and _recurse_validate(). I'm unsure why the workaround in validate() is working, or even required, but I have a custom information system to have prototyped by Friday afternoon so I'm just happy I have an environment the little darlings will be able to login to :-) -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From mj@antraciet.nl Wed Nov 17 09:29:41 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Wed, 17 Nov 1999 10:29:41 +0100 Subject: [Zope-dev] Javascript wizards wanted for Zope project In-Reply-To: Message-ID: <4.2.0.58.19991117095230.046ec7a0@lisp.atmm.nl> I know you have been given many answers, but I'll bud in anyway. I've done way too much JavaScript, I like to think I know it's pitfalls. At 02:45 17/11/99 , Anthony Pfrunder wrote: >The problem is: how do I get a form to talk to an object in another frame? >ie: > >Also, how can I "call" a html page without causing a reload: > >function jsZDOMsetAttribute(name, value){ > call("getWidget/setAttribute?name=name&value=value") >} > >For further information on this problem please see >http://163.182.196.200/zwiki/VisualZope - jsZDOM reflecter part. For this one you'll need a hidden frame (width or height of 0), or you could use a hidden DynDuo Layer and use it's load method: http://www.dansteinman.com/dynduo/en/dynlayer-common.html You should be able to then also read attributes from the server with this. Just have the server return a page with javascript in it that does the trick. Just remember, that you cannot wait for the page to load and expect it to return a value, you'll have to write something asynchronous (and non-blocking, Navigator's Javascript implementation is single threaded, use setTimeout) to retrieve the value. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From mj@antraciet.nl Wed Nov 17 09:43:23 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Wed, 17 Nov 1999 10:43:23 +0100 Subject: [Zope-dev] Suggestions towards implementing an experimental protocol for cross-database persistent object references and multi-database Zopelications cross-database persistent object references and multi-database Zopelications In-Reply-To: <199911170459.UAA30730@zope.codeit.com> References: Message-ID: <4.2.0.58.19991117103656.04745760@lisp.atmm.nl> At 05:58 17/11/99 , Phillip J. Eby wrote: >After studying Jeffrey Shell's ZLDAP package, and the current ZODB system, >in the light of recent conversations with Jim Fulton, a few lightbulbs went >on with respect to the usefulness of multi-database Zopelications. For >example, wouldn't it be keen if regular Zope objects could 'store' object >attributes that were actually LDAP entries? Or SQL database records? That >would be pretty awesome. I believe that Jim Fulton has let his mind wander over this already. The general implementation wasn't hard, he said, the problems arise in the details. How, for example, do you remove unreferenced objects from any such database? How do you find out if an otherwise unreferenced object in one database, is not referenced by another one. Also, IIRC, there is an issue with caching and connections, and the question of when to close a connection to a referenced database. But as I was experiencing some jet-lag at the time, and didn't bring a memo recording when I spoke with Jim, I don't remember the full details. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From jhauser@ifm.uni-kiel.de Wed Nov 17 10:04:11 1999 From: jhauser@ifm.uni-kiel.de (Janko Hauser) Date: Wed, 17 Nov 1999 11:04:11 +0100 (CET) Subject: [Zope-dev] GenericUserFolder available for beta In-Reply-To: References: Message-ID: <14386.32155.245935.94573@ifm.uni-kiel.de> I'm trying to install this product. But right after adding a guf I get a login screen. I can look at the index_html but can not get to the acl_users Folder to add Users. Is it wrong to add a guf out of the box, or do I need to tweak some methods beforehand? TIA, __Janko From m.faassen@vet.uu.nl Wed Nov 17 10:11:07 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Wed, 17 Nov 1999 11:11:07 +0100 Subject: [Zope-dev] XMLDocument development References: Message-ID: <38327F3B.E70181E6@vet.uu.nl> Anthony Pfrunder wrote: > > On Tue, 16 Nov 1999, Melis Gábor wrote: > > > Hi > > > > Is there developement underway for XMLDocument? I looked at the cvs and > > couldn't find it there. Is 1.0a2 the latest version? If not, where > > can I find it? > > It is under development somewhere but am not sure where. The 1.0a2 > release is the latest but needs a patched Node.py to be applied. You can > get this file from either XML Widgets or VisualZope (development release) It's in CVS at..argh..the cvs-web interface is not working and I always checked it out through that..Handy interface. So I don't know where it is in CVS right now, but it's in there. I'll mail Digicool to ask about the cvs-web (I hadn't used it for a while but it's very useful). Regards, Martijn From mj@antraciet.nl Wed Nov 17 10:31:17 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Wed, 17 Nov 1999 11:31:17 +0100 Subject: [Zope-dev] XMLDocument development In-Reply-To: <38327F3B.E70181E6@vet.uu.nl> References: Message-ID: <4.2.0.58.19991117112835.00bfdbd0@lisp.atmm.nl> At 11:11 17/11/99 , Martijn Faassen wrote: >Anthony Pfrunder wrote: > > > > On Tue, 16 Nov 1999, Melis Gábor wrote: > > > > > Hi > > > > > > Is there developement underway for XMLDocument? I looked at the cvs and > > > couldn't find it there. Is 1.0a2 the latest version? If not, where > > > can I find it? > > > > It is under development somewhere but am not sure where. The 1.0a2 > > release is the latest but needs a patched Node.py to be applied. You can > > get this file from either XML Widgets or VisualZope (development release) > >It's in CVS at..argh..the cvs-web interface is not working and I always >checked it out through that..Handy interface. So I don't know where it >is in CVS right now, but it's in there. I'll mail Digicool to ask about >the cvs-web (I hadn't used it for a while but it's very useful). I pointed out it's usefulness to Ken Manheimer, he's promised to bring it back up when he has time (which is practically never right now..=)). XML Document can be checked out from Products/DC/XMLDocument. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From pje@telecommunity.com Wed Nov 17 16:09:09 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Wed, 17 Nov 1999 11:09:09 -0500 Subject: [Zope-dev] Suggestions towards implementing an experimental protocol for cross-database persistent object references and multi-database Zopelications In-Reply-To: <4.2.0.58.19991117103656.04745760@lisp.atmm.nl> References: <199911170459.UAA30730@zope.codeit.com> Message-ID: <3.0.5.32.19991117110909.01907250@telecommunity.com> At 10:43 AM 11/17/99 +0100, Martijn Pieters wrote: >At 05:58 17/11/99 , Phillip J. Eby wrote: > >Also, IIRC, there is an issue with caching and connections, and the >question of when to close a connection to a referenced database. But as I >was experiencing some jet-lag at the time, and didn't bring a memo >recording when I spoke with Jim, I don't remember the full details. Actually, this is (fairly) straightforward to handle since the connections themselves are Persistent and subject to caching. Implementing such a connection as a Persistent object can be anywhere from very easy to moderately complex, depending on the nature of the database backing it. Manipulation of _p_changed may be necessary. I point to ZLDAP as an example of one that works, although I don't think it will currently work correctly if the LDAPConnection is deactivated by the cache machinery during a transaction. >I believe that Jim Fulton has let his mind wander over this already. The >general implementation wasn't hard, he said, the problems arise in the >details. How, for example, do you remove unreferenced objects from any such >database? How do you find out if an otherwise unreferenced object in one >database, is not referenced by another one. Like cross-database undo, cross-database garbage collection also requires a global naming scheme. However, the point of my proposal wasn't to create a full multi-database Zope implementation, but rather, a tool for providing database-independent referencing, making it possible for an object's place in the Zope URL hierarchy to be independent of its physical database location - a mechanism roughly analagous to a hard-link, but still breakable like a symlink. This hard-link mechanism improves over symlinks by having a signifcantly lesser performance penalty for dereferencing, better transparency of usage, and by allowing a reference to be independent of the target object's acquisition hierarchy. (Since it will be treated as belonging to the hierarchy of the object that points to it, not the hierarchy it originally came from.) An example usage: suppose you create a UserFolder that lets you paste arbitrary objects into it as users, and it stores them using getReference(). You could, within the same folder, paste references to users stored in relational databases, LDAP databases, and perhaps "person" objects from some other part of the same ZODB. The UserFolder wouldn't care where they came from. This might seem a contrived example, but in dealing with some of the "legacy" environments I deal with, such a thing could be quite handy in allowing only hand-selected individuals access to a Zope installation, but without requiring password maintenance to be part of the Zope application itself. From robin@jessikat.demon.co.uk Wed Nov 17 17:36:08 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Wed, 17 Nov 1999 17:36:08 +0000 Subject: [Zope-dev] unhandled connect events Message-ID: I get unhandled connect events when changing directory in the zope ftp server. I also don't seem to get a decent termination of uploads; my client reports successful upload then hangs. Anyone else see these errors? I am using the latest CVS code. -- Robin Becker From RossBoylan@stanfordalumni.org Wed Nov 17 19:07:24 1999 From: RossBoylan@stanfordalumni.org (Ross Boylan) Date: Wed, 17 Nov 1999 11:07:24 -0800 Subject: [Zope-dev] Old traceback errors Message-ID: While working on a Zope product, I kept getting traceback errors referring to earlier versions of the code--that is, they gave an error for a line I had deleted. Specifically, my __init__.py had import OrgUser and OrgUser.py used to have the line import somethingItCouldNotFind I kept getting a broken product and a traceback indicating failure on the import somethingItCouldNotFind line. I know python will not import something if it already has it, so I took all the following steps * shutdown zope * verify python is not running * delete .pyc files for __init__ and OrgUser * logoff and login When I add a deliberately bogus line, I get a traceback for it, so it does seem the new file is getting read. My current theory is that the product definition was failing for some other reason, and the error message I am receiving is bogus. Perhaps no new error message is generated, so I get the most recent one? I'm running Zope 2.1.0b2, which I installed over a previous version. Windows NT 4, SP4. I had a separate installation of python 1.5.2 (and pythonwin) before I installed Zope. AMD K6-2 processor, 256Mg Ram. I ran zope as a service, and also shut it down and tried running it manually. From otto@ipass.net Wed Nov 17 19:39:39 1999 From: otto@ipass.net (Otto) Date: Wed, 17 Nov 1999 14:39:39 -0500 Subject: [Zope-dev] Re: [Zope] Pointer-to-Object Properties References: <38209B1B.5E59F11C@profitscape.net> <3820ABEB.4DCA74F9@ipass.net> <3821DD67.6DDF32E7@profitscape.net> Message-ID: <3833047B.8FB0E09D@ipass.net> Argh! Almost had this message entirely written and the power shuts off. *sigh* Here we go a second time... Moved to zope-dev for obvious reasons. Michael Bernstein wrote: > [snip] > > > > I think we're on the same track, see my XLink ramblings from yesterday: > > http://lists.zope.org/pipermail/zope/1999-November/013235.html > > Hmm. thanks for the pointer, I missed it first time 'round. The XLink > spec was VERY interesting reading. Mostly it seems as though it deals > with how to express (render) in XML the type of non-hierarchical > structures we're discussing, and provides a good source for use-case > scenarios. The question remains "How do we implement this data in the > ZODB and management interface?". You're welcome. And to answer your question: In the ZODB: a specialized form of XML Document that understands what an XLink is, when a such a document is created it catalogs it's X Links in "LinkCatalog" (rather than "Catalog"). According to one of the posts on cataloging XML Documents, this should be rather easy (see http://lists.zope.org/pipermail/zope/1999-November/013240.html). Management interface: a simple form interface that creates an XML Document and manipulates it via Zope's DOM. You could even add links inline to an existing XML Document doing this. The form interface can do whatever it needs to do to be pretty (see my ramblings below on RelationshipAware). [snip] > > Well, while exposing XLink-type information to the client as an > excellent goal, and should certainly be taken into (very serious) > consideration, I am more interested at the moment with making this type > of information available to server-side applications. Absolutely, server-side is the only practical application of XLink stuff right now. [snip] > > This was the most interesting part of the XLink spec for me, in that it > validated a notion percolating through my brain that objects do not > neccessarily have to be aware of their incoming links at all. > Implementation-wise, this means that only Classes and objects that > inherited from a 'relationship-aware' base class would display the > 'Relationships' tab in the management interface. All objects could have access to the "Relationships" tab. A RelationshipAware base class could be useful to make the interface a little more convenient... like providing a subset of possible links that make sense with this object. (Though, don't take away the ability to create any kind of link you want. (As a side note, if you find the out of line links interesting, check out Xanadu at http://www.udanax.com. It's a full blown hypertext system that provides unique (possibly out of line) links that don't break when you move documents around... even across servers. At least, that's what it's supposed to be, it's not entirely complete. :) They have a lot of good ideas, though.) [snip] > Well, you're correct that the client-side applications you're thinking > of do not require this sort of feature. However, for an web interface > that allows you establish these relationships (ie: create XLinks) > implementing an 'Object picker' that is constrained by the object's > meta-type is fairly important, and should not have to be re-implemented > from scratch for each application. Putting the constraints in the > Relationship Object instance seems like a convenient location. I agree that an 'object picker' is needed. I also agree that it would be convenient if the interface could give you a good set of defaults (this is where RelationshipAware comes in, as I said above). However, I can see no technical reason to restrict what kind of objects that Links can point to. [snip] > > I'm not sure I understand your third question. > > Let me give an example of what I mean: In the DTML of the default method > for a book object that has a defined relationship called 'Author' to a > 'Person' object (which has a 'FullName' string property), I would like > to place a DTML snippet that said and have > the final document render the pointed-to object's 'FullName' property, > even if the 'Book' object has one as well(unlikely) or could acquire one > from somewhere (possible). The chief advantage to containing 'pointers' > within the objects themselves is that it makes implementing this easier > (Re: http://lists.zope.org/pipermail/zope/1999-November/013215.html). I see, you basically want a few convenience methods to abstract away the Link Catalog (a good thing, too) in DTML. Again, it seems this would be a good place to RelationshipAware to take over functionality. The base class could provide a few methods that would return a list of links based on various constraints... i.e., who's being pointed to, or what role the link has. This should be relatively easy to provide and would make it easy to iterate over the list in DTML and provide a nifty interface to the incoming links. > > (BTW, please tell me if my ramblins make any sense or not, thanks. :) > > Yes, you make a lot of sense, and when more browsers are XML aware, the > XLink syntax will be very important for moving some of this stuff onto > the client, instead of leaving it all on the server. On the other hand, > this might be even more important in the interim when considered in > combination with XML-RPC for moving more complex data between servers. > (cue blue sky music). More blue sky... a standard interface between servers to notify of new links. I could use XML-RPC to tell your server that my server just created a link that points to you and you update your Link Catalog is updated appropriately. Make it a standard interface, and anyone who has a application server that understands XML, XLink and XML-RPC can participate. Perhaps it's even possible to provide Xanadu like, unique, unbreakable links across servers that can be moved about willy nilly. :) I think I covered everything I lost in the power outage. I hope. :) -Otto. Addendum: something new just came out called the Schematron, see http://www.xmlhack.com/read.php?item=121 and http://www.ascc.net/xml/resource/schematron/schematron.html. It's basically a new way of validating an XML document based on XSL. This sounds like precisely the kind of thing necessary to decide whether an XML Document in the ZODB has XLinks... and possibly could be used to figure out what kind of XLinks documents belong to. Rather than provide a specialize sub class for each XML Document you want to customize the Relationships panel for, you simply provide a schema for the kinds of documents that your links link to and Zope figures out whether XML Documents it knows about fit that profile and change the management interface accordingly. (I know that's not entirely coherent, but I wrote it quickly so I can get back to reading about the Schematron. :) From fohrman@mediaone.net Thu Nov 18 00:27:26 1999 From: fohrman@mediaone.net (John Fohrman) Date: Wed, 17 Nov 1999 19:27:26 -0500 Subject: [Zope-dev] Easy DTML question Message-ID: Hi All -- Could someone please tell me how to concatenate a string using DTML in the following example? I need to put "smtp:" in front of the email variable for sendmail to work. Thanks! From zen@cs.rmit.edu.au Thu Nov 18 04:06:49 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Thu, 18 Nov 1999 15:06:49 +1100 (EST) Subject: [Zope-dev] GenericUserFolder available for beta In-Reply-To: <14386.32155.245935.94573@ifm.uni-kiel.de> Message-ID: On Wed, 17 Nov 1999, Janko Hauser wrote: > I'm trying to install this product. But right after adding a guf I get > a login screen. I can look at the index_html but can not get to the > acl_users Folder to add Users. > > Is it wrong to add a guf out of the box, or do I need to tweak some > methods beforehand? No tweaking is required before hand - just create the GUF object in a subfolder. Tested with 2.1beta2 and 2.0.1 - I've sent a list of questions to Janko to learn more of his installation via private mail. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From djay@lucent.com Thu Nov 18 04:15:08 1999 From: djay@lucent.com (Jay, Dylan) Date: Thu, 18 Nov 1999 15:15:08 +1100 Subject: [Zope-dev] Object oriented schema evolution Message-ID: Just thought I'd throw a bit of research into the mix with regard to what I think is a very important issue with object persistant storage. Something that Zope still has yet to come to terms with. Object shema evolution looks at ways to minimise the problems associated with changing the sturcture/types/classes etc of persistant objects over time. This will become more of an issue when ZODB's become big and start aging. How do I switch to a better model while keeping my old data and keeping it running at the same time? http://davis.wpi.edu/dsrg/OOSE/oose-all-pubs.html From brad@bradm.ne.mediaone.net Thu Nov 18 05:17:55 1999 From: brad@bradm.ne.mediaone.net (Bradley McLean) Date: Thu, 18 Nov 1999 00:17:55 -0500 Subject: [Zope-dev] Replacing/Augmenting dtml-sqltest from a Product? Message-ID: <19991118001755.A15965@bradm.ne.mediaone.net> Please forgive the somewhat naive question. I'm a seasoned C/C++, Java, Perl programmer new to Python and Zope. Hopefully someone can save me a little time. I've modified Shared/DC/ZRDB/sqltest.py and sqlgroup.py to provide some additional semantics that I find very useful. Specifically, I've added range and keyword operations, and comparisons other than equality to sqltest, and I've made a parameterized version of sqlgroup that allows selection of 'and' or 'or' linkages from a variable, making it easier to provide sophisticated search options on a Zope page. I'd like to make these modifications available for public review and comment. The best way I can think of to do this is to make a new Product that provides the new versions and replaces them in DC/ZRDB/DA/SQL. Can anyone give me a brief shortcut on how to do that? I can figure out how to make a Product, but figuring out how to either replace these classes, or to create a duplicate of SQL Method which uses them is not entirely obvious. TIA, -Brad From bill.anderson@libc.org Thu Nov 18 05:37:18 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Wed, 17 Nov 1999 22:37:18 -0700 Subject: [Zope-dev] Replacing/Augmenting dtml-sqltest from a Product? References: <19991118001755.A15965@bradm.ne.mediaone.net> Message-ID: <3833908E.B3DE4EB0@libc.org> Bradley McLean wrote: > > Please forgive the somewhat naive question. I'm a > seasoned C/C++, Java, Perl programmer new to Python > and Zope. GLad to hear it, Perl programmers go much better with seasoning ;^) > Hopefully someone can save me a little > time. I'll try ... > I've modified Shared/DC/ZRDB/sqltest.py and > sqlgroup.py to provide some additional semantics > that I find very useful. Specifically, I've > added range and keyword operations, and comparisons > other than equality to sqltest, and I've made > a parameterized version of sqlgroup that allows > selection of 'and' or 'or' linkages from a variable, > making it easier to provide sophisticated search > options on a Zope page. > > I'd like to make these modifications available > for public review and comment. > > The best way I can think of to do this is to make > a new Product that provides the new versions and > replaces them in DC/ZRDB/DA/SQL. > > Can anyone give me a brief shortcut on how to do > that? I can figure out how to make a Product, > but figuring out how to either replace these > classes, or to create a duplicate of SQL Method > which uses them is not entirely obvious. > > TIA, Personally, I would post a patch to the collector, and to this list (or if patch == large_file: procide URL for download), that way you get DC looking over it, as well as anyone of the rest of us that might like to try it out. Bill Anderson -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From technews@egsx.com Thu Nov 18 06:17:46 1999 From: technews@egsx.com (technews@egsx.com) Date: Thu, 18 Nov 1999 01:17:46 -0500 (EST) Subject: [Zope-dev] How to define selection list elements In-Reply-To: <3833908E.B3DE4EB0@libc.org> Message-ID: Hi, I am creating an object in Zope. I have defined various different values for the object such as url (string) title (string) description (text) But now I want to create a drop down object that has predefined values so the users can select one of the options. There is a property called selection list, and I was unable to find any documentation in how to use it. I tried adding a space seperated values, but it did not work. In the Zope content manager guide on page 42 (pdf version) figure 40 it does not talk about the selection lists. Any help will be appretitated.. Adonis From Anthony Baxter Thu Nov 18 08:06:57 1999 From: Anthony Baxter (Anthony Baxter) Date: Thu, 18 Nov 1999 19:06:57 +1100 Subject: [Zope-dev] How to define selection list elements In-Reply-To: Message from technews@egsx.com of "Thu, 18 Nov 1999 01:17:46 CDT." Message-ID: <199911180806.TAA11942@mbuna.arbhome.com.au> >>> technews@egsx.com wrote > There is a property called selection list, and I was unable to find any > documentation in how to use it. I tried adding a space seperated values, > but it did not work. In the Zope content manager guide on page 42 (pdf > version) figure 40 it does not talk about the selection lists. easy way: create a property of type 'tokens', specify a bunch of strings, seperated by spaces (e.g. "abc def ghi jkl"). Say you call this token property 'option_choices'. Now define a property, type selection, with a value of 'option_choices'. Voila. the slightly trickier way: make an object that returns a list of strings. Set the value of the new selection property to the name of this object. Done. Anthony From anthony@interlink.com.au Thu Nov 18 08:18:03 1999 From: anthony@interlink.com.au (Anthony Baxter) Date: Thu, 18 Nov 1999 19:18:03 +1100 Subject: [Zope-dev] A few modifications to the tree tag Message-ID: <199911180818.TAA11990@mbuna.arbhome.com.au> A few modifications, or proposed modifications, to the tree tag: I wanted to make the tree tag support my SQLSession product, so that it could store the tree state in the session, rather than in a cookie. I've created a patch against the current CVS that adds this - there's a new tree tag option, 'store_session', which when set will use the session to store the tree state. Yay. no more annoying cookie warning dialog boxes. Patch is at http://www.zope.org/Members/anthony/patches/ The second point, would a patch to allow a 'prefix' for the tree-[ecs] options be a useful thing? That way you can have multiple trees on the same page. So if prefix=foobar, the cookies/form values would be of the type 'foobartree-e' &c. Third point: is it worth allowing the tree icons +/- to be overridden? I thought I remembered someone had done this, but I can't remember it for sure, and I can't find it in my zope archives... ta, Anthony From fohrman@mediaone.net Thu Nov 18 08:39:32 1999 From: fohrman@mediaone.net (John Fohrman) Date: Thu, 18 Nov 1999 03:39:32 -0500 Subject: [Zope-dev] Easy DTML question In-Reply-To: <19991117194444.F12275@universal-fasteners.com> Message-ID: I appreciate this response, but it unfortunately it didn't work. Anyone have any other ideas? Thanks, John > -----Original Message----- > From: Jim Penny [mailto:jpenny@universal-fasteners.com] > Sent: Wednesday, November 17, 1999 7:45 PM > To: John Fohrman > Subject: Re: [Zope-dev] Easy DTML question > > > On Wed, Nov 17, 1999 at 07:27:26PM -0500, John Fohrman wrote: > > Hi All -- > > > > Could someone please tell me how to concatenate a string using > DTML in the > > following example? I need to put "smtp:" in front of the email > variable for > > sendmail to work. > > > > > > try > > > When to use a double quote and when not always gives me a headache, > I usually try the " version first. > > > > > Thanks! > > > > From hannu@tm.ee Thu Nov 18 08:41:44 1999 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 18 Nov 1999 10:41:44 +0200 Subject: [Zope-dev] A few modifications to the tree tag References: <199911180818.TAA11990@mbuna.arbhome.com.au> Message-ID: <3833BBC8.2D10B76E@tm.ee> Anthony Baxter wrote: > > A few modifications, or proposed modifications, to the tree tag: > > I wanted to make the tree tag support my SQLSession product, so > that it could store the tree state in the session, rather than in > a cookie. I've created a patch against the current CVS that adds > this - there's a new tree tag option, 'store_session', which when > set will use the session to store the tree state. Yay. no more > annoying cookie warning dialog boxes. > > Patch is at http://www.zope.org/Members/anthony/patches/ Great. BTW, Is SQLSession usable on Gadfly (and is gadfly thread-safe) ? Is gadfly a good place for storing sessions ? > The second point, would a patch to allow a 'prefix' for the tree-[ecs] > options be a useful thing? That way you can have multiple trees on the > same page. So if prefix=foobar, the cookies/form values would be of the > type 'foobartree-e' &c. Thats exactly what I have been thinking. > > Third point: is it worth allowing the tree icons +/- to be overridden? > I thought I remembered someone had done this, but I can't remember it > for sure, and I can't find it in my zope archives... I remember it has been discussed on the list, but I don't remember anyone actually doing it. OTOH the existance of the following in TreeTag.py: # opened_decoration=None, # closed_decoration=None, # childless_decoration=None, suggests that it has been that way once ? --------------------- Hannu From hannu@tm.ee Thu Nov 18 08:55:32 1999 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 18 Nov 1999 10:55:32 +0200 Subject: [Zope-dev] Easy DTML question References: Message-ID: <3833BF04.AE426A07@tm.ee> John Fohrman wrote: > > I appreciate this response, but it unfortunately it didn't work. Anyone have > any other ideas? > In what way did it not work ? Maybe it is _not_ an "Easy DTML question" but instead a "Tricky Sendmail Issue" ? > > > > try > > does it work when you use a fixed string, like ----------------- Hannu From hannu@tm.ee Thu Nov 18 09:16:58 1999 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 18 Nov 1999 11:16:58 +0200 Subject: [Zope-dev] Easy DTML question References: Message-ID: <3833C40A.759E1E89@tm.ee> John Fohrman wrote: > > Thanks for your response. Yes, it works with a fixed string, that is why I'm > trying to do that. try something like It _may_ be the same thing I encountered when setting cookies (in ver 1.0.3, not sure it is still in 2.x), namely that in some places variables are not evaluated In my case I had a rcursive loop that constructed a path from SQL database, and when setting a cookie with RESPONSE.setCookie('path',make_path) the source code of the method was set in the cookie resulting in broken page ;( using the trick with REQUEST.set solved the problem --------- Hannu From jim@digicool.com Thu Nov 18 10:55:44 1999 From: jim@digicool.com (Jim Fulton) Date: Thu, 18 Nov 1999 10:55:44 +0000 Subject: [Zope-dev] A few modifications to the tree tag References: <199911180818.TAA11990@mbuna.arbhome.com.au> <3833BBC8.2D10B76E@tm.ee> Message-ID: <3833DB30.29097F1@digicool.com> Hannu Krosing wrote: > > Anthony Baxter wrote: > > (snip) > > > > Third point: is it worth allowing the tree icons +/- to be overridden? > > I thought I remembered someone had done this, but I can't remember it > > for sure, and I can't find it in my zope archives... > > I remember it has been discussed on the list, but I don't remember anyone > actually doing it. > > OTOH the existance of the following in TreeTag.py: > > # opened_decoration=None, > # closed_decoration=None, > # childless_decoration=None, > > suggests that it has been that way once ? Actually, it wasn't done, but I wanted to do it. It would certainly be a good idea and not very hard. Patches would be greatfully accepted. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. From sekter@mail.matav.hu Thu Nov 18 11:44:05 1999 From: sekter@mail.matav.hu (Arpad Kiss) Date: Thu, 18 Nov 1999 12:44:05 +0100 Subject: [Zope-dev] Easy DTML question References: <3833C40A.759E1E89@tm.ee> Message-ID: <006101bf31ba$380fc960$029f38c3@geometria.hu> Hi, dtml-let may be another solution in this case(not tested, but it should work): ... Arpad Kiss ----- Original Message ----- From: Hannu Krosing To: John Fohrman ; Sent: Thursday, November 18, 1999 10:16 AM Subject: Re: [Zope-dev] Easy DTML question > John Fohrman wrote: > > > > Thanks for your response. Yes, it works with a fixed string, that is why I'm > > trying to do that. > > try something like > > > > > > It _may_ be the same thing I encountered when setting cookies (in ver 1.0.3, > not sure it is still in 2.x), namely that in some places variables are not > evaluated > > In my case I had a rcursive loop that constructed a path from SQL database, > and > when setting a cookie with > > RESPONSE.setCookie('path',make_path) the source code of the method was set in > the > cookie resulting in broken page ;( > > using the trick with REQUEST.set solved the problem > > --------- > Hannu > > _______________________________________________ > 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 ) > > From mj@antraciet.nl Thu Nov 18 12:03:00 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Thu, 18 Nov 1999 13:03:00 +0100 Subject: [Zope-dev] A few modifications to the tree tag In-Reply-To: <3833BBC8.2D10B76E@tm.ee> References: <199911180818.TAA11990@mbuna.arbhome.com.au> Message-ID: <4.2.0.58.19991118105611.038a4d80@lisp.atmm.nl> At 09:41 18/11/99 , Hannu Krosing wrote: >Anthony Baxter wrote: > > > > A few modifications, or proposed modifications, to the tree tag: > > > > I wanted to make the tree tag support my SQLSession product, so > > that it could store the tree state in the session, rather than in > > a cookie. I've created a patch against the current CVS that adds > > this - there's a new tree tag option, 'store_session', which when > > set will use the session to store the tree state. Yay. no more > > annoying cookie warning dialog boxes. > > > > Patch is at http://www.zope.org/Members/anthony/patches/ > >Great. > >BTW, Is SQLSession usable on Gadfly (and is gadfly thread-safe) ? > >Is gadfly a good place for storing sessions ? > > > The second point, would a patch to allow a 'prefix' for the tree-[ecs] > > options be a useful thing? That way you can have multiple trees on the > > same page. So if prefix=foobar, the cookies/form values would be of the > > type 'foobartree-e' &c. > >Thats exactly what I have been thinking. > > > > > Third point: is it worth allowing the tree icons +/- to be overridden? > > I thought I remembered someone had done this, but I can't remember it > > for sure, and I can't find it in my zope archives... > >I remember it has been discussed on the list, but I don't remember anyone >actually doing it. > >OTOH the existance of the following in TreeTag.py: > > # opened_decoration=None, > # closed_decoration=None, > # childless_decoration=None, > >suggests that it has been that way once ? It suggests that it was once planned. I implemented these attributes, the patch can be found in the archives somewhere, I cannot even find it myself anymore =). Sorry, I have no time right now to make a new one for you.. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From mindlace@majordomo.net Thu Nov 18 12:33:08 1999 From: mindlace@majordomo.net (Ethan Fremen) Date: Thu, 18 Nov 1999 12:33:08 +0000 Subject: [Zope-dev] A few modifications to the tree tag References: <199911180818.TAA11990@mbuna.arbhome.com.au> <4.2.0.58.19991118105611.038a4d80@lisp.atmm.nl> Message-ID: <3833F204.6C374856@majordomo.net> This is a multi-part message in MIME format. --------------B642BE3848537D60439C3958 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Martijn Pieters wrote: > At 09:41 18/11/99 , Hannu Krosing wrote: > >OTOH the existance of the following in TreeTag.py: > > > > # opened_decoration=None, > > # closed_decoration=None, > > # childless_decoration=None, > > > >suggests that it has been that way once ? > > It suggests that it was once planned. I implemented these attributes, the > patch can be found in the archives somewhere, I cannot even find it myself > anymore =). Sorry, I have no time right now to make a new one for you.. here ya go. Jamie Becker said: >Martijn Pieters said: >>"Just replace TreeTag.py and restart. Then you can use opened_decoration, closed_decoration and childless_decoration as attributes to the treetag, each being the URL within your Zope installation of the images you want to use." >It works great, too. I added the + and - alt tags ... -- anyway. i think this should go somewhere other than the swampy collective memory of the mailinglist archives... -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology. --------------B642BE3848537D60439C3958 Content-Type: text/plain; charset=us-ascii; name="TreeTag.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="TreeTag.py" ############################################################################## # # Zope Public License (ZPL) Version 1.0 # ------------------------------------- # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright # notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions, and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # 3. Digital Creations requests that attribution be given to Zope # in any manner possible. Zope includes a "Powered by Zope" # button that is installed by default. While it is not a license # violation to remove this button, it is requested that the # attribution remain. A significant investment has been put # into Zope, and this effort will continue if the Zope community # continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning # features derived from or use of this software must display # the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # In the event that the product being advertised includes an # intact Zope distribution (with copyright and license included) # then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to # endorse or promote products derived from this software without # prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain # the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # # Intact (re-)distributions of any official Zope release do not # require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as # patches to official Zope releases. Distributions that do not # clearly separate the patches from the original work must be clearly # labeled as unofficial distributions. Modifications which do not # carry the name Zope may be packaged in any form, as long as they # conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ############################################################################## """Rendering object hierarchies as Trees """ __rcs_id__='$Id: TreeTag.py,v 1.33 1999/07/13 14:21:57 jim Exp $' __version__='$Revision: 1.33 $'[11:-2] from DocumentTemplate.DT_Util import * from DocumentTemplate.DT_String import String from string import join, split, rfind, find, translate from urllib import quote, unquote from zlib import compress, decompress from binascii import b2a_base64, a2b_base64 tbl=join(map(chr, range(256)),'') tplus=tbl[:ord('+')]+'-'+tbl[ord('+')+1:] tminus=tbl[:ord('-')]+'+'+tbl[ord('-')+1:] plus_icon = '/p_/pl' minus_icon = '/p_/mi' class Tree: name='tree' blockContinuations=() expand=None def __init__(self, blocks): tname, args, section = blocks[0] args=parse_params(args, name=None, expr=None, nowrap=1, expand=None, leaves=None, header=None, footer=None, branches=None, branches_expr=None, sort=None, reverse=1, skip_unauthorized=1, id=None, single=1, url=None, opened_decoration=None, closed_decoration=None, childless_decoration=None, assume_children=1) has_key=args.has_key if has_key('name'): name=args['name'] elif has_key(''): name=args['name']=args[''] else: name='a tree tag' if has_key('branches_expr'): if has_key('branches'): raise ParseError, _tm( 'branches and and branches_expr given', 'tree') args['branches_expr']=VSEval.Eval( args['branches_expr'], expr_globals).eval elif not has_key('branches'): args['branches']='tpValues' if not has_key('id'): args['id']='tpId' if not has_key('url'): args['url']='tpURL' if not has_key('opened_decoration'): args['opened_decoration']=minus_icon if not has_key('closed_decoration'): args['closed_decoration']=plus_icon if not has_key('childless_decoration'): args['childless_decoration']='' self.__name__ = name self.section=section.blocks self.args=args if args.has_key('expr'): if args.has_key('name'): raise ParseError, _tm('name and expr given', 'tree') args['expr']=VSEval.Eval(args['expr'], expr_globals) def render(self,md): args=self.args have=args.has_key if have('name'): v=md[args['name']] elif have('expr'): v=args['expr'].eval(md) else: v=md.this return tpRender(v,md,self.section, self.args) __call__=render String.commands['tree']=Tree pyid=id # Copy builtin def tpRender(self, md, section, args, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key): """Render data organized as a tree. We keep track of open nodes using a cookie. The cookie stored the tree state. State should be a tree represented like: [] # all closed ['eagle'], # eagle is open ['eagle'], ['jeep', [1983, 1985]] # eagle, jeep, 1983 jeep and 1985 jeep where the items are object ids. The state will be converted to a compressed and base64ed string that gets unencoded, uncompressed, and evaluated on the other side. Note that ids used in state need not be connected to urls, since state manipulation is internal to rendering logic. Note that to make eval safe, we do not allow the character '*' in the state. """ data=[] idattr=args['id'] if hasattr(self, idattr): id=getattr(self, idattr) if not simple_type(type(id)): id=id() elif hasattr(self, '_p_oid'): id=oid(self) else: id=pyid(self) try: # see if we are being run as a sub-document root=md['tree-root-url'] url=md['tree-item-url'] state=md['tree-state'] diff=md['tree-diff'] substate=md['-tree-substate-'] colspan=md['tree-colspan'] level=md['tree-level'] except KeyError: # OK, we are a top-level invocation level=-1 if md.has_key('collapse_all'): state=[id,[]], elif md.has_key('expand_all'): state=[id, tpValuesIds(self, args['branches'], args)], else: if md.has_key('tree-s'): state=md['tree-s'] state=decode_seq(state) try: if state[0][0] != id: state=[id,[]], except IndexError: state=[id,[]], else: state=[id,[]], if md.has_key('tree-e'): diff=decode_seq(md['tree-e']) apply_diff(state, diff, 1) if md.has_key('tree-c'): diff=decode_seq(md['tree-c']) apply_diff(state, diff, 0) colspan=tpStateLevel(state) substate=state diff=[] url='' root=md['URL'] l=rfind(root,'/') if l >= 0: root=root[l+1:] treeData={'tree-root-url': root, 'tree-colspan': colspan, 'tree-state': state } md._push(InstanceDict(self, md)) md._push(treeData) try: tpRenderTABLE(self,id,root,url,state,substate,diff,data,colspan, section,md,treeData, level, args) finally: md._pop(2) if state is substate and not (args.has_key('single') and args['single']): state=state or ([id],) state=encode_seq(state) md['RESPONSE'].setCookie('tree-s',state) return join(data,'') def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUrl=getattr(self, urlattr) if not simple_type(type(tpUrl)): tpUrl=tpUrl() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 idattr=args['id'] output=data.append items=None if (have_arg('assume_children') and args['assume_children'] and substate is not state): # We should not compute children unless we have to. # See if we've been asked to expand our children. for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if not exp: items=1 if items is None: validate=md.validate if have_arg('branches') and hasattr(self, args['branches']): if validate is None or not hasattr(self, 'aq_acquire'): items=getattr(self, args['branches']) else: items=self.aq_acquire(args['branches'],validate,md) items=items() elif have_arg('branches_expr'): items=args['branches_expr'](md) if not items and have_arg('leaves'): items=1 if items and items != 1: if validate is not None: unauth=[] index=0 for i in items: try: v=validate(items,items,index,i,md) except: v=0 if not v: unauth.append(index) index=index+1 if unauth: if have_arg('skip_unauthorized') and args['skip_unauthorized']: items=list(items) unauth.reverse() for i in unauth: del items[i] else: raise ValidationError, unauth if have_arg('sort'): # Faster/less mem in-place sort if type(items)==type(()): items=list(items) sort=args['sort'] size=range(len(items)) for i in size: v=items[i] k=getattr(v,sort) try: k=k() except: pass items[i]=(k,v) items.sort() for i in size: items[i]=items[i][1] if have_arg('reverse'): items.reverse() diff.append(id) sub=None if substate is state: output('\n') sub=substate[0] exp=items else: # Add prefix output('\n') # Add +/- icon if items: if level: if level > 3: output( '' % (level-1)) elif level > 1: output('' * (level-1)) output('\n') output('\n') else: if level > 2: output('' % level) elif level > 0: output('' * level) if have_arg('childless_decoration') and args['childless_decoration']: output('\n' % (md['SCRIPT_NAME'], args['childless_decoration'])) else: output('\n') # add item text dataspan=colspan-level output('' % ((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), (have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) ) output(render_blocks(section, md)) output('\n\n') if exp: level=level+1 dataspan=colspan-level if level > 3: h='' % (level-1) elif level > 1: h='' * (level-1) else: h='' if have_arg('header'): doc=args['header'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '%s' '' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='', )) if items==1: # leaves if have_arg('leaves'): doc=args['leaves'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '%s' '' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='', )) finally: md._pop(1) elif have_arg('expand'): doc=args['expand'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '%s' '' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='', )) finally: md._pop(1) else: __traceback_info__=sub, args, state, substate ids={} for item in items: if hasattr(item, idattr): id=getattr(item, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=oid(item) else: id=pyid(item) if len(sub)==1: sub.append([]) substate=sub[1] ids[id]=1 md._push(InstanceDict(item,md)) try: data=tpRenderTABLE( item,id,root_url,url,state,substate,diff,data, colspan, section, md, treeData, level, args) finally: md._pop() if not sub[1]: del sub[1] ids=ids.has_key for i in range(len(substate)-1,-1): if not ids(substate[i][0]): del substate[i] if have_arg('footer'): doc=args['footer'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '%s' '' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='', )) del diff[-1] if not diff: output('
    ') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break #################################### # Mostly inline encode_seq for speed s=compress(str(diff)) if len(s) > 57: s=encode_str(s) else: s=b2a_base64(s)[:-1] l=find(s,'=') if l >= 0: s=s[:l] s=translate(s, tplus) #################################### script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 if have_arg('opened_decoration'): icon=args['opened_decoration'] else: icon=minus_icon output('' '' '-' % (id, root_url, s, id, script, icon)) else: if have_arg('closed_decoration'): icon=args['closed_decoration'] else: icon=plus_icon output('' '' '+' % (id, root_url, s, id, script, icon)) output('.
    \n') return data def apply_diff(state, diff, expand): if not diff: return s=[None, state] diff.reverse() __traceback_info__=s, diff while diff: id=diff[-1] del diff[-1] if len(s)==1: s.append([]) s=s[1] loc=-1 for i in range(len(s)): if s[i][0]==id: loc=i break if loc >= 0: if not diff and not expand: del s[loc] else: s=s[loc] elif diff or expand: s.append([id,[]]) s=s[-1][1] while diff: id=diff[-1] del diff[-1] if diff or expand: s.append([id,[]]) s=s[-1][1] def encode_seq(state): "Convert a sequence to an encoded string" state=compress(str(state)) l=len(state) if l > 57: states=[] for i in range(0,l,57): states.append(b2a_base64(state[i:i+57])[:-1]) state=join(states,'') else: state=b2a_base64(state)[:-1] l=find(state,'=') if l >= 0: state=state[:l] state=translate(state, tplus) return state def encode_str(state): "Convert a sequence to an encoded string" l=len(state) if l > 57: states=[] for i in range(0,l,57): states.append(b2a_base64(state[i:i+57])[:-1]) state=join(states,'') else: state=b2a_base64(state)[:-1] l=find(state,'=') if l >= 0: state=state[:l] state=translate(state, tplus) return state def decode_seq(state): "Convert an encoded string to a sequence" state=translate(state, tminus) l=len(state) if l > 76: states=[] j=0 for i in range(l/76): k=j+76 states.append(a2b_base64(state[j:k])) j=k if j < l: state=state[j:] l=len(state) k=l%4 if k: state=state+'='*(4-k) states.append(a2b_base64(state)) state=join(states,'') else: l=len(state) k=l%4 if k: state=state+'='*(4-k) state=a2b_base64(state) state=decompress(state) if find(state,'*') >= 0: raise 'Illegal State', state try: return list(eval(state,{'__builtins__':{}})) except: return [] def tpStateLevel(state, level=0): for sub in state: if len(sub)==2: level = max(level, 1+tpStateLevel(sub[1])) else: level=max(level,1) return level def tpValuesIds(self, branches, args, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): # This should build the ids of subitems which are # expandable (non-empty). Leaves should never be # in the state - it will screw the colspan counting. r=[] idattr=args['id'] try: try: items=getattr(self, branches)() except AttributeError: items=() for item in items: try: if getattr(item, branches)(): if hasattr(self, idattr): id=getattr(self, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=oid(item) else: id=pyid(item) e=tpValuesIds(item, branches, args) if e: id=[id,e] else: id=[id] r.append(id) except: pass except: pass return r def oid(self): return b2a_base64(str(self._p_oid))[:-1] --------------B642BE3848537D60439C3958-- From Anthony Baxter Thu Nov 18 12:40:48 1999 From: Anthony Baxter (Anthony Baxter) Date: Thu, 18 Nov 1999 23:40:48 +1100 Subject: [Zope-dev] A few modifications to the tree tag In-Reply-To: Message from Hannu Krosing of "Thu, 18 Nov 1999 10:41:44 +0200." <3833BBC8.2D10B76E@tm.ee> Message-ID: <199911181240.XAA12474@mbuna.arbhome.com.au> >>> Hannu Krosing wrote > BTW, Is SQLSession usable on Gadfly (and is gadfly thread-safe) ? > Is gadfly a good place for storing sessions ? In _theory_, yes. In practice, gadfly's parser barfs on strings with embedded newlines. Since by default Sessions store the data as base64, this breaks if the objects encode to more than a line. I plan to allow a choice of encoding as base64 or using zopes var:type format - I'd hoped to get this into 0.2, but it's not working yet, so it will be in 0.3. > > The second point, would a patch to allow a 'prefix' for the tree-[ecs] > > options be a useful thing? That way you can have multiple trees on the > > same page. So if prefix=foobar, the cookies/form values would be of the > > type 'foobartree-e' &c. > Thats exactly what I have been thinking. cool - I'll send a patch tomorrow. > > Third point: is it worth allowing the tree icons +/- to be overridden? > > I thought I remembered someone had done this, but I can't remember it > > for sure, and I can't find it in my zope archives... MartijnP's response (he did it, but can't find it now) suggests that I need to implement it myself. Since I need it for a system that's going live in the next week or so, expect a patch in the not too distant future. :) -- Anthony Baxter It's never too late to have a happy childhood. From mj@antraciet.nl Thu Nov 18 12:40:47 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Thu, 18 Nov 1999 13:40:47 +0100 Subject: [Zope-dev] A few modifications to the tree tag In-Reply-To: <3833DB30.29097F1@digicool.com> References: <199911180818.TAA11990@mbuna.arbhome.com.au> <3833BBC8.2D10B76E@tm.ee> Message-ID: <4.2.0.58.19991118133722.00a363e0@lisp.atmm.nl> At 11:55 18/11/99 , Jim Fulton wrote: >Actually, it wasn't done, but I wanted to do it. >It would certainly be a good idea and not very hard. >Patches would be greatfully accepted. They are in the Collector...: http://classic.zope.org:8080/Collector/374/view and http://classic.zope.org:8080/Collector/375/view Can't remember why it is in there twice =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From anthony@interlink.com.au Thu Nov 18 12:43:10 1999 From: anthony@interlink.com.au (Anthony Baxter) Date: Thu, 18 Nov 1999 23:43:10 +1100 Subject: [Zope-dev] more on sessions in general. Message-ID: <199911181243.XAA12486@mbuna.arbhome.com.au> It seems to me that the Session type object as used in SQLSession is a useful general class of object (regardless of the backend storage). Is it worth making this a more general piece of Zope? Right now, you have to do a at the start of the transaction to get the REQUEST.SESSION object created - it would be nice if this was done automagically (and done in a way that allowed you to slot in a different Session object if you wanted it...) Any thoughts? Anthony From fohrman@mediaone.net Thu Nov 18 12:47:07 1999 From: fohrman@mediaone.net (John Fohrman) Date: Thu, 18 Nov 1999 07:47:07 -0500 Subject: [Zope-dev] Easy DTML question -- ha, ha!!!!! In-Reply-To: <006101bf31ba$380fc960$029f38c3@geometria.hu> Message-ID: > Hi, > dtml-let may be another solution in this case(not tested, but it should > work): > > > ... > > > Arpad Kiss > Thanks for the suggestions. Apparently, none of these work however. The sendmail command apparently doesn't accept any variables inside the tag. Unfortunatley, this messes us up here, because the mail server won't send without the address specified within the tag. Not too useful! > ----- Original Message ----- > From: Hannu Krosing > To: John Fohrman ; > Sent: Thursday, November 18, 1999 10:16 AM > Subject: Re: [Zope-dev] Easy DTML question > > > > John Fohrman wrote: > > > > > > Thanks for your response. Yes, it works with a fixed string, > that is why > I'm > > > trying to do that. > > > > try something like > > > > > > > > > > > > It _may_ be the same thing I encountered when setting cookies (in ver > 1.0.3, > > not sure it is still in 2.x), namely that in some places > variables are not > > evaluated > > > > In my case I had a rcursive loop that constructed a path from SQL > database, > > and > > when setting a cookie with > > > > RESPONSE.setCookie('path',make_path) the source code of the > method was set > in > > the > > cookie resulting in broken page ;( > > > > using the trick with REQUEST.set solved the problem > > > > --------- > > Hannu > > > > _______________________________________________ > > 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 ) > > > > > > > _______________________________________________ > 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 ) > From jsanford@atinucleus.com Thu Nov 18 14:58:04 1999 From: jsanford@atinucleus.com (Jim Sanford) Date: Thu, 18 Nov 1999 08:58:04 -0600 Subject: [Zope-dev] Easy DTML question -- ha, ha!!!!! References: Message-ID: <004801bf31d5$5a1b5900$04fea8c0@sanwinmain> This works. It is in use now where I work to automatically notify users when there are orders that need their attention. _______dtml method: AutoMail_________________ To: From: Subject: _______________________________ ___test dtml document that calls the AutoMail method_________

    This is the Document.

    __________________________________________________ ----- Original Message ----- From: John Fohrman To: Arpad Kiss ; Sent: Thursday, November 18, 1999 6:47 AM Subject: RE: [Zope-dev] Easy DTML question -- ha, ha!!!!! > > Hi, > > dtml-let may be another solution in this case(not tested, but it should > > work): > > > > > > ... > > > > > > Arpad Kiss > > > > > Thanks for the suggestions. Apparently, none of these work however. The > sendmail command apparently doesn't accept any variables inside the tag. > > Unfortunatley, this messes us up here, because the mail server won't send > without the address specified within the tag. Not too useful! > > > > > > > > > ----- Original Message ----- > > From: Hannu Krosing > > To: John Fohrman ; > > Sent: Thursday, November 18, 1999 10:16 AM > > Subject: Re: [Zope-dev] Easy DTML question > > > > > > > John Fohrman wrote: > > > > > > > > Thanks for your response. Yes, it works with a fixed string, > > that is why > > I'm > > > > trying to do that. > > > > > > try something like > > > > > > > > > > > > > > > > > > It _may_ be the same thing I encountered when setting cookies (in ver > > 1.0.3, > > > not sure it is still in 2.x), namely that in some places > > variables are not > > > evaluated > > > > > > In my case I had a rcursive loop that constructed a path from SQL > > database, > > > and > > > when setting a cookie with > > > > > > RESPONSE.setCookie('path',make_path) the source code of the > > method was set > > in > > > the > > > cookie resulting in broken page ;( > > > > > > using the trick with REQUEST.set solved the problem > > > > > > --------- > > > Hannu > > > > > > _______________________________________________ > > > 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 ) > > > > > > > > > > > > _______________________________________________ > > 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 ) > > > > > _______________________________________________ > 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 ) > > From pavlos@gaaros.msrc.sunysb.edu Thu Nov 18 15:19:48 1999 From: pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) Date: Thu, 18 Nov 1999 10:19:48 -0500 (EST) Subject: [Zope-dev] more on sessions in general. In-Reply-To: <199911181243.XAA12486@mbuna.arbhome.com.au> Message-ID: On Thu, 18 Nov 1999, Anthony Baxter wrote: > > Is it worth making this a more general piece of Zope? Right now, you I think yes. > have to do a at the start of the transaction to > get the REQUEST.SESSION object created - it would be nice if this was > done automagically (and done in a way that allowed you to slot in a > different Session object if you wanted it...) > A few thoughts ... The session should not be created in every transation. You could achieve some automation by replacing REQUEST.SESSION with a function. Whenever you want to save or retrieve something you could do: . Your method would then query the db (or whatever backend you use). Retrieval of data should also inlude caching so that session data are cached across transactions, if not modified. Also the default backend should be one that does not require additional components not shipped with standard Zope. SQL,bsddb etc should be optional backends. Just my morning thoughts ... Pavlos From sekter@mail.matav.hu Thu Nov 18 15:30:32 1999 From: sekter@mail.matav.hu (Arpad Kiss) Date: Thu, 18 Nov 1999 16:30:32 +0100 Subject: [Zope-dev] Easy DTML question -- ha, ha!!!!! References: Message-ID: <009201bf31d9$da897910$029f38c3@geometria.hu> Yes, you are correct. I have tested it and doesn't work. But the next way it works for me: to: from: subject: subj It works! The header and the body must be separated at least one blank line! Arpad ----- Original Message ----- From: John Fohrman To: Arpad Kiss ; Sent: Thursday, November 18, 1999 1:47 PM Subject: RE: [Zope-dev] Easy DTML question -- ha, ha!!!!! > > Hi, > > dtml-let may be another solution in this case(not tested, but it should > > work): > > > > > > ... > > > > > > Arpad Kiss > > > > > Thanks for the suggestions. Apparently, none of these work however. The > sendmail command apparently doesn't accept any variables inside the tag. > > Unfortunatley, this messes us up here, because the mail server won't send > without the address specified within the tag. Not too useful! > > > > > > > > > ----- Original Message ----- > > From: Hannu Krosing > > To: John Fohrman ; > > Sent: Thursday, November 18, 1999 10:16 AM > > Subject: Re: [Zope-dev] Easy DTML question > > > > > > > John Fohrman wrote: > > > > > > > > Thanks for your response. Yes, it works with a fixed string, > > that is why > > I'm > > > > trying to do that. > > > > > > try something like > > > > > > > > > > > > > > > > > > It _may_ be the same thing I encountered when setting cookies (in ver > > 1.0.3, > > > not sure it is still in 2.x), namely that in some places > > variables are not > > > evaluated > > > > > > In my case I had a rcursive loop that constructed a path from SQL > > database, > > > and > > > when setting a cookie with > > > > > > RESPONSE.setCookie('path',make_path) the source code of the > > method was set > > in > > > the > > > cookie resulting in broken page ;( > > > > > > using the trick with REQUEST.set solved the problem > > > > > > --------- > > > Hannu > > > > > > _______________________________________________ > > > 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 ) > > > > > > > > > > > > _______________________________________________ > > 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 ) > > > > > _______________________________________________ > 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 ) > > From kamon.ayeva@bureauveritas.com Thu Nov 18 15:41:44 1999 From: kamon.ayeva@bureauveritas.com (kamon.ayeva@bureauveritas.com) Date: Thu, 18 Nov 1999 16:41:44 +0100 Subject: [Zope-dev] Interoperability between Zope and Fast.Serv FastCGI solution Message-ID: Hi, I would like to know if DC or someone from the community has done or is planning to do some work for using Fast.Serv from Fast Engines (www.fastengines.com) as a FastCGI solution for running Zope with Microsoft IIS and/or Netscape servers. A while ago, I got a feedback from Fast Engines people themselves saying they were interested in working with DC for this interoperability. Just to know if it is on a TODO list and to have your feeling on this solution. Regards, Kamon From petrilli@digicool.com Thu Nov 18 15:57:23 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Thu, 18 Nov 1999 10:57:23 -0500 Subject: [Zope-dev] more on sessions in general. In-Reply-To: <199911181243.XAA12486@mbuna.arbhome.com.au> Message-ID: On 11/18/99 7:43 AM, Anthony Baxter at anthony@interlink.com.au wrote: > > It seems to me that the Session type object as used in SQLSession is > a useful general class of object (regardless of the backend storage). > > Is it worth making this a more general piece of Zope? Right now, you > have to do a at the start of the transaction to > get the REQUEST.SESSION object created - it would be nice if this was > done automagically (and done in a way that allowed you to slot in a > different Session object if you wanted it...) I haven't had a chance to look at your product yet Anthony, so excuse any idiotic assumptions... what we've talked about---but never gotten to yet---was either a modification to Folder, or a new ObjectManager that would cause Sessions to be tracked from that level down. This would probably work well, I think. Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From petrilli@digicool.com Thu Nov 18 16:04:36 1999 From: petrilli@digicool.com (Christopher Petrilli) Date: Thu, 18 Nov 1999 11:04:36 -0500 Subject: [Zope-dev] Interoperability between Zope and Fast.Serv FastCGI solution In-Reply-To: Message-ID: On 11/18/99 10:41 AM, kamon.ayeva@bureauveritas.com at kamon.ayeva@bureauveritas.com wrote: > > I would like to know if DC or someone from the community has done or is > planning to do some work for using Fast.Serv from Fast Engines > (www.fastengines.com) as a FastCGI solution for running Zope with Microsoft > IIS and/or Netscape servers. > A while ago, I got a feedback from Fast Engines people themselves saying > they were interested in working with DC for this interoperability. > Just to know if it is on a TODO list and to have your feeling on this > solution. I don't think anyone will mind my saying that 2.1 has FastCGI support in it, and it was tested with the FastEngines stuff I believe... (if they're the people at fastcgi.org, don't ask!). Chris -- | Christopher Petrilli Python Powered Digital Creations, Inc. | petrilli@digicool.com http://www.digicool.com From gabor.melis@essnet.se Thu Nov 18 16:50:20 1999 From: gabor.melis@essnet.se (Melis Gábor) Date: Thu, 18 Nov 1999 18:50:20 +0200 Subject: [Zope-dev] XMLDocument shortcomings Message-ID: <199911181650.RAA07623@hun46ux.essnet.se> Having retrieved the current code from the CVS I see no difference from my old version. No matter, it was a useful exercise. I realize there are problems with the current code: - Special characters (&,<,>) are not escaped by the toxml() method - there is no way to specify encoding for toxml or for display purpose in general The first is a trivial issue, but I am not sure how (or where) to solve the second one. It gets pretty annoying if at the management interface one types: öäå but after clicking on the Change button gets: öäå As I understand it, the result is UTF-16. In most cases though, I would like to output it in 'iso-8859-1'. I think that XMLDocument should remember the encoding used to create the DOM and use that encoding to produce xml. Perhaps toXML() can take an encoding parameter and there is a getEncoding() method, too. So one can write: mydoc.toXML(encoding=mydoc.getEncoding()) I can imagine making this the default, as well. What do you guys think? And what is the policy on bringing new library dependencies? I am thinking about using more of xml-sig's stuff. Regards, Gabor From m.faassen@vet.uu.nl Thu Nov 18 18:57:35 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 18 Nov 1999 19:57:35 +0100 Subject: [Zope-dev] HTMLFile() question Message-ID: <38344C1F.DCF3359F@vet.uu.nl> Hi there, In my Product code I do more or less the following: .. from Globals import HTMLFile form1 = HTMLFile('addForm', globals(), formname='form1') form2 = HTMLFile('addForm', globals(), formname='form2') form3 = HTMLFile('addForm', globals(), formname='form3') .. addForm.dtml contains something like this: .. The name of the form is: .. After this I register several product classes with Zope, product1, product2 and product3 each given their own form (form1, form2 and form3) as their addForm. Now, upon trying to add product1, I'd like it to have 'form1' appear in its addForm. But instead 'form3' appears, the HTMLFile that was created last. This happens for form2 as well. Somehow all the earlier values are forgotten. Why does this happen? What am I doing wrong? Should I use globals() as an argument here? What other arguments could work in its place? If I don't use globals() but None instead, Zope won't find the addForm.dtml file at all, looking for it in 'lib/python' for some reason. I suppose I should dig more into the code, but could anybody enlighten me on what's going on? Regards, Martijn From m.faassen@vet.uu.nl Thu Nov 18 20:10:26 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 18 Nov 1999 21:10:26 +0100 Subject: [Zope-dev] Re: [Zope] RewriteRules problems and broken image links References: Message-ID: <38345D32.54595BFC@vet.uu.nl> Harry wrote: [problems with multiple URLs pointing at the same site] Hm, I haven't worked with this myself so I may be totally off-base, but have you looked at SiteAccess? I'm not sure if this product will actually solve your woes, but it won't hurt looking at it, I imagine. http://www.zope.org/Members/4am/SiteAccess Regards, Martijn From fohrman@mediaone.net Thu Nov 18 20:37:06 1999 From: fohrman@mediaone.net (John Fohrman) Date: Thu, 18 Nov 1999 15:37:06 -0500 Subject: [Zope-dev] Easy DTML question -- ha, ha!!!!! *WINNER* In-Reply-To: <009201bf31d9$da897910$029f38c3@geometria.hu> Message-ID: This is indeed the correct answer. Thanks everyone for your responses. -- John > -----Original Message----- > From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf > Of Arpad Kiss > Sent: Thursday, November 18, 1999 10:31 AM > To: John Fohrman; zope-dev@zope.org > Subject: Re: [Zope-dev] Easy DTML question -- ha, ha!!!!! > > > Yes, you are correct. I have tested it and doesn't work. But the > next way it > works for me: > > > to: > from: > subject: subj > > It works! > > > The header and the body must be separated at least one blank line! > Arpad > > ----- Original Message ----- > From: John Fohrman > To: Arpad Kiss ; > Sent: Thursday, November 18, 1999 1:47 PM > Subject: RE: [Zope-dev] Easy DTML question -- ha, ha!!!!! > > > > > Hi, > > > dtml-let may be another solution in this case(not tested, but > it should > > > work): > > > > > > > > > ... > > > > > > > > > Arpad Kiss > > > > > > > > > Thanks for the suggestions. Apparently, none of these work however. The > > sendmail command apparently doesn't accept any variables inside the tag. > > > > Unfortunatley, this messes us up here, because the mail server > won't send > > without the address specified within the tag. Not too useful! > > > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: Hannu Krosing > > > To: John Fohrman ; > > > Sent: Thursday, November 18, 1999 10:16 AM > > > Subject: Re: [Zope-dev] Easy DTML question > > > > > > > > > > John Fohrman wrote: > > > > > > > > > > Thanks for your response. Yes, it works with a fixed string, > > > that is why > > > I'm > > > > > trying to do that. > > > > > > > > try something like > > > > > > > > > > > > > > > > > > > > > > > > It _may_ be the same thing I encountered when setting > cookies (in ver > > > 1.0.3, > > > > not sure it is still in 2.x), namely that in some places > > > variables are not > > > > evaluated > > > > > > > > In my case I had a rcursive loop that constructed a path from SQL > > > database, > > > > and > > > > when setting a cookie with > > > > > > > > RESPONSE.setCookie('path',make_path) the source code of the > > > method was set > > > in > > > > the > > > > cookie resulting in broken page ;( > > > > > > > > using the trick with REQUEST.set solved the problem > > > > > > > > --------- > > > > Hannu > > > > > > > > _______________________________________________ > > > > 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 ) > > > > > > > > > > > > > > > > > _______________________________________________ > > > 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 ) > > > > > > > > > _______________________________________________ > > 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 ) > > > > > > > _______________________________________________ > 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 ) > From m.faassen@vet.uu.nl Thu Nov 18 21:12:58 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 18 Nov 1999 22:12:58 +0100 Subject: [Zope-dev] Writing custom folderish products Message-ID: <38346BDA.1680D023@vet.uu.nl> Hi there, I'm writing a product (in Python, not with ZClasses) which consists of: form - a folderish object to which you can add.. fields - a number of SimpleItemish objects that can be added to a form What I have working: * I can make the form behave like a folder by deriving it from OFS.ObjectManager * I have a number of fields that can be added anywhere in the Zope tree What I want to reach is this situation: * I want the form to behave like an folder, but only fields should be addable. and * Fields should not be addable anywhere but in a form. What set of incantations would accomplish this? Any example source? Or Zope source code I should study? Anything? Any hint in the right direction would be appreciated. Regards, Martijn From evan@4-am.com Thu Nov 18 22:01:48 1999 From: evan@4-am.com (Evan Simpson) Date: Thu, 18 Nov 1999 16:01:48 -0600 Subject: [Zope-dev] HTMLFile() question References: <38344C1F.DCF3359F@vet.uu.nl> Message-ID: <3834774C.33723859@4-am.com> Martijn Faassen wrote: > In my Product code I do more or less the following: > > form1 = HTMLFile('addForm', globals(), formname='form1') [snip] > Why does this happen? What am I doing wrong? Should I use globals() as > an argument here? What other arguments could work in its place? If I > don't use globals() but None instead, Zope won't find the addForm.dtml > file at all, looking for it in 'lib/python' for some reason. I suppose I > should dig more into the code, but could anybody enlighten me on what's > going on? Here's some code I use in PythonMethod: from Globals import MessageDialog, HTMLFile, package_home import sys, os, traceback, re _www = os.path.join(package_home(globals()), 'www') manage_addPythonMethodForm=HTMLFile('methodAdd', _www) I do this because a recent version was bitten by a bug which mysteriously prevented my objects from being copied, imported, renamed, etc. It had something to do with the add form being initialized with HTMLFile('www/methodAdd', globals()), and changing to the above cured it. In any case, you may wish to try something like: from Globals import HTMLFile, package_home _pdir = package_home(globals()) form1 = HTMLFile('addForm', _pdir, formname='form1') ... Cheers, Evan @ 4-am From zen@cs.rmit.edu.au Thu Nov 18 22:04:24 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 19 Nov 1999 09:04:24 +1100 (EST) Subject: [Zope-dev] more on sessions in general. In-Reply-To: <199911181243.XAA12486@mbuna.arbhome.com.au> Message-ID: On Thu, 18 Nov 1999, Anthony Baxter wrote: > It seems to me that the Session type object as used in SQLSession is > a useful general class of object (regardless of the backend storage). There is a need for someone to write ZSession or DumbSession that simply stores the information in a in-memory dictionary (or var/session for ZEO compatibility?), which would then define the API. > Is it worth making this a more general piece of Zope? Right now, you > have to do a at the start of the transaction to > get the REQUEST.SESSION object created - it would be nice if this was > done automagically (and done in a way that allowed you to slot in a > different Session object if you wanted it...) How would you 'slot in' a session? Perhaps it just calls getSession(this(),REQUEST), which would be aquired from higher-on-up. This method could defined in SQLSessionFolder, or just a DTML/external method the site manager left in the root folder, or we could patch OFS/Folder.py to give it a 'Session' property defining the class of the session object we use). The getSession method would return the existing session, if it exists, or returns a fresh one. Your code would then just look like: blah It would be nice if REQUEST.SESSION was filled in for you if the session class has been defined, but someone else will need to comment on its feasibility :-) -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From m.faassen@vet.uu.nl Thu Nov 18 22:12:35 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 18 Nov 1999 23:12:35 +0100 Subject: [Zope-dev] HTMLFile() question References: <38344C1F.DCF3359F@vet.uu.nl> <3834774C.33723859@4-am.com> Message-ID: <383479D3.8929D125@vet.uu.nl> Evan Simpson wrote: > > Martijn Faassen wrote: [my problems with HTMLFile] [snip] > from Globals import HTMLFile, package_home > _pdir = package_home(globals()) > form1 = HTMLFile('addForm', _pdir, formname='form1') > ... Nope, this approach gives me the same bug as the one I described before. Weird. Anyway, I hacked around this problem with a custom class, but it'd be cleaner to use HTMLFile, so I'm still curious. Thanks anyway, though! Regards, Martijn From pje@telecommunity.com Thu Nov 18 22:15:25 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Thu, 18 Nov 1999 17:15:25 -0500 Subject: [Zope-dev] ZServer FastCGI patch for IRIX (and others?) In-Reply-To: <38347046.699A3FE3@digicool.com> References: Message-ID: <3.0.5.32.19991118171525.01d69200@telecommunity.com> Below is a patch to let ZServer's FastCGI support work with FastCGI client implementations that don't properly close the STDIN sub-stream. On the IRIX/Apache/cgi-fcgi combo used where I work, the client side doesn't seem to know when it's done sending STDIN data, and thus the ZServer side simply hangs forever waiting for it. The patch below makes ZServer ignore STDIN altogether if there is no Content-Length, and also stop looking for more STDIN data if Content-Length or more bytes have already been read. --- FCGIServer.py Thu Nov 18 17:08:24 1999 +++ Zope2/ZServer/FCGIServer.py Thu Nov 18 17:05:02 1999 @@ -429,6 +429,8 @@ elif rec.recType == FCGI_PARAMS: if rec.contentLength == 0: # end of the stream self.remainingRecs = self.remainingRecs - 1 + self.content_length=string.atoi(self.env.get('CONTENT_LENGTH','0')) + if self.content_length==0: self.remainingRecs = self.remainingRecs - 1 else: self.env.update(rec.values) @@ -438,6 +440,8 @@ self.remainingRecs = self.remainingRecs - 1 else: self.stdin.write(rec.content) + self.content_length = self.content_length - rec.contentLength + if self.content_length<=0: self.remainingRecs = self.remainingRecs - 1 # read some filter data elif rec.recType == FCGI_DATA: @@ -448,7 +452,7 @@ # We've processed the record. Now what do we do? - if self.remainingRecs: + if self.remainingRecs > 0: # prepare to get the next record self.setInitialState() From Anthony Baxter Thu Nov 18 23:12:22 1999 From: Anthony Baxter (Anthony Baxter) Date: Fri, 19 Nov 1999 10:12:22 +1100 Subject: [Zope-dev] more on sessions in general. In-Reply-To: Message from "Stuart 'Zen' Bishop" of "Fri, 19 Nov 1999 09:04:24 +1100." Message-ID: <199911182312.KAA13405@mbuna.arbhome.com.au> >>> "Stuart 'Zen' Bishop" wrote > There is a need for someone to write ZSession or DumbSession that simply > stores the information in a in-memory dictionary (or var/session for ZEO > compatibility?), which would then define the API. Yep. Don't look at me - SQL Sessions do what I need. > How would you 'slot in' a session? > > Perhaps it just calls getSession(this(),REQUEST), which would be aquired > from higher-on-up. This method could defined in SQLSessionFolder, or just > a DTML/external method the site manager left in the root folder, or we could > patch OFS/Folder.py to give it a 'Session' property defining the class of the Right now, you simply . The Session is the SQLSession object - it contains the SQL methods used by the session. It creates REQUEST.SESSION, which is a dictionary-like thing. > It would be nice if REQUEST.SESSION was filled in for you if the session > class has been defined, but someone else will need to comment on its > feasibility :-) That's what I do now. It seemed appropriate - it felt like it should be on an equivalent level to RESPONSE. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From brad@bradm.ne.mediaone.net Thu Nov 18 23:20:48 1999 From: brad@bradm.ne.mediaone.net (Bradley McLean) Date: Thu, 18 Nov 1999 18:20:48 -0500 Subject: [Zope-dev] Patches to add range / kw searching, etc In-Reply-To: <3833908E.B3DE4EB0@libc.org> References: <19991118001755.A15965@bradm.ne.mediaone.net> <3833908E.B3DE4EB0@libc.org> Message-ID: <19991118182048.A17074@bradm.ne.mediaone.net> * Bill Anderson (bill.anderson@libc.org) [991118 00:38]: > > Personally, I would post a patch to the collector, and to this list (or > if patch == large_file: procide URL for download), that way you get DC > looking over it, as well as anyone of the rest of us that might like to > try it out. Thanks for the suggestion, Bill. Here it is: --- sqlgroup.py.orig Tue Mar 9 19:15:44 1999 +++ sqlgroup.py Thu Nov 18 17:52:25 1999 @@ -150,7 +150,8 @@ import sys class SQLGroup: - blockContinuations='and','or' + # Brad McLean 11/17/99: Allow a new operator "andor" + blockContinuations='and','or','andor' name='sqlgroup' required=None where=None @@ -172,7 +173,12 @@ __traceback_info__=tname s=strip(section(None, md)) if s: - if r: r.append(tname) + if r: + # Brad McLean 11/17/99: If it's andor tag, use the + # Value of the arguments as the sqljoiner + if tname == 'andor': + r.append(md[args]) + else: r.append(tname) r.append("%s\n" % s) if r: --- sqltest.py.orig Thu Aug 26 13:59:36 1999 +++ sqltest.py Thu Nov 18 17:52:25 1999 @@ -126,6 +126,41 @@ with the appropriate boolean operator, as indicated by use of an 'and' or 'or' tag, otherwise, no text is inserted. + Extensions made 11/17/99 by Brad McLean: + + There is an 'andor' tag which takes a parameter: + or + This permits having the user interface present something like: + + + + Further, sqltest has been extended with 'expr' options: + 'expr' defaults to 'eq' + other values are 'ge','le','lt','gt','rng','kw' + + For 'rng' (range), if a single parameter is given, it devolves to 'eq'. + If two values are provided, then a field test ensuring that the value + lies between the two values (inclusive) is generated. Simply repeat + the same 'name' attribute on two input elements on the calling form; + the first will be taken to be the lower element + + For 'kw' (Keyword), each word provided is searched for. This could + use some further work to allow 'and' semantics as well as 'or', and + phrases would be cool too, but that's future. + + This code works well with MySQL. I think it should work with most + other SQL databases, but I'm not sure. + + Examples: + + + + + ''' __rcs_id__='$Id: sqltest.py,v 1.10 1999/08/26 17:59:36 jim Exp $' @@ -151,8 +186,9 @@ optional=multiple=None def __init__(self, args): + # Brad McLean 11/17/99: args = parse_params(args, name='', type=None, column=None, - multiple=1, optional=1) + multiple=1, optional=1, expr='') self.__name__ = name_param(args,'sqlvar') has_key=args.has_key if not has_key('type'): @@ -164,6 +200,9 @@ if has_key('multiple'): self.multiple=args['multiple'] if has_key('column'): self.column=args['column'] else: self.column=self.__name__ + # Brad McLean 11/17/99: + if has_key('expr'): self.expr=args['expr'] + else: self.expr = "eq" def render(self, md): name=self.__name__ @@ -201,7 +240,9 @@ 'Invalid floating-point value for %s' % name) else: v=str(v) - v=md.getitem('sql_quote__',0)(v) + # Brad McLean 11/17/99: + if self.expr != 'kw': + v=md.getitem('sql_quote__',0)(v) #if find(v,"\'") >= 0: v=join(split(v,"\'"),"''") #v="'%s'" % v @@ -212,11 +253,55 @@ raise 'Missing Input', ( 'No input was provided for %s' % name) - if len(vs) > 1: - vs=join(map(str,vs),', ') - return "%s in (%s)" % (self.column,vs) - return "%s=%s" % (self.column,vs[0]) + # Brad McLean 11/17/99: Major semantics changes below: + if len(vs) > 1 or self.expr == 'kw': + if self.expr == 'eq': + vs=join(map(str,vs),', ') + return "%s in (%s)" % (self.column,vs) + # Range processing: Must have just two values. Future: + # might want a both inclusive and exclusive options. + elif self.expr == 'rng' and len(vs) == 2: + return "(%s >= %s and %s <= %s)" % (self.column,vs[0],self.column,vs[1]) + # Keyword processing: Split each word into a separate SQL + # clause. This might be rather database specific; perhaps it + # can be parameterized or factored into a helper method somehow. + # Future options might include other operators than 'or', and + # possibly a parser smart enough to handle phrases, etc. + elif self.expr == 'kw': + result = ["("] + for i in vs: + for w in split(i): + result.append("locate(lower(%s),lower(%s))>0" + % (md.getitem('sql_quote__',0)(w),self.column)) + result.append(" or ") + result[-1] = ")" + return join(result) + else: + raise ValueError, ( + 'Wrong Value count for type for %s' % name) + # Single value to a range devolves to a simple eq + # Should there be a table of these per database in case of differing + # operators? + if self.expr == 'eq' or self.expr == 'rng': + return "%s=%s" % (self.column,vs[0]) + elif self.expr == 'lt': + return "%s<%s" % (self.column,vs[0]) + elif self.expr == 'gt': + return "%s>%s" % (self.column,vs[0]) + elif self.expr == 'le': + return "%s<=%s" % (self.column,vs[0]) + elif self.expr == 'ge': + return "%s>=%s" % (self.column,vs[0]) + elif self.expr == 'ne': + return "%s!=%s" % (self.column,vs[0]) + raise ValueError, ( + 'Unknown expr type for %s' % name) __call__=render valid_type={'int':1, 'float':1, 'string':1, 'nb': 1}.has_key + + + + + From circle@gwi.net Thu Nov 18 23:25:47 1999 From: circle@gwi.net (Andrew Wilcox) Date: Thu, 18 Nov 1999 18:25:47 -0500 Subject: [Zope-dev] Got "expand_all" to work in a tree tag with leaves Message-ID: <3.0.6.32.19991118182547.0079a4f0@mail.gwi.net> I've been battling the tree tag all day to get expand_all to work, and it almost won, but then I hacked the source. {insert evil manical laughter here} Simple use of the tree tag, listing the titles of objects within folders:

    Expand all

    Where listObjects is a simple DTML Method that lists the titles of the objects within the folder, with a little indenting:


        
    Now, if you hit the "expand all", it expands all the folders except those at the lowest level, the ones that just contain (non-folder) objects. My first thought was that maybe it wasn't really considering the lowest level folders to be a branch, so I spent a while trying different functions for the "branches" attribute. That didn't work. Take a look at tpValuesId inside of TreeTag.py, which builds a list of all the expandable subitems for expand_all: try: items=getattr(self, branches)() except AttributeError: items=() for item in items: try: if getattr(item, branches)(): If I'm reading this right, the first call on branches gets the subitems which are considered a branch (defaulting to isPrincipiaFolderish over in ObjectManager). But then the second call on branches checks if the subitem itself has a non-zero number of branches. I commented out the second call there, and lo and behold! Suddenly my tree was fully expanding. So, what did I break? :) Andrew From lstafford@icompression.com Thu Nov 18 23:47:01 1999 From: lstafford@icompression.com (Loren Stafford) Date: Thu, 18 Nov 1999 15:47:01 -0800 Subject: [Zope-dev] Writing custom folderish products In-Reply-To: <38346BDA.1680D023@vet.uu.nl> Message-ID: <000a01bf321f$35d093e0$8b0127d8@eagle.icompression.com> I have a similar question, but I'm working with ZClasses. If I subclass Folder, I get a pick list of all possible classes that I can add to my object. If I subclass ObjectManager, I don't automatically get any list of classes that I can add to my object. I presume that I have to do something to generate the list of classes that I want to be able to add, but I don't know what I have to do. Can someone help get me pointed in the right direction. -- Thanks -- Loren > -----Original Message----- > From: Martijn.Faassen@vet.uu.nl [mailto:Martijn.Faassen@vet.uu.nl]On > Behalf Of Martijn Faassen > Sent: Thursday, November 18, 1999 13:13 > To: zope-dev@zope.org > Subject: [Zope-dev] Writing custom folderish products > > > Hi there, > > I'm writing a product (in Python, not with ZClasses) which consists of: > > form - a folderish object to which you can add.. > fields - a number of SimpleItemish objects that can be added to a form > > What I have working: > > * I can make the form behave like a folder by deriving it from > OFS.ObjectManager > > * I have a number of fields that can be added anywhere in the Zope tree > > What I want to reach is this situation: > > * I want the form to behave like an folder, but only fields should be > addable. > > and > > * Fields should not be addable anywhere but in a form. > > What set of incantations would accomplish this? Any example source? Or > Zope source code I should study? Anything? Any hint in the right > direction would be appreciated. > > Regards, > > Martijn > > _______________________________________________ > 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 ) > From robin@jessikat.demon.co.uk Fri Nov 19 00:40:11 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Fri, 19 Nov 1999 00:40:11 +0000 Subject: [Zope-dev] killing zombies Message-ID: After putting the site I've developed on a live test basis I notice that I'm getting some zombie connections. I'm using the medusa active channel display code as in the code below. I notice that there are kill_zombies method for zhhtp_channel, but how should I use that method? My approach uses a similar approach, but is probably wrong. The zombie killers aren't happening in Zope as it stands. Can I ask why not? can I get the same thing to happen for other channels eg ftp etc? #status.py from ZServer.medusa.status_handler import channel_list_producer from ZServer.medusa.asyncore import socket_map from ZServer.HTTPServer import zhttp_channel from string import replace from time import time def __build(s): r='' while 1: t = s.more() if t=='': break r = r + t return r def get_active_channels(): r='' s=channel_list_producer('aaaa') r = r + replace(__build(s),'

    Status Report','') return r def kill_zombies(self): now = int (time()) for channel in socket_map.keys(): if channel.__class__ == zhttp_channel: if (now - channel.creation_time) > channel.zombie_timeout: channel.close() -- Robin Becker From anthony@ekorp.com Fri Nov 19 03:54:21 1999 From: anthony@ekorp.com (Anthony Baxter) Date: Fri, 19 Nov 1999 14:54:21 +1100 Subject: [Zope-dev] mozilla and zope, update. Message-ID: <199911190354.OAA05333@luxor.off.ekorp.com> For those who are interested, Mozilla is very very close to being usable for working in Zope. At the moment, the killer is the open bug 6144 - Moz loses track of the auth header, and doesn't re-send it in. This means that in the management interface, you're not authorised, and so manage_workspace defaults to index_html, rather than manage_main. It's currently listed to be fixed before the next milestone release, M12, which is scheduled for 15th December. I'll post an update when it's fixed. Anthony From s341625@student.uq.edu.au Fri Nov 19 04:11:45 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Fri, 19 Nov 1999 14:11:45 +1000 (GMT+1000) Subject: [Zope-dev] Writing custom folderish products In-Reply-To: <38346BDA.1680D023@vet.uu.nl> Message-ID: On Thu, 18 Nov 1999, Martijn Faassen wrote: > Hi there, > > I'm writing a product (in Python, not with ZClasses) which consists of: > > form - a folderish object to which you can add.. > fields - a number of SimpleItemish objects that can be added to a form > > What I have working: > > * I can make the form behave like a folder by deriving it from > OFS.ObjectManager > > * I have a number of fields that can be added anywhere in the Zope tree > > What I want to reach is this situation: > > * I want the form to behave like an folder, but only fields should be > addable. > > and > > * Fields should not be addable anywhere but in a form. > > What set of incantations would accomplish this? Any example source? Or > Zope source code I should study? Anything? Any hint in the right > direction would be appreciated. > > Regards, > > Martijn > Use VisualZope. The Forms are XML Documents, Widgets - folderish items containing other bits 'n pieces. Remember, the XML Document Element functions can be applied to anything in Zope (check lib/python/Ofs/ZDOM.py for more info). Cheers, Anthony Pfrunder From mo@local2me.com Fri Nov 19 05:27:53 1999 From: mo@local2me.com (Michael Olivier) Date: Thu, 18 Nov 1999 21:27:53 -0800 Subject: [Zope-dev] RE-POST: getting Zap to work with cgi-bin directory? Message-ID: <3834DFD9.44E4A224@local2me.com> I'm reposting because I got no responses to this, and we're stuck. I would greatly appreciate any light you can shed on whether Zap should work with its cgi-bin like standard apache does, and how to troubleshoot problems. Ours isn't working and it isn't clear to us what else to try. --Michael Michael Olivier wrote: > > Hi folks, > > We've got Zope and Zap running but are having trouble with Zap's cgi-bin > directory. Specifically, we're wanting to run some pcgi/bobo stuff but > can't get even the perl test scripts (printenv, test-cgi) to work. > > >From the error log I can see that it's mapping /localhost/cgi-bin to > /usr/local/zope/Zap/htdocs/cgi-bin/ -- > it's looking for cgi-bin below htdocs. I'd like to have it as a sibling > directory with htdocs. If I actually put it inside htdocs > (htdocs/cgi-bin), it > displays the scripts but doesn't execute them. I tried adding this to > the zap.conf file: > > > AllowOverride None > Options ExecCGI > > > ...but this didn't seem to have any effect... > > Can someone advise please on how to debug this situation? Doesn't zap > come preconfigured for cgi-bin use, or not? > > Many thanks, > Michael From kankie@thegrid.net Fri Nov 19 05:49:52 1999 From: kankie@thegrid.net (David Kankiewicz) Date: Thu, 18 Nov 1999 21:49:52 -0800 Subject: [Zope-dev] Max objects before ZCatalog? Message-ID: <3834E500.903FDCAA@thegrid.net> What is the magic number for performance? Between the individual lookup, doing a 'large catalog' ZCatalog search, and creating many ZCatalogs. I'm accessing a few variable (~ 2-8) in 20-5000 (~max) subobjects and testing them against the current objects variables. The design is for something that most scale and can easily to be changed (I have this half done). The idea is really close to ZTopics, with my own idea of a minimalistic custom implementation. Is there anyone who has experience or has done performance testing and would like to comment? Thanks in advanced, David From mj@antraciet.nl Fri Nov 19 09:39:53 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Fri, 19 Nov 1999 10:39:53 +0100 Subject: [Zope-dev] Patches to add range / kw searching, etc In-Reply-To: <19991118182048.A17074@bradm.ne.mediaone.net> References: <3833908E.B3DE4EB0@libc.org> <19991118001755.A15965@bradm.ne.mediaone.net> <3833908E.B3DE4EB0@libc.org> Message-ID: <4.2.0.58.19991119103410.00a27610@lisp.atmm.nl> At 00:20 19/11/99 , Bradley McLean wrote: >* Bill Anderson (bill.anderson@libc.org) [991118 00:38]: > > > > Personally, I would post a patch to the collector, and to this list (or > > if patch == large_file: procide URL for download), that way you get DC > > looking over it, as well as anyone of the rest of us that might like to > > try it out. > >Thanks for the suggestion, Bill. Here it is: From 2.1.0 beta 1 on, the sqltest tag supports an optional 'op' attribute, which let's you specify what comperisn operator should be used. You can fill in any operator you like, it will use that operator in stead of the '=' sign, or you could specify a keyword from the list 'eq', 'ne', 'lt', 'le', 'lte', 'gt', 'ge' or 'gte', and it will use the appropriate operator that goes with that keyword. Maybe you should try and integrate your changes to the sqltest tag with this operator. Also, did you also file this addition in the Collector (http://classic.zope.org:8080/Collector)? -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From faassen@vet.uu.nl Fri Nov 19 11:32:08 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Fri, 19 Nov 1999 12:32:08 +0100 Subject: [Zope-dev] Writing custom folderish products In-Reply-To: References: <38346BDA.1680D023@vet.uu.nl> Message-ID: <19991119123208.B6586@vet.uu.nl> Anthony Pfrunder wrote: > Use VisualZope. The Forms are XML Documents, Widgets - folderish items > containing other bits 'n pieces. I don't see how VisualZope is going to help me here, unless as example code? I'm just trying to make a folderish object that has a set of other objects that are addable (which then are not addable in normal folders). Sort of like in the Product View you can only add Products. But I studied that code and I couldn't make a lot of sense of it. Anyway, my approach is quite unambitious, at least compared to VisualZope. :) I'm sure there are synergies between my system and VisualZope, but I just want to get my system done first. > Remember, the XML Document Element functions can be applied to anything in > Zope (check lib/python/Ofs/ZDOM.py for more info). Hm, I know this, but I don't understand why this is relevant, I'm afraid. I'll see about taking a look at the latest VisualZope, though. Thanks! Regards, Martijn From david.brusowankin@gs.com Fri Nov 19 16:09:28 1999 From: david.brusowankin@gs.com (Brusowankin, David) Date: Fri, 19 Nov 1999 11:09:28 -0500 Subject: [Zope-dev] ctsybasemodule Message-ID: <6BCBBDF4762DD311815000902762CD492E837C@gsny15e.et.gs.com> Hi, I noticed that you guys are maintaining ctsybasemodule for now. What is the latest version of ctsybasemodule ? Can I get it ? And, although I am not guaranteeing anything for NOW, I may be able to find some time to help in its maintainence. Please send me the bug list as well. Thanks in advance, David ---------------------------------------------------------------------------- ------------ David Brusowankin Goldman Sachs Information Technology 1 NY Plaza 38th Floor New York, NY 10004 Voice: 212.357.0317 Email: david.brusowankin@gs.com From michel@digicool.com Fri Nov 19 16:28:54 1999 From: michel@digicool.com (Michel Pelletier) Date: Fri, 19 Nov 1999 11:28:54 -0500 Subject: [Zope-dev] Max objects before ZCatalog? Message-ID: <613145F79272D211914B0020AFF640192762D6@gandalf.digicool.com> > -----Original Message----- > From: David Kankiewicz [mailto:kankie@thegrid.net] > Sent: Friday, November 19, 1999 12:50 AM > To: Zope-dev@zope.org > Subject: [Zope-dev] Max objects before ZCatalog? > > > > What is the magic number for performance? Between the > individual lookup, > doing a 'large catalog' ZCatalog search, and creating many ZCatalogs. 'large' here is a big number. ZCatalog stores it's index information in BTrees. Without getting into too much theory or insulting anyones intelligence, a BTree is a tree like data structure. When doing a 'search' you start at the top and work your way down the tree, comparing your search value to the value of each node in the tree. If you had on the order of a million objects, you would only make on the order of 10-20 or so comparisons. This is very fast and scales quite well. > > I'm accessing a few variable (~ 2-8) in 20-5000 (~max) subobjects and > testing them against the current objects variables. The design is for > something that most scale and can easily to be changed (I > have this half > done). I don't really understand what your saying here. But if you have 5000 cataloged objects, max, then you're well below flexing catalog. -Michel From michel@digicool.com Fri Nov 19 16:35:59 1999 From: michel@digicool.com (Michel Pelletier) Date: Fri, 19 Nov 1999 11:35:59 -0500 Subject: [Zope-dev] ctsybasemodule Message-ID: <613145F79272D211914B0020AFF640192762D7@gandalf.digicool.com> > -----Original Message----- > From: Brusowankin, David [mailto:david.brusowankin@gs.com] > Sent: Friday, November 19, 1999 11:09 AM > To: 'zope-dev@zope.org' > Subject: [Zope-dev] ctsybasemodule > > > Hi, > > I noticed that you guys are maintaining ctsybasemodule for now. Actually we aren't. ctsybasemodule was pretty ripe with problems and bugs, so we wrote our own which is still in the hands of the testers who helped pay for its development. It will be releases as soon as they give it the OK. Which should be very soon. Mind you, our 'module' is not a Python DB API complient module, but rather a thin wrapper around the sybase ctlib C library. A DB API module could be quicky and easily written with our C module, but we have not written one and we don't plan on it. The only thing we are providing is the new C module and a Zope Sybase databse adapter. -Michel From jec@mgmt-inc.com Fri Nov 19 16:52:46 1999 From: jec@mgmt-inc.com (Jim Cain) Date: Fri, 19 Nov 1999 11:52:46 -0500 (EST) Subject: [Zope-dev] Re: [Zope] Zope-2.1.0b2 fails on access to management screen In-Reply-To: <4.2.0.58.19991119162633.045a5240@lisp.atmm.nl> Message-ID: (I'm moving this to zope-dev.) On Fri, 19 Nov 1999, Martijn Pieters wrote: > At 15:52 19/11/99 , Jim Cain wrote: > >On Fri, 19 Nov 1999, Martijn Pieters wrote: > > > > > > > > >Yes, I have python 1.5.2 installed. I have used the same python > > > >installation with Zope 2.0.1 and several versions before that. > > > > > > Hmm... and make test still does alright? You get an error with standard > > > python library methods, very strange. > > > >Here is the make test output for python: > > Your tests run fine then. It's just that the call to > time.gmtime(time.time()) seemd to fail. You could try and do: > > python > >> import time > >> time.gmtime(time.time()) > > but I think that'll be alright. > > The problem then list with the PCGServer. The code around this statement > has changed between 2.0.1 and 2.1.0 beta 1. I have a feeling that > self.reply_code (line 231) is not an integer for you. > > You could change this to int(self.reply_code), or change corresponding %d > on line 225 (2nd one in the string) to %s. > > If this fixes things, file a Collector bug report. It might be something > deeper, or other places may need to be fixed. I tried the above changes, but I still got the same error. Then I tried removing things altogether, one at a time. Finally I discovered that by removing the first %d on line 225 and self.addr[1] on line 226, while leaving everything else alone, it works fine. One curious thing though: When I run it this way, the line it writes in the log file begins with ^D. Where is that character coming from? Jim From gabor.melis@essnet.se Fri Nov 19 18:46:26 1999 From: gabor.melis@essnet.se (Gabor Melis) Date: Fri, 19 Nov 1999 20:46:26 +0200 Subject: [Zope-dev] XMLDocument patch Message-ID: This message is in MIME format --_=XFMail.1.3.p0.Linux:991119194626:5143=_ Content-Type: text/plain; charset=us-ascii Hi I made a patch to remedy two of the present bugs: 1) Escape <, & and > characters in toxml() 2) abort the transaction if parsing fails 1) uses the escape method from xml-sigs xml.utils, but this dependency can be removed. (not done now) I was wondering about encodings the other day (subject: XMLDocument shortcomings). If you have comments on how to introduce intelligent encoding/decoding please share it with me. Gabor --_=XFMail.1.3.p0.Linux:991119194626:5143=_ Content-Disposition: attachment; filename="patch" Content-Transfer-Encoding: base64 Content-Description: patch Content-Type: application/octet-stream; name=patch; SizeOnDisk=1475 T25seSBpbiBYTUxEb2N1bWVudC5vcmlnLzogQ1ZTCmRpZmYgLXUgWE1MRG9jdW1lbnQub3JpZy9O b2RlLnB5IFhNTERvY3VtZW50L05vZGUucHkKLS0tIFhNTERvY3VtZW50Lm9yaWcvTm9kZS5weQlU dWUgTm92IDE2IDE2OjA5OjIyIDE5OTkKKysrIFhNTERvY3VtZW50L05vZGUucHkJRnJpIE5vdiAx OSAxOToyNToyOSAxOTk5CkBAIC05OCw2ICs5OCw4IEBACiBpbXBvcnQgc3RyaW5nCiBpbXBvcnQg Y29weQogCitmcm9tIHhtbC51dGlscyBpbXBvcnQgZXNjYXBlCisKICMgTm9kZSBjbGFzc2VzCiAj IC0tLS0tLS0tLS0tLQogICAgICAgICAgICAgIApAQCAtNTM3LDcgKzUzOSw3IEBACiAgICAgICAg IHJlc3VsdC5hcHBlbmQoJzwlcycgJSBzZWxmLl9uYW1lKQogICAgICAgICBmb3IgYSBpbiBzZWxm LmdldEF0dHJpYnV0ZXMoKToKICAgICAgICAgICAgIGlmIGEuZ2V0Tm9kZVZhbHVlKCk6Ci0gICAg ICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgnICVzPSIlcyInICUgKGEuZ2V0TmFtZSgpLGEuZ2V0 Tm9kZVZhbHVlKCkpKQorICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoZXNjYXBlKCcgJXM9 IiVzIicgJSAoYS5nZXROYW1lKCksYS5nZXROb2RlVmFsdWUoKSkpKQogICAgICAgICBpZiBkZWVw IGFuZCBzZWxmLl9jaGlsZF9pZHM6CiAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKCc+JykKICAg ICAgICAgICAgIGZvciBjaGlsZCBpbiBzZWxmOgpAQCAtNjM3LDcgKzYzOSw3IEBACiAgICAgICAg ICIiIgogICAgICAgICBpZiBSRVNQT05TRSBpcyBub3QgTm9uZToKICAgICAgICAgICAgIFJFU1BP TlNFLnNldEhlYWRlcignY29udGVudC10eXBlJywndGV4dC94bWwnKQotICAgICAgICByZXR1cm4g c2VsZi5fZGF0YQorICAgICAgICByZXR1cm4gZXNjYXBlKHNlbGYuX2RhdGEpCiAKICAgICAjIERP TSBNZXRob2RzCiAgICAgIyAtLS0tLS0tLS0tLQpkaWZmIC11IFhNTERvY3VtZW50Lm9yaWcvWE1M RG9jdW1lbnQucHkgWE1MRG9jdW1lbnQvWE1MRG9jdW1lbnQucHkKLS0tIFhNTERvY3VtZW50Lm9y aWcvWE1MRG9jdW1lbnQucHkJVHVlIE5vdiAxNiAxNjowOTozMyAxOTk5CisrKyBYTUxEb2N1bWVu dC9YTUxEb2N1bWVudC5weQlGcmkgTm92IDE5IDE5OjI1OjI5IDE5OTkKQEAgLTE3OSw2ICsxNzks NyBAQAogICAgICAgICB0cnk6CiAgICAgICAgICAgICBzZWxmLnBhcnNlKGRhdGEpCiAgICAgICAg IGV4Y2VwdCBCdWlsZGVyLlBhcnNlRXJyb3IsIG1lc3NhZ2U6CisgICAgICAgICAgICBnZXRfdHJh bnNhY3Rpb24oKS5hYm9ydCgpCiAgICAgICAgICAgICBpZiBSRVFVRVNUOgogICAgICAgICAgICAg ICAgIHJldHVybiBzZWxmLm1hbmFnZV9lZGl0Rm9ybShzZWxmLCBSRVFVRVNULCB0b1hNTD1kYXRh LAogICAgICAgICAgICAgICAgICAgICAgICAgbWFuYWdlX3RhYnNfbWVzc2FnZT0nPGZvbnQgY29s b3I9InJlZCI+WE1MIFBhcnNpbmcgRXJyb3I6ICVzPC9mb250PicgJSBtZXNzYWdlKQo= --_=XFMail.1.3.p0.Linux:991119194626:5143=_-- End of MIME message From mj@antraciet.nl Fri Nov 19 23:02:10 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Sat, 20 Nov 1999 00:02:10 +0100 Subject: [Zope-dev] Re: [Zope] Zope-2.1.0b2 fails on access to management screen In-Reply-To: References: <4.2.0.58.19991119162633.045a5240@lisp.atmm.nl> Message-ID: <4.2.2.19991119235719.02646420@212.48.38.34> At 17:52 19-11-99 , Jim Cain wrote: >I tried the above changes, but I still got the same error. > >Then I tried removing things altogether, one at a time. Finally I >discovered that by removing the first %d on line 225 and self.addr[1] on >line 226, while leaving everything else alone, it works fine. > >One curious thing though: When I run it this way, the line it writes in >the log file begins with ^D. Where is that character coming from? Eh? This suggests that self.addr[1] is now broken, which means that it was previously (older Zope version) wasn't working either.. And I don't get the ^D either. Do you know how to use the Perl Debugger? I think a few debugging steps are in order here. Insert the lines import pdb pdb.set_trace() somewhere before the offending lines (for example, at 222), start Zope in debugging mode (so it won't detach from the console). Then, when you go to your site and your pdb statements are executed, you can follow exactly what goes wrong where, and why. Let us know! -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From faassen@vet.uu.nl Fri Nov 19 23:00:37 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sat, 20 Nov 1999 00:00:37 +0100 Subject: [Zope-dev] Writing custom folderish products In-Reply-To: <19991119.22084614@mis.configured.host> References: <38346BDA.1680D023@vet.uu.nl> <19991119123208.B6586@vet.uu.nl> <19991119.22084614@mis.configured.host> Message-ID: <19991120000037.A7693@vet.uu.nl> s341625@student.uq.edu.au wrote: > On 11/19/99, 9:32:08 PM, Martijn Faassen wrote > regarding Re: [Zope-dev] Writing custom folderish products: > [VisualZope explanation snipped] Hm, I'm not sure I get that yet. I have a difficult time understanding VisualZope, I'm afraid...seeing a working demo would *really* help in my understanding of it; I tried to install it again today but ended up with javascript errors. Once I really understand what it's for and what it can do, I'll be far more able to understand your explanations on how it works. From what I understand it does sound way cool, though. :) [ZClass based approach:] > * Create a Zclass based on a folder and objectManager (this is > important - an objectManager is always required for some reason) And 'folder' is in fact not necessary; objectManager is enough. > * In the Methods area of this class create another zclass (say, > "MyObject" > * Then, in the SubObjects area pick MyObject as an object that can be > added within this folder > > Thats it! The user will only see MyObject in the "Add Object" > dropdown! I know this -- I've done this myself. But what I'm developing is a Python-only product; no ZClasses involved. I have a set of field classes (all deriving from a common base class; these are Zope products) and I want to make a folderish class to which they can be added. They shouldn't be addable anywhere else (in normal folders, for instance). Going through the source I found some stuff involving all_meta_types, meta_types and lots of magic code (to me) that seems to make products addable to folders. Zope's sources could use some documenting though.. I am assuming there is a clean mechanism to say: 'these products can only be added to this ObjectManagerish product, and nowhere else'. Could a real Zope Guru speak up now? On the bright side, all this Zope source digging does mean I know my way around significant parts of it now; don't understand much of it yet, but all helps on my road to the Zen, I suppose. :) Regards, Martijn From faassen@vet.uu.nl Fri Nov 19 23:14:09 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sat, 20 Nov 1999 00:14:09 +0100 Subject: [Zope-dev] XMLDocument patch In-Reply-To: References: Message-ID: <19991120001409.A7718@vet.uu.nl> Gabor Melis wrote: > Hi > > I made a patch to remedy two of the present bugs: Cool! Improvements to XMLDocument are good.. You might want to send this directly to Amos Latteier in case he misses it (amos@digicool.com), or post it to the collector at www.zope.org. Regards, Martijn From eric@sourcegear.com Fri Nov 19 23:22:06 1999 From: eric@sourcegear.com (Eric W. Sink) Date: Fri, 19 Nov 1999 17:22:06 -0600 Subject: [Zope-dev] Re: what?!? In-Reply-To: <4.2.2.19991119235719.02646420@212.48.38.34> References: <4.2.0.58.19991119162633.045a5240@lisp.atmm.nl> Message-ID: >Do you know how to use the Perl Debugger? Three possibilities: 1. There is something about this thread that I am missing. 2. The above question contains a typo. 3. The above question contains a blasphemy. ;-) Eric W. Sink, Software Craftsman SourceGear Corporation eric@sourcegear.com From mj@antraciet.nl Fri Nov 19 23:32:02 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Sat, 20 Nov 1999 00:32:02 +0100 Subject: [Zope-dev] Re: what?!? In-Reply-To: References: <4.2.2.19991119235719.02646420@212.48.38.34> <4.2.0.58.19991119162633.045a5240@lisp.atmm.nl> Message-ID: <4.2.2.19991120002701.02d915c0@212.48.38.34> At 00:22 20-11-99 , Eric W. Sink wrote: > >Do you know how to use the Perl Debugger? Aaaargggg.... >Three possibilities: > >1. There is something about this thread that I am missing. > >2. The above question contains a typo. It is a typo. Please believe me... =) Thank you for pointing out. >3. The above question contains a blasphemy. I meant to say Python Debugger, honestly. I am a former Perl user, true, but I am a true believer now. =) My excuse is that I am somewhat tired, and very preoccupied right now. Big things afoot. =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From geoff@gnaa.net Fri Nov 19 23:34:44 1999 From: geoff@gnaa.net (geoff nordli) Date: Fri, 19 Nov 1999 15:34:44 -0800 Subject: [Zope-dev] creating trees with squishdot Message-ID: <003601bf32e6$a9b5e400$0101a8c0@highwayi.com> Hopefully someone can give me a hand. I would like to create a tree structure based on subjects in a squishdot site. I have some code that looks like this: which creates a tree based on articles (only the article id), and the comments--not what I am looking for. this will create a tree with the same number of subjects that I have, but all named "KnowIT". I guess it is a little bit closer, but not close enough. Can someone help me fill in the blanks. thanks, geoff nordli From faassen@vet.uu.nl Sat Nov 20 00:49:15 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sat, 20 Nov 1999 01:49:15 +0100 Subject: [Zope-dev] Re: [Zope] Rules Based Applications In-Reply-To: References: Message-ID: <19991120014915.A7882@vet.uu.nl> Jerry.Spicklemire@IFLYATA.COM wrote: > Hi Zope Fans, > > I've been searching the Web for references to > Rules Based Programming with Python, and Zope. > Not much so far. > > Anybody else out there interested in this topic? I am. Interesting direction you're looking in. Looking at logic programming might be a good idea; I recall a thread on comp.lang.python a while back on Python/prolog interfacing; that may contain some good references. There might also be something in the (new) Vaults of Parnassus: http://www.vex.net/~x/parnassus/ Hm, nothing obvious in the vaults besides the strout.net reference. I shall do some thinking on this. Keep us posted. I've moved this thread to zope-dev, by the way, or we'll have Paul onto us. :) Regards, Martijn From alex@gabuzomeu.net Sat Nov 20 17:23:15 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Sat, 20 Nov 1999 18:23:15 +0100 Subject: [Zope-dev] Keyword Indexes in ZCatalogs Message-ID: <4.2.0.58.19991120181127.00aae100@192.168.0.2> Hello, Could someone explain how to use Keyword Indexes in ZCatalogs? In a ZCatalog, we now have 3 index types: Text Index, Field Indexes and Keyword Indexes. Here is the information I have found so far about the Keyword type: "Keyword Indexes index a sequence of objects that act as 'keywords' for an object. A Keyword Index will return any objects that have one or more keywords specified in a search query." (source: Indexes tab of a Zcatalog) "Keyword Index: Subclasses all of the field index behavior, except that property values are treated as a sequence of keywords." (source: posting on a Zope list) Could someone provide an implementation example? Thanks. Alexandre From cmille9@hotmail.com Sat Nov 20 18:48:09 1999 From: cmille9@hotmail.com (Clayton Miller) Date: Sat, 20 Nov 1999 13:48:09 -0500 Subject: [Zope-dev] SQLSession help needed! Message-ID: <3836ECE8.C9EC2FC6@hotmail.com> I have posted this message on the Zope maillist but I did not get a good answer. So I decided maybe some real Geeks hang out here instead. I am having trouble getting the SESSION.set(...) to work. Here is the code I am using. -----code starts here -------- ZipCode = Distance = -----code ends here ------- Here is the error I am getting: ! Temporarily Unavailable The resource you requested is temporarily unavailable - please try again later. (116) unable to connect, fd=5 If I out the SESSSION.sets on down. I do see the values of Zipcode and Distance working correctly. I am connecting to a Postgresql database. Zope/Apache/Postgresql are all running on my Linux box. I have created the Sessions and Session_data tables as prescribed. I have included a in my standard_header_html file. Just to see if the code was working at all, I modified the SQLSession.py:__init__ routine to put the sessionName into the Session_data table. I can see this information just fine using a command. This shows one key called session (this is the name I gave it in __init__) and the value of sessionName (the value I assigned). This is the type of error I have received plenty of times when the SQL statement was incorrect somehow. Just how do you debug this error? I looked at standard_error_html and I do not see this error text. How do you find out which object /line is causing the problem? Thank you for the help. Clayton. From bill.anderson@libc.org Sat Nov 20 20:52:07 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Sat, 20 Nov 1999 13:52:07 -0700 Subject: [Zope-dev] SQLSession help needed! References: <3836ECE8.C9EC2FC6@hotmail.com> Message-ID: <383709F7.7ECA5FF5@libc.org> Clayton Miller wrote: > > I have posted this message on the Zope maillist but I did not get a good > answer. So I decided maybe some real Geeks hang out here instead. I am > having trouble getting the SESSION.set(...) to work. > Here is the code I am using. > > > -----code starts here -------- > ZipCode = > Distance = > > > > > > > -----code ends here ------- > Does this page include ? If not, this may be part of the problem. -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From cmille9@hotmail.com Sat Nov 20 23:24:40 1999 From: cmille9@hotmail.com (Clayton Miller) Date: Sat, 20 Nov 1999 23:24:40 GMT Subject: [Zope-dev] SQLSession help needed! Message-ID: <19991120232441.32255.qmail@hotmail.com> Bill: Thanks, but yes this page includes both the standard_header_html and standard_footer_html documents. I did forget to include this information in my source code listing, sorry :^(. Clayton. >From: Bill Anderson >To: Clayton Miller >CC: zope-dev@zope.org >Subject: Re: [Zope-dev] SQLSession help needed! >Date: Sat, 20 Nov 1999 13:52:07 -0700 > >Clayton Miller wrote: > > > > I have posted this message on the Zope maillist but I did not get a good > > answer. So I decided maybe some real Geeks hang out here instead. I am > > having trouble getting the SESSION.set(...) to work. > > Here is the code I am using. > > > > > > -----code starts here -------- > > ZipCode = > > Distance = > > > > > > > > > > > > > > -----code ends here ------- > > > > >Does this page include ? >If not, this may be part of the problem. > > >-- >"They laughed at Columbus, they laughed at Fulton, they laughed at the >Wright brothers. But they also laughed at Bozo the Clown." -- Carl >Sagan ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com From zen@cs.rmit.edu.au Sun Nov 21 00:56:04 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Sun, 21 Nov 1999 11:56:04 +1100 (EST) Subject: [Zope-dev] Keyword Indexes in ZCatalogs In-Reply-To: <4.2.0.58.19991120181127.00aae100@192.168.0.2> Message-ID: On Sat, 20 Nov 1999, Alexandre Ratti wrote: > Could someone explain how to use Keyword Indexes in ZCatalogs? In a > ZCatalog, we now have 3 index types: Text Index, Field Indexes and Keyword > Indexes. > > Here is the information I have found so far about the Keyword type: > > "Keyword Indexes index a sequence of objects that act as 'keywords' for an > object. A Keyword Index will return any objects that have one or more > keywords specified in a search query." > (source: Indexes tab of a Zcatalog) > > "Keyword Index: Subclasses all of the field index behavior, except that > property values are treated as a sequence of keywords." > (source: posting on a Zope list) > > Could someone provide an implementation example? I have a ZClass with a 'lines' type property (a list) called course_logs If I then search using: This returns all catalog entrys which contain 'Feedback' as one of the course_logs elements. This is essential for building many-many relationships. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From benno@sesgroup.net Sun Nov 21 01:20:47 1999 From: benno@sesgroup.net (Ben Leslie) Date: Sun, 21 Nov 1999 12:20:47 +1100 Subject: [Zope-dev] A few modifications to the tree tag In-Reply-To: <199911181240.XAA12474@mbuna.arbhome.com.au>; from anthony@interlink.com.au on Thu, Nov 18, 1999 at 11:40:48PM +1100 References: <199911181240.XAA12474@mbuna.arbhome.com.au> Message-ID: <19991121122047.D22067@sesgroup.net> Hi Anthony! On Thu, 18 Nov 1999, Anthony Baxter wrote: > > >>> Hannu Krosing wrote > > BTW, Is SQLSession usable on Gadfly (and is gadfly thread-safe) ? > > Is gadfly a good place for storing sessions ? > > In _theory_, yes. In practice, gadfly's parser barfs on strings with > embedded newlines. Since by default Sessions store the data as base64, > this breaks if the objects encode to more than a line. > > I plan to allow a choice of encoding as base64 or using zopes var:type > format - I'd hoped to get this into 0.2, but it's not working yet, so > it will be in 0.3. > > > > The second point, would a patch to allow a 'prefix' for the tree-[ecs] > > > options be a useful thing? That way you can have multiple trees on the > > > same page. So if prefix=foobar, the cookies/form values would be of the > > > type 'foobartree-e' &c. > > Thats exactly what I have been thinking. > > cool - I'll send a patch tomorrow. > > > > Third point: is it worth allowing the tree icons +/- to be overridden? > > > I thought I remembered someone had done this, but I can't remember it > > > for sure, and I can't find it in my zope archives... > > MartijnP's response (he did it, but can't find it now) suggests that I need > to implement it myself. Since I need it for a system that's going live in > the next week or so, expect a patch in the not too distant future. :) I reported this to the collector about a week ago and supplied a patch. Don't know exactly what happened to it after that though. Benno From Anthony Baxter Sun Nov 21 05:08:58 1999 From: Anthony Baxter (Anthony Baxter) Date: Sun, 21 Nov 1999 16:08:58 +1100 Subject: [Zope-dev] SQLSession help needed! In-Reply-To: Message from Clayton Miller of "Sat, 20 Nov 1999 13:48:09 CDT." <3836ECE8.C9EC2FC6@hotmail.com> Message-ID: <199911210508.QAA00761@mbuna.arbhome.com.au> >>> Clayton Miller wrote > I have posted this message on the Zope maillist but I did not get a good > answer. So I decided maybe some real Geeks hang out here instead. I am > having trouble getting the SESSION.set(...) to work. > Here is the code I am using. > > > -----code starts here -------- > ZipCode = > Distance = > > > > > > > -----code ends here ------- > > > Here is the error I am getting: > ! > > Temporarily Unavailable > > The resource you requested is temporarily unavailable - > > please try again later. > > (116) unable to connect, fd=5 This isn't an SQLSession error. I've never seen this at all. Hm - I wonder if it's breaking the postgres adaptor in some way... Can you do a 'test' of the various SQL methods inside the SQLSession? Do they work? Can anyone who uses Postgres confirm whether or not strings in an insert can contain newlines? e.g.: will the following work? create table foobar ( ch varchar(200) ) insert into foobar ( ch ) values ( 'this is a long string' ) If not, it's possible that this is the problem. Gadfly has a similar issue. I have an idea on how to fix this, I'll whack it in the code and upload a new version shortly. > This is the type of error I have received plenty of times when the SQL > statement was incorrect somehow. Just how do you debug this error? I > looked at standard_error_html and I do not see this error text. How do > you find out which object /line is causing the problem? It sounds like the PostgreSQL DA is a little bad in it's handling of errors - the Oracle, Sybase and Gadfly DAs all produce a decent error message. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From srichter@cbu.edu Sun Nov 21 05:50:44 1999 From: srichter@cbu.edu (Stephan Richter) Date: Sat, 20 Nov 1999 23:50:44 -0600 Subject: [Zope-dev] User authentication using UserDB Message-ID: <99112023545100.01323@einstein> hello everyone, I just learned how to use UserDB to have a login on my page. Okay, I got to the point where I can login and the AUTHENTICATED_USER is set to my new username. But now how can I use this login and the Zope security features to actually shut off sections of my site. Basically I want to make certain directories only available to the logged in user. Note: I also created a new role. All users that are authenticated and have this role can see a certain directory. Is it right that I have to use the "Security" tab? What do I have to do? regards, stephan -- Stephan Richter iXL - Software Designer and Engineer CBU - Physics, Computer Science and Chemistry Student From Jeff Rush" On Sun, 21 Nov 1999 16:08:58 +1100, Anthony Baxter wrote: >>>> Clayton Miller wrote >> Here is the error I am getting: >> >> Temporarily Unavailable >> The resource you requested is temporarily unavailable - >> >> please try again later. >> >> (116) unable to connect, fd=5 > >This isn't an SQLSession error. I've never seen this at all. It comes from the pcgi-wrapper program. It means he could not establish a connection to ZServer, and contains no further information. The fd=5 part is just the handle of the sock that pcgi-wrapper was using and is of no use to you. >> This is the type of error I have received plenty of times when the SQL >> statement was incorrect somehow. Just how do you debug this error? I >> looked at standard_error_html and I do not see this error text. How do >> you find out which object /line is causing the problem? Interesting... you see this on any SQL statement error? Re how to debug, the only way is to consult any logfiles and/or core files Zope produces. >It sounds like the PostgreSQL DA is a little bad in it's handling of >errors - the Oracle, Sybase and Gadfly DAs all produce a decent error >message. Perhaps, but Zope should not crash/become incommunicative when a DA goes wierd. __________________________________________________ Jeff Rush Tau Productions Inc. Linux/Python/Zope Consultant http://www.taupro.com From Anthony Baxter Sun Nov 21 07:21:28 1999 From: Anthony Baxter (Anthony Baxter) Date: Sun, 21 Nov 1999 18:21:28 +1100 Subject: [Zope-dev] SQLSession help needed! In-Reply-To: Message from "Jeff Rush" of "Sun, 21 Nov 1999 00:14:30 CDT." <199911210614.AAA21518@rampart.timecastle.net> Message-ID: <199911210721.SAA01391@mbuna.arbhome.com.au> >>> "Jeff Rush" wrote > >It sounds like the PostgreSQL DA is a little bad in it's handling of > >errors - the Oracle, Sybase and Gadfly DAs all produce a decent error > >message. > > Perhaps, but Zope should not crash/become incommunicative when > a DA goes wierd. well yes, but then, DCOracle shouldn't make Zope crash when you give it an incorrect connection string, either :) Anthony From Anthony Baxter Sun Nov 21 07:42:37 1999 From: Anthony Baxter (Anthony Baxter) Date: Sun, 21 Nov 1999 18:42:37 +1100 Subject: [Zope-dev] User authentication using UserDB In-Reply-To: Message from Stephan Richter of "Sat, 20 Nov 1999 23:50:44 MDT." <99112023545100.01323@einstein> Message-ID: <199911210742.SAA01521@mbuna.arbhome.com.au> >>> Stephan Richter wrote > But now how can I use this login and the Zope security features to actually > shut off sections of my site. Basically I want to make certain directories > only available to the logged in user. Note: I also created a new role. All > users that are authenticated and have this role can see a certain directory. > Is it right that I have to use the "Security" tab? What do I have to do? Yep - you should go to the security tab for the folder(s) that are accessible only to auth'd users, and for each of 'view', 'access contents' and whatever else you want to shutoff: uncheck the 'acquire permission settings' box make sure 'anonymous' doesn't have the box checked check the box for your new role Anthony From Anthony Baxter Sun Nov 21 07:46:10 1999 From: Anthony Baxter (Anthony Baxter) Date: Sun, 21 Nov 1999 18:46:10 +1100 Subject: [Zope-dev] A few modifications to the tree tag In-Reply-To: Message from Martijn Pieters of "Thu, 18 Nov 1999 13:40:47 BST." <4.2.0.58.19991118133722.00a363e0@lisp.atmm.nl> Message-ID: <199911210746.SAA01548@mbuna.arbhome.com.au> >>> Martijn Pieters wrote > [altering tree tags to allow different images] > > They are in the Collector...: > http://classic.zope.org:8080/Collector/374/view > and > http://classic.zope.org:8080/Collector/375/view blah. can't access the collector items. Was there a reason given to the previous request to allow general folks access to collector items that are pending? From using mozilla and bugzilla, having publically accessible bug reports is a good, good, thing. It allows you to track changes and fixes much more easily... From anthony@interlink.com.au Sun Nov 21 10:41:46 1999 From: anthony@interlink.com.au (Anthony Baxter) Date: Sun, 21 Nov 1999 21:41:46 +1100 Subject: [Zope-dev] draft how-to on local roles and the owner role. Message-ID: <199911211041.VAA01962@mbuna.arbhome.com.au> I've just started a how-to on local roles and the owner role at http://www.zope.org/Members/anthony/owner_role/ The information is just collected from some posts by Brian Lloyd to the zope list, but hopefully will be easier to find as a how-to. Comments to me - I'll have another bash at it tomorrow, then add it to the catalog. Anthony From itamars@ibm.net Sun Nov 21 13:41:25 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Sun, 21 Nov 1999 15:41:25 +0200 Subject: [Zope-dev] Creating Python base class for ZClasses Message-ID: <3837F685.542E64A2@ibm.net> I want to create a Python base class that inherits from the ObjectManager ZClass, since I want to have it automatically add the "Subobjects" tab in the ZClass management screen. Inheriting from OFS.ObjectManager.ObjectManager does not do this - I need to inherit from ZClasses.ObjectManager.ObjectManager. Would the appropiate way to do this be: class MyObjectManager(ZClasses.ObjectManager.ObjectManager): " .... " class ZMyObjectManager: """Mix-in for Object Management """ _zclass_=myObjectManager propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets() manage_options=( {'label': 'Subobjects', 'action' :'propertysheets/subobjects/manage'}, ) and then register ZMyObjectManager as a base class in __init__.py? Or should I do: class MyObjectManager(ZClasses.ObjectManager.ObjectManager): propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets() manage_options=( {'label': 'Subobjects', 'action' :'propertysheets/subobjects/manage'}, ) and register that as the base class? -- Itamar S.T. itamars@ibm.net From fohrman@mediaone.net Sun Nov 21 14:07:19 1999 From: fohrman@mediaone.net (John Fohrman) Date: Sun, 21 Nov 1999 09:07:19 -0500 Subject: [Zope-dev] DTML question Message-ID: Hi Everyone -- I'd greatly appreciate any help. Question by example: if I have a form: which calls "showme" it returns jim@whereever.com bob@wherever.com but how would I return: Jim jim@whereever.com Bob bob@whereever.com Thanks! -- John From alex@gabuzomeu.net Sun Nov 21 13:58:29 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Sun, 21 Nov 1999 14:58:29 +0100 Subject: [Zope-dev] getPropertyType returns None in ZClass Message-ID: <4.2.0.58.19991121130131.00aba100@192.168.0.2> Hello, I tried to list all properties in a ZClass instance and check their types. I used the following code (within the ZClass; 'infos' is a custom propertysheet name):

  • - - This is the result: title - string - 1 description - None - 0 adresse - None - 0 modele_lien - None - 0 lien - None - 0 The property names are available but all properties except built-in 'title' are described as missing (though they do store data I can retrieve and display). This doesn't happen when I run the same code on a standard object type outside a Zclass. Also, the propertyMap() method returns the correct info. Eg.:
    returns {'id': 'title', 'type': 'string', 'meta': {}, 'mode': 'w'} {'id': 'description', 'type': 'text', 'meta': {}, 'mode': 'w'} {'id': 'adresse', 'type': 'string', 'meta': {}, 'mode': 'w'} {'id': 'modele_lien', 'type': 'string', 'meta': {}, 'mode': 'w'} {'id': 'lien', 'type': 'string', 'meta': {}, 'mode': 'w'} What did I missed? Thanks. Alexandre From benno@sesgroup.net Sun Nov 21 14:13:55 1999 From: benno@sesgroup.net (Ben Leslie) Date: Mon, 22 Nov 1999 01:13:55 +1100 Subject: [Zope-dev] ANN: NotMail v0.2.0 alpha Available Message-ID: <19991122011355.B31417@sesgroup.net> Hi everyone, After much playing around I finally have a NotMail release. This is still very much alpha but will give those who are game a chance to have a look at it, find some bugs, make some patches and give me any further suggestions for the future of NotMail. My main concern at the moment is to get this release stable and before working on extra features so this is where my priority is at the moment. I have tested this on UW Imap and Exchange servers. Please read the about document for more detailed information. Breifly features are: View MIME message Send attachments Manage messages and folders Use a readonly addressbook (readwrite soon) There are still some rough edges which I would have liked to clean up before releasing but I have exams in the follwoing week so I thought getting something out would be better than getting nothing out. Please send any bug reports to benno@sesgroup.net Cheers, Ben Leslie From benno@sesgroup.net Sun Nov 21 14:17:53 1999 From: benno@sesgroup.net (Ben Leslie) Date: Mon, 22 Nov 1999 01:17:53 +1100 Subject: [Zope-dev] ANN: NotMail v0.2.0 alpha Available In-Reply-To: <19991122011355.B31417@sesgroup.net>; from benno@sesgroup.net on Mon, Nov 22, 1999 at 01:13:55AM +1100 References: <19991122011355.B31417@sesgroup.net> Message-ID: <19991122011753.C31417@sesgroup.net> I guess a URL would have helped. http://www.zope.org/Members/Benno/NotMail2 Cheers, Benno > Hi everyone, > > After much playing around I finally have a NotMail release. This is still > very much alpha but will give those who are game a chance to have a look at > it, find some bugs, make some patches and give me any further suggestions > for the future of NotMail. > > My main concern at the moment is to get this release stable and before > working on extra features so this is where my priority is at the moment. > > I have tested this on UW Imap and Exchange servers. Please read the about > document for more detailed information. > > Breifly features are: > > View MIME message > Send attachments > Manage messages and folders > Use a readonly addressbook (readwrite soon) > > > There are still some rough edges which I would have liked to clean up before > releasing but I have exams in the follwoing week so I thought getting something > out would be better than getting nothing out. > > > Please send any bug reports to benno@sesgroup.net > > Cheers, > > Ben Leslie > From circle@gwi.net Sun Nov 21 14:27:59 1999 From: circle@gwi.net (Andrew Wilcox) Date: Sun, 21 Nov 1999 09:27:59 -0500 Subject: [Zope-dev] Is _getOb() best way to grab a ref to a particular object? Message-ID: <3.0.6.32.19991121092759.0080b370@mail.gwi.net> I need to grab a reference to a particular object in the ZODB from an external method, bypassing acquisition. Is this the right way to do it: def test(self, REQUEST=None): """doc string""" myobj = REQUEST.PARENTS[-1].aTopLevelFolder.anotherFolder._getOb('id_of_myobj') ...do stuff with myobj: myobj.title, myobj.index_html, myobj.property = 123 ... From alex@gabuzomeu.net Sun Nov 21 20:37:43 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Sun, 21 Nov 1999 21:37:43 +0100 Subject: [Zope-dev] Keyword Indexes in ZCatalogs In-Reply-To: References: <4.2.0.58.19991120181127.00aae100@192.168.0.2> Message-ID: <4.2.0.58.19991121201746.00ab5620@192.168.0.2> Hello, Thanks for this information. I tested Keyword indexes in a simple keyword search form for ZClass documents. It works beautifully. I'll summarize it in a mini-howto. Cheers. Alexandre At 11:56 21/11/1999 +1100, Stuart 'Zen' Bishop wrote: > > Could someone explain how to use Keyword Indexes in ZCatalogs? In a > > ZCatalog, we now have 3 index types: Text Index, Field Indexes and Keyword > > Indexes. (snip) >I have a ZClass with a 'lines' type property (a list) called course_logs > >If I then search using: > >This returns all catalog entrys which contain 'Feedback' as one >of the course_logs elements. This is essential for building many-many >relationships. > >-- > ___ > // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au > // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au > //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From johanc@torped.se Sun Nov 21 21:20:21 1999 From: johanc@torped.se (Johan Carlsson) Date: Sun, 21 Nov 1999 22:20:21 +0100 Subject: [Zope-dev] DTML question In-Reply-To: Message-ID: <000801bf3466$37d863e0$ac0aa8c0@tor.torped.se> Hi John, You can use the :record type conversion keyword to tell Zope how to interpet multiple form entries as a list of records. Look in the FormVariableTypes HOWTO how to do it: http://www.zope.org/Members/Zen/howto/FormVariableTypes Regards, Johan Carlsson > > Hi Everyone -- > > I'd greatly appreciate any help. Question by example: if I have a form: > > > > value=jim@whereever.com> > value=bob@whereever.com> > > > > > > which calls "showme" > > > > > > > > it returns > > > jim@whereever.com > bob@wherever.com > > but how would I return: > > Jim jim@whereever.com > Bob bob@whereever.com > > Thanks! > -- John > > > > > _______________________________________________ > 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 ) > From jfarr@real.com Sun Nov 21 22:54:22 1999 From: jfarr@real.com (Jonothan Farr) Date: Sun, 21 Nov 1999 14:54:22 -0800 Subject: [Zope-dev] getPropertyType returns None in ZClass References: <4.2.0.58.19991121130131.00aba100@192.168.0.2> Message-ID: <02f001bf3473$5a444450$eb0217ac@dev.prognet.com> > I tried to list all properties in a ZClass instance and check their types. > I used the following code (within the ZClass; 'infos' is a custom > propertysheet name): > > >
  • - > - > > > > > This is the result: > > title - string - 1 > description - None - 0 > adresse - None - 0 > modele_lien - None - 0 > lien - None - 0 It looks like you need to call "propertysheets.infos.getPropertyType(...)" and "propertysheets.infos.hasProperty(...)". --jfarr From tseaver@palladion.com Mon Nov 22 01:58:22 1999 From: tseaver@palladion.com (Tres Seaver) Date: Sun, 21 Nov 1999 19:58:22 -0600 Subject: [Zope-dev] Writing custom folderish products Message-ID: <3838A33E.89048912@palladion.com> Martijn Pieters wrote: > Going through the source I found some stuff involving all_meta_types, > meta_types and lots of magic code (to me) that seems to make products > addable to folders. Zope's sources could use some documenting though. > I am assuming there is a clean mechanism to say: 'these products can > only be added to this ObjectManagerish product, and nowhere else'. > Could a real Zope Guru speak up now? Heh, I hate to tell you this, Martijn, but to almost everyone reading this, YOU are one of the "real Zope Gurus". I think your Zope Zen level is at least three koans higher than mine. :) -- ========================================================= Tres Seaver tseaver@palladion.com 713-523-6582 Palladion Software http://www.palladion.com From zen@cs.rmit.edu.au Mon Nov 22 08:20:41 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Mon, 22 Nov 1999 19:20:41 +1100 (EST) Subject: [Zope-dev] New beta GenericUserFolder Message-ID: I've uploaded a new beta of GUF , which I've fixed the outstanding authentication issues. This has (hopefully temporary) introduced a new limitation where things will stuff up if you create a GUF (using cookie authentication) inside an area already protected with cookie authentcation. I'm fairly certain this problem is also in most other acl_users inplementations that use cookie authentication methods. Now for something wierd: I have a Zope installation that looks like the following: [Root] +- acl_users (UserFolder) +- CS +- acl_users (GenericUserFolder) +- Zen (Protected - just user 'zen' has permissions to it) +- index_html Now - its all working just fine in most situations. Now, I can happily access the URL http://myserver:8080/CS/Zen - login screen pops up, I enter username & password, and I get my index_html page. I can then also go to http://myserver:8080/CS/Zen/manage and see the management screen just dandy. In this case, the manage method populates the left and right frames with the following URL's: http://myserver:8080/CS/Zen/manage_menu http://myserver:8080/CS/Zen/manage_workspace The title is: Zen on http://wombat:8080/Test2/CS/Zen However, If I fire up the browser and go directly to http://myserver:8080/CS/Zen/manage, things start screwing up. I get the authentication screen, enter username & password, ok, and then the manage panes pop up but authentication to these protected resources never happens. The manage method is populating the left and right frames with the following URL's: http://myserver:8080/manage_menu http://myserver:8080/manage_workspace The title is: Zen on http://myserver:8080 If you click 'cancel' on the BasicUser authentication dialog box that has popped up, you will end up with unauthentated tracebacks in both panes. However, sharp eyes will notice that the 'back' button is now available on your brower, which is strange since this is the first page we have visited. Clicking 'Back' brings you to a fully functional, correctly authentication management screen. Wierd - something must be sending a dodgy redirect. Which is odd, since it isn't my code as far as I'm aware. I'm at a loss to why this would be happening. Why should the manage method return differently depending on if the browser has previously visited a protected page or not? I can duplicate this on both 2.0.1 and 2.1beta2. I can't duplicate in an area not protected by a GUF, so I assume it is something wrong in my code. Since I don't actually *have* manage, manage_main or manage_menu functions (I'm inheriting from Folder), I'll further assume it is something I've left out that shouldn't have been. Any hints? My forehead hurts. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From itamars@ibm.net Mon Nov 22 10:00:12 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Mon, 22 Nov 1999 12:00:12 +0200 Subject: [Zope-dev] Python base classes again (and now I'm really stuck) Message-ID: <3839142C.A1EE50C9@ibm.net> I want to create a Python base class that inherits from the ObjectManager and has the "Subobjects" tab in the ZClass management screen. Inheriting from OFS.ObjectManager.ObjectManager does not do this - I need to inherit from ZClasses.ObjectManager.ObjectManager. I still don't know how to have the Subobjects propertysheet thing work. I've tried the two ways I listed in my last email of doing this, but I can't get it to work. One way was: class MyObjectManager(ZClasses.ObjectManager.ObjectManager): " .... " class ZMyObjectManager: """Mix-in for Object Management """ _zclass_=myObjectManager propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets() manage_options=( {'label': 'Subobjects', 'action' :'propertysheets/subobjects/manage'}, ) and then register ZMyObjectManager as a base class in __init__.py. The other way was: class MyObjectManager(ZClasses.ObjectManager.ObjectManager): propertysheets=ZClasses.ObjectManager.ZObjectManagerPropertySheets() manage_options=( {'label': 'Subobjects', 'action' :'propertysheets/subobjects/manage'}, ) and register that as the base class. Neither of them work. -- Itamar S.T. itamars@ibm.net From itamars@ibm.net Mon Nov 22 10:45:57 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Mon, 22 Nov 1999 12:45:57 +0200 Subject: [Zope-dev] FYI: A possible bug in manage_pasteObjects (submitted to the Collector) Message-ID: <38391EE5.E1101391@ibm.net> It looks like manage_afterClone should be called with the original object passed to the function, but in fact manage_pasteObjects passes the cloned object, which is rather pointless. -------- Original Message -------- Date: Mon, 22 Nov 1999 12:22:05 +0200 (IST) From: Noa Harvey In lib/OFS/CopySupport.py In the function manage_pasteObjects the following line appears: ob=ob._getCopy(self) ob.manage_afterClone(ob) Passing ob as an argument doesn't make sense because the function is being called on ob, (so self is already ob) it would make more sense to to something along the lines of: original_ob=ob ob=ob._getCopy(self) ob.manage_afterClone(original_ob) That way REQUEST and other useful information will be available when overriding manage_afterClone. From gabor.melis@essnet.se Mon Nov 22 10:51:09 1999 From: gabor.melis@essnet.se (Gabor Melis) Date: Mon, 22 Nov 1999 12:51:09 +0200 Subject: [Zope-dev] An even smaller XMLDocument patch Message-ID: This message is in MIME format --_=XFMail.1.3.p0.Linux:991122115109:21351=_ Content-Type: text/plain; charset=us-ascii Hi gents, I took the easy way out (my problem was posted a few days ago) and avoiding confrontation with ISO-8859-* encodings I just told the browser to use utf-8. It was done to documentEdit.dtml and elementEdit.dtml and to all my pages with xml input or output in them. Of course it means that one must encode pages with XML stuff in them in utf-8. For the management pages it is OK since they contain only ASCII stuff. For your pages though ... Still, I think it is justifiable and probably right. Gabor --_=XFMail.1.3.p0.Linux:991122115109:21351=_ Content-Disposition: attachment; filename="patch2" Content-Transfer-Encoding: base64 Content-Description: patch2 Content-Type: application/octet-stream; name=patch2; SizeOnDisk=640 ZGlmZiAtdSBYTUxEb2N1bWVudC5wMS9kb2N1bWVudEVkaXQuZHRtbCBYTUxEb2N1bWVudC9kb2N1 bWVudEVkaXQuZHRtbAotLS0gWE1MRG9jdW1lbnQucDEvZG9jdW1lbnRFZGl0LmR0bWwJRnJpIE5v diAxOSAxOToyNToyOSAxOTk5CisrKyBYTUxEb2N1bWVudC9kb2N1bWVudEVkaXQuZHRtbAlNb24g Tm92IDIyIDExOjMzOjE3IDE5OTkKQEAgLTEsMyArMSw0IEBACis8ZHRtbC1jYWxsICJSRVNQT05T RS5zZXRIZWFkZXIoJ2NvbnRlbnQtdHlwZScsJ3RleHQvaHRtbDsgY2hhcnNldD11dGYtOCcpIj4K IDxIVE1MPgogPEhFQUQ+CiA8VElUTEU+RWRpdDwvVElUTEU+CmRpZmYgLXUgWE1MRG9jdW1lbnQu cDEvZWxlbWVudEVkaXQuZHRtbCBYTUxEb2N1bWVudC9lbGVtZW50RWRpdC5kdG1sCi0tLSBYTUxE b2N1bWVudC5wMS9lbGVtZW50RWRpdC5kdG1sCUZyaSBOb3YgMTkgMTk6MjU6MjkgMTk5OQorKysg WE1MRG9jdW1lbnQvZWxlbWVudEVkaXQuZHRtbAlNb24gTm92IDIyIDExOjMzOjE3IDE5OTkKQEAg LTEsMyArMSw0IEBACis8ZHRtbC1jYWxsICJSRVNQT05TRS5zZXRIZWFkZXIoJ2NvbnRlbnQtdHlw ZScsJ3RleHQvaHRtbDsgY2hhcnNldD11dGYtOCcpIj4KIDxIVE1MPgogPEhFQUQ+CiA8VElUTEU+ RWRpdDwvVElUTEU+Cg== --_=XFMail.1.3.p0.Linux:991122115109:21351=_-- End of MIME message From mj@antraciet.nl Mon Nov 22 12:24:07 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 22 Nov 1999 13:24:07 +0100 Subject: [Zope-dev] Writing custom folderish products In-Reply-To: <3838A33E.89048912@palladion.com> Message-ID: <4.2.2.19991122132206.02750410@212.48.38.34> At 02:58 22-11-99 , Tres Seaver wrote: >Martijn Pieters wrote: > > > Going through the source I found some stuff involving all_meta_types, > > meta_types and lots of magic code (to me) that seems to make products > > addable to folders. Zope's sources could use some documenting though. > > I am assuming there is a clean mechanism to say: 'these products can > > only be added to this ObjectManagerish product, and nowhere else'. > > Could a real Zope Guru speak up now? > >Heh, I hate to tell you this, Martijn, but to almost everyone reading >this, YOU >are one of the "real Zope Gurus". I think your Zope Zen level is at least >three >koans higher than mine. :) Thank you for the compliment Tres, but that was not me, but Martijn Faassen, also known as The Other Martijn (tm, we both claim this title). =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From bill.anderson@libc.org Mon Nov 22 12:48:24 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Mon, 22 Nov 1999 05:48:24 -0700 Subject: [Zope-dev] Problem with attributes and/or aquisition? Message-ID: <38393B98.5EE53382@libc.org> OK, in a dtml-in iteration of PARENTS[-1], I have the following code: ... ...do stuff with RXML and tables ... And In my root folder, I have anumber of folders, some with SiteMenu, some without. Problem: None of the folders appear in my menulist. If I negate the condition (), all my folders show up. I can't use because this will be called from within a folder (sometimes) that has that property set. I don't recall having this problem before .. but it has been a long night/morning. Anyone know what the heck I am missing (Besides several hours of needed sleep)? IIRC -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From mj@antraciet.nl Mon Nov 22 13:33:36 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 22 Nov 1999 14:33:36 +0100 Subject: [Zope-dev] Problem with attributes and/or aquisition? In-Reply-To: <38393B98.5EE53382@libc.org> Message-ID: <4.2.2.19991122143223.027e6640@212.48.38.34> At 13:48 22-11-99 , Bill Anderson wrote: >OK, in a dtml-in iteration of PARENTS[-1], I have the following code: >... > > > > > ...do stuff with RXML and tables ... Make that: at least (no single quotes around _[id]). -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From jim@digicool.com Mon Nov 22 14:07:46 1999 From: jim@digicool.com (Jim Fulton) Date: Mon, 22 Nov 1999 09:07:46 -0500 Subject: [Zope-dev] Overriding __getattr__ for requests only. References: Message-ID: <38394E32.1D3CD533@digicool.com> "Jeff K. Hoffman" wrote: > > Hello, everyone. > > I am trying to write a new subclass of OFS.Folder (as a python product) to > do the following: When a user requests /myFolder/index_html, myFolder > will search itself, then its list of 'parents', returning the attribute > from one of them if they have it, and raising an AttributeError if not. > > I have had some moderate success by overloading __getattr__ as follows: > > def __getattr__(self, name): > try: > return OFS.Folder.Folder.__getattr__(self, name) > except: > for parent in self.parentList: > try: > return getattr(parent, name) > except AttributeError: > pass > raise AttributeError, name Never override __getattr__ on persistent objects. __getattr__ is already overridden by the persistence machinery and overriding it yourself will cause big problems. You can accomplish the same thing by overriding __getitem__, being careful to include (or call) the base __getitem__ inherited from ObjectManager. When publishing a URL, Zope tries __bobo_traverse__, then __getattr__, then __getitem__. If you *don't* want to acquire, you will also need to mix-in Acquisition.Explicit, before Folder (or ObjectManager). (snip) Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. From Brian@digicool.com Mon Nov 22 14:25:56 1999 From: Brian@digicool.com (Brian Lloyd) Date: Mon, 22 Nov 1999 09:25:56 -0500 Subject: [Zope-dev] Is _getOb() best way to grab a ref to a particular object? Message-ID: <613145F79272D211914B0020AFF6401914DD66@gandalf.digicool.com> > I need to grab a reference to a particular object in the ZODB from an > external method, bypassing acquisition. Is this the right > way to do it: > > def test(self, REQUEST=None): > """doc string""" > myobj = > REQUEST.PARENTS[-1].aTopLevelFolder.anotherFolder._getOb('id_o > f_myobj') > ...do stuff with myobj: myobj.title, myobj.index_html, > myobj.property = 123 ... Maybe, maybe not... _getOb will not return an acquired object, but if the object exists it _will_ be returned as a "wrapped" object so acquisition will be preserved in the result. I'm not clear from your example whether this is what you want. If you want the *resulting* object to be non-acquiring, you'll want to do something like: def test(self, REQUEST=None): """ """ # get object named 'foo' from self, but dont allow it # to be found via acquisition. obj=self._getOb('foo') # while we know that foo is not acquired from above, it # is still wrapped in the context of 'self', so to disable # acquisition we need to unwrap it. non_aquiring_obj=obj.aq_base ... Hope this helps! Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From jim@digicool.com Mon Nov 22 14:16:55 1999 From: jim@digicool.com (Jim Fulton) Date: Mon, 22 Nov 1999 09:16:55 -0500 Subject: [Zope-dev] Overriding __getattr__ for requests only. References: Message-ID: <38395057.85AE7600@digicool.com> "Jeff K. Hoffman" wrote: > > On Fri, 12 Nov 1999, Christopher Petrilli wrote: > > > On 11/12/99 3:57 PM, Jeff K. Hoffman at jkhoffman@carolina.rr.com wrote: > > > > > I am trying to write a new subclass of OFS.Folder (as a python product) to > > > do the following: When a user requests /myFolder/index_html, myFolder > > > will search itself, then its list of 'parents', returning the attribute > > > from one of them if they have it, and raising an AttributeError if not. > > > > Pardon my ignorance, but what exactly does this accomplish that isn't > > accomplished by Acquisition? > > I am trying to build a site as follows: > > --- > / > baseline/ > index_html > content/ > paragraph_a > paragraph_b > images/ > image_a > image_b > variant1/ > content/ > paragraph_a > images/ > image_b > variant2/ > content/ > paragraph_b > images/ > image_a > --- > > Such that navigating to /baseline/index_html shows paragraph_a, > paragraph_b, image_a, and image_b. I also need to be able to navigate to > /baseline/variant1 and see the same index_html, this time referencing the > "overloaded" paragraph_a and image_b. The same for variant2, with > paragraph_b and image_a. > > I have found no obvious way to do this, using acquisition, without > flatting my folder hierarchy out as such: (snip) > This is unacceptable, because there are a LOT of paragraph's and images, > and I want to divide them up logically using folders. Interesting. The organizational approach you've taken defeats acquisition. I'll have to think about this (and decide if I care :). > I am evaluating Zope in the hopes of transitioning one of our major web > assets (which is currently built on top of our proprietary web development > platform, which supports inheritance) to Zope and dropping development on > our platform. I am finding it hard to move from an inheritance based model > to a purely acquisition based model without making major sacrifices in the > design of our site. Zope supports both acquisition and inheritence. Have you looked at ZClasses? ZClasses were introduced specifically to provide inheritence. We didn't provide inheritence originally, because we thought it was beyond "content- managers", which were the target audience of Principia, the predecessor of Zope. We found, however, that alot of people were mis-using acquisition to achieve the effects of inheritence. > Am I stupid? No. :) > Please tell me I'm missing something obvious. I think ZClasses will give you what you want. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. From Brian@digicool.com Mon Nov 22 14:59:40 1999 From: Brian@digicool.com (Brian Lloyd) Date: Mon, 22 Nov 1999 09:59:40 -0500 Subject: [Zope-dev] ZServer FastCGI patch for IRIX (and others?) Message-ID: <613145F79272D211914B0020AFF6401914DD67@gandalf.digicool.com> > Below is a patch to let ZServer's FastCGI support work with > FastCGI client > implementations that don't properly close the STDIN > sub-stream. On the > IRIX/Apache/cgi-fcgi combo used where I work, the client side > doesn't seem > to know when it's done sending STDIN data, and thus the > ZServer side simply > hangs forever waiting for it. The patch below makes ZServer > ignore STDIN > altogether if there is no Content-Length, and also stop > looking for more > STDIN data if Content-Length or more bytes have already been read. Thanks - I've checked this in. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From michel@digicool.com Mon Nov 22 15:03:10 1999 From: michel@digicool.com (Michel Pelletier) Date: Mon, 22 Nov 1999 10:03:10 -0500 Subject: [Zope-dev] Keyword Indexes in ZCatalogs Message-ID: <613145F79272D211914B0020AFF640192762DA@gandalf.digicool.com> > -----Original Message----- > From: Alexandre Ratti [mailto:alex@gabuzomeu.net] > Sent: Sunday, November 21, 1999 3:38 PM > To: zope-dev@zope.org > Cc: zen@cs.rmit.edu.au > Subject: Re: [Zope-dev] Keyword Indexes in ZCatalogs > > > Hello, > > > Thanks for this information. I tested Keyword indexes in a > simple keyword > search form for ZClass documents. It works beautifully. I'll > summarize it > in a mini-howto. Thank you! -Michel From m.faassen@vet.uu.nl Mon Nov 22 15:17:42 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 22 Nov 1999 16:17:42 +0100 Subject: [Zope-dev] Writing custom folderish products References: <4.2.2.19991122132206.02750410@212.48.38.34> Message-ID: <38395E96.6A612CB6@vet.uu.nl> Martijn Pieters wrote: > At 02:58 22-11-99 , Tres Seaver wrote: > >Martijn Pieters wrote: No, *this* was: Martijn Faassen wrote: > > > Going through the source I found some stuff involving all_meta_types, > > > meta_types and lots of magic code (to me) that seems to make products > > > addable to folders. Zope's sources could use some documenting though. > > > I am assuming there is a clean mechanism to say: 'these products can > > > only be added to this ObjectManagerish product, and nowhere else'. > > > Could a real Zope Guru speak up now? > > > >Heh, I hate to tell you this, Martijn, but to almost everyone reading > >this, YOU > >are one of the "real Zope Gurus". I think your Zope Zen level is at least > >three > >koans higher than mine. :) > > Thank you for the compliment Tres, but that was not me, but Martijn > Faassen, also known as The Other Martijn (tm, we both claim this title). =) Right. Now that the Other Martijn is here anyway, could you please help me with my custom folder problem? :) Groeten, Martijn From mj@antraciet.nl Mon Nov 22 15:51:02 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 22 Nov 1999 16:51:02 +0100 Subject: [Zope-dev] Writing custom folderish products In-Reply-To: <38395E96.6A612CB6@vet.uu.nl> References: <4.2.2.19991122132206.02750410@212.48.38.34> Message-ID: <4.2.2.19991122164230.027de950@212.48.38.34> At 16:17 22-11-99 , Martijn Faassen wrote: >Right. Now that the Other Martijn is here anyway, could you please help >me with my custom folder problem? :) You're in luck, I've got a few minutes. =) all_meta_types is used to determine what objects are addable. It simply returns any acquired property _product_meta_types (which is filled with initialized products, I think) and the meta_types proprty. It returns list of dictionaries with 'name' and 'action' entries. lib\python\ZClasses\Property.py for example does what you want like this: meta_types=( Globals.Dictionary(name=ZCommonSheet.meta_type, action='manage_addCommonSheetForm'), ) def all_meta_types(self): return self.meta_types which shows also how to have objects that cannot be added anywhere else. Just don't register them with context.registerClass, only reference their constructor in the dictionary returned by meta_types. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From lalo@webcom.com Mon Nov 22 16:06:27 1999 From: lalo@webcom.com (Lalo Martins) Date: Mon, 22 Nov 1999 14:06:27 -0200 Subject: [Zope-dev] ANN: NotMail v0.2.0 alpha Available In-Reply-To: <19991122011355.B31417@sesgroup.net> References: <19991122011355.B31417@sesgroup.net> Message-ID: <19991122140626.A28122@webcom.com> Ben, I realize your NotMail is still pretty much an alpha, but would you say your IMAPAdapter is stable enought to base other products on it? (I'm thinking of a read-only interface I'd use to make mailing list archives publicly available) []s, |alo +---- -- I am Lalo of deB-org. You will be freed. Resistance is futile. http://www.webcom.com/lalo mailto:lalo@webcom.com pgp key in the web page Debian GNU/Linux --- http://www.debian.org Brazil of Darkness -- http://zope.gf.com.br/BroDar From Joerg Wittenberger Mon Nov 22 16:21:04 1999 From: Joerg Wittenberger (Joerg Wittenberger) Date: Mon, 22 Nov 1999 17:21:04 +0100 (CET) Subject: [Zope-dev] Q: adding products, weird behavior Message-ID: ---- =_NextPart_000_01BE9BCA.1CD36B40 Hello, I'm trying to get a product straight, but I can't find how to add it's objects programatically the right way(tm). As explained somewhere (to make things worse, I can't find where I learned that anymore) I wrote a "manage_addDCDocument" method in my module, which, AFAIK, should be become a Folder method, in the hope I could use it like any other e. g., manage_addFile. When I add such an object via the web, I can actually derive instances of it (even though I've been wondering, which weird operations I have to perform inside the object constructor, to find the correct DestinationURL) but now I tried to use a script derived from load_site.py I see "manage_addDCDocument Not Found" error. The load_site.py adds new objects like this: call(object.manage_addFile, id=name, file='') Where object points to the folder, within which the new File object is to be placed. I couldn't make head or tail of the code surrounding the problem, base on wild guess (actually reading the manage_addXYZFom code of ZClass products) I found the following kludge to work around the problem. It's so terribly ugly... I beg for help: o_kludge = object.__class__(object.url+'/manage_addProduct/docstore', # ==> F***^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ username=object.username, password=object.password) call(o_kludge.manage_addDCDocument, id=name, data='') This o_kludge object shouldn't been needed. What might I have missed? For reference I attach 3 files: __init__.py : the product initialization DCDocument.py : the object class I want to use (mirrors the hirarchy in the file system and provides dublin core meta data in rdf format) docstore.py : command line tool to store and retrieve files. Any help appreciated. /Jerry -- You can have it done fast, you can have it done cheap, and you can have it done well. --- But you can only have two of those at once. ---- =_NextPart_000_01BE9BCA.1CD36B40 Content-Type: text/plain; name="__init__.py" # have fun from Globals import HTMLFile import DCDocument, Feature, User import sys from zLOG import LOG def initialize(context): perm = 'Add DCDocuments' try: context.registerClass( Feature.Feature, permission='Add IBM Features', constructors=[Feature.manage_addFeature], #icon='' ) except: print "%s: %s" % (sys.exc_type, sys.exc_value) print 'scheisse' try: context.registerClass( User.IBMUserFolder, constructors= (User.manage_addUserFolder,), permission='Add Users', #icon='' ) except: print "%s: %s" % (sys.exc_type, sys.exc_value) print 'scheisse' context.registerClass( DCDocument.DCDocument, permission=perm, constructors=(DCDocument.manage_addDCDocumentForm, DCDocument.manage_addDCDocument), #icon='' ) context.registerBaseClass(DCDocument.DCDocument) ---- =_NextPart_000_01BE9BCA.1CD36B40 Content-Type: text/plain; name="DCDocument.py" """ We add documentation here the other day. """ from OFS.Folder import Folder import Globals import ExtensionClass import DocumentTemplate from Globals import HTML, HTMLFile, MessageDialog from DateTime import DateTime import os, string from zLOG import LOG def manage_addDCDocument(self, id, file='', REQUEST=None): """ Create a DCDocument """ if type(file) is not type(''): file=file.read() self._setObject(id, DCDocument(id, data=file, REQUEST=REQUEST)) return self.manage_main(self, REQUEST, update_menu=1) manage_main=HTMLFile('documentEdit', globals()) manage_addDCDocumentForm=HTMLFile('addDCDocumentForm', globals()) # This should be somewhere else! def _dropPathSep(path): if path[-1] == os.sep: return path[:-1] return path the_publisher = 'IBM Deutschland GmbH' the_rights = 'all rights reserved' class DCDocument(Folder): """ jojo """ meta_type = 'DCDocument' description = '' index_html=None # Prevent accidental acquisition _properties=({'id':'title', 'type':'string', 'mode':'w'}, {'id':'creator', 'type':'string', 'mode':'w'}, # The subject should better be 'tokens' type {'id':'subject', 'type':'string', 'mode':'w'}, {'id':'description', 'type':'text', 'mode':'w'}, {'id':'publisher', 'type':'string', 'mode':'w'}, #{'id':'contributor', 'type':'string', 'mode':'w'}, {'id':'date', 'type':'date', 'mode':''}, #{'id':'type', 'type':'string', 'mode':'w'}, #{'id':'format', 'type':'string', 'mode':'w'}, {'id':'identifier', 'type':'string', 'mode':''}, #{'id':'source', 'type':'string', 'mode':'w'}, #{'id':'language', 'type':'string', 'mode':'w'}, #{'id':'relation', 'type':'string', 'mode':'w'}, #{'id':'coverage', 'type':'string', 'mode':'w'}, {'id':'rights', 'type':'string', 'mode':'w'}, ) _dc_properties = _properties def _init_identifier_ininit(self, id, REQUEST): self.id=id self.parents = REQUEST['PARENTS'] self.parents.reverse() self.parents=self.parents[2:-2] psv=map(lambda i: i.id, self.parents) self._setPropValue('identifier', string.join(psv, '/') + '/' + id) def _init_other(self, REQUEST): self._setPropValue('creator', `REQUEST.AUTHENTICATED_USER`) self._setPropValue('date', DateTime().Date()) self._setPropValue('publisher', the_publisher) self._setPropValue('rights', the_rights) self.locked = None self.manage_changeProperties(REQUEST) def __init__(self, id, data=None, REQUEST=None): self._init_identifier_ininit(id, REQUEST) self._init_other(REQUEST) if REQUEST: self.data=REQUEST['data'] else: self.data=data if type(self.data) is not type(''): self.data=self.data.read() self._saveData() self._saveProperties() return '' def __str__(self): return self.data def _SavePath(self, ext='.sgml', base='/tmp'): dirname = os.path.join(base, string.join(map(lambda i: i.id, self.parents), '/')) if not os.path.exists(dirname): os.makedirs(dirname) return os.path.join(dirname, self.id) + ext def _saveData(self, ext='.sgml'): path = self._SavePath(ext=ext) try: f=open(path, 'wb') except: raise f.write(self.__str__()) f.close() def _saveProperties(self, ext='.rdf'): path = self._SavePath(ext=ext) try: f=open(path, 'w') except: raise f.write(self.RDF()) f.close() def get_size(self): return len(self.__str__()) def PrincipiaSearchSource(self): "Support for searching - the document's contents are searched." LOG('Hier', 0, self.data) return self.data _rdf_header= """ """ def RDF(self, REQUEST=None): ' returns the properties as xml ' md=self._rdf_header helpvariable=map(lambda i: i.id, self.parents) md = md + ' \n' for p in self._dc_properties: n = p['id'] try: v = getattr(self, n) except AttributeError: v = None if v and v != '': md=(md + ' ' + DocumentTemplate.DT_Util.html_quote(v) + '\n') md = (md +' ' + self.bobobase_modification_time().Date() + '\n') if REQUEST is not None: REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml') return md+' \n\n' _size_changes={ 'Bigger': (5,5), 'Smaller': (-5,-5), 'Narrower': (0,-5), 'Wider': (0,5), 'Taller': (5,0), 'Shorter': (-5,0), } def _er(self,SUBMIT,dtpref_cols,dtpref_rows,REQUEST): dr,dc = self._size_changes[SUBMIT] rows=max(1,string.atoi(dtpref_rows)+dr) cols=max(40,string.atoi(dtpref_cols)+dc) e=(DateTime('GMT') + 365).rfc822() resp=REQUEST['RESPONSE'] resp.setCookie('dtpref_rows',str(rows),path='/',expires=e) resp.setCookie('dtpref_cols',str(cols),path='/',expires=e) def manage_edit(self, data, SUBMIT='Change',dtpref_cols='50', dtpref_rows='20', REQUEST=None): """ tbc """ if `REQUEST.AUTHENTICATED_USER` == 'Anonymous User': REQUEST.RESPONSE.setStatus(403) return MessageDialog(title="Nicht authorisiert", message="Nicht authorisiert") if `REQUEST.AUTHENTICATED_USER` != self.locked: REQUEST.RESPONSE.setStatus(423) return MessageDialog(title="Object locked", message=(getattr(self, 'identifier') + " ist gelocked durch " + `self.locked`)) if self._size_changes.has_key(SUBMIT): self._er(SUBMIT,dtpref_cols,dtpref_rows,REQUEST) if type(data) is not type(''): data=data.read() self.data=data self._saveData() self.locked=None if REQUEST: REQUEST.RESPONSE.redirect(REQUEST['URL1'] + '/manage_editForm') def manage_getLock(self, REQUEST): " tbc " if `REQUEST.AUTHENTICATED_USER` == 'Anonymous User': REQUEST.RESPONSE.setStatus(403) return MessageDialog(title="Nicht authorisiert", message="Nicht authorisiert") if not hasattr(self, 'locked') or self.locked is None or `REQUEST.AUTHENTICATED_USER` == self.locked: self.locked = `REQUEST.AUTHENTICATED_USER` REQUEST.RESPONSE.redirect(REQUEST['URL1'] + '/manage_editForm') def manage_unLock(self, REQUEST): # " tbc " if `REQUEST.AUTHENTICATED_USER` == 'Anonymous User': REQUEST.RESPONSE.setStatus(403) return MessageDialog(title="Nicht authorisiert", message="Nicht authorisiert") if `REQUEST.AUTHENTICATED_USER` == self.locked: self.locked = None REQUEST.RESPONSE.redirect(REQUEST['URL1'] + '/manage_editForm') def manage_editProperties(self, REQUEST): """ edit the PRoperties and write the copy into the meta file """ Folder.manage_editProperties(self, REQUEST) self._saveProperties() def index_html(self, REQUEST, RESPONSE): """ render the document, i.e., give away the plain text """ if REQUEST: REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml') return self.data manage_editForm=HTMLFile('documentEdit', globals()) manage_options=( {'label':'Contents', 'action':'manage_editForm'}, {'label':'Children', 'action':'manage_main'}, {'label':'View', 'action':''}, {'label':'Properties', 'action':'manage_propertiesForm'}, {'label':'Import/Export', 'action':'manage_importExportForm'}, {'label':'Security', 'action':'manage_access'}, {'label':'Undo', 'action':'manage_UndoForm'}, #{'label':'Find', 'action':'manage_findFrame', 'target':'manage_main'}, ) __ac_permissions__=( ('View management screens', ('manage_editForm', 'manage', 'manage_main', 'manage_uploadForm', 'PrincipiaSearchSource')), ('Change DCDocuments', ('manage_edit', 'manage_upload', 'PUT')), ('View', ('__call__', '')), ) Globals.default__class_init__(DCDocument) ---- =_NextPart_000_01BE9BCA.1CD36B40 Content-Type: text/plain; name="docstore.py" #!/usr/bin/python import sys, getopt, os, posix, string usage = """docstore {get|ext|put|create} id...""" passwordfile = '/.priv/docstore-password' url = 'http://dev.ffm.tc:9080/ffm.tc' verbose = 1 def main(): try: cmd = sys.argv[1] except IndexError: print usage sys.exit(1) opts, args = getopt.getopt(sys.argv[2:], '') if not args: print usage sys.exit(1) sys.path.insert(0,'./lib/python') import ZPublisher.Client global ServerError ServerError=ZPublisher.Client.ServerError user = os.environ['USER'] try: f = open(os.environ['HOME']+passwordfile) password = f.read() except IOError: print sys.argv[0] + " can't read " + passwordfile sys.exit(1) object=ZPublisher.Client.Object(url, username=user, password=password) for f in args: if cmd == 'ext' or cmd == 'get': get_file(object, cmd, f) elif cmd == 'put': upload_file(object, cmd, f) elif cmd == 'create': upload_file(object, cmd, f) elif cmd == 'unlock': print "Unlock unwork" elif cmd == 'locate': print "locate unwork" elif cmd == 'ls': print 'ls unwork' else: print usage def call(f, *args, **kw): # Call a function ignoring redirect bci errors. try: apply(f,args, kw) except ServerError, v: if str(v)[:1] != '3': raise sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2] def get_file(object, cmd, f): dir, name = os.path.split(f) root, ext = os.path.splitext(name) if ext in ('.sgml', '.text', '.txt'): name = root object = object.__class__(object.url+'/'+name, username=object.username, password=object.password) if cmd == 'get': call(object.manage_getLock) try: posix.chmod(f, 0644) except: pass out = open(f, "w") data = object.index_html()[1] out.write(data) out.close() #n, e = os.path.splitext(f) #out = open(n + '.rdf', 'w') #data = object.RDF()[1] #out.write(data) #out.close() def upload_file(object, cmd, f): if os.path.isdir(f): return upload_dir(object, cmd, f) dir, name = os.path.split(f) root, ext = os.path.splitext(name) if ext in ('file', 'dir'): ext='' else: if ext and ext[0] in '.': ext=ext[1:] if ext and globals().has_key('upload_'+ext): if verbose: print 'upload_'+ext, f return globals()['upload_'+ext](object, cmd, f) if verbose: print 'skip_file', f, ext #call(object.manage_addFile, id=name, file=open(f)) def upload_dir(object, cmd, f): if verbose: print 'upload_dir', f dir, name = os.path.split(f) if cmd == 'create': o_kludge = object.__class__(object.url+'/manage_addProduct/docstore', username=object.username, password=object.password) call(o_kludge.manage_addDCDocument, id=name, data='') object=object.__class__(object.url+'/'+name, username=object.username, password=object.password) for n in os.listdir(f): upload_file(object, cmd, os.path.join(f,n)) def upload_sgml(object, cmd, f): dir, name = os.path.split(f) name, ext = os.path.splitext(name) input=open(f) input=input.read() if cmd == 'create': o_kludge = object.__class__(object.url+'/manage_addProduct/docstore', username=object.username, password=object.password) call(o_kludge.manage_addDCDocument, id=name, data=input) else: object=object.__class__(object.url+'/'+name, username=object.username, password=object.password) call(object.manage_edit, data=input) posix.chmod(f, 0444) upload_txt=upload_sgml upload_text=upload_sgml upload_tex=upload_sgml def upload_ps(object, cmd, f): dir, name = os.path.split(f) call(object.manage_addFile, id=name, file=open(f)) upload_eps=upload_ps upload_fig=upload_ps def upload_gif(object, cmd, f): dir, name = os.path.split(f) call(object.manage_addImage, id=name, file=open(f)) upload_jpg=upload_gif upload_png=upload_gif if __name__=='__main__': main() ---- =_NextPart_000_01BE9BCA.1CD36B40-- From circle@gwi.net Mon Nov 22 17:04:31 1999 From: circle@gwi.net (Andrew Wilcox) Date: Mon, 22 Nov 1999 12:04:31 -0500 Subject: [Zope-dev] Is _getOb() best way to grab a ref to a particular object? In-Reply-To: <613145F79272D211914B0020AFF6401914DD66@gandalf.digicool.co m> Message-ID: <3.0.6.32.19991122120431.00818bb0@mail.gwi.net> Right, what I'm looking for is to reference an absolute object, sort of like saying "/usr/bin/sendmail" in the filesystem. The note about avoiding an acquisition wrapper by using aq_base is helpful. Hmm, I don't know why I thought I needed _getOb(). Some test I did that confused me because the result was being rendered, and I didn't realize that was happening in the publisher. I think. Anyway, let's say I want to grab /topfolder/subfolder/myobj, and I know they exist, so I'm not worried about acquisition along the way. So what I've got now is: obj = REQUEST.PARENTS[-1].topfolder.subfolder.myobj or na_obj = REQUEST.PARENTS[-1].topfolder.subfolder.myobj.aq_base Ok, that's pretty straightforward! Thanks! Andrew At 09:25 AM 11/22/99 -0500, Brian Lloyd wrote: >> I need to grab a reference to a particular object in the ZODB from an >> external method, bypassing acquisition. Is this the right >> way to do it: >> >> def test(self, REQUEST=None): >> """doc string""" >> myobj = >> REQUEST.PARENTS[-1].aTopLevelFolder.anotherFolder._getOb('id_o >> f_myobj') >> ...do stuff with myobj: myobj.title, myobj.index_html, >> myobj.property = 123 ... > >Maybe, maybe not... _getOb will not return an acquired object, but >if the object exists it _will_ be returned as a "wrapped" object >so acquisition will be preserved in the result. I'm not clear from >your example whether this is what you want. If you want the *resulting* >object to be non-acquiring, you'll want to do something like: > >def test(self, REQUEST=None): > """ """ > # get object named 'foo' from self, but dont allow it > # to be found via acquisition. > > obj=self._getOb('foo') > > # while we know that foo is not acquired from above, it > # is still wrapped in the context of 'self', so to disable > # acquisition we need to unwrap it. > > non_aquiring_obj=obj.aq_base > > ... > >Hope this helps! > > >Brian Lloyd brian@digicool.com >Software Engineer 540.371.6909 >Digital Creations http://www.digicool.com > > > > From alex@gabuzomeu.net Mon Nov 22 16:39:19 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Mon, 22 Nov 1999 17:39:19 +0100 Subject: [Zope-dev] Keyword Indexes in ZCatalogs In-Reply-To: <613145F79272D211914B0020AFF640192762DA@gandalf.digicool.co m> Message-ID: <4.2.0.58.19991122173339.00ab0e70@192.168.0.2> Hello, I uploaded a draft "Keyword Indexes" howto here: . It describes a simple use of keyword indexes. Please have a look and send me your feedback / corrections / additions. Cheers. Alexandre At 10:03 22/11/1999 -0500, Michel Pelletier wrote: > > Thanks for this information. I tested Keyword indexes in a > > simple keyword > > search form for ZClass documents. It works beautifully. I'll > > summarize it > > in a mini-howto. > >Thank you! > >-Michel From alex@gabuzomeu.net Mon Nov 22 17:28:01 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Mon, 22 Nov 1999 18:28:01 +0100 Subject: [Zope-dev] getPropertyType returns None in ZClass In-Reply-To: <02f001bf3473$5a444450$eb0217ac@dev.prognet.com> References: <4.2.0.58.19991121130131.00aba100@192.168.0.2> Message-ID: <4.2.0.58.19991122180726.00ab9d60@192.168.0.2> "Curiouser and curiouser, said Alex" OK, here is what I tried on a test ZClass ("infos" is a propertysheet name):
    • - - - -
    And here is what I got: title - string - Site du Gisti - title - 1 description - None - C'est le site du Gisti. - description - 1 adresse - None - http://www.gisti.org - adresse - 1 lien - None - Site du Gisti - lien - 1 mots_cles - None - ['Gisti', 'site', 'le poulpe', "l'afrique"] - mots_cles - 1 So everything is working fine *except* getPropertyType(). This doesn't work any better: I also get "None". I used propertyMap() as a workaround but I'm puzzled. Did I miss something? (I use Zope 2.1b2 on Win NT4). Cheers. Alexandre At 14:54 21/11/1999 -0800, Jonothan Farr wrote: > > I tried to list all properties in a ZClass instance and check their types. > > I used the following code (within the ZClass; 'infos' is a custom > > propertysheet name): > > > > > >
  • - > > - > > > > > > > > > > This is the result: > > > > title - string - 1 > > description - None - 0 > > adresse - None - 0 > > modele_lien - None - 0 > > lien - None - 0 > >It looks like you need to call "propertysheets.infos.getPropertyType(...)" and >"propertysheets.infos.hasProperty(...)". > >--jfarr From klm@digicool.com Mon Nov 22 17:51:04 1999 From: klm@digicool.com (klm) Date: Mon, 22 Nov 1999 12:51:04 -0500 (EST) Subject: [Zope-dev] cvsweb.cgi back In-Reply-To: <38393F94.D46E3FF6@digicool.com> Message-ID: One of the victims of the site transition, the web-based browsing of the public CVS checkin, has been resuscitated. A number of people have asked about it - i'm sorry i hadn't realized how useful it is to people, or i would have placed more priority on getting it back sooner! Ken klm@digicool.com From michel@digicool.com Mon Nov 22 18:18:12 1999 From: michel@digicool.com (Michel Pelletier) Date: Mon, 22 Nov 1999 13:18:12 -0500 Subject: [Zope-dev] Keyword Indexes in ZCatalogs Message-ID: <613145F79272D211914B0020AFF640192762E2@gandalf.digicool.com> > -----Original Message----- > From: Alexandre Ratti [mailto:alex@gabuzomeu.net] > Sent: Monday, November 22, 1999 11:39 AM > To: zope-dev@zope.org > Cc: zen@cs.rmit.edu.au; Michel Pelletier > Subject: RE: [Zope-dev] Keyword Indexes in ZCatalogs > > > Hello, > > > I uploaded a draft "Keyword Indexes" howto here: > . > > It describes a simple use of keyword indexes. Please have a > look and send > me your feedback / corrections / additions. Looks good to me, there don't seem to be any technical inacuracies. -Michel From mj@antraciet.nl Mon Nov 22 18:30:58 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 22 Nov 1999 19:30:58 +0100 Subject: [Zope-dev] cvsweb.cgi back In-Reply-To: References: <38393F94.D46E3FF6@digicool.com> Message-ID: <4.2.2.19991122193034.0277b330@212.48.38.34> At 18:51 22-11-99 , klm wrote: >One of the victims of the site transition, the web-based browsing of the >public CVS checkin, has been resuscitated. A number of people have asked >about it - i'm sorry i hadn't realized how useful it is to people, or i >would have placed more priority on getting it back sooner! Thanks Ken! =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From mj@antraciet.nl Mon Nov 22 19:00:08 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Mon, 22 Nov 1999 20:00:08 +0100 Subject: [Zope-dev] Re: rfc1123 In-Reply-To: <86256831.005C2B8C.00@B000004.ralston.com> Message-ID: <4.2.2.19991122193649.027ed970@212.48.38.34> [Moved to Zope-Dev] At 17:47 22-11-99 , rgines@purina.com wrote: >I have been getting an rfc1123 error on the site that I have been >developing on for about a week now. I will get this error off of my main >page (ie www.sitename.com:8080/). If I go to the manage resource, I am >authenticated through a id/pw screen and from then on all is well. I have >tried to debug myself but to no avail. > >If someone can suggest the error of my ways I would appreciate it. You are trying to call a non-existent method. At least not in that context. I think the following will do what you trying to accomplish: This does the following: 1. ZopeTime() + .01 returns a DateTime object 36 minutes in the future 2. rfc822() is called on this resulting DateTime, which is a date and time string that also confirms to the RFC1123 standard. DateTime objects don't (yet) support an rfc1123 method. 3. A header, expires, is set with this string ad a value on the RESPONSE object. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From m.faassen@vet.uu.nl Mon Nov 22 19:32:57 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 22 Nov 1999 20:32:57 +0100 Subject: [Zope-dev] Writing custom folderish products References: <4.2.2.19991122132206.02750410@212.48.38.34> <4.2.2.19991122164230.027de950@212.48.38.34> Message-ID: <38399A69.DDF3CEB5@vet.uu.nl> Martijn Pieters wrote: > > At 16:17 22-11-99 , Martijn Faassen wrote: > >Right. Now that the Other Martijn is here anyway, could you please help > >me with my custom folder problem? :) > > You're in luck, I've got a few minutes. =) [explanation snipped] Thank you! I'm glad you had a few minutes, as now ZFormulator (my web form automation system) is another big leap closer to initial release! It worked! ZFormulator is full of Zope hackery in order to shield the ordinary python programmer (me :) from Zope's internals, and to avoid all kinds of code duplication as well. Paradoxically I learnt a lot about Zope's internals as a result. Significant amounts of Zope Zen have been acquired. :) But now I can stop thinking about them for a while and add new field types to ZFormulator. Thanks again! Martijn From jec@mgmt-inc.com Mon Nov 22 19:47:41 1999 From: jec@mgmt-inc.com (Jim Cain) Date: Mon, 22 Nov 1999 14:47:41 -0500 Subject: [Zope-dev] Re: [Zope] Zope-2.1.0b2 fails on access to management screen In-Reply-To: <4.2.2.19991119235719.02646420@212.48.38.34> Message-ID: <12834751.3152270861@[10.1.1.2]> --On Saturday, November 20, 1999 00:02 +0100 Martijn Pieters wrote: > At 17:52 19-11-99 , Jim Cain wrote: >> I tried the above changes, but I still got the same error. >> >> Then I tried removing things altogether, one at a time. Finally I >> discovered that by removing the first %d on line 225 and self.addr[1] on >> line 226, while leaving everything else alone, it works fine. >> >> One curious thing though: When I run it this way, the line it writes in >> the log file begins with ^D. Where is that character coming from? > > Eh? This suggests that self.addr[1] is now broken, which means that it > was previously (older Zope version) wasn't working either.. And I don't > get the ^D either. > > Do you know how to use the Perl Debugger? I think a few debugging steps > are in order here. Insert the lines > > import pdb > pdb.set_trace() > > somewhere before the offending lines (for example, at 222), start Zope in > debugging mode (so it won't detach from the console). Then, when you go > to your site and your pdb statements are executed, you can follow > exactly what goes wrong where, and why. > > Let us know! Okay, I put in the set_trace, and this is what I found: (Pdb) l 220 else: 221 method="GET" 222 if self.addr: 223 import pdb 224 pdb.set_trace() 225 -> self.server.logger.log ( 226 self.addr[0], 227 '%d - - [%s] "%s %s" %d %d' % ( 228 self.addr[1], 229 time.strftime ( 230 '%d/%b/%Y:%H:%M:%S ', (Pdb) whatis self.addr (Pdb) p self.addr '\004\010\204\364\377\277\226y' (Pdb) p self.addr[0] '\004' (Pdb) p self.addr[1] '\010' Well at least we know where the ^D is coming from, but what is self.addr supposed to contain, a string representation of the IP address of the client? Jim From rgines@purina.com Mon Nov 22 22:23:16 1999 From: rgines@purina.com (rgines@purina.com) Date: Mon, 22 Nov 1999 16:23:16 -0600 Subject: [Zope-dev] Re: rfc1123 Message-ID: <86256831.007AE05C.00@B000004.ralston.com> ... >You are trying to call a non-existent method. At least not in that context. >I think the following will do what you trying to accomplish: > So far so good. Thanks for the assistance. From benno@sesgroup.net Mon Nov 22 22:39:26 1999 From: benno@sesgroup.net (Ben Leslie) Date: Tue, 23 Nov 1999 09:39:26 +1100 Subject: [Zope-dev] ANN: NotMail v0.2.0 alpha Available In-Reply-To: <19991122140626.A28122@webcom.com>; from lalo@webcom.com on Mon, Nov 22, 1999 at 02:06:27PM -0200 References: <19991122011355.B31417@sesgroup.net> <19991122140626.A28122@webcom.com> Message-ID: <19991123093926.C29399@sesgroup.net> On Mon, 22 Nov 1999, Lalo Martins wrote: > Ben, > > I realize your NotMail is still pretty much an alpha, but would > you say your IMAPAdapter is stable enought to base other > products on it? (I'm thinking of a read-only interface I'd use > to make mailing list archives publicly available) IMAPAdapter is also pretty alpha. I will try at the end of this week to publish some documetation for the whole package. If you have time to help find the bugs in IMAPAdapter then please go right ahead and use it, if not wait I would wait a couple more weeks until I have it more stable. Cheers, Benno From mj@antraciet.nl Mon Nov 22 23:02:01 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Tue, 23 Nov 1999 00:02:01 +0100 Subject: [Zope-dev] PCGI bug (Was: Zope-2.1.0b2 fails on access to management screen) In-Reply-To: <12834751.3152270861@[10.1.1.2]> References: <4.2.2.19991119235719.02646420@212.48.38.34> Message-ID: <4.2.2.19991122234012.028689d0@212.48.38.34> Jim Cain wrote: > >> Then I tried removing things altogether, one at a time. Finally I > >> discovered that by removing the first %d on line 225 and self.addr[1] on > >> line 226, while leaving everything else alone, it works fine. > >> > >> One curious thing though: When I run it this way, the line it writes in > >> the log file begins with ^D. Where is that character coming from? Then I wrote something that amounts to > > import pdb > > pdb.set_trace() > > > > somewhere before the offending lines (for example, at 222), start Zope in > > debugging mode (so it won't detach from the console). > > > > Let us know! > And Jim then wrote >Okay, I put in the set_trace, and this is what I found: > >(Pdb) l >220 else: >221 method="GET" >222 if self.addr: >223 import pdb >224 pdb.set_trace() >225 -> self.server.logger.log ( >226 self.addr[0], >227 '%d - - [%s] "%s %s" %d %d' % ( >228 self.addr[1], >229 time.strftime ( >230 '%d/%b/%Y:%H:%M:%S ', >(Pdb) whatis self.addr > >(Pdb) p self.addr >'\004\010\204\364\377\277\226y' >(Pdb) p self.addr[0] >'\004' >(Pdb) p self.addr[1] >'\010' > >Well at least we know where the ^D is coming from, but what is self.addr >supposed to contain, a string representation of the IP address of the >client? Hmm.. And this means, what I can make out, that you now have a AF_UNIX type socket and address, and that address is a string, but the code expects a AF_INET type socket and address, whose address is a (host, port) pair. Which leaves us with the question, how did you end up with a AF_UNIX type socket instead of a AF_INET type? And why doesn't the code in PCGIServer.py account for the possibility? You probably switched from Inet sockets to Unix sockets in the meantime, right? Does ZServer start up with a message like 'PCGI Server started at ... Inet socket port: ...' or does it say 'Unix Socket: ...'? As PCGIServer works with both types of sockets, this logging thing is a bug. Report it at the Collector: http://classic.zope.org:8080/Collector/ -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 --------------------------------------------- From kent@goathill.org Mon Nov 22 23:59:44 1999 From: kent@goathill.org (Kent Polk) Date: 22 Nov 1999 23:59:44 GMT Subject: [Zope-dev] Missing and cmp Message-ID: <943315183.921839@fezzik.endicor.com> The module Missing has interesting cmp behavior: >>> import Missing >>> b=[5,Missing.Value,0,-3,'c',Missing.Value,0,4,'a',Missing.Value, 'b',Missing.Value,6] >>> b.sort() >>> b [-3, 5, Missing.Value, 0, Missing.Value, 0, 4, Missing.Value, \ Missing.Value, 6, 'a', 'b', 'c'] As you can see, inserting a Missing.Value in the midst of a list, (particularly when juxtaposed with a zero) causes problems with numeric compares. Question: How should Missing.Values be sorted? Regardless of what their 'value' should be, I don't think they should disturb how other values are sorted. I'd recommend that they evaluate to less than all other values... Comments? From s341625@student.uq.edu.au Tue Nov 23 00:11:22 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Tue, 23 Nov 1999 10:11:22 +1000 (GMT+1000) Subject: [Zope-dev] ZopeZen listing on zwiki Message-ID: Hi, Due to the recent unveiling of Zope Zen on the zope-dev list I've collected the gems into zwiki so that they will be available for others. The address is: http://209.67.167.82/zwiki/ZopeZen. If it is ok, I'll cross-post to zope@zope.org after feedback. Cheers, Anthony Pfrunder From robert@leftfieldcorp.com Tue Nov 23 01:13:13 1999 From: robert@leftfieldcorp.com (Robert Leftwich) Date: Tue, 23 Nov 1999 12:13:13 +1100 Subject: [Zope-dev] Generic filtering of objects In-Reply-To: <199911110350.TAA24829@zope.codeit.com> Message-ID: Robert Leftwich wrote: > >I have a requirement to be able to apply a user-definable filter to all the >views on the object database. Obviously this would be best applied at a low >a level as possible in order to minimise the impact on the application code >and to be made as generic as possible for maximum flexibility. >To save re-inventing the wheel, has anyone else had this requirement and if >so how did you implement it ? > Phillip J. Eby wrote : > > Ty Sarna and I have come up with a concept for this, which we have not yet > implemented, as we are still finalizing design details. We > believe that it > could be made quite general. The basic idea is that you have a > (Snip some excellent design/use case discussion [not to mention the odd head spin :-) ]...) I have been thinking about this on and off for the last week or so and I wanted to bounce around an idea or two. Given that one of the main criteria (for me, at least) is the ability to apply different filters on a per user basis, I am contemplating adding a filter keyword to the in and tree tags. There already exists a very specialised filter in both of these tags (the skip_unauthorized flag - which is a filter for unauthorised objects), so it should be easy to enhance this to support a more generic filter of the type proposed by Philip and Ty. The factors pushing me toward this solution are that filtering is generally a UI-driven requirement and I felt very uncomfortable about retrieving user-selected filters from the REQUEST variable at low levels in the code (I was experimenting with filtering in the objectId() method of ObjectManager). Not to mention that this solution only worked for ObjectManager associated data and fails when you have lists or dictionaries or external data access such as SQL. Anyone have any thoughts or comments ? Robert Leftwich From zen@cs.rmit.edu.au Tue Nov 23 06:08:43 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Tue, 23 Nov 1999 17:08:43 +1100 (EST) Subject: [Zope-dev] New beta GenericUserFolder In-Reply-To: <3.0.5.32.19991122205858.00995100@pop.mindspring.com> Message-ID: On Mon, 22 Nov 1999, Ross Boylan wrote: > I notice that a lot of products redefine class variables (e.g., > GenericUserFolder has > isPrincipiaFolderish=1 > isAUserFolder=1 > ) which are already in the superclass. Is this because: > * it's more readable Because it is more readable, and ensures that nothing wierd goes on with multiple inheritance. For example, in GenericUserFolder, I inherit from both Folder and BasicUserFolder. Now, since only BasicUserFolder defined isAUserFolder, then I could have left it out and things would work happily. However, if in a future revision, someone moved isAUserFolder to SimpleItem or other subclass of Folder and defined it as false, my product would break. I used to like multiple inheritance until I saw a real product using it (Zope), and now I appreciate Java more :-) > 1) Let new users define themselves on a new user screen (not a Zope > management console). > I've been hung up on the architectural points of where such a screen should > go, how it is to refer to the acl_users folder, and how to set permissions. You need a form, accessible to the Anonymous role, that will let a user setup an account. You also need a DTML method to act as the action of this form. This DTML method would insert the releveant data into a TinyTable,SQL table, whatever. It would probably need a proxy role defined so that the method has rights to add the data (since the anonymous user shouldn't have rights). You could then use GenericUserFolder to authenticate users from this TinyTable,SQL table,whatever. [root] +- createAccount_form (DTML Method) +- createAccount_submit (DTML Method) +- secured +- acl_users (GenericUserFolder) +- UserTable (TinyTable) +- userAuthenticate +- [ other GUF hooks] createAccount_submit would be given a proxy role of Manager, and would insert a row into UserTable with all the relevant information (username, sha.new(password).digest(), possibly roles). userAuthenticate would generate sha.new(password).digest() and compare this to the stored SHA password hash in UserTable. the other GUF hooks could calculate their return values, suck them out of UserTable or just return fixed strings depending on your environment. > 2) Have User objects which are subclasses of user, for extra data and > functionality. > I've been trying to avoid modifying the code in AccessControl/ directly, > since that's cheating (and not robust against Zope system changes). > > I think if you took the class as a variable, or took a factory object as an > optional argument to your stuff, it would meet 2) without much trouble. Its on my todo list, but it won't be there until I get the basics released. Similar functionality can be done right now. For example, I have a DTML method userEmail high up in my tree which takes a username and returns that users email address. It just means I have to do userEmail(this(),REQUEST,username=AUTHENTICATED_USER.getUserName()) instead of AUTHENTICATED_USER.getEmail(). Note that your pluggable brain would have to be a subclass of GenericUserFolder.User, and not AccessControl.BasicUser. The method described in the previous paragraph could also work for users authenticated through other mechanisms besides GenericUserFolder provided by DTML code was intelligent enough. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From m.faassen@vet.uu.nl Tue Nov 23 12:35:04 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 23 Nov 1999 13:35:04 +0100 Subject: [Zope-dev] cvsweb.cgi back References: Message-ID: <383A89F8.478F29D8@vet.uu.nl> klm wrote: > > One of the victims of the site transition, the web-based browsing of the > public CVS checkin, has been resuscitated. A number of people have asked > about it - i'm sorry i hadn't realized how useful it is to people, or i > would have placed more priority on getting it back sooner! Cool, thanks! Now I can see if XMLDocument has changed. :) Regards, Martijn From m.faassen@vet.uu.nl Tue Nov 23 13:19:34 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 23 Nov 1999 14:19:34 +0100 Subject: [Zope-dev] cvsweb.cgi back References: <383A89F8.478F29D8@vet.uu.nl> Message-ID: <383A9466.22600ACA@vet.uu.nl> Martijn Faassen wrote: > > klm wrote: > > > > One of the victims of the site transition, the web-based browsing of the > > public CVS checkin, has been resuscitated. A number of people have asked > > about it - i'm sorry i hadn't realized how useful it is to people, or i > > would have placed more priority on getting it back sooner! > > Cool, thanks! Now I can see if XMLDocument has changed. :) > Hm, no, there haven't been any changes to it. Amos, there's been some patches posted on zope-dev recently by Gabor Melis. Could you take a look at them? Perhaps they're useful. Regards, Martijn From js@ac-copy.net Tue Nov 23 17:23:20 1999 From: js@ac-copy.net (Joachim Schmitz) Date: Tue, 23 Nov 1999 18:23:20 +0100 (CET) Subject: [Zope-dev] Error using GenericUserFolder Message-ID: Hi, I installed GenericUserFolder-1-0-1, and for a test tried the logon. I entered "jorge" and "secret", and got back: Zope Error Zope has encountered an error while publishing this resource. Error Type: AttributeError Error Value: user_expires Mit freundlichen Grüßen Joachim Schmitz WWW-Consultant email: js@ac-copy.net tel: +49-241-89491-0 fax: +49-241-89491-29 From Brian@digicool.com Tue Nov 23 16:58:58 1999 From: Brian@digicool.com (Brian Lloyd) Date: Tue, 23 Nov 1999 11:58:58 -0500 Subject: [Zope-dev] PCGI bug (Was: Zope-2.1.0b2 fails on access to ma nagement screen) Message-ID: <613145F79272D211914B0020AFF6401914DD6F@gandalf.digicool.com> > Hmm.. And this means, what I can make out, that you now have > a AF_UNIX type > socket and address, and that address is a string, but the > code expects a > AF_INET type socket and address, whose address is a (host, port) pair. > > Which leaves us with the question, how did you end up with a > AF_UNIX type > socket instead of a AF_INET type? And why doesn't the code in > PCGIServer.py > account for the possibility? Hmm - it looks like the logging code in PCGI server was just broken - it didn't account for the fact that self.addr could be other than a (host, port) tuple. I've checked in a change for 2.1.0 that adds a check to make sure the addr is really a tuple and will cause it to fall through to the safe default otherwise. Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com From ross@sphinx.com Tue Nov 23 17:20:54 1999 From: ross@sphinx.com (Ross Boylan) Date: Tue, 23 Nov 1999 09:20:54 -0800 Subject: [Zope-dev] New beta GenericUserFolder In-Reply-To: Message-ID: This note is mostly a feature request. I don't know if these features would fit in with what you are doing or not, but I thought I'd throw them out. Also, I'm hoping someone would explain to me how I might get the functionality I need, since several weeks of part-time fooling around haven't gotten me there yet :) Also, I have a more general question. I'll start with that, for those not into UserFolders: I notice that a lot of products redefine class variables (e.g., GenericUserFolder has isPrincipiaFolderish=1 isAUserFolder=1 ) which are already in the superclass. Is this because: * it's more readable * Python object model forces this * Zope forces it by ignoring the superclass chain (while doing .....)? Now, here are the two User-specific things I've been trying to do: 1) Let new users define themselves on a new user screen (not a Zope management console). I've been hung up on the architectural points of where such a screen should go, how it is to refer to the acl_users folder, and how to set permissions. 2) Have User objects which are subclasses of user, for extra data and functionality. I've been trying to avoid modifying the code in AccessControl/ directly, since that's cheating (and not robust against Zope system changes). I think if you took the class as a variable, or took a factory object as an optional argument to your stuff, it would meet 2) without much trouble. I know many of these questions are elementary. I have spent a fair amount of time RTFMing (such as they are), but I'm still getting a feel for the system, and would welcome some help. Thanks. From ross@sphinx.com Tue Nov 23 17:21:35 1999 From: ross@sphinx.com (Ross Boylan) Date: Tue, 23 Nov 1999 09:21:35 -0800 Subject: [Zope-dev] New beta GenericUserFolder In-Reply-To: References: <3.0.5.32.19991122205858.00995100@pop.mindspring.com> Message-ID: Thanks for a very useful and generous response. I do have a few more questions/comments... At 05:08 PM 11/23/99 +1100, Stuart 'Zen' Bishop wrote: >On Mon, 22 Nov 1999, Ross Boylan wrote: > >> I notice that a lot of products redefine class variables (e.g., >> GenericUserFolder has >> isPrincipiaFolderish=1 >> isAUserFolder=1 >> ) which are already in the superclass. Is this because: >> * it's more readable > >Because it is more readable, and ensures that nothing wierd goes on >with multiple inheritance. For example, in GenericUserFolder, >I inherit from both Folder and BasicUserFolder. Now, since only BasicUserFolder >defined isAUserFolder, then I could have left it out and things would >work happily. However, if in a future revision, someone moved isAUserFolder >to SimpleItem or other subclass of Folder and defined it as false, my >product would break. I used to like multiple inheritance until I saw >a real product using it (Zope), and now I appreciate Java more :-) > I have a smalltalk background, so single inheritance always seemed fine to me. I think strong typing makes it much more essential than otherwise (I've done quite a bit of C++ too), and of course Python is not strongly typed). >> 1) Let new users define themselves on a new user screen (not a Zope >> management console). >> I've been hung up on the architectural points of where such a screen should >> go, how it is to refer to the acl_users folder, and how to set permissions. > >You need a form, accessible to the Anonymous role, that will let a >user setup an account. You also need a DTML method to act as the >action of this form. This DTML method would insert the releveant data >into a TinyTable,SQL table, whatever. It would probably need a proxy >role defined so that the method has rights to add the data (since the >anonymous user shouldn't have rights). You could then use GenericUserFolder >to authenticate users from this TinyTable,SQL table,whatever. > How does one setup a proxy role? I was thinking of a much different approach, namely that I would create an OrgUser (my subclass of User) on the spot, and shove it into the acl_users. I understood that python, rather than dtml, was the way to go for that. So I thought it would look like this: form dispatches to python method (and I wasn't sure how to get the form and python namespaces together) python method creates OrgUser and puts it in acl_users (rasing both a namespace and permissioning issue) using existing methods where possible. I recall reading that permissions only inhibit the ORB and dtml, but not python. Is that accurate? From kent@goathill.org Tue Nov 23 17:53:46 1999 From: kent@goathill.org (Kent Polk) Date: 23 Nov 1999 17:53:46 GMT Subject: [Zope-dev] Generic filtering of objects In-Reply-To: Message-ID: <943379626.71695@fezzik.endicor.com> On 22 Nov 1999 19:40:00 -0600, Robert Leftwich wrote: >Robert Leftwich wrote: >> >>I have a requirement to be able to apply a user-definable filter to all the >>views on the object database. Obviously this would be best applied at a low >>a level as possible in order to minimise the impact on the application code >>and to be made as generic as possible for maximum flexibility. >>To save re-inventing the wheel, has anyone else had this requirement and if >>so how did you implement it ? I'm off in a little different area which is an extension of the TinyTables concept where I'm wrapping information obtained from several different locations into an object which is then unrolled or 'SubMined' as Ty calls it. :^) The information comes from the filesystem, the Zope database, and hopefully soon, from other database queries, etc. Right now I roll almost all the results into ZRDB.Results objects so I can more consistently filter them and carry the filter results along as the user traverses through the data. This has a chance of allowing me to 'join' my ZRDB.Results with other database results, etc. I've tried to separate functionality to provide for more flexibility with selectable filters that are applied to the SubMine results object via __bobo_traverse__, in addition to DTML-based rendering filters which are not 'carried around' as the user traverses the objects. The SubMine filters are listed in order and can be selectively removed from the 'filter list'. This concept was derived from the 'Datamining' product posted earlier this year, along with some initial work that Ty helped me with. The problem is that the __bobo_traverse__ mechanism I'm using is fraught with many problems but I can't see any way around them right now. This is somewhat applicable to the discussion on schemas because these objects change on a regular basis (SubMines on every request), but storing *some* of those changes as transactions in the Zope database is simply not appropriate. Right now, it appears to me that Zope isn't well suited to dealing with persistent, user-defined volatile filters, schemas, etc. It really wants to pass those things off to database-like queries. For a while I thought that I ought to do just that with my datamining stuff - just write a separate server that handles the things that Zope doesn't deal very well with, but the problem is that Zope is so darned close to what *is* needed that it'd be pretty stupid to go off and write something else. I'd rather see if there is a way to convince Zope to differentiate between objects that need transacted in the Zope database and objects that just need to be cached in the Zope database, otherwise retaining the same behavior. >Phillip J. Eby wrote : >> >> Ty Sarna and I have come up with a concept for this, which we have not yet >> implemented, as we are still finalizing design details. We >> believe that it >> could be made quite general. The basic idea is that you have a >> >(Snip some excellent design/use case discussion [not to mention the odd head >spin :-) ]...) > >I have been thinking about this on and off for the last week or so and I >wanted to bounce around an idea or two. > >Given that one of the main criteria (for me, at least) is the ability to >apply different filters on a per user basis, I am contemplating adding a >filter keyword to the in and tree tags. There already exists a very >specialised filter in both of these tags (the skip_unauthorized flag - which >is a filter for unauthorised objects), so it should be easy to enhance this >to support a more generic filter of the type proposed by Philip and Ty. > >The factors pushing me toward this solution are that filtering is generally >a UI-driven requirement and I felt very uncomfortable about retrieving >user-selected filters from the REQUEST variable at low levels in the code (I >was experimenting with filtering in the objectId() method of ObjectManager). >Not to mention that this solution only worked for ObjectManager associated >data and fails when you have lists or dictionaries or external data access >such as SQL. > >Anyone have any thoughts or comments ? The SubMine filters that Ty and I worked on attempted to mimic SQL query commands as it provided a familiar environment. If we are really talking about general-purpose filters that can operate on ZRDB.Results objects (in particular), I'd sure like to see what could be done here. BTW, Phillip kinda lost me. :^) Ty - You know what I'm working on. Are we talking about anything remotely related? :^) I'm ready to ditch what I'm doing if there's a better way out there. ---- FWIW, MS and MIT are offering some funds for developing Open Source educational resources that I think we stand a chance of taking advantage of in this area... (http://swissnet.ai.mit.edu/projects/i-campus/) "I-Campus is a collaborative initiative of MIT and Microsoft Research to conduct research and create new technologies that will set the pace for university education in the next five to ten years. The project aims at fostering excellence in technology-enhanced education, through producing materials that adhere to open standards, with results and source code which can be widely published and disseminated. I-Campus was launched in October 1999 as a five-year research partnership between MIT and Microsoft, but we plan to engage additional academic and industry partners as the project evolves." I am in touch with some people who are considering a proposal that some of these issues might address. A few application-specific things would need to be developed but I think we are headed down similar paths and ought to consider working together. Any interested parties? Paul and the rest of you DC folks, there are a number of issues with the I-Campus research that are darned close to what the AISD proposal that we worked on eventually wanted to address. You might want to take a look and see if there are partnership opportunities available to pick up where we left off. Kent From michel@digicool.com Tue Nov 23 18:31:42 1999 From: michel@digicool.com (Michel Pelletier) Date: Tue, 23 Nov 1999 13:31:42 -0500 Subject: [Zope-dev] RE: [Zope] How do I make an external object persistent? Message-ID: <613145F79272D211914B0020AFF640192762EC@gandalf.digicool.com> Moved to zope-dev > -----Original Message----- > From: Andres Corrada [mailto:andres@corrada.com] > Sent: Tuesday, November 23, 1999 11:56 AM > To: zope@zope.org > Subject: [Zope] How do I make an external object persistent? > > > Hi, > I'm new to Zope. I have classes that I want to use in > Zope without > making them Products. How can I inject the Zope namespace > with an object > so it remains persistent? For example, a Form object that renders and > validates a form. For an object to exist persistently in zope, its class must subclass Persistence.Persistent. You can, however, utilize other classes in external methods. Note that the *instances* of these classes will not persist across external method calls. -Michel From alex@gabuzomeu.net Tue Nov 23 18:48:51 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Tue, 23 Nov 1999 19:48:51 +0100 Subject: [Zope-dev] ZCatalog search problem with some extended chars Message-ID: <4.2.0.58.19991123191411.00ade780@192.168.0.2> Hello, I tested the ZCatalog search feature on text with French extended characters. I use Zope 2.1b2 on Win NT 4. I set the 'fr' locale in z2.py. Zope restarted OK. The results are strange: when words with extended characters are indexed in Text Fields, some can be found and some can't. (No problems in Keyword Fields). I think I narrowed it down to the following: some extended characters are OK and some are not. I enclosed below a list of 'searchable' and 'non-searchable' characters. I suppose there is a pattern but I couldn't see it. Did anyone witness similar behavior? Can I do something to fix it? Cheers. Alexandre --------------- (When testing I included the actual character, not its entity representation. However, I include the entities here for reference because mailers may not display these characters properly). Included information : HTML entity name - Octal code - ANSI code Are not working on my box --------------------------------------- À - Octal \300 - ANSI 192 Â - Octal \302 - ANSI 194 Ä - Octal \304 - ANSI 196 Ö - Octal \326 - ANSI 214 à - Octal \340 - ANSI 224 â - Octal \342 - ANSI 226 ä - Octal \344 - ANSI 228 ç - Octal \347 - ANSI 231 è - Octal \350 - ANSI 232 ö - Octal \366 - ANSI 246 ù - Octal \371 - ANSI 249 Are working on my box ---------------------------------- É - Octal \311 - ANSI 201 Ê - Octal \312 - ANSI 202 Î - Octal \316 - ANSI 206 Ï - Octal \317 - ANSI 207 Ô - Octal \324 - ANSI 212 Û - Octal \333 - ANSI 219 Ü - Octal \334 - ANSI 220 é - Octal \351 - ANSI 233 ê - Octal \352 - ANSI 234 î - Octal \356 - ANSI 238 ï - Octal \357 - ANSI 239 ñ - Octal \361 - ANSI 241 ô - Octal \364 - ANSI 244 û - Octal \373 - ANSI 251 ü - Octal \374 - ANSI 252 From alex.ratti@ras.eu.org Tue Nov 23 19:24:34 1999 From: alex.ratti@ras.eu.org (Alexandre Ratti) Date: Tue, 23 Nov 1999 20:24:34 +0100 Subject: [Zope-dev] Questions about ZCatalogs Message-ID: <4.2.0.58.19991123194918.00ac4950@192.168.0.2> Hello, I read in the zope lists archives that ZCatalogs support: - the 'andnot' operator; - a near operator ("..."); - phrasing. Is this acurate? I cannot find how to use any of this in Zope 2.1b2 on Win NT4. 1) The andnot operator If it is available, could you provide a syntax example? This works: This works too: This doesn't return any answer: This doesn't either: 2) Near operator Can you provide an example? How near is 'near'? 3) Phrasing search Does ZCatalogs support searching for an exact phrase, eg. "blue cars"? If supported, this would return only docs where the phrase occurs, not the individual words. I'm really interested in this feature. Could you provide a DTML syntax example? I found the following example (not disrespect intended MartijnF ;-) in an email but I get a Document Template Parse Error when I run it: ... Many thanks. Alexandre From m.faassen@vet.uu.nl Tue Nov 23 19:57:49 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 23 Nov 1999 20:57:49 +0100 Subject: [Zope-dev] RE: [Zope] How do I make an external object persistent? References: <613145F79272D211914B0020AFF640192762EC@gandalf.digicool.com> Message-ID: <383AF1BD.88ABFFD6@vet.uu.nl> Michel Pelletier wrote: > > Moved to zope-dev > > From: Andres Corrada [mailto:andres@corrada.com] > > I'm new to Zope. I have classes that I want to use in > > Zope without > > making them Products. How can I inject the Zope namespace > > with an object > > so it remains persistent? For example, a Form object that renders and > > validates a form. [snips Michel's reply] Note that ZFormulator, a Zope Product/Framework that I'm working on is nearing its initial release. It does form rendering (at least field rendering) and form validation. You might want to leverage your stuff on top of that. :) Regards, Martijn From m.faassen@vet.uu.nl Tue Nov 23 19:59:18 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 23 Nov 1999 20:59:18 +0100 Subject: [Zope-dev] Questions about ZCatalogs References: <4.2.0.58.19991123194918.00ac4950@192.168.0.2> Message-ID: <383AF216.FB773A11@vet.uu.nl> Alexandre Ratti wrote: [snip] > I found the following example (not disrespect intended MartijnF ;-) None taken. It's cool to be mentioned at all. :) > in an > email but I get a Document Template Parse Error when I run it: > > Faassen"'})">... Good-for-the-ego-ly yours, Martijn From technews@egsx.com Tue Nov 23 20:36:48 1999 From: technews@egsx.com (technews@egsx.com) Date: Tue, 23 Nov 1999 15:36:48 -0500 (EST) Subject: [Zope-dev] ZCatalog search problem with some extended chars In-Reply-To: <4.2.0.58.19991123191411.00ade780@192.168.0.2> Message-ID: Hi, We use Arabic encoding, basically all characters are over the 127, and we have been unable to use the search feature in Zope. For now we are trying to figure out how we can adapt our search engine to search those records. Adonis On Tue, 23 Nov 1999, Alexandre Ratti wrote: > Hello, > > > I tested the ZCatalog search feature on text with French extended > characters. I use Zope 2.1b2 on Win NT 4. I set the 'fr' locale in z2.py. > Zope restarted OK. > > The results are strange: when words with extended characters are indexed in > Text Fields, some can be found and some can't. (No problems in Keyword Fields). > > I think I narrowed it down to the following: some extended characters are > OK and some are not. I enclosed below a list of 'searchable' and > 'non-searchable' characters. I suppose there is a pattern but I couldn't > see it. > > Did anyone witness similar behavior? Can I do something to fix it? > > > Cheers. > > Alexandre > > --------------- > > (When testing I included the actual character, not its entity > representation. However, I include the entities here for reference because > mailers may not display these characters properly). > > Included information : > HTML entity name - Octal code - ANSI code > > Are not working on my box > --------------------------------------- > À - Octal \300 - ANSI 192 > Â - Octal \302 - ANSI 194 > Ä - Octal \304 - ANSI 196 > Ö - Octal \326 - ANSI 214 > à - Octal \340 - ANSI 224 > â - Octal \342 - ANSI 226 > ä - Octal \344 - ANSI 228 > ç - Octal \347 - ANSI 231 > è - Octal \350 - ANSI 232 > ö - Octal \366 - ANSI 246 > ù - Octal \371 - ANSI 249 > > Are working on my box > ---------------------------------- > É - Octal \311 - ANSI 201 > Ê - Octal \312 - ANSI 202 > Î - Octal \316 - ANSI 206 > Ï - Octal \317 - ANSI 207 > Ô - Octal \324 - ANSI 212 > Û - Octal \333 - ANSI 219 > Ü - Octal \334 - ANSI 220 > é - Octal \351 - ANSI 233 > ê - Octal \352 - ANSI 234 > î - Octal \356 - ANSI 238 > ï - Octal \357 - ANSI 239 > ñ - Octal \361 - ANSI 241 > ô - Octal \364 - ANSI 244 > û - Octal \373 - ANSI 251 > ü - Octal \374 - ANSI 252 > > > _______________________________________________ > 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 ) > From circle@gwi.net Tue Nov 23 21:43:09 1999 From: circle@gwi.net (Andrew Wilcox) Date: Tue, 23 Nov 1999 16:43:09 -0500 Subject: [Zope-dev] ANN: TableView 0.01 available Message-ID: <3.0.6.32.19991123164309.00819780@mail.gwi.net> This is an initial development release of code in progress. Hackers and other help welcome! Release 0.01 is up on the Zope site at http://www.zope.org/Members/AndrewWilcox/TableView/ A TableView displays a folder of objects as an HTML table. Each object in the folder is displayed as a row in the table, and the columns show property values from the objects. You can also use a ZClass that subclasses from ObjectManager. So if you have a CD_Collection class that contains CD objects, the TableView will display your collection of CD's. Goals of the project: * Create a general-purpose Zope interface for editing data in a tabular format. * Let users easily arrange a list of items in a particular order. * Allow web site designers to display information in an HTML table with needing to know the ins and outs of HTML coding with the tag, and programming with tag. This is my first attempt at creating a Zope product distribution, so feedback on packaging, installation problems, etc. would be great. Feedback on the design approach from experienced Zope hackers would be terrific as well. The product creates an object that displays a view of another object, similar to the model-view paradigm you see in Java or Smalltalk programming. Right now the displayer and the displayee get linked through acquisition, but that might not be the best way to do it. Thanks all, Andrew From zen@cs.rmit.edu.au Tue Nov 23 22:30:21 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Wed, 24 Nov 1999 09:30:21 +1100 (EST) Subject: [Zope-dev] Error using GenericUserFolder In-Reply-To: Message-ID: On Tue, 23 Nov 1999, Joachim Schmitz wrote: > I installed GenericUserFolder-1-0-1, and for a test tried the logon. I > entered "jorge" and "secret", and got back: > > Zope Error > > Zope has encountered an error while publishing this resource. > > Error Type: AttributeError > Error Value: user_expires I can duplicate this (User.py line 42). Looks like I'm not going to be able to share my User cache between threads (as the user object needs a reference to the GUF that spawned it). Or perhaps I can locate the users GUF using aquisition? Hmm... Thanks. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From pje@telecommunity.com Tue Nov 23 22:32:32 1999 From: pje@telecommunity.com (Phillip J. Eby) Date: Tue, 23 Nov 1999 17:32:32 -0500 Subject: [Zope-dev] Generic filtering of objects In-Reply-To: <943379626.71695@fezzik.endicor.com> References: Message-ID: <3.0.5.32.19991123173232.01902100@telecommunity.com> At 05:53 PM 11/23/99 GMT, Kent Polk wrote: > >I'm off in a little different area which is an extension of the >TinyTables concept where I'm wrapping information obtained from >several different locations into an object which is then unrolled >or 'SubMined' as Ty calls it. :^) The information comes from the >filesystem, the Zope database, and hopefully soon, from other >database queries, etc. > I'm going to have to hold off on replying to your mails for a bit, today's my last day in the office before a much needed vacation. I'll try to get back to you some more then. From ZMARKVOSS@aol.com Wed Nov 24 01:07:38 1999 From: ZMARKVOSS@aol.com (ZMARKVOSS@aol.com) Date: Tue, 23 Nov 1999 20:07:38 EST Subject: [Zope-dev] Moving load to client computers with Zope ? Message-ID: <0.ea932c04.256c945a@aol.com> Hello: I am looking to host an engineering application over the Internet. I have investigated ZOPE and it seems to be the best solution for what I am trying to do ... but I have a question. The application would place a large load on a server if it had to run local for each current user ... Is it possible to have the users download Python modules to specified directories on their machines and then have ZOPE call these Python modules, do some calculations locally, and then transfer information back and forth between the user (remote browser) and the server. Could you point me in the correct direction for studying how to use Zope for a high load application server using the clients local computing power. Eventually I could (my current understanding) migrate the system to a ZEO type solution but that would require a good cash flow. Any advice you have in the matter would be appreciated: Mark Voss zmarkvoss@aol.com From robert@leftfieldcorp.com Wed Nov 24 02:00:39 1999 From: robert@leftfieldcorp.com (Robert Leftwich) Date: Wed, 24 Nov 1999 13:00:39 +1100 Subject: [Zope-dev] Moving load to client computers with Zope ? In-Reply-To: <0.ea932c04.256c945a@aol.com> Message-ID: XML-RPC might help you here, search the Zope site for xmlrpc. Also look at ZPublisher.Client Robert Leftwich > -----Original Message----- > From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf > Of ZMARKVOSS@aol.com > Sent: Wednesday, 24 November 1999 12:08 > To: zope-dev@zope.org > Subject: [Zope-dev] Moving load to client computers with Zope ? > > > Hello: > > I am looking to host an engineering application over the Internet. > > I have investigated ZOPE and it seems to be the best solution for > what I am > trying to do ... but I have a question. > > The application would place a large load on a server if it had to > run local > for each current user ... Is it possible to have the users > download Python > modules to specified directories on their machines and then have > ZOPE call > these Python modules, do some calculations locally, and then transfer > information back and forth between the user (remote browser) and > the server. > > Could you point me in the correct direction for studying how to > use Zope for > a high load application server using the clients local computing power. > > Eventually I could (my current understanding) migrate the system to a ZEO > type solution but that would require a good cash flow. > > Any advice you have in the matter would be appreciated: > > Mark Voss > zmarkvoss@aol.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 ) > From s341625@student.uq.edu.au Wed Nov 24 03:29:02 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 24 Nov 1999 13:29:02 +1000 (GMT+1000) Subject: [Zope-dev] Moving load to client computers with Zope ? In-Reply-To: <0.ea932c04.256c945a@aol.com> Message-ID: On Tue, 23 Nov 1999 ZMARKVOSS@aol.com wrote: > Hello: [snip] > The application would place a large load on a server if it had to run local > for each current user ... Is it possible to have the users download Python > modules to specified directories on their machines and then have ZOPE call > these Python modules, do some calculations locally, and then transfer > information back and forth between the user (remote browser) and the server. Why not implement some functions in JPython and get Java to mashall the data back and forth using XML-rpc? This way you have better control over the distribution yet still allow local calculation and you don't have to learn java. If you still wish to run python locally investigate the installer from Gordon (it "freezes" a complete python system - scripts and all into one binary. Works on all python platforms). You will have DLL issues unless you bind up the DLL's as well. Third option is to install Windows Scripting Host and Python and use ActiveX scripting within the web page to talk to python COM objects. This is messy however it may be required for some corporate environments that require a Microsoft Solution. Cheers, Anthony Pfrunder From Anthony Baxter Wed Nov 24 04:10:41 1999 From: Anthony Baxter (Anthony Baxter) Date: Wed, 24 Nov 1999 15:10:41 +1100 Subject: [Zope-dev] Re: mozilla and zope, update. In-Reply-To: Message from Anthony Baxter of "Fri, 19 Nov 1999 14:54:21 +1100." Message-ID: <199911240410.PAA21737@crown.off.ekorp.com> Just an update - Mozilla, as of the current builds, works fine with the zope management screens. The build I'm using is 1999112208, and it's really quite nice for zope. (and for not having to deal with Netscape4's appalling style sheet handling) I'm going to try and make a sidebar link that links into Zope's management sidebar - that would be way cool. Now if only ftp worked properly :) Anthony >>> Anthony Baxter wrote > For those who are interested, Mozilla is very very > close to being usable for working in Zope. At the > moment, the killer is the open bug 6144 - Moz loses > track of the auth header, and doesn't re-send it in. > This means that in the management interface, you're > not authorised, and so manage_workspace defaults to > index_html, rather than manage_main. From itamars@ibm.net Wed Nov 24 11:32:28 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Wed, 24 Nov 1999 13:32:28 +0200 Subject: [Zope-dev] Calling DTML methods from Python Message-ID: <383BCCCC.5D644EA8@ibm.net> I want to run manage_tabs from a PythonMethod. So I do request = self.manage_tabs(_.None, _) but now manage_tabs doesn't know who filtered_manage_tabs is. So how do I call a dtml method so that it knows where it is and works correctly? -- Itamar S.T. itamars@ibm.net From mezger@innominate.de Wed Nov 24 11:33:25 1999 From: mezger@innominate.de (Thilo Mezger) Date: 24 Nov 1999 11:33:25 GMT Subject: [Zope-dev] Re: mozilla and zope, update. References: Message-ID: <81gie5$3q2$1@lingo01.bln.innominate.de> Anthony Baxter wrote: > Now if only ftp worked properly :) you probably meant webdav i suppose... ;-) thilo -- mezger@innominate.de innominate AG networking people fon: +49.30.308806-11 fax: -77 web: http://innominate.de pgp: /pgp/tm From mj@antraciet.nl Wed Nov 24 10:43:49 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Wed, 24 Nov 1999 11:43:49 +0100 Subject: [Zope-dev] Calling DTML methods from Python In-Reply-To: <383BCCCC.5D644EA8@ibm.net> Message-ID: <4.2.0.58.19991124114301.00b52f00@lisp.atmm.nl> At 12:32 PM 11/24/99 , Itamar Shtull-Trauring wrote: >I want to run manage_tabs from a PythonMethod. >So I do > > request = self.manage_tabs(_.None, _) > >but now manage_tabs doesn't know who filtered_manage_tabs is. So how do I >call a dtml method so that it knows where it is and works correctly? Quick guess (untested): request = self.manage_tabs(self, _) The first parameter is the client object, a DTML Method's 'self'. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From s341625@student.uq.edu.au Wed Nov 24 12:15:00 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 24 Nov 1999 22:15:00 +1000 (GMT+1000) Subject: [Zope-dev] Calling DTML methods from Python In-Reply-To: <383BCCCC.5D644EA8@ibm.net> Message-ID: On Wed, 24 Nov 1999, Itamar Shtull-Trauring wrote: > I want to run manage_tabs from a PythonMethod. > So I do > > request = self.manage_tabs(_.None, _) > > but now manage_tabs doesn't know who filtered_manage_tabs is. So how do I > call a dtml method so that it knows where it is and works correctly? I could never get manage_tabs to work so I wrote my own ;) Check out VZClasses/Form/Editor/tab_management within VZ. Its based on manage_tabs but cleaned up. Next release i'll give it a makeover Cheers, Anthony Pfrunder From s341625@student.uq.edu.au Wed Nov 24 12:17:49 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Wed, 24 Nov 1999 22:17:49 +1000 (GMT+1000) Subject: [Zope-dev] Calling DTML methods from Python In-Reply-To: <4.2.0.58.19991124114301.00b52f00@lisp.atmm.nl> Message-ID: On Wed, 24 Nov 1999, Martijn Pieters wrote: > At 12:32 PM 11/24/99 , Itamar Shtull-Trauring wrote: > Quick guess (untested): > > request = self.manage_tabs(self, _) > > The first parameter is the client object, a DTML Method's 'self'. Hmm, But the filter list isn't hanging off self so that won't work. Check out the source at lib/python/App/manage_tabs.dtml. The filter is some global meta-dictionary thing that is defined elsewhere. Cheers, Anthony Pfrunder From Anthony Baxter Wed Nov 24 12:19:52 1999 From: Anthony Baxter (Anthony Baxter) Date: Wed, 24 Nov 1999 23:19:52 +1100 Subject: [Zope-dev] Re: mozilla and zope, update. In-Reply-To: Message from Thilo Mezger of "24 Nov 1999 11:33:25 GMT." <81gie5$3q2$1@lingo01.bln.innominate.de> Message-ID: <199911241219.XAA04170@mbuna.arbhome.com.au> >>> Thilo Mezger wrote > Anthony Baxter wrote: > > > Now if only ftp worked properly :) > > you probably meant webdav i suppose... ;-) nah, current mozilla, ftp is busted - you can't download files. but webdav would also be nice. last I looked, they weren't planning to support it for 5.0, tho. :( Anthony From itamars@ibm.net Wed Nov 24 12:41:28 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Wed, 24 Nov 1999 14:41:28 +0200 Subject: [Zope-dev] Calling DTML methods from Python References: <4.2.0.58.19991124114301.00b52f00@lisp.atmm.nl> Message-ID: <383BDCF8.4F74C261@ibm.net> Martijn Pieters wrote: > request = self.manage_tabs(self, _) I tried that too - it gives the following error: Error Type: AttributeError Error Value: validate Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: CatalogAware) File /home/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_ImagesForm) File /home/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_ImagesForm) File /home/zope/lib/python/Products/PythonMethod/PythonMethod.py, line 168, in __call__ (Object: manage_ImagesForm) (Info: ((
    ,), {}, None)) File , line 3, in manage_ImagesForm (Object: CatalogAware) File /home/zope/lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_tabs) (Info: /home/zope/lib/python/App/manage_tabs.dtml) File /home/zope/lib/python/DocumentTemplate/DT_String.py, line 490, in __call__ (Object: manage_tabs) AttributeError: (see above) -- Itamar S.T. itamars@ibm.net From robin@jessikat.demon.co.uk Wed Nov 24 14:16:00 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Wed, 24 Nov 1999 14:16:00 +0000 Subject: [Zope-dev] getting status variables Message-ID: anyone know how I can get the effect of
    • Zope version:
    • Python version:
    • System Platform:
    • Process ID: ()
    • Running for:
    without logging in as manager. Perhaps I should be using an external method? -- Robin Becker From mezger@innominate.de Wed Nov 24 14:24:55 1999 From: mezger@innominate.de (Thilo Mezger) Date: 24 Nov 1999 14:24:55 GMT Subject: [Zope-dev] FastCGI: failed to connect to server Message-ID: <81gsfn$jnq$1@lingo01.bln.innominate.de> hi! anybody using apache/mod_fastcgi together with zope as described in the very latest version of zope (just checked out from the cvs tree)??? i set up everything as described in WEBSERVERS.txt but i haven't managed to connect from apache to the zope process. apache's error_log shows: (111)Connection refused: FastCGI: failed to connect to server "/usr/local/httpd/htdocs/Zope": connect() failed i'm using sockets for connecting and mod_fastcgi_SNAP_Oct06 ... any helps/suggestions/reports welcome... thilo -- mezger@innominate.de innominate AG networking people fon: +49.30.308806-11 fax: -77 web: http://innominate.de pgp: /pgp/tm From circle@gwi.net Wed Nov 24 15:05:53 1999 From: circle@gwi.net (Andrew Wilcox) Date: Wed, 24 Nov 1999 10:05:53 -0500 Subject: [Zope-dev] How do I call careful_getattr()? Message-ID: <3.0.6.32.19991124100553.00820b10@mail.gwi.net> My TableView class allows the user to enter the name of a method to be called. Right now the code to call the method looks like this: rowIds = getattr(folder, self.rowIdsMethodName)() "self.rowIdsMethodName" gives me the name of the method, then I use getattr() to find the method, and then I call it. But, it would be better if this was security checked, so that the user couldn't type in something like "manage_delObjects" for the method name. :) Is this a job for careful_getattr() ? How do I call it? In particular, what is the "md" argument? I'm inside of a Product method superclassing a ZClass, so I've got a "self" and a "REQUEST" to work with. Thanks, Andrew From tommymi@concentric.net Wed Nov 24 16:36:50 1999 From: tommymi@concentric.net (Jens Vagelpohl) Date: Wed, 24 Nov 1999 11:36:50 -0500 Subject: [Zope-dev] Re: mozilla and zope, update. In-Reply-To: <199911241219.XAA04170@mbuna.arbhome.com.au> Message-ID: hi guys, how come when i enter the management pages using M11 the right pane will show the default method of whichever folder i click on in the left side pane..? :( jens > -----Original Message----- > From: anthony@nextTelecom.com [mailto:anthony@nextTelecom.com]On Behalf > Of Anthony Baxter > Sent: Wednesday, November 24, 1999 07:20 > To: Thilo Mezger > Cc: zope-dev@zope.org > Subject: Re: [Zope-dev] Re: mozilla and zope, update. > > > > >>> Thilo Mezger wrote > > Anthony Baxter wrote: > > > > > Now if only ftp worked properly :) > > > > you probably meant webdav i suppose... ;-) > > nah, current mozilla, ftp is busted - you can't download files. > > but webdav would also be nice. last I looked, they weren't planning > to support it for 5.0, tho. :( > > Anthony > > _______________________________________________ > 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 ) > > From itamars@ibm.net Wed Nov 24 17:06:21 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Wed, 24 Nov 1999 19:06:21 +0200 Subject: [Zope-dev] Re: mozilla and zope, update. References: Message-ID: <383C1B0D.EDF9FA6E@ibm.net> Jens Vagelpohl wrote: > > hi guys, > > how come when i enter the management pages using M11 the right pane will > show the default method of whichever folder i click on in the left side > pane..? I've had the same problem in kfm, and in w3m (coolest text browser around - it supports tables and you can it with a mouse!). -- Itamar S.T. itamars@ibm.net From robin@jessikat.demon.co.uk Wed Nov 24 15:07:39 1999 From: robin@jessikat.demon.co.uk (Robin Becker) Date: Wed, 24 Nov 1999 15:07:39 +0000 Subject: [Zope-dev] getting status variables In-Reply-To: References: Message-ID: In article , Robin Becker writes >anyone know how I can get the effect of > >
      >
    • Zope version: >
    • Python version: >
    • System Platform: >
    • Process ID: > () >
    • Running for: >
    > >without logging in as manager. Perhaps I should be using an external method? OK I used a proxy of manager for the containing document. Is this dangerous? -- Robin Becker From michel@digicool.com Wed Nov 24 18:15:57 1999 From: michel@digicool.com (Michel Pelletier) Date: Wed, 24 Nov 1999 13:15:57 -0500 Subject: [Zope-dev] Re: mozilla and zope, update. Message-ID: <613145F79272D211914B0020AFF640192762F6@gandalf.digicool.com> > -----Original Message----- > From: Itamar Shtull-Trauring [mailto:itamars@ibm.net] > Sent: Wednesday, November 24, 1999 12:06 PM > To: zope-dev@zope.org > Subject: Re: [Zope-dev] Re: mozilla and zope, update. > > > Jens Vagelpohl wrote: > > > > hi guys, > > > > how come when i enter the management pages using M11 the > right pane will > > show the default method of whichever folder i click on in > the left side > > pane..? This is a known bug in Mozilla, it's in their bugtracker. Someone posted this information to zope-dev a few days ago. > I've had the same problem in kfm, and in w3m (coolest text > browser around - > it supports tables and you can it with a mouse!). I like w3m too, but its got this bug and others. It's not a bug in Zope, Zope computes the right hand frame based on the user auth and nothing else, if the browser doesn't send that with the frame as well as the frameset, then Zope can't compute it. -Michel From evan@4-am.com Wed Nov 24 18:40:24 1999 From: evan@4-am.com (Evan Simpson) Date: Wed, 24 Nov 1999 12:40:24 -0600 Subject: [Zope-dev] Calling DTML methods from Python References: <383BCCCC.5D644EA8@ibm.net> Message-ID: <383C3118.5DDD088B@4-am.com> Itamar Shtull-Trauring wrote: > I want to run manage_tabs from a PythonMethod. > So I do > > request = self.manage_tabs(_.None, _) > > but now manage_tabs doesn't know who filtered_manage_tabs is. So how do I > call a dtml method so that it knows where it is and works correctly? This needs a bit more context. Is this PythonMethod being called from another object, or is it the target of the request? I ask because the following works for me, if it is the target: self, REQUEST print self.standard_html_header(self, REQUEST) print self.manage_tabs(self, REQUEST) print '

    Test

    ' print self.standard_html_footer(self, REQUEST) return printed When called from a DTML Method with , the following also works: client, _ return client.manage_tabs(client, _) Cheers, Evan @ 4-am From lstafford@icompression.com Wed Nov 24 18:45:42 1999 From: lstafford@icompression.com (Loren Stafford) Date: Wed, 24 Nov 1999 10:45:42 -0800 Subject: [Zope-dev] Moving load to client computers with Zope ? In-Reply-To: <0.ea932c04.256c945a@aol.com> Message-ID: <000401bf36ac$1c463060$8b0127d8@eagle.icompression.com> If the local machines can also run Zope or if you otherwise have total control over the interfaces to the processes that run on those machines, then ZClient (ZPublisher.client) is an easy way to enable the main server to do remote procedure calls to the local machines. See http://www.zope.org/Members/lstaffor/ZClientMethod. XML-RPC is more general, but a little harder to get started with. -- Loren > -----Original Message----- > From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf > Of ZMARKVOSS@aol.com > Sent: Tuesday, November 23, 1999 17:08 > To: zope-dev@zope.org > Subject: [Zope-dev] Moving load to client computers with Zope ? > > > Hello: > > I am looking to host an engineering application over the Internet. > > I have investigated ZOPE and it seems to be the best solution for > what I am > trying to do ... but I have a question. > > The application would place a large load on a server if it had to > run local > for each current user ... Is it possible to have the users > download Python > modules to specified directories on their machines and then have > ZOPE call > these Python modules, do some calculations locally, and then transfer > information back and forth between the user (remote browser) and > the server. > > Could you point me in the correct direction for studying how to > use Zope for > a high load application server using the clients local computing power. > > Eventually I could (my current understanding) migrate the system to a ZEO > type solution but that would require a good cash flow. > > Any advice you have in the matter would be appreciated: > > Mark Voss > zmarkvoss@aol.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 ) > From evan@4-am.com Wed Nov 24 19:48:50 1999 From: evan@4-am.com (Evan Simpson) Date: Wed, 24 Nov 1999 13:48:50 -0600 Subject: [Zope-dev] Re: mozilla and zope, update. References: <383C1B0D.EDF9FA6E@ibm.net> Message-ID: <383C4122.AF3A89FF@4-am.com> Itamar Shtull-Trauring wrote: > Jens Vagelpohl wrote: > > > > hi guys, > > > > how come when i enter the management pages using M11 the right pane will > > show the default method of whichever folder i click on in the left side > > pane..? > > I've had the same problem in kfm, and in w3m (coolest text browser around - > it supports tables and you can it with a mouse!). I think that all of these browsers fail to properly pass authentication information to framed pages, so manage_main is filtered out of the method list consulted by manage_workspace. You may also notice them asking you to login multiple times under some circumstances because of this. Cheers, Evan @ 4-am From hannu@tm.ee Wed Nov 24 19:57:50 1999 From: hannu@tm.ee (Hannu Krosing) Date: Wed, 24 Nov 1999 21:57:50 +0200 Subject: [Zope-dev] Re: mozilla and zope, update. References: <383C1B0D.EDF9FA6E@ibm.net> Message-ID: <383C433E.71E45A1F@tm.ee> Itamar Shtull-Trauring wrote: > > Jens Vagelpohl wrote: > > > > hi guys, > > > > how come when i enter the management pages using M11 the right pane will > > show the default method of whichever folder i click on in the left side > > pane..? > > I've had the same problem in kfm, and in w3m (coolest text browser around - > it supports tables and you can it with a mouse!). The same behavior is also present in Grail, just to be complete ;) ------------- Hannu From lalo@webcom.com Wed Nov 24 20:41:10 1999 From: lalo@webcom.com (Lalo Martins) Date: Wed, 24 Nov 1999 18:41:10 -0200 Subject: [Zope-dev] dtml: "where am I? who am I?" Message-ID: <19991124184109.H20496@webcom.com> Is there a way for a method (dtml or python, whatever) to know its location? Say: foo (folder) +--- bar (folder) | +--- my_method (DTML|python method) +--- gee (folder) +--- index_html if gee/index_html calls my_method, it doesn't know it's inside ``bar'' so it messes up any relative URL it spits. The practical case where this is bothering me is the Banner product. The Banner objects reside inside a BannerFolder which does the banner rotation. But if some method/document not in the same folder as the BannerFolder calls it, the Banner objects will freak out (and not show an image). []s, |alo +---- -- I am Lalo of deB-org. You will be freed. Resistance is futile. http://www.webcom.com/lalo mailto:lalo@webcom.com pgp key in the web page Debian GNU/Linux --- http://www.debian.org Brazil of Darkness -- http://zope.gf.com.br/BroDar From michel@digicool.com Wed Nov 24 21:49:30 1999 From: michel@digicool.com (Michel Pelletier) Date: Wed, 24 Nov 1999 16:49:30 -0500 Subject: [Zope-dev] dtml: "where am I? who am I?" Message-ID: <613145F79272D211914B0020AFF640192762F9@gandalf.digicool.com> > -----Original Message----- > From: Lalo Martins [mailto:lalo@webcom.com] > Sent: Wednesday, November 24, 1999 3:41 PM > To: zope-dev@zope.org > Subject: [Zope-dev] dtml: "where am I? who am I?" > > > Is there a way for a method (dtml or python, whatever) to know > its location? Say: > > foo (folder) > +--- bar (folder) > | +--- my_method (DTML|python method) > +--- gee (folder) > +--- index_html > > if gee/index_html calls my_method, it doesn't know it's inside > ``bar'' so it messes up any relative URL it spits. I think what your looking for is the containment path of the object, not the acquisition path. If you use acquisition, you'll have to deal with the fact that the objects 'path' depends on how it is acquired. In your example, if gee/index_html called my_method, then its aq_parent is 'gee' not 'bar'. This is the correct behavior. If you want to find an objects *containment* parent, then you have to do 'object.aq_inner.aq_parent'. You cannot get 'aq_inner' from DTML, I can't think of any good reason why not, but security would have to be carefully thought out. -Michel From banderson@boi.hp.com Wed Nov 24 21:40:32 1999 From: banderson@boi.hp.com (Bill Anderson) Date: Wed, 24 Nov 1999 21:40:32 +0000 Subject: [Zope-dev] Sybase DA import error Message-ID: <383C5B50.DC7A19D8@boi.hp.com> I seem to be getting in import error when testing the SyBase adapter. import error follows: >>> import ctsybase Traceback (innermost last): File "", line 1, in ? ImportError: /opt/sybase-11.9.2/lib/libct.so: undefined symbol: scl_sess_alloc Any ideas? I have reinstalled the rpm to no avail (as expected). (this address is not on the list, so a cc would be appreciated ...) -- Bill Anderson Linux/Unix Administrator, Security Analyst ESBU (ARC) bill_anderson@boi.hp.com My opinions are just that; _my_ opinions. From michel@digicool.com Wed Nov 24 21:55:05 1999 From: michel@digicool.com (Michel Pelletier) Date: Wed, 24 Nov 1999 16:55:05 -0500 Subject: [Zope-dev] Sybase DA import error Message-ID: <613145F79272D211914B0020AFF640192762FA@gandalf.digicool.com> > -----Original Message----- > From: Bill Anderson [mailto:banderson@boi.hp.com] > Sent: Wednesday, November 24, 1999 4:41 PM > To: zope-dev@zope.org > Subject: [Zope-dev] Sybase DA import error > > > > > I seem to be getting in import error when testing the SyBase adapter. > > import error follows: > > >>> import ctsybase > Traceback (innermost last): > File "", line 1, in ? > ImportError: /opt/sybase-11.9.2/lib/libct.so: undefined symbol: > scl_sess_alloc > > > Any ideas? I have reinstalled the rpm to no avail (as expected). > > (this address is not on the list, so a cc would be appreciated ...) Are you using the new ctsybase adapter or the old one? (We only support the new one). http://www.zope.org/Products/DA/SybaseDA/ -Michel From chrism@digicool.com Wed Nov 24 21:46:22 1999 From: chrism@digicool.com (Chris McDonough) Date: Wed, 24 Nov 1999 16:46:22 -0500 Subject: [Zope-dev] Sybase DA import error References: <383C5B50.DC7A19D8@boi.hp.com> Message-ID: <383C5CAE.615E0532@digicool.com> Bill, a new dcSybaseDA was released into beta... please download it and install it per the package installation instructions. It can be found at http://www.zope.org/Products/DA/SybaseDA It (apparently) fixes a lot of bugs encountered in the old sybase da's. HTH... Bill Anderson wrote: > > I seem to be getting in import error when testing the SyBase adapter. > > import error follows: > > >>> import ctsybase > Traceback (innermost last): > File "", line 1, in ? > ImportError: /opt/sybase-11.9.2/lib/libct.so: undefined symbol: > scl_sess_alloc > > Any ideas? I have reinstalled the rpm to no avail (as expected). > > (this address is not on the list, so a cc would be appreciated ...) > > -- > Bill Anderson Linux/Unix Administrator, Security Analyst > ESBU (ARC) bill_anderson@boi.hp.com > My opinions are just that; _my_ opinions. > > _______________________________________________ > 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 ) From banderson@boi.hp.com Wed Nov 24 21:59:10 1999 From: banderson@boi.hp.com (Bill Anderson) Date: Wed, 24 Nov 1999 21:59:10 +0000 Subject: [Zope-dev] Sybase DA import error References: <383C5B50.DC7A19D8@boi.hp.com> <383C5CAE.615E0532@digicool.com> Message-ID: <383C5FAE.CAD65E99@boi.hp.com> (list cc'ed to avoid unneccesary responses ;-) Chris McDonough wrote: > > Bill, a new dcSybaseDA was released into beta... please download it and > install it per the package installation instructions. It can be found > at http://www.zope.org/Products/DA/SybaseDA > > It (apparently) fixes a lot of bugs encountered in the old sybase da's. > > HTH... doh! downloaded it, but apparently untarred the wrong one! Seems to work now. Thanks for the Speedy response. Oughtta make the boss happier (they are considering Zope w/a support contract). Thanks, Bill -- Bill Anderson Linux/Unix Administrator, Security Analyst ESBU (ARC) bill_anderson@boi.hp.com My opinions are just that; _my_ opinions. From tpatrick@IndigoNetworks.com Wed Nov 24 22:16:41 1999 From: tpatrick@IndigoNetworks.com (Theodore Patrick) Date: Wed, 24 Nov 1999 16:16:41 -0600 Subject: [Zope-dev] HAPPY THANKSGIVING TO ALL! Message-ID: <57D47461794DD211825300A0C9D17EF914CA8F@IGOPDC01> Zope & All, Thanks for the code and all the trimmings (Plus the Recipe!)! Have a wonderful Thanksgiving! Keep up the great work! Theodore E. Patrick Ishophere.com - Where do you shop? From alex@gabuzomeu.net Wed Nov 24 22:56:51 1999 From: alex@gabuzomeu.net (Alexandre Ratti) Date: Wed, 24 Nov 1999 23:56:51 +0100 Subject: [Zope-dev] Getting a list of ZCatalogish objects Message-ID: <4.2.0.58.19991124235307.00a9cf10@192.168.0.2> Hello, How could I retrieve a list of available ZCatalogish objects? I meant objects in which CatalogAware objects can register themselves. This include ZCatalogs but also custom objects based on ZCatalog. The nearest solution I've found yet is using ZQueryIds(). This method returns ids of searchable objects, which isn't exactly what I'm looking for (Z SQL methods are searchable, aren't they?). Thanks. Alexandre From Anthony Baxter Wed Nov 24 23:15:30 1999 From: Anthony Baxter (Anthony Baxter) Date: Thu, 25 Nov 1999 10:15:30 +1100 Subject: [Zope-dev] Re: mozilla and zope, update. In-Reply-To: Message from Evan Simpson of "Wed, 24 Nov 1999 13:48:50 MDT." <383C4122.AF3A89FF@4-am.com> Message-ID: <199911242315.KAA05261@mbuna.arbhome.com.au> >>> Evan Simpson wrote > Itamar Shtull-Trauring wrote: > > > Jens Vagelpohl wrote: > > > > > > hi guys, > > > > > > how come when i enter the management pages using M11 the right pane will > > > show the default method of whichever folder i click on in the left side > > > pane..? > > > > I've had the same problem in kfm, and in w3m (coolest text browser around - > > it supports tables and you can it with a mouse!). > > I think that all of these browsers fail to properly pass authentication > information to framed pages, so manage_main is filtered out of the method list > consulted by manage_workspace. You may also notice them asking you to login > multiple times under some circumstances because of this. Yep, this is the cause. See the post I made yesterday - snapshots of mozilla since a few days ago have a fix for this. Without this fix, the zope mgmt interface is not usable. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From lalo@webcom.com Wed Nov 24 23:48:03 1999 From: lalo@webcom.com (Lalo Martins) Date: Wed, 24 Nov 1999 21:48:03 -0200 Subject: [Zope-dev] dtml: "where am I? who am I?" In-Reply-To: <613145F79272D211914B0020AFF640192762F9@gandalf.digicool.com>; from michel@digicool.com on Wed, Nov 24, 1999 at 04:49:30PM -0500 References: <613145F79272D211914B0020AFF640192762F9@gandalf.digicool.com> Message-ID: <19991124214803.A26379@webcom.com> On Wed, Nov 24, 1999 at 04:49:30PM -0500, Michel Pelletier wrote: > > > > if gee/index_html calls my_method, it doesn't know it's inside > > ``bar'' so it messes up any relative URL it spits. > > I think what your looking for is the containment path of the object, not > the acquisition path. If you use acquisition, you'll have to deal with > the fact that the objects 'path' depends on how it is acquired. In your > example, if gee/index_html called my_method, then its aq_parent is 'gee' > not 'bar'. This is the correct behavior. Yes, I get that. As I said, the real-world example is the Banner Product: root +--- BroDar (Folder) | +--- BotaoBroDar (BannerAd) +--- lalo (Folder) +--- aqtest (DTML Method) Documents under ``BroDar'' can include the button by using . Works. But if something under ``lalo'' tries to include it (), it will generate something like: which of couse won't work. I worked around this by copying the button to my folder. In the BannerFolder ZClass, I work around this by doing the Python equivalent of sed'ing the BannerAd output to convert it to something like (where ``banner'' is the name of the BannerFolder). But I wonder if there isn't a better way. []s, |alo +---- -- I am Lalo of deB-org. You will be freed. Resistance is futile. http://www.webcom.com/lalo mailto:lalo@webcom.com pgp key in the web page Debian GNU/Linux --- http://www.debian.org Brazil of Darkness -- http://zope.gf.com.br/BroDar From itavor@bigpond.net.au Thu Nov 25 00:27:07 1999 From: itavor@bigpond.net.au (Itai Tavor) Date: Thu, 25 Nov 1999 11:27:07 +1100 Subject: [Zope-dev] Best way to email a newsletter to thousands of recipients from a Zope site Zope site Message-ID: Hi, I need to add a newsletter feature to a Zope site. Interested people will be able to register their email addresses, and the newsletter will be mailed to all addresses every 1-2 weeks. The number of recipients could potentially have 4 zeroes in it (and no, it won't be 0000). What would be the best way to do the mailing? Use mailhost with a very long recipient list? Call mailhost once for every recipient? Use some external tool to do the mailing? Thanks in advance Itai Tavor -- Itai Tavor -- "Je sautille, donc je suis." -- itavor@vic.bigpond.net.au -- - Kermit the Frog -- -- "What he needs now is understanding... and a confederate victory" -- -- Dr. Jacobi, Twin Peaks -- From zope@teleo.net Thu Nov 25 01:01:39 1999 From: zope@teleo.net (Patrick Phalen) Date: Wed, 24 Nov 1999 17:01:39 -0800 Subject: [Zope-dev] Best way to email a newsletter to thousands of recipients from a Zope site Zope site In-Reply-To: References: Message-ID: <99112417290400.01241@quadra.teleo.net> [Itai Tavor, on Wed, 24 Nov 1999] :: Hi, :: :: I need to add a newsletter feature to a Zope site. Interested people :: will be able to register their email addresses, and the newsletter :: will be mailed to all addresses every 1-2 weeks. The number of :: recipients could potentially have 4 zeroes in it (and no, it won't be :: 0000). :: :: What would be the best way to do the mailing? Use mailhost with a :: very long recipient list? Call mailhost once for every recipient? Use :: some external tool to do the mailing? I think I've looked at everything available and am convinced that Dan Bernstein's qmail/ezmlm offer the best performance, security and ease of maintenance. Have a look at www.qmail.org and www.ezmlm.org (qmail is the MTA and ezmlm the mailing list manager -- they work hand in hand). You can run a dedicated list server with the qmail/ezmlm combo on a castoff 486 machine under Linux and it will be plenty fast enough for your needs. I think both apache.org and redhat.com still handle all their mail on low-end Pentiums with qmail. I administer 20 mailing lists this way and never have to touch them. From s341625@student.uq.edu.au Thu Nov 25 02:05:20 1999 From: s341625@student.uq.edu.au (Anthony Pfrunder) Date: Thu, 25 Nov 1999 12:05:20 +1000 (GMT+1000) Subject: [Zope-dev] Best way to email a newsletter to thousands of recipients from a Zope site Zope site In-Reply-To: Message-ID: Hi, Check out Mailman. This is the system used on Zope and Python sites. Unforetunatly it doesn't integrete with the new Zope features but it *is* written in python. I assume it can handle the load as Zope gets a lot of traffic. Cheers, Anthony Pfrunder From bill.anderson@libc.org Thu Nov 25 10:10:24 1999 From: bill.anderson@libc.org (Bill Anderson) Date: Thu, 25 Nov 1999 03:10:24 -0700 Subject: [Zope-dev] Re: [Zope] P SQL Input Wizard and Zope 2.01 References: <383C2085.BDE16D1E@engin.umich.edu> Message-ID: <383D0B10.4D63DC9D@libc.org> CC-ed to Zope list, as far as I can see, it is the appropriate list?) Darcy Clark wrote: > > I am learning Z SQL methods and thought that the P SQL Input Wizard > might be a useful product to play with, since the Z SQL User Guide > doesn't really cover inserts and updates. Unfortunately it don't work > with my install of Zope 2.01/Linux. The product installs ok, and the > wizard runs up until the point when the methods are created, then I get > a Zope error : ... >Error Type: NameError >Error Value: Products > Errors with this product and Zope2.01 have been flagged before on the > list, and several fixes have been promoted ....unfortunately, none of > the fixes worked for me [see http://www.egroups.com/mboxsearch?query=PSQL&what=frame&listname=zope] > > Anyone got this product working with Zope2.01/Linux? > > thanks for any help, > > Darcy Though not truly helpful, none of them worked for me either :-( I am still getting ye ole manage_addZSQLMethod attribute (name?) error :-( btw, this is on 2.1b as well. Bill -- "They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown." -- Carl Sagan From itamars@ibm.net Thu Nov 25 10:12:00 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Thu, 25 Nov 1999 12:12:00 +0200 Subject: [Zope-dev] Calling DTML methods from Python References: <383BCCCC.5D644EA8@ibm.net> <383C3118.5DDD088B@4-am.com> Message-ID: <383D0B70.F83D9BD3@ibm.net> Evan Simpson wrote: > This needs a bit more context. Is this PythonMethod being called from > another object, or is it the target of the request? I ask because the > following works for me, if it is the target: > > self, REQUEST > print self.standard_html_header(self, REQUEST) > print self.manage_tabs(self, REQUEST) Thanks - that worked. -- Itamar S.T. itamars@ibm.net From mezger@innominate.de Thu Nov 25 11:14:46 1999 From: mezger@innominate.de (Thilo Mezger) Date: 25 Nov 1999 11:14:46 GMT Subject: [Zope-dev] deleting standard_html_header Message-ID: <81j5n6$efc$1@lingo01.bln.innominate.de> hi, does anybody know why i can't delete standard_html_{header,footer,error} ? i get an error message "standard_html_header does not support this action" or something. i suppose that this object is somehow "protected" so that i can't delete it because it is vitally important to the system. any idea how i could remove this delete protection? thilo -- mezger@innominate.de innominate AG networking people fon: +49.30.308806-11 fax: -77 web: http://innominate.de pgp: /pgp/tm From mj@antraciet.nl Thu Nov 25 10:31:17 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Thu, 25 Nov 1999 11:31:17 +0100 Subject: [Zope-dev] deleting standard_html_header In-Reply-To: <81j5n6$efc$1@lingo01.bln.innominate.de> Message-ID: <4.2.0.58.19991125112139.01d68df0@lisp.atmm.nl> At 12:14 PM 11/25/99 , Thilo Mezger wrote: >hi, > >does anybody know why i can't delete >standard_html_{header,footer,error} ? i get an error message >"standard_html_header does not support this action" or something. > >i suppose that this object is somehow "protected" so that i can't >delete it because it is vitally important to the system. > >any idea how i could remove this delete protection? Why do you want to do this? It is possible to remove this protection by removing the id of the object that is protected from a list found on the root object, called _reserved_names. You could use the monitor client to step into your zope process, and do something like this: import Zope app=Zope.app() app._reserved_names and the last command should show a tuple with all protected ids in it. If you set _reserved_names to a tuple that doesn't include the ids you want to be able to delete, the protection is gone. The command sequence: app._reserved_names = () get_transaction().commit() will remove all objects from this protection against deletion. Don't forget the commit(), this will save all changes made in the transaction. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From ava@dde974.equipement.gouv.fr Thu Nov 25 13:29:35 1999 From: ava@dde974.equipement.gouv.fr (Ava) Date: Thu, 25 Nov 1999 17:29:35 +0400 Subject: [Zope-dev] type() in DTML or/and in Python Method? Message-ID: Hello, I wonder why the builtin function type() is not available, neither from DTML nor from products like PythonMethod ? Could the use of such a function be a security problem? For example, it is impossible to know if a variable holds a list or a tuple or a string from DTML. I wrote a PythonMethod to do just that: ---------8<---------- return type(value)==type([]) ---------8<---------- But that didn't work either. So I ended up writing this PythonMethod: ---------8<---------- try: value+[] # if it throws an exception, value is not of type 'list' except: return 0 return 1 ---------8<---------- Sometimes, it is not desirable to write an external method, and in such circumstances, one feel like doing simple things in a simple manner... :-) note that i am mostly interested by the security implication caused by the use of the type function. Solving my "problem" is not important right now. Regards, Jephte CLAIN minf7@educ.univ-reunion.fr PS: please post any answer to minf7@educ.univ-reunion.fr instead of ava@dde974.equipement.gouv.fr Also, I'm not on the list yet, so if you could cc me any answer... From m.faassen@vet.uu.nl Thu Nov 25 15:17:27 1999 From: m.faassen@vet.uu.nl (Martijn Faassen) Date: Thu, 25 Nov 1999 16:17:27 +0100 Subject: [Zope-dev] Copy and paste is not working in custom folder product Message-ID: <383D5307.9E85C241@vet.uu.nl> Hi there, I've created a custom folder which has some addable products defined inside it. When I add such a product and try to copy and paste it, I get this traceback: The object test does not support this operation Traceback (innermost last): File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/zope/lib/python/Zope/__init__.py, line 201, in zpublisher_exception_hook File /home/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /home/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_pasteObjects) File /home/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_pasteObjects) File /home/zope/lib/python/OFS/CopySupport.py, line 199, in manage_pasteObjects File /home/zope/lib/python/OFS/CopySupport.py, line 374, in _verifyObjectPaste Copy Error: (see above) The folderish product derives from ObjectManager. The addable products derive from OFS.SimpleItem.Item, Persistent, Acquisition.Implicit, AccessControl.Role.RoleManager Note that these addable products do have an extra object set inside them. Should this one somehow define copysupport as well? Anybody have any clue why copy and paste is not working? What should I investigate? If this post contains too little information I'll just release my code with this bug next week so people can study it then. :) Regards, Martijn From mj@antraciet.nl Thu Nov 25 14:48:55 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Thu, 25 Nov 1999 15:48:55 +0100 Subject: [Zope-dev] Copy and paste is not working in custom folder product In-Reply-To: <383D5307.9E85C241@vet.uu.nl> Message-ID: <4.2.0.58.19991125152930.00c652c0@lisp.atmm.nl> At 04:17 PM 11/25/99 , Martijn Faassen wrote: >Hi there, > >I've created a custom folder which has some addable products defined >inside it. When I add such a product and try to copy and paste it, I get >this traceback: > >The object test does not support this operation > >Traceback (innermost last): > File /home/zope/lib/python/ZPublisher/Publish.py, line 214, in >publish_module > File /home/zope/lib/python/ZPublisher/Publish.py, line 179, in publish > File /home/zope/lib/python/Zope/__init__.py, line 201, in >zpublisher_exception_hook > File /home/zope/lib/python/ZPublisher/Publish.py, line 165, in publish > File /home/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply > (Object: manage_pasteObjects) > File /home/zope/lib/python/ZPublisher/Publish.py, line 102, in >call_object > (Object: manage_pasteObjects) > File /home/zope/lib/python/OFS/CopySupport.py, line 199, in >manage_pasteObjects > File /home/zope/lib/python/OFS/CopySupport.py, line 374, in >_verifyObjectPaste >Copy Error: (see above) > >The folderish product derives from ObjectManager. > >The addable products derive from > OFS.SimpleItem.Item, > Persistent, > Acquisition.Implicit, > AccessControl.Role.RoleManager > >Note that these addable products do have an extra object set inside >them. Should this one somehow define copysupport as well? > >Anybody have any clue why copy and paste is not working? What should I >investigate? If this post contains too little information I'll just >release my code with this bug next week so people can study it then. :) Well, let's start with CopySupport.py. It'll throw above warning in several cases, but the line number in your traceback points to the last case in this method. It first checks if the meta_type of the object copied is addable to the target container (it checks for this with all_meta_types). Then it'll check if the user has permission to add the copied object to this container. One of these two checks fails. You can check this code yourself, it's line 332 up to 369 of CopySupport.py. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From evan@4-am.com Thu Nov 25 15:58:17 1999 From: evan@4-am.com (Evan Simpson) Date: Thu, 25 Nov 1999 09:58:17 -0600 Subject: [Zope-dev] Copy and paste is not working in custom folder product References: <383D5307.9E85C241@vet.uu.nl> Message-ID: <383D5C99.2DA3C7B6@4-am.com> Martijn Faassen wrote: > Anybody have any clue why copy and paste is not working? What should I > investigate? If this post contains too little information I'll just > release my code with this bug next week so people can study it then. :) Do rename and import fail with the same message? One version of PythonMethods had a bug which looked just like this. It was introduced when I moved some HTMLFiles (in particular, the add-a-new-PM dtml file) into a subdirectory of the product. I was never able to track down the exact cause, but changing how I loaded my .dtml files fixed the problem. Cheers, Evan @ 4-am From evan@4-am.com Thu Nov 25 16:01:41 1999 From: evan@4-am.com (Evan Simpson) Date: Thu, 25 Nov 1999 10:01:41 -0600 Subject: [Zope-dev] type() in DTML or/and in Python Method? References: Message-ID: <383D5D65.EF5FFAD3@4-am.com> Ava wrote: > Hello, > > I wonder why the builtin function type() is not available, neither from DTML > nor from products like PythonMethod ? > Could the use of such a function be a security problem? Yep. Beleive it or not, on certain Extension Methods type() returns an executable object which should not be exposed in Zope. I've suggested adding a nice safe same_type(a,b) function to the namespace, but got no response. I'll go file it with the Collector now. Cheers, Evan @ 4-am From itamars@ibm.net Thu Nov 25 20:05:57 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Thu, 25 Nov 1999 22:05:57 +0200 Subject: [Zope-dev] Storing changes in ZODB, without keeping old versions Message-ID: <383D96A5.F6E723F4@ibm.net> The ZCache Product I created has one major problem - every time it updates itself it'll make the ZODB grow, since it stores all the old contents it had. I don't want this to happen - there's no reason why anyone should undo a change to the cache. I do however want the contents of the ZCache to be stored on disk when it gets moved out of the Zope cache, so I don't want to use volatile variables. Is there any way to do this? Or is it impossible? -- Itamar S.T. itamars@ibm.net From zen@cs.rmit.edu.au Fri Nov 26 01:11:57 1999 From: zen@cs.rmit.edu.au (Stuart 'Zen' Bishop) Date: Fri, 26 Nov 1999 12:11:57 +1100 (EST) Subject: [Zope-dev] Storing changes in ZODB, without keeping old versions In-Reply-To: <383D96A5.F6E723F4@ibm.net> Message-ID: On Thu, 25 Nov 1999, Itamar Shtull-Trauring wrote: > The ZCache Product I created has one major problem - every time it updates > itself it'll make the ZODB grow, since it stores all the old contents it > had. I don't want this to happen - there's no reason why anyone should undo > a change to the cache. I do however want the contents of the ZCache to be > stored on disk when it gets moved out of the Zope cache, so I don't want to > use volatile variables. > > Is there any way to do this? Or is it impossible? If you don't want it in memory, and you don't want it in a SQL backend, you'll need to store the contents in a file in Zope's var directory. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen From hgebel@inet.net Fri Nov 26 01:39:26 1999 From: hgebel@inet.net (Harry Henry Gebel) Date: Fri, 26 Nov 1999 01:39:26 +0000 Subject: [Zope-dev] Problem editing index_html in Zclass Message-ID: <383DE4CE.A973090B@inet.net> I have an index_html DTML Method in a ZClass called ProfileClass, I am unable to open this method for editing in Xemacs. Here is the problem, I tried to open it with: /127.0.0.1:/Control_Panel/Products/Profile/ProfileClass/index_html but got a message that the file did not exist. I then opened /127.0.0.1:/ and changed "directories" until I got to /127.0.0.1:/Control_Panel/Products/Profile but when I looked at this listing ProfileClass was not marked as a "directory" so there was no way for me to cd to it. I tried moving the index_html method to Profile thinking that perhaps ProfileClass would acquire it from Profile, but it didn't work. Is there any way for me to edit this directly in Xemacs with EFS or will I have to open it in the Zope management interface and use cut and paste to enter it? I am using Zope 2.1.0b2 on Linux Mandrake 6.1 w/ the included python (1.5.2) . ---------------------------------------------------------------------- Harry Henry Gebel ICQ# 43675297 West Dover Hundred, Delaware ---------------------------------------------------------------------- From faassen@vet.uu.nl Fri Nov 26 01:49:19 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Fri, 26 Nov 1999 02:49:19 +0100 Subject: [Zope-dev] Copy and paste is not working in custom folder product In-Reply-To: <4.2.0.58.19991125152930.00c652c0@lisp.atmm.nl> References: <383D5307.9E85C241@vet.uu.nl> <4.2.0.58.19991125152930.00c652c0@lisp.atmm.nl> Message-ID: <19991126024919.A15679@vet.uu.nl> Martijn Pieters wrote: > At 04:17 PM 11/25/99 , Martijn Faassen wrote: [snip my problem] > Well, let's start with CopySupport.py. > > It'll throw above warning in several cases, but the line number in your > traceback points to the last case in this method. Right, I saw that and I looked at that code, but then I felt vague and got lost. :) > It first checks if the meta_type of the object copied is addable to the > target container (it checks for this with all_meta_types). Then it'll check > if the user has permission to add the copied object to this container. > > One of these two checks fails. You can check this code yourself, it's line > 332 up to 369 of CopySupport.py. Oddly enough though, it doesn't seem like these checks *should* fail: * I can add a new object of the same meta_type to that folder, in the management screen -- so it should be part of all_meta_types * Because I can do that (logged in as manager) it doesn't seem to be a security check that fails as well. Since apparently it has to be one of these two I'll continue my search, but it certainly is odd. Perhaps it's a matter of strangely configured security. And I do hack around meta_types a bit so it may be that as well. Regards, Martijn From faassen@vet.uu.nl Fri Nov 26 01:55:13 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Fri, 26 Nov 1999 02:55:13 +0100 Subject: [Zope-dev] Copy and paste is not working in custom folder product In-Reply-To: <383D5C99.2DA3C7B6@4-am.com> References: <383D5307.9E85C241@vet.uu.nl> <383D5C99.2DA3C7B6@4-am.com> Message-ID: <19991126025513.B15679@vet.uu.nl> Evan Simpson wrote: > Martijn Faassen wrote: > > > Anybody have any clue why copy and paste is not working? What should I > > investigate? If this post contains too little information I'll just > > release my code with this bug next week so people can study it then. :) > > Do rename and import fail with the same message? One version of > PythonMethods had a bug which looked just like this. It was introduced > when I moved some HTMLFiles (in particular, the add-a-new-PM dtml file) > into a subdirectory of the product. I was never able to track down the > exact cause, but changing how I loaded my .dtml files fixed the problem. Good question.. I'll check. rename -- yup, fails on the same error. import/export -- hm. reminds me to add an import/export tab. Right now the 'export..' button can be used though. Yes, also the same error. Thanks for this clue! I don't know what to do now, though. My .dtml files don't reside in subdirectories. Though it's very well possible it's due to some of the other odd stuff I do. :) How'd you change the way you loaded your .dtml files? I suppose I should just release what I have next week to have people look at it. Regards, Martijn From evan@4-am.com Fri Nov 26 02:29:48 1999 From: evan@4-am.com (Evan Simpson) Date: Thu, 25 Nov 1999 20:29:48 -0600 Subject: [Zope-dev] Copy and paste is not working in custom folder product References: <383D5307.9E85C241@vet.uu.nl> <383D5C99.2DA3C7B6@4-am.com> <19991126025513.B15679@vet.uu.nl> Message-ID: <383DF09C.F4230D9A@4-am.com> Martijn Faassen wrote: > Thanks for this clue! I don't know what to do now, though. My .dtml files > don't reside in subdirectories. Though it's very well possible it's due to > some of the other odd stuff I do. :) How'd you change the way you loaded > your .dtml files? I changed manage_addPythonMethodForm=HTMLFile('www/methodAdd', globals()) to _www = os.path.join(package_home(globals()), 'www') manage_addPythonMethodForm=HTMLFile('methodAdd', _www) All I can figure is that loading the HTMLFile with a pathname instead of a basename somehow caused the problem. Cheers, Evan @ 4-am From benno@netizen.com.au Fri Nov 26 03:32:24 1999 From: benno@netizen.com.au (Benno Rice) Date: Fri, 26 Nov 1999 14:32:24 +1100 Subject: [Zope-dev] Australian time zones? Message-ID: <19991126143224.B10442@netizen.com.au> Does Zope's DateTime class know about Australian timezones? I did a grep through lib/python/DateTime/DateTimeZone.py and didn't get any results. If they're not there, how can I add them? -- Benno Rice "No, no. We're *sweet* and XNFP Aries Dark Subculture- *innocent* evil bastards." friendly Internet Geek benno@netizen.com.au "Defend your joy" From faassen@vet.uu.nl Fri Nov 26 03:30:01 1999 From: faassen@vet.uu.nl (Martijn Faassen) Date: Fri, 26 Nov 1999 04:30:01 +0100 Subject: [Zope-dev] Copy and paste is not working in custom folder product In-Reply-To: <383DF09C.F4230D9A@4-am.com> References: <383D5307.9E85C241@vet.uu.nl> <383D5C99.2DA3C7B6@4-am.com> <19991126025513.B15679@vet.uu.nl> <383DF09C.F4230D9A@4-am.com> Message-ID: <19991126043000.A15874@vet.uu.nl> Evan Simpson wrote: > Martijn Faassen wrote: > > > Thanks for this clue! I don't know what to do now, though. My .dtml files > > don't reside in subdirectories. Though it's very well possible it's due to > > some of the other odd stuff I do. :) How'd you change the way you loaded > > your .dtml files? > > I changed > > manage_addPythonMethodForm=HTMLFile('www/methodAdd', globals()) > > to > > _www = os.path.join(package_home(globals()), 'www') > manage_addPythonMethodForm=HTMLFile('methodAdd', _www) > > All I can figure is that loading the HTMLFile with a pathname instead of a > basename somehow caused the problem. The exact equivalent can't be happening in my code right now; everything's in one directory right now. I *do* mess with meta_types, though. When I register a SimpleItem derived class with my Folderish object, I do an ugly hack to manually add it to its meta_types: # Form is the class of my Folderish object (deriving from ObjectManager) # fieldname is the meta_type of the field object I want to addable to # these forms # add this as an addable field to the form # for some reason we must use this tuple adding, # as setting meta_types to an empty list in Form # does not appear work; meta_types always seems to be a tuple. Form.meta_types = Form.meta_types +\ ({ 'name': fieldname, 'action': 'manage_add%sForm' % fieldname }, ) I imagine this kind of hack could wreck things. This is another hack: # add manage_add method for this field to the Form class # use FormHack to create the right add form setattr(Form, 'manage_add%sForm' % fieldname, FormHack(fieldname)) Where FormHack is a class I use instead of HTMLFile(). The FormHack instance simply gives back the HTML I want when called. I reported the weird grief HTMLFile() gave me earlier on the list. Anyway, this hack is another suspect. And there are other tricks I've used to shield my code from Zope's machinery. Perhaps this has given anybody any clues as to my problems? Regards, Martijn From itavor@bigpond.net.au Fri Nov 26 05:14:13 1999 From: itavor@bigpond.net.au (Itai Tavor) Date: Fri, 26 Nov 1999 16:14:13 +1100 Subject: [Zope-dev] Best way to email a newsletter to thousands of recipients from a Zope site Zope site Message-ID: Patrick Phalen wrote: > [Itai Tavor, on Wed, 24 Nov 1999] > :: Hi, > :: > :: I need to add a newsletter feature to a Zope site. Interested people > :: will be able to register their email addresses, and the newsletter > :: will be mailed to all addresses every 1-2 weeks. The number of > :: recipients could potentially have 4 zeroes in it (and no, it won't be > :: 0000). > :: > :: What would be the best way to do the mailing? Use mailhost with a > :: very long recipient list? Call mailhost once for every recipient? Use > :: some external tool to do the mailing? > > I think I've looked at everything available and am convinced that Dan > Bernstein's qmail/ezmlm offer the best performance, security and ease of > maintenance. Have a look at www.qmail.org and www.ezmlm.org (qmail is > the MTA and ezmlm the mailing list manager -- they work hand in hand). > > You can run a dedicated list server with the qmail/ezmlm combo on a > castoff 486 machine under Linux and it will be plenty fast enough for > your needs. I think both apache.org and redhat.com still handle all > their mail on low-end Pentiums with qmail. > > I administer 20 mailing lists this way and never have to touch them. What I need is quite different from what a mailing list program like ezmlm or Mailman does - The newsletter is one-way only - no user submissions, no question/reply threads. - I need full control over the format of the newsletter - can't just email entries to the list manager. - Users can only register and de-register, so I don't need user-accessible configuration screens. - This site will eventually get a user registration system for customizing the interface (Portal Toolkit?), and I'd like to use the same registration interface for the newsletter. So if I wanted to use a mailing list program, I think I'd have to do a lot of work to force it into my desired frame: My Zope registration code will have to register users with the mailing list. Then I'd have to email each news item to the mailing list so it gets included in the next digest. And I'd have to hack the program code to control the digest format. Looks like a whole lot of work trying to force an inappropriate tool to do what I want. The only part of a mailing list system I really need is the bulk mailer. I need to do the user registration inside Zope anyway. And the content gets generated by Zope so I don't need the mailing program to format it. I just need something that can deliver a message to 10,000 recipients quickly and efficiently, and has support for suspension of recipients that bounce too often. Is anybody familiar with Mailman or ezmlm enough to tell me how hard it would be to bypass all the mailing list handling functions and get straight to the bulk mailer? Or, is there a standalone bulk mailer program I can use? One other thing: This site is hosted on a dedicated server in a web farm (yes, I'm 100% buzzword compliant), and I would need a very good reason to justify getting a second server. Since my newsletter won't receive email and will only mail out once a week, can I expect to get by with running it on the main server? Or will mailing out 10,000 messages at once kill the Zope server performance for an hour every time? Thanks Itai -- Itai Tavor -- "Je sautille, donc je suis." -- itavor@vic.bigpond.net.au -- - Kermit the Frog -- -- "What he needs now is understanding... and a confederate victory" -- -- Dr. Jacobi, Twin Peaks -- From Victor.Zhai@ogilvy.com Fri Nov 26 07:31:09 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Fri, 26 Nov 1999 15:31:09 +0800 Subject: [Zope-dev] ZCatalog help? Message-ID: Hi ,all Some promblerm need you help. I want to Use catalog to display sub folder of current object. /* I want to display the folder of current directory named content */ .... /* Want to display http://.../index.html in current screen */ "> /* This can work but I must click the "content" */ Thanks in advance. Victor zhai. "WorldSecure Server " made the following annotations on 11/26/99 02:19:55 ------------------------------------------------------------------------------ Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the Ogilvy Group shall be understood as neither given nor endorsed by it. ============================================================================== From zope@teleo.net Fri Nov 26 08:16:18 1999 From: zope@teleo.net (Patrick Phalen) Date: Fri, 26 Nov 1999 00:16:18 -0800 Subject: [Zope-dev] Best way to email a newsletter to thousands of recipients from a Zope site Zope site In-Reply-To: References: Message-ID: <99112600544400.01539@quadra.teleo.net> [Itai Tavor, on Thu, 25 Nov 1999] :: Is anybody familiar with Mailman or ezmlm enough to tell me how hard :: it would be to bypass all the mailing list handling functions and get :: straight to the bulk mailer? Or, is there a standalone bulk mailer :: program I can use? That is exactly how I use ezmlm for the 20 lists I mentioned before. To run an announcement-only list is simply a matter of deleting one config file for each list, to prevent posting. And other features like auto-archiving are just as easily switched off. Users can then subscribe and unsubscribe and that's it. If a message bounces, they are sent a notice. After twelve days of bounces, they are auto-unsubscribed. :: One other thing: This site is hosted on a dedicated server in a web :: farm (yes, I'm 100% buzzword compliant), and I would need a very good :: reason to justify getting a second server. Since my newsletter won't :: receive email and will only mail out once a week, can I expect to get :: by with running it on the main server? Or will mailing out 10,000 :: messages at once kill the Zope server performance for an hour every :: time? qmail can routinely dispatch 200,000 messages a day from a dedicated Pentium machine. You may want to ask your question on the qmail list, hoping to get an answer from someone in your same position. The number of concurrent messages it will handle is easily tunable -- the default is 20; you might want to dial that down to 5?. Note: assuming you are running *nix, you will need to uninstall sendmail (but I recommend doing that anyway). Having qmail, you don't need sendmail or binmail. From jhauser@ifm.uni-kiel.de Fri Nov 26 09:01:09 1999 From: jhauser@ifm.uni-kiel.de (Janko Hauser) Date: Fri, 26 Nov 1999 10:01:09 +0100 (CET) Subject: [Zope-dev] Problem editing index_html in Zclass In-Reply-To: <383DE4CE.A973090B@inet.net> References: <383DE4CE.A973090B@inet.net> Message-ID: <14398.19541.246358.123481@ifm.uni-kiel.de> Zclasses are not FTP-aware, as they are not subclassing from the necessary base classes. __Janko From mindlace@majordomo.net Fri Nov 26 09:12:07 1999 From: mindlace@majordomo.net (Ethan Fremen) Date: Fri, 26 Nov 1999 09:12:07 +0000 Subject: [Zope-dev] dtml-let & the DTML debate References: <383D8AEB.BDBE63D8@majordomo.net> <383D97C2.940CE44B@majordomo.net> Message-ID: <383E4EE7.EA50D934@majordomo.net> Ethan Fremen wrote: > pdf=end > pdffile="name + pdf" > filesize="_[pdffile].get_size() / 1024"> > >

    Download > kb

    >
    Having now used it for the first time, I think that dtml-let and similar constructs should be pure python, as PythonMethods... Let's say I call that pythonmethood kb, then I'd do something like this: or even better &dtml-kb; and kb would just return the final string I'm looking for (file size in KB). -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology. From Victor.Zhai@ogilvy.com Fri Nov 26 09:36:33 1999 From: Victor.Zhai@ogilvy.com (Victor.Zhai@ogilvy.com) Date: Fri, 26 Nov 1999 17:36:33 +0800 Subject: [Zope-dev] Can I creat a object' ID in pure chinese? Message-ID: Hi,all I can creat ID like "1Á¢¿Ì½´¶¹¸¯¡° ,But cannot do it like this:"Á¢¿Ì½´¶¹ ¸¯" Can Zope support this.? Victor zhai. ıj+•ÔrêŞIêïz¿è‚)oË÷(›ÿæi×­…çè–Z0Šxz-jبÊ'×_öëÿ}ÓöÛı¹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóëŠø¥zü*'~'^Øš”‰ß¢¹š¶*'™¬›yÊ'µ¨§yا¶¬™ë,jÿ!ü¨¹ªŞ‹m…æv·¬±ç¢Øœj׊{aŠÉ²Æ {ú+­ë)¢{"nWŸ¢·^–+ޯ*¶¦zËëh²ç!¥êì¢ÿÊ‹¦k)èµÊ)ÊŠİzX¯z»aŠÉ²Æ zÚŸ*'{ò'²ç!q«ÿ*.².•×^²ÚèÊØb²g¬±¨jwdŠweÊz-‰ü­…ë׫o*ަ\™¨¥üù^jÇšvø¬z)¦yØšµér‰ü¨ºŠò¢êŞš™hÉêİ¡ë'¢×(ǧ¶Ú™¨¥~ŠæzËë(~Øb²H§wó©Šx¨ÏÜ¢w%ºÈ¨Æ§v‹az¸§~Šæjب)í†+&zËëaj×h‹kzV­zÚ-…ê~'"jVî²)޲ʶ‚)oÈj躛!jY[zéİz»-¢‡Z²w¢¶«‚+Şz+zwh®Ço(­ From johanc@torped.se Fri Nov 26 09:40:57 1999 From: johanc@torped.se (Johan Carlsson) Date: Fri, 26 Nov 1999 10:40:57 +0100 Subject: [Zope-dev] Storing changes in ZODB, without keeping old versions In-Reply-To: <383D96A5.F6E723F4@ibm.net> Message-ID: <000201bf37f2$56fd08e0$ad0aa8c0@tor.torped.se> It sounds like the problem that would come from storing session data in ZODB. One nice solution (as someone pointed out for me) would be to have multiple parallell ZODB-storages. One for the normal transactional ZODB(filebased or RDMS-based) and one non-transactional for session-data and cache-data. Both would be distributed by the ZEO for failover and scalability. Regards, Johan Carlsson > The ZCache Product I created has one major problem - every time it updates > itself it'll make the ZODB grow, since it stores all the old contents it > had. I don't want this to happen - there's no reason why anyone > should undo > a change to the cache. I do however want the contents of the ZCache to be > stored on disk when it gets moved out of the Zope cache, so I > don't want to > use volatile variables. > > Is there any way to do this? Or is it impossible? > > -- > Itamar S.T. itamars@ibm.net > > _______________________________________________ > 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 ) > From mj@antraciet.nl Fri Nov 26 08:33:40 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Fri, 26 Nov 1999 09:33:40 +0100 Subject: [Zope-dev] Storing changes in ZODB, without keeping old versions In-Reply-To: <383D96A5.F6E723F4@ibm.net> Message-ID: <4.2.0.58.19991126093137.01eb2ee0@lisp.atmm.nl> At 09:05 PM 11/25/99 , Itamar Shtull-Trauring wrote: >The ZCache Product I created has one major problem - every time it updates >itself it'll make the ZODB grow, since it stores all the old contents it >had. I don't want this to happen - there's no reason why anyone should undo >a change to the cache. I do however want the contents of the ZCache to be >stored on disk when it gets moved out of the Zope cache, so I don't want to >use volatile variables. > >Is there any way to do this? Or is it impossible? Why would you want the cache to be persistent? The data is already elsewhere in the ZODB, and the usual behaviour of a cache is to not persist over reboots. The ZODB at this moment doesn't support mixed FileStorages, which would be the way to store both versioned and non-versioned persistent objects. You'll have to make your own storage in the var directory. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From mj@antraciet.nl Fri Nov 26 08:34:37 1999 From: mj@antraciet.nl (Martijn Pieters) Date: Fri, 26 Nov 1999 09:34:37 +0100 Subject: [Zope-dev] Problem editing index_html in Zclass In-Reply-To: <383DE4CE.A973090B@inet.net> Message-ID: <4.2.0.58.19991126093422.01eb4c90@lisp.atmm.nl> At 02:39 AM 11/26/99 , Harry Henry Gebel wrote: >I have an index_html DTML Method in a ZClass called ProfileClass, I am >unable to open this method for editing in Xemacs. > >Here is the problem, I tried to open it with: > >/127.0.0.1:/Control_Panel/Products/Profile/ProfileClass/index_html > >but got a message that the file did not exist. I then opened >/127.0.0.1:/ and changed "directories" until I got to >/127.0.0.1:/Control_Panel/Products/Profile but when I looked at this >listing ProfileClass was not marked as a "directory" so there was no way >for me to cd to it. I tried moving the index_html method to Profile >thinking that perhaps ProfileClass would acquire it from Profile, but it >didn't work. Is there any way for me to edit this directly in Xemacs >with EFS or will I have to open it in the Zope management interface and >use cut and paste to enter it? > >I am using Zope 2.1.0b2 on Linux Mandrake 6.1 w/ the included python >(1.5.2) . ZClass do not (yet) support FTP. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------ From ava@dde974.equipement.gouv.fr Fri Nov 26 10:28:16 1999 From: ava@dde974.equipement.gouv.fr (Ava) Date: Fri, 26 Nov 1999 14:28:16 +0400 Subject: [Zope-dev] bug in PythonMethod.py Message-ID: Hello, I found (what I think is) a bug in PythonMethod.py version 0.1.2 from the PythonMethod product around line 133 (and 246), we have the following expression: self._v_selfish = (fc.co_varnames and fc.co_varnames[0]=='self' and (fc.co_argcount - len(f.func_defaults) - 1)) len(f.func_defaults) is not correct because when your function has no default argument, it is None, and len(None) raises a TypeError. I changed this to read: self._v_selfish = (fc.co_varnames and fc.co_varnames[0]=='self' and (fc.co_argcount - len(f.func_defaults or ()))) But it seems that I have to drop the 'minus 1' to get a correct behavior is func(self, args='') selfish? I think so, but with the 'minus 1', it turns to be wrong! What do you think? -- Cordialement, Jephté CLAIN minf7@educ.univ-reunion.fr PS: répondez sur minf7@educ.univ-reunion.fr, et pas sur ava@dde974.equipement.gouv.fr From ava@dde974.equipement.gouv.fr Fri Nov 26 10:37:03 1999 From: ava@dde974.equipement.gouv.fr (Ava) Date: Fri, 26 Nov 1999 14:37:03 +0400 Subject: [Zope-dev] bug in PythonMethod.py (2) Message-ID: Hello, Forgot the rambling about the 'minus 1' problem. I didn't understand what _v_selfish was for. It is the number or arguments one has to supply to activate the self=currentobject trick So the expression has to be written: self._v_selfish = (fc.co_varnames and fc.co_varnames[0]=='self' and (fc.co_argcount - len(f.func_defaults or ()) - 1)) -- Cordialement, Jephté CLAIN minf7@educ.univ-reunion.fr PS: répondez sur minf7@educ.univ-reunion.fr, et pas sur ava@dde974.equipement.gouv.fr From itamars@ibm.net Fri Nov 26 11:55:43 1999 From: itamars@ibm.net (Itamar Shtull-Trauring) Date: Fri, 26 Nov 1999 13:55:43 +0200 Subject: [Zope-dev] Storing changes in ZODB, without keeping oldversions References: <4.2.0.58.19991126093137.01eb2ee0@lisp.atmm.nl> Message-ID: <383E753F.B2528E34@ibm.net> Martijn Pieters wrote: > Why would you want the cache to be persistent? The data is already > elsewhere in the ZODB, and the usual behaviour of a cache is to not persist > over reboots. 1. Expensive methods - one use for the zcache is storing expensive methods' results without having to run them every time you need their info. 2. Lets say you want an article that changes once an hour (or the output of fortune, like Slashdot has). Write a method that outputs the next article in the list of possible articles every time it's run, and the have a zcache point at this method with a expiration rate of 1 hour. Now your article gets updated every hour, assuming its being read - if no-one reads it, it isn't updated, so you don't waste content, and you don't have to worry about cron jobs. I might add an alternative expiration method, maybe similar to the cron syntax, so you can have it expire at a certain hour. For example, expire cache contents at midnight every day would update your article once a day, as opposed to current method which limits you stuff like expiring if 24 hours have passed since the last access. On an unrelated note, writing the contents of the ZCache to file instead of using the ZODB has the benefit that I can use the same method Apache uses for generating Etag headers - inode together with last-modified date. (Etag headers are used by HTTP proxies as a unique identifier for your page so that they can check when the content on the web server has changed.) So I'll probably end up using files loaded by __setstate__ into volatile variables. -- Itamar S.T. itamars@ibm.net From tdickenson@geminidataloggers.com Fri Nov 26 14:14:39 1999 From: tdickenson@geminidataloggers.com (Toby Dickenson) Date: Fri, 26 Nov 1999 14:14:39 -0000 Subject: [Zope-dev] Copy and paste is not working in custom folder pro duct Message-ID: <9FC702711D39D3118D4900902778ADC803E8F2@JUPITER> > -----Original Message----- > From: Evan Simpson [mailto:evan@4-am.com] > Sent: 26 November 1999 02:30 > To: Martijn Faassen > Cc: zope-dev@zope.org > Subject: Re: [Zope-dev] Copy and paste is not working in custom folder > product > > > Martijn Faassen wrote: > > > Thanks for this clue! I don't know what to do now, though. > My .dtml files > > don't reside in subdirectories. Though it's very well > possible it's due to > > some of the other odd stuff I do. :) How'd you change the > way you loaded > > your .dtml files? > > I changed > > manage_addPythonMethodForm=HTMLFile('www/methodAdd', globals()) > > to > > _www = os.path.join(package_home(globals()), 'www') > manage_addPythonMethodForm=HTMLFile('methodAdd', _www) > > All I can figure is that loading the HTMLFile with a pathname > instead of a > basename somehow caused the problem. > Cheers, Have a look at the html for the contents tab of a folderish objects where you can add your object, and see what method is going to be called. I guess it will be something like....
    + + + + + + + + + + + + ------_=_NextPart_000_01BF3AFF.C0C131D0 Content-Type: application/octet-stream; name="ObjectManager.py.patch" Content-Disposition: attachment; filename="ObjectManager.py.patch" --- ObjectManager.py.orig Thu Jul 22 11:19:22 1999 +++ ObjectManager.py Tue Nov 30 06:24:26 1999 @@ -464,14 +464,28 @@ manage_importExportForm=HTMLFile('importExport',globals()) - def manage_importObject(self, file, REQUEST=None): + def manage_importObject(self, file=None, uploadfile=None, upload=None, REQUEST=None): """Import an object from a file""" - dirname, file=os.path.split(file) - if dirname: - raise 'Bad Request', 'Invalid file name %s' % file - file=os.path.join(INSTANCE_HOME, 'import', file) - if not os.path.exists(file): - raise 'Bad Request', 'File does not exist: %s' % file + if upload: + file=uploadfile + if file and file.filename: + # check file size + # We do not need to check anything else, because if the file is invalid, + # the import machinery will raise an error + file.seek(0, 2) + if file.tell() > 65536: # the limit is 64K. is this enough or too much ??? + raise 'Bad Request', 'Files imported can not be over 64K in size' + file.seek(0, 0) + else: + raise 'Bad Request', 'You must specify the file to upload' + else: + dirname, file=os.path.split(file) + if dirname: + raise 'Bad Request', 'Invalid file name %s' % file + file=os.path.join(INSTANCE_HOME, 'import', file) + if not os.path.exists(file): + raise 'Bad Request', 'File does not exist: %s' % file + ob=self._p_jar.importFile(file) if REQUEST: self._verifyObjectPaste(ob, REQUEST) id=ob.id ------_=_NextPart_000_01BF3AFF.C0C131D0-- From hannu@tm.ee Tue Nov 30 08:48:13 1999 From: hannu@tm.ee (Hannu Krosing) Date: Tue, 30 Nov 1999 10:48:13 +0200 Subject: [Zope-dev] [Fwd: first disregarding and then complaining about missing ] Message-ID: <38438F4D.2A879028@tm.ee> This is a multi-part message in MIME format. --------------3B448631A32F2903BE5E90E6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit After playing with tidy from w3.org I complained to them about an issue with zope's management frameset page and this is what I got back. --------------3B448631A32F2903BE5E90E6 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: Received: from mail1.microsoft.com (mail1.microsoft.com [131.107.3.125]) by sid.trust.ee (8.8.7/8.8.7) with SMTP id TAA19103 for ; Mon, 29 Nov 1999 19:15:17 +0200 Received: from 157.54.9.101 by mail1.microsoft.com (InterScan E-Mail VirusWall NT); Mon, 29 Nov 1999 09:05:04 -0800 (Pacific Standard Time) Received: by INET-IMC-01 with Internet Mail Service (5.5.2650.21) id ; Mon, 29 Nov 1999 08:55:38 -0800 Message-ID: <5B3F16B2DB67D1119A0D00805F312AA21497FC36@RED-MSG-58> From: Stuart Updegrave To: "'Hannu Krosing'" , html-tidy@w3.org Subject: RE: first disregarding and then complaining about missing Date: Mon, 29 Nov 1999 08:35:22 -0800 X-Mailer: Internet Mail Service (5.5.2650.21) According to the HTML 4.0 Specification, NOFRAMES is a child of FRAMESET (see for definition). Try the following to see if it works for you: Zope on http://hu.tm.ee:8080 Management interfaces require the use of a <B>frames-capable</B> web browser. cheers, ~stuart -----Original Message----- From: Hannu Krosing [mailto:hannu@tm.ee] Sent: Sunday, November 28, 1999 5:11 PM To: html-tidy@w3.org Subject: first disregarding and then complaining about missing attached page (managment frameset from Zope> generates the following errors: line 4 column 1 - Warning:
    + + Import from file on server +
    Import file name +
    + + Upload file to import +
    Attach file here +