[Zope-dev] Unicode in Zope 2 (ZMI, Archetypes, Plone, Formulator)
While we're all waiting for Zope 3 and Plone 3, I'd like to know what the standard practice way of using Unicode with Zope 2. In particular, we'd like to store all text as Unicode in the ZODB, and have Zope do the encoding/decoding as automatically and transparently as possible. We've been using Zope 2's ZPublisher to do this encoding/decoding for over 2 years, and it's working fine. We just have to ensure that we set the appropriate encoding in a HTTP Content-type header, and that we add :utext/ustring:ENCODING to HTML form field names. Regardless of what you may have heard, THIS WORKS FINE! We also store Unicode, not UTF-8 (or other encodings), strings in the ZODB. The problem we're running into are with other components, basically making our Unicode-with-Zope experience, shall we say, less than ecstatic (To put it this way, I seem to lose hair much faster when dealing with Unicode problems :) I'm wondering why components/products aren't all relying on the ZPublisher for Unicode encoding/decoding? Is there another standard way? Here is a summary of what we've found: ZMI * gets charset from manage_page_charset encoding * relies on ZPublisher for encoding (but doesn't do decoding, see below) * in PropertyManager you can add ustrings, but since it doesn't add :ENCODING to the field names, you get a Unicode error when trying to save since it tries to decode the text assuming ASCII (big problem) * DTML Methods/Documents: doesn't support Unicode (annoying) * can't use Unicode id's (not a big problem) Archetypes: * gets charset from portal_url.getCharset() or portal_properties.site_properties.default_charset * doesn't rely on ZPublisher, does its own encoding/decoding * returns encoded strings, not Unicode strings, to Zope apps, leading to problems such as: - SearcableText() encodes, and as such can't be used with Unicode-aware ZCatalogs - transform() encodes (and because of that SearchableText() sometimes decodes/encodes 2 times instead of 0 times) - get()ing field values will encode them, so if you want Unicode, you have to decode yourself (adding both unnecessary overhead for data access, and unnecessary dependency on the global variable for the charset) Plone: * no special Unicode support for HTML forms; relies on Archetypes Formulator: * gets charset from manage_page_charset (same as ZMI), but can be overridden * stores field values as encoded text (not Unicode), but lets you specify which encoding to use (confusingly calls this unicode mode) * messages are stored as UTF-8 (hardcoded) I suggest this way of dealing with Unicode right now in Zope 2: (1) Let ZPublisher do the encoding/decoding of form input and HTML output: a. Always set a character encoding in a HTTP Content-type request b. Always append :ustring/utext/ulines/utokens:ENCODING to field names of fields that support Unicode (we may need some library code to make this easier) (2) Store Unicode strings directly in the ZODB. The ZODB is perfectly capable of storing strings in Python's internal Unicode format; no need to encode the text to UTF-8 or some other encoding. (3) Encode/decode yourself when reading from/ writing to other external data sources such as files and other databases. Do it just before you write, or just after you read, so that as much code as possible can be encoding-agnostic. Keep the encoding/decoding as close to the source data as possible. The best way to do it is (in most cases) to specify the encoding on the IO stream, and let Python do the encoding/decoding for you transparently. If possible, get the encoding from the external data source (e.g., the file) instead of relying on a magical global variable. If you have to rely on a global variable, let it be manage_page_charset. (4) [This is really just advice...] Resist patching your code to work with components that doesn't deal with Unicode. Others are likely having the same problem, so to avoid ending up with lots of ugly patches (that are the source of mysterious Unicode problems), fix the problem at its source: the other component. It's really not that difficult to fix (if we agree on how it should be fixed ;) None of the above components handles Unicode in this way, but it seems to be how the Unicode support in Zope 2 was meant to be used. Let me know if there is another better way, but please do let me know... I think we need to resolve this once and for all or I know some people that'll just go mad (or bald, or both) :) I'll be willing to contribute patches, but since this applies to so many products, it would be good to get some consensus first. At the very least, can we create a Standard Unicode Practices page? Bye, -- Bjorn Stabell mailto:[EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope
[Zope-dev] RE: [Archetypes-devel] Unicode in Zope 2 (ZMI, Archetypes, Plone, Formulator)
--On Montag, 26. April 2004 10:53 Uhr +0200 David Convent [EMAIL PROTECTED] wrote: I always believed that unicode and utf-8 were same encoding, but reading you let me think i was wrong. Can you tell me what the difference is between unicode and utf-8 ? Andreas Jung wrote: Unicode is common database for almost all characters. UTF-8 is an *encoding* that allows you to represent any element of this character database as set for 1,2,3 or 4 bytes. There are also other encoding e.g. like UTF16 that encode an element in a different wayso we are talking about completely different things. Yes, the difference is that Python has a whole different understanding of Unicode strings (type(u)) than it has of text of some character encoding (e.g., UTF-8, GB18030, ISO8859-1, ASCII, stored as type()). Python will of course represent these unicode strings internally some way (maybe as a 16-bit integer?), but we don't need to know what that is like. All we need to know is that this is a string that can contain any character on the planet, and that we can reasonably expect normal text operations to work on it. UTF-8 is, similar to ISO-8869-1 (latin1), just a character encoding. It (and UTF16, UCS2, UCS4) is only special in that it was issued by the Unicode consortium and can encode any Unicode character. Wherease ISO-8859-1 (for example), being only 8 bits, can only encode characters used in Western Europe. GB18030, to take another extreme, is a 32-bit encoding endorsed by the Chinese govnerment; being 32-bit, it can encode/represent a lot of Unicode characters, even many non-Chinese ones; it is big enough to potentially encode any Unicode character, if the Chinese government defined how each Unicode code point was mapped into GB18030. In this case, it would be similar in function to UCS4 (I think it is). Internally, we want to work with Unicode strings (where str[4] is the 4th character) instead of UTF-8 encoded text strings (where str[4], being the 4th byte, has little semantic meaning). Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] RE: [Archetypes-devel] Unicode in Zope 2 (ZMI, Archetypes, Plone, Formulator)
None of the above components handles Unicode in this way, but it seems to be how the Unicode support in Zope 2 was meant to be used. Martijn wrote: You're actually wrong about Formulator. :) Apologies. We were using older versions of Formulator before, and I was just doing code inspection of the new version when I concluded the above about Formulator. One less component to worry about :) Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] TCPWatch or other such tool
Title: Message Has anyone gotten TCPWatch to work recently? Using Python2.1/2.2/2.3 I get: Unhandled exception in thread started by function window_loop at 0x402877d4Traceback (most recent call last): File "/zope/opt/bin/tcpwatch.py", line 656, in window_loop app.mainloop() File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 965, in mainloop self.tk.mainloop(n)RuntimeError: Calling Tcl from different appartment Are there any other good, free TCPWatch-like tools that allow you to snoop on HTTP requests. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] TCPWatch or other such tool
Shane wrote: [...] Other people have reported this, but I can't reproduce it. I've been using tcpwatch on Python versions 2.1 through 2.3 without a hiccup. Are you using Linux? If so, what distribution? As a workaround, you can use -s to dump to stdout. Thanks. I was running it on Debian, so it's most likely a python-tk problem as also reported by Christian Theune. When I ran it under Windows it worked fine. I'll report it as a Debian bug. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Proposal (was How to make Zope fail nicely under high load?)
I wrote up a simple proposal for how to change Zope to work better under heavy load: http://zope.org/Members/bjorn/proposals/MakeZopeFailNicelyUnderHeavyLoad The solution is a bit different from what we discussed on the list before; basically do away with the Medusa request queue altogether and use listen()'s backlog instead. Comments are welcome. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Proposal (was How to make Zope fail nicely under highload?)
Toby wrote: On Thursday 19 February 2004 11:18, Bjorn Stabell wrote: [...] The solution is a bit different from what we discussed on the list before; basically do away with the Medusa request queue altogether and use listen()'s backlog instead. Last week you were keen that medusa keep processing requests so that it can return a 503 error quickly. I guess your view on that requirement has changed? This is still something that have to be tested to see what works best. Managing the work with the listen() backlog instead of Medusa's request queue has the benefit of being less resource intensive (Medusa doesn't have to do anything). If Zope is behind a HTTP accelerator/surrogate or load balancer, the surrogate's connect() should fail if the listen queue is full, and it may return 503 anyways (not tested). In the end, the most important point is to put an upper bound on the request backlog (and therefore the response time). Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Toby wrote: One of the optimization we're thinking of is storing results of ZCatalog searches (e.g., number of replies to postings) in volatile variables so we don't have to run the catalog search at all. We'd like to use memory space shared between threads for this. Using ZEO would require us to store this in the ZODB. Storing that in ZODB would be a bad idea. Theres no reason to think that this cache would be faster than ZCatalog. I dont see why you would be *required* to store in ZODB... just dont share your cache between publisher threads on different Zope instances. (my apologies if this is obvious) Okay, for example, since it's a BBS we need to have quick access to: the latest poster the latest posting the latest registered member All of these are complex queries (in the case of the latest registered member it's not even a query but a brute-force search). What I think most ASP/PHP boards do is that they store these values in the database instead of querying for them all the time. Since many of these can be found through queries, they don't really need persistent storage, but updates need to be seen by all threads; thus the requirement for ZODB if we use ZEO, but the possibility to use (even faster) shared memory if we don't use ZEO. In effect we want to do something like this: def getLatestPoster(self): if not hasattr(self, '_v_latestPoster'): self._v_latestPoster = whatever_query() return self._v_latestPoster return self._v_latestPoster def setLatestPoster(self, poster): self._v_latestPoster = poster But instead of having thread-local variables we wanted to use Dieter Maurer's SharedResource in order to share the cache between threads: http://www.dieter.handshake.de/pyprojects/zope/SharedResource.html Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Erik: using the _v_ variables won't work for this since different threads won't agree on who was latest. Its definitely a bad idea to do queries for these three data points. What about putting them in the temp_folder then you can still use ZEO with a bunch of clients that will all share the same data but you don't need to write the values to disk every time they change. Even putting them in a normal ZODB storage would be a _lot_ faster than doing a query. You're right, _v_ wouldn't work. So with temp_folder (TemporaryStorage) there is basically no need for the SharedResource product anymore? For ZEO, my understanding is that we would still have to store the values in the ZODB, though. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Jan-Wijbrand wrote: [...] You are able to store *and* share data over ZEO Clients in a TemporaryStorage by making the ZSS serve this TemporaryStorage to its ZCs. You could mount this storage as temp_folder I guess, but any other mount point would work too. Col :) Not sure, but I'd expect so, whether this has significant perfomance advantages over a 'normal' ZODB served by the ZSS. Probably, and it's no-packing as well. Very nice. We'll definitely use this then. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] How to make Zope fail nicely under high load?
Hi, We've run into an interesting problem when load-testing a Zope site behind Apache, a problem that we've also encountered in real life. Basically, when the load gets high, Zope has a huge backload of work (several minutes of requests), making the average latency for each request many minutes. What are effective ways to do this kind of overload management so that the backlog of work doesn't get that big? The ideal would be for requests to fail immediately if the backlog of work is more than a certain number of requests (or even better, estimated time to process). Here's what we've tried: Naively, we thought we could just set the socket.listen() backlog in Apache and Zope to a lower value, but in TCP connect()'s apparently don't fail if the server's listen backlog is full; instead requests are retried, resulting in a client side managed listen backlog, also giving the same long latency. (If someone knows this stuff, please confirm/deny these allegations against TCP :) It appears the way to control it would for Apache or Zope to return 503 Service Unavailable when the load is too high, but we haven't found a good way to do this; Zope doesn't appear to have any mechanism for it, and Apache's ProxyPass doesn't either. I guess load balancers would, but that's a bit overkill since we run the server on one machine. Regards, -- Bjorn Stabell [EMAIL PROTECTED] Tel +86 (10) 65918490 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Bjorn Stabell wrote: Basically, when the load gets high, Zope has a huge backload of work (several minutes of requests), making the average latency for each request many minutes. What are effective ways to do this kind of overload management so that the backlog of work doesn't get that big? Make the app faster so that doesn't happen. You'll always reach the bottleneck sooner or later, and in 99% of the cases it'll be Zope. It's not exactly a racing horse. [...] ...return 503 to every new request probably isn't a good idea, 503 to every new session is probably OK. Maybe. It depends on the workload. If you have a user who sends 10 requests and 5 of them fail, they're going to keep hitting reload to try to get them all to work, which just compounds your problems. The idea is that you want tweak it so some of your users get everything, and some get nothing, instead of everybody getting partials. This means you have to track sessions though... thats probably easier to do in ZServer than it is in Apache 1.3 just because of the process model, but that doesn't mean its easy. By default, Apache doesn't track sessions and do that kind of planned failure. There are probably modules that can enable that behavior. ZServer's multiplexed IO model just hides the accepting socket from the poller if its concurrency level is reached, and yeah, then the incoming connections end up in the backlog. You'd have to change ZServer so it handled those new requests instead, identified if they were part of a session, queued them up if they were, or spat out a 503 if they weren't. With KeepAlive on, wouldn't everything in one session sent over one TCP connection? If that is the case, each accept() will basically service a whole session, and so you should be able to do the easy thing of refusing a connection just after an accept(). Frankly, I bet you'd have more fun just making your app faster. We'll do that as well, but this problem is pretty serious; we can't overload our server for even just a little while before latencies start building up to ridiculous levels and users start hitting reload, further compounding the problem. In the end we have to restart the server, same as Dario reported. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Toby wrote: [...] Zope's ZServer manages a queue of requests that have been recieved over http, but not dispatched to the publisher. This is handled in PubCore/ZRendezvous.py. I suspect this queue will be holding your backlog. You might get some benefit from capping the length of that queue. Thanks Toby. It doesn't seem like that queue (the requests list) has a cap at all. Have been stresstesting Zope for a few minutes and the queue is up to 300+ requests in the backlog queue. Not sure how to force a 503 return from within ZRendezvous.handle(), though; that's ZServer medusa magic. 300 requests at 1 request per 2 seconds yields a backlog of work of 10 minutes. This is before we've started optimizing. I wonder if Zope also processes requests that have been closed from the client end? I know Zope will continue processing a request even if it times out at least (so you can do long-running requests, like packing, through the web). Many (all?) of these 300 requests would have been closed by the time Zope got to process them, and so Zope shouldn't bother with them. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Toby wrote: Hmm, yes. ZRendezvous doesnt have any choice but to queue up the request. Handling the request at that point could cause problems because the support for pipelined http requests might cause another recursive call to ZRendezvous.handle, and deadlock. You need to handle it earlier. Maybe tweak the readable() method of zhttp_server and zhttp_channel in HTTPServer.py, to stop bytes coming in over the socket if the queue is too large. ? Hm. And making this limit (and the listen backlog parameter) available as configuration options. :) Not letting bytes through is not enough, though. I think a 503 error should be returned as quickly as possible back to the client. I wonder if Zope also processes requests that have been closed from the client end? It will I know Zope will continue processing a request even if it times out at least (so you can do long-running requests, like packing, through the web). Many (all?) of these 300 requests would have been closed by the time Zope got to process them, and so Zope shouldn't bother with them. That doesnt need fixing. It wouldnt be a problem if the queue was kept small. Well, I think it would help in many cases. Many people click on links before the server has finished (or before it has even visibly started) serving up pages. Searching the web today I saw a commercial product (I think it was a load balancer) promoting this as an important feature. Any page for which the client has closed the connection before the server has started serving up the page could be skipped. If the server has already started serving up the page, it could complete the transaction. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Richard Jones wrote: On Thursday 12 February 2004 01:23, Casey Duncan wrote: What kinds of requests are these? Do they all require a dynamic output? If not, then you should put better caching in front of Zope, or at a minimum tweak you caching headers so that some could be served as 304s for instance. If they are all dynamic, how dynamic? How different is the page for one session than another? If much of the page is the same then you might benefit from an ESI approach where you cache parts of pages and assemble them in the cache, serving only small pieces from Zope. I'm a bit surprised that you have not (from what I can see), used the most common Zope speedup (and often the cheapest overall): Buy more hardware and use ZEO. I was going to suggest these things too. And a bunch of other stuff. A while ago, I wrote a page about making Zope go faster - it might help. http://zope.org/Members/richard/docs/zope_optimisation.html Okay, I'd better explain our situation in more detail, then. Richard, Casey, thanks. Except for using ZEO, we're already doing everything Richard and you mentions. Zope only serves pages (no images etc) that are dynamic, the object cache is set at 20,000 objects with only 2 threads (otherwise we got too much deactivation of objects), and we also use the RAM Cache Manager for static bits of dynamic pages. We could probably have used it more, but since it can't cache persistent objects, it's a bit of a pain sometimes. The point is, our template is very dynamic, and our application (a BBS) is very dynamic as well. We have done one round of optimization (basically making things as cacheable as possible) and after testing the scalability now we're going to do another round of optimization, tweaking the algorithm and removing as many ZCatalog searches as possible. One of the optimization we're thinking of is storing results of ZCatalog searches (e.g., number of replies to postings) in volatile variables so we don't have to run the catalog search at all. We'd like to use memory space shared between threads for this. Using ZEO would require us to store this in the ZODB. I'm sure we can make the application run faster, but we'd like to support 500-1000 simultaneous users whereas now we can only support 20-25! I don't know if we can scale it enough just by tweaking the application. Another option is to scrap Zope for the BBS part and use one of the fully featured, and optimized, BBS applications for PHP. That would definitely be a safer choice, but would require extra application integration time (user database, searching). Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Bjorn wrote: I wonder if Zope also processes requests that have been closed from the client end? I know Zope will continue processing a request even if it times out at least (so you can do long-running requests, like packing, through the web). Many (all?) of these 300 requests would have been closed by the time Zope got to process them, and so Zope shouldn't bother with them. Casey wrote: Why would they be closed by the client? Two scenarios: 1) The user gets tired of waiting for the page to come up after a few seconds and stopes or reloads it. This is very common if the response time is above a few seconds. 2) After clicking on a link the user discovers another, better link, and quickly clicks on that one as well. This is quite common for me, at least :) When Zope gets very loaded, response times suffer and these things happen more often; in our case with 300 requests in the pending queue, nobody would bother waiting 10 minutes for their page to come up (they'd stop the page loading and go somewhere else), so all the requests (most likely) would be needless; Zope is in fact just processing dead requests. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] How to make Zope fail nicely under high load?
Jamie writes: Lennart Regebro wrote: OK, you get the problem that images may not load even if the main page does, but is that really worse for the end user than not getting anything? As I've been saying, if you do that, they will reload repeatedly making the problem worse. If the images are fluf, and the user knows they are fluf, then *maybe* they won't reload, and your pages will simply appear ugly. But then you have to ask yourself, why am I sending fluf images that degrades the overall user experience of my application? Clearly there's more optimization that could be done to your application. If you run Apache as a caching reverse proxy (caching surrogate server) then images will be served from Apache. Only the dynamic HTML pages are served from Zope, so having them fail without regards to sessions is relatively okay. Images and other static content are almost guaranteed to load correctly, and if they didn't, a straight reload from the client will not reload cached images. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ESI support
Any news on Zope support for ESI? http://mail.zope.org/pipermail/zope-dev/2003-January/018619.html http://www1.cn.squid-cache.org/mail-archive/squid-dev/200208/0047.html From what little I can gather from the Squid mailing lists, it looks like ESI support is materializing in Squid. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ESI support
Jens: Zope does not need ESI support - You can write ESI statements in your templates without specific support from Zope. Yes, but I think they were planning to make it easier from DTML/ZPT, a la JSP's ESI library. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Where did __traceback_info__ go?
I upgraded to 2.7b3, and it looks quite solid! I have one problem, though: I can't find the full tracebacks that include __traceback_info__ anywhere! I used to start up Zope in debug mode, so I'd get everything sent to stdout. Now, stdout just contains some startup stuff; doesn't even contain simple tracebacks. The event log contains tracebacks, but it doesn't contain __traceback_info__. I'm not sure if it contains the __traceback_supplement__ stuff? On a related note, perhaps it would be more clear what got sent to stdout if stdout was just another log handler, and so it could be configured the same way other logs are configured, e.g., logger event stdout level INFO /stdout stderr level WARN /stderr /logger Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Where did __traceback_info__ go?
Dieter: Bjorn Stabell wrote at 2003-12-21 23:49 +0800: I upgraded to 2.7b3, and it looks quite solid! I have one problem, though: I can't find the full tracebacks that include __traceback_info__ anywhere! They are not in http://yourZope/error_log? No, the error, UnicodeError, doesn't even show up in error_log or on STDOUT. It does show up in events.log and on the error page, if I add error_tb to the standard_error_message. Nowhere, however, does the __traceback_info__ information show up. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Etag support in page templates
Just FYI. Apache 2.0.48 now honors caching of pages which only have Expires set (no need to include Etag and/or Last-Modified), but the 1.3 team hasn't responded and so 1.3.29 still has the bug. With mod_deflate site-wide compression of text/html etc, I guess it's enough candy there for me to upgrade:) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Unicode encoding/decoding
How does Zope handle Unicode encoding/decoding of non-UTF8 encodings? I see encoding/decoding functions popping up in products (e.g., Archetypes), but I thought Zope already had this covered? Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] [Summary] Caching prob with AHCM and headers
Just for the record to help others in the same situation... PROBLEM Apache (1.3.28 and 2.0.47) will not cache content with just an Expires header, but it will correctly cache content with a Last-Modified header. This problem has been reported before in 1999 by James Cooper, but the bug request seems to have been forgotten/ left behind. It makes sense for dynamic content to produce Expires headers, not Last-Modified headers, so this is a problem. Looking at the code for Zope, it seems that the standard HTTP accelerator product used to produce a Last-Modified header, but no longer does so, thus making it useless with the current versions of Apache. The problem has been re-reported to the Apache group with patches: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23129 (for Apache 1.3.28) http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23130 (for Apache 2.0.47) WORK-AROUNDS 1) Produce a Last-Modified header yourself by using 2) Patch Zope's standard HTTP accelerator product so that it produces a Last-Modified header (the line is commented out now) SOLUTIONS 3) Patch Apache (see bug report links above for patches) 4) Wait until the problem is hopefully fixed in Apache Bye, -- Bjorn Stabell [EMAIL PROTECTED] Tel +86 (10) 65918490 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Etag support in page templates
Janko wrote: I think, this is one problem with the current code. There is no defined way to decide, when something is last modified. With CMF-based sites there is a clearly defined property for this. On the other hand all objects have at least a bobobase_modification_time, but this one changes with every ZODB action on the object. I'm not sure what to do. Also, in most cases, the content of pages doesn't all come from one object, so Last-Modfied doesn't really make sense since it should refer to the whole page. I think the problem is with Apache's inability to cache content with Expires set, and that Apache should be fixed. ETAG NOTES As for Zope, I'm not sure if setting and empty Etag header is the right thing to do if no Etag was provided...? I've been thinking about how Zope could be extended to support HTTP validators on Etags. How about this (Page Templates = ZPT or DTML): - Page Templates are extended with a customizable Etag function/ property. Could be part of the cachable interface. You should set this to return a different etag if, and only if, the content of the page was different. - Page Templates are extended to support If-Match and other such conditionals by calling the customized Etag function and returning 304 Not Modified if the Etag conditions are met (e.g., the calculated etag is the same as the browser/cache provided etag). - Upon rendering the top most Page Template the Etag is automatically calculated and included in the HTTP Headers. If all objects have an etag (Zope seems to be going in that direction looking at the WebDAV code), then a simple way to calculate the etag for a page would be the hash of all the etags for all of the content of that page added together (string concats). Another way could be to let the etag change every X seconds (to simulate the current expires caching model). Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Caching prob with AHCM and headers
Accelerated HTTP Caching Manager doesn't work out-of-the-box as this thread reported, but the thread had no conclusion: http://mail.zope.org/pipermail/zope/2003-April/134800.html http://mail.zope.org/pipermail/zope/2003-April/135059.html http://mail.zope.org/pipermail/zope/2003-April/135101.html I'm running into the same problem now, also with Apache as the caching reverse proxy, so I was wondering if there was any progress? Here are some of my thoughts; It seems reasonable that without a Last-Modified or Etag header in the response, that a client (and surrogate/ http accelerator) will not have any validators (e.g., If-Modified-Since or If-Match corresponding to last modified and etag headers, respectively) in the request headers. It's probably right that dynamic code doesn't return a Last-Modified header; instead, the RFC includes an Etag header, which is hash of the content, which is much easier to use for dynamic code. The Etag header returned by Zope, however, looks very suspicous; it is empty. This could perhaps be fooling the caching machinery? Perhaps the Etag header should just always be a hash of the content? (Another system worth looking at: http://www.jpcache.com/) Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] AW: Caching prob with AHCM and headers
Carsten wrote: Well, sadly I didn't find the time to pursue the issue any further yet. We're kneedeep in work to get the system up and running and caching isn't top priority so far. I don't even know if someone patched the AHCM yet, simply haven't looked. But as someone suggested somewhere and you can see in http://mail.zope.org/pipermail/zope/2003-April/135101.html it works if you set the headers yourself. So if you need caching _now_ and AHCM is not fixed yet, change the object used so that it sets the headers correctly itself. I know that this solution is ikky but I don't know when I will have time to tackle the issue of a comfortable cache system. Though I know I will have to solve it sometime :) I know, I was just trying to figure out how this was supposed to work. Currently setting Last-Modified seems to be the only way to get something cached in Apache; Expires alone is no good, and adding an Etag header doesn't seem to have any effect either. Maybe this should be classified as an Apache problem? Shouldn't Apache cache pages that have Expires? Setting Last-Modified to the current time isn't always the right thing; some objects, .e.g., Files, Images, Documents, have last modification times, and using those would be better. Not sure if the accelerator can be smart enough to know about these, though. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Strange bug(?) accessing File objects
Hi, Has anyone encountered this problem: When accessing File objects that are not accessible to Anonymous (HTTP and WebDAV View permissions not given), the Basic HTTP Auth window pops up repeatedly even after the user has logged in using the cookie crumbler method, and the user has permissions to view the file. Clicking cancel actually lets the user view the file, but that's not an acceptable solution, of course. I see this behavior with Zope 2.5.1 2.6.1 (haven't tried 2.7b2 yet), and I seem to recall earlier versions as well. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Conflict Errors; how to track them down?
Hi all, Except for SARS, another problem that's been plagueing us for months are seemingly random Conflict Errors. We see about 10 every day on our Zope 2.6.1, and they can happen on any page. In most cases they are not related to pages that actually updated anything (AFAIK), although we do use SESSIONS (but no frames). Any clue how to track down which objects are having problems, what's causing this? -- 2003-06-03T09:08:10 INFO(0) ZODB conflict error at /VirtualHostBase/http/www.beijingsammies.com:80/sammies/VirtualHostRoot/ (7 conflicts since startup at 2003-06-02T13:15:05) -- I volounteer to write up a HOWTO document regarding this and the Bad reference to errors we're also getting (see previous post) if I can just find out what's wrong. Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Bad reference to ... how to find object references?
Hi all, During packing, we're seing errors such as the ones attached below. Can someone give a description how to track down which objects have these broken references? Such help would be much appreciated... -- 2003-06-03T00:55:26 ERROR(200) ZODB FS FS21 ERROR: Bad reference to ('\x00\x00\x00\x00 \x00\x0b\x9e\xb7', '') -- 2003-06-03T00:55:27 ERROR(200) ZODB FS FS21 ERROR: Bad reference to ('\x00\x00\x00\x00 \x00\x0b\x9e\xb8', '') -- 2003-06-03T00:55:27 ERROR(200) ZODB FS FS21 ERROR: Bad reference to ('\x00\x00\x00\x00 \x00\x0b\x9fy', '') -- Bye, -- Bjorn Stabell ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Conflict Errors; how to track them down?
On 06/02/2003 11:08 PM, Bjorn Stabell wrote: Except for SARS, another problem that's been plagueing us for months are seemingly random Conflict Errors. We see about 10 every day on our Zope 2.6.1, and they can happen on any page. In most cases they are not related to pages that actually updated anything (AFAIK), although we do use SESSIONS (but no frames). Any clue how to track down which objects are having problems, what's causing this? Shane wrote: Look at your undo log. If the conflicts don't correspond with entries in the undo log, and you're not mounting other databases, the conflicts are almost certainly due to sessions. However, conflicts are a normal occurrence and rarely reach the user. Zope automatically retries the request and delivers the successful page. They do not always correspond to entries in the undo log. But the ones that do are always (?) committed successfully. The problem is, as I can see from other threads here, that they are related to other systems that cannot be rolled back (e.g., sending email / faxes), so we get duplicate emails / faxes. I'll look at how to wrap these systems in transaction-aware wrappers, as was mentioned in a related thread. In any case, is there no way to find out more detailed information about why a conflict happened? There must be some oids somewhere? Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Sporadic IOErrors...?
Thanks Shane. This sounds very plausible. I seem to recall that we started it in debug mode, then disowned the process and exited. That probably caused debug to stdout to create this kind of error. Now we should be able to find the underlying error that caused it to try to write the error to the first place. :) -Original Message- From: Shane Hathaway [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 23:41 To: Bjorn Stabell Cc: [EMAIL PROTECTED] Subject: Re: [Zope-dev] Sporadic IOErrors...? Bjorn Stabell wrote: Hi Zope gurus, After upgrading to Zope 2.6.1 on Linux, when submitting forms, we sometimes get this error: Site Error ... exceptions.IOError ... Traceback: Module ZPublisher.Publish, line 150, in publish_module Module ZPublisher.Publish, line 114, in publish Module Zope.App.startup, line 149, in zpublisher_exception_hook Module Products.SiteErrorLog.SiteErrorLog, line 195, in raising Module Products.SiteErrorLog.SiteErrorLog, line 206, in _do_copy_to_zlog Module zLOG, line 130, in LOG Module ZLogger.ZLogger, line 16, in log_write Module ZLogger.stupidFileLogger, line 27, in __call__ Module ZLogger.stupidFileLogger, line 90, in stupid_log_write IOError: [Errno 5] Input/output error ... It's terrible hard to debug as it happens sporadically, not consistently, and we don't get any more debug info than this. Even worse, we have a standard-error-message that emails errors to us, but it fails to do anything in this case. Any ideas what could be wrong and how to troubleshoot better? The disks have plenty of free space; after restarting, or waiting a while, things work again. This usually means Python is trying to write to stdout or stderr and failing because stdout/stderr don't go anywhere. Make sure you have a log file configured (using the EVENT_LOG_FILE environment variable, rather than the old STUPID_LOG_FILE). Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Sporadic IOErrors...?
Hi Zope gurus, After upgrading to Zope 2.6.1 on Linux, when submitting forms, we sometimes get this error: Site Error ... exceptions.IOError ... Traceback: Module ZPublisher.Publish, line 150, in publish_module Module ZPublisher.Publish, line 114, in publish Module Zope.App.startup, line 149, in zpublisher_exception_hook Module Products.SiteErrorLog.SiteErrorLog, line 195, in raising Module Products.SiteErrorLog.SiteErrorLog, line 206, in _do_copy_to_zlog Module zLOG, line 130, in LOG Module ZLogger.ZLogger, line 16, in log_write Module ZLogger.stupidFileLogger, line 27, in __call__ Module ZLogger.stupidFileLogger, line 90, in stupid_log_write IOError: [Errno 5] Input/output error ... It's terrible hard to debug as it happens sporadically, not consistently, and we don't get any more debug info than this. Even worse, we have a standard-error-message that emails errors to us, but it fails to do anything in this case. Any ideas what could be wrong and how to troubleshoot better? The disks have plenty of free space; after restarting, or waiting a while, things work again. Regards, -- Bjorn Stabell [EMAIL PROTECTED] Tel +86 (10) 65918490 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Weird batches produced by dtml-in
Hello, I'm trying to implement a Google-like pagination using the dtml-in batching system, and I'm getting some very strange results. Either I'm overlooking something obvious or there is a problem with dtml-in. See attached source code of simplified example that produces the strange results. The first time I access the page the results are as follows: 0-9 10-19 20-29 30-39 40-49 50-59 60-69 70-79 If I click '10-19' it'll take me to batch_start=10, which gives the following strange results: 0-8 10-19 19-28 29-38 39-48 49-58 59-68 69-78 79-79 I have no idea why the first batch is now 0-8 and the next batch is now 19-28. Shouldn't they be 0-9 and 20-29 like above? I'm using Zope 2.6.1 precompiled Linux version. - dtml-let batch=_.range(100, 180) batch_size=10 batch_start=REQUEST.get('batch_start', 0) dtml-in batch start=batch_start size=batch_size overlap=0 dtml-sequence-item;br /dtml-in dtml-in batch start=batch_start size=batch_size previous overlap=0 dtml-in previous-batches mapping a href=dtml-var URLdtml-var sequence-querybatch_start=dtml-batch-start-index; dtml-batch-start-index;-dtml-batch-end-index; /a /dtml-in /dtml-in STRONGdtml-batch_start;-dtml-var batch_size + _.int(batch_start) - 1/STRONG dtml-in batch start=batch_start size=batch_size next overlap=0 dtml-in next-batches mapping a href=dtml-var URLdtml-var sequence-querybatch_start=dtml-batch-start-index; dtml-batch-start-index;-dtml-batch-end-index; /a /dtml-in /dtml-in /dtml-let ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Weird batches produced by dtml-in
From: Andreas Jung [mailto:[EMAIL PROTECTED]] Take a look at PloneBatch.py from the Plone package. PloneBatch.py is a very sophisticated module for batching and forget about dtml-in. That doesn't really solve my problem. I don't use ZPT and I don't use Plone, and the PloneBatch module doesn't strike me as a particularly beautiful solution to the problem (mostly because of the extremely verbose ZPT syntax, I guess). In any case, my problem was with dtml-in... Unless someone says otherwise I'm assuming it's a bug in dtml-in and will submit it to the collector in a day or so. --On Dienstag, 11. Februar 2003 17:01 +0800 Bjorn Stabell [EMAIL PROTECTED] wrote: Hello, I'm trying to implement a Google-like pagination using the dtml-in batching system, and I'm getting some very strange results. Either I'm overlooking something obvious or there is a problem with dtml-in. See attached source code of simplified example that produces the strange results. The first time I access the page the results are as follows: 0-9 10-19 20-29 30-39 40-49 50-59 60-69 70-79 If I click '10-19' it'll take me to batch_start=10, which gives the following strange results: 0-8 10-19 19-28 29-38 39-48 49-58 59-68 69-78 79-79 I have no idea why the first batch is now 0-8 and the next batch is now 19-28. Shouldn't they be 0-9 and 20-29 like above? I'm using Zope 2.6.1 precompiled Linux version. - dtml-let batch=_.range(100, 180) batch_size=10 batch_start=REQUEST.get('batch_start', 0) dtml-in batch start=batch_start size=batch_size overlap=0 dtml-sequence-item;br /dtml-in dtml-in batch start=batch_start size=batch_size previous overlap=0 dtml-in previous-batches mapping a href=dtml-var URLdtml-var sequence-querybatch_start=dtml-batch-start-index; dtml-batch-start-index;-dtml-batch-end-index; /a /dtml-in /dtml-in STRONGdtml-batch_start;-dtml-var batch_size + _.int(batch_start) - 1/STRONG dtml-in batch start=batch_start size=batch_size next overlap=0 dtml-in next-batches mapping a href=dtml-var URLdtml-var sequence-querybatch_start=dtml-batch-start-index; dtml-batch-start-index;-dtml-batch-end-index; /a /dtml-in /dtml-in /dtml-let ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) - -Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - -Life is too short to (re)write parsers - - ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Rendering of objects in DTML
Hello, When a content is rendered by the Zpublisher, its index_html() is called. When it is rendered in DTML, e.g., as dtml-var content, its __call__ method is called. The __call__ method is also called if the object appears in dtml-if content or dtml-with content. Is it possible to render these two cases differently from dtml-var content? Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] Rendering of objects in DTML
Bjorn Stabell wrote: Hello, When a content is rendered by the Zpublisher, its index_html() is called. When it is rendered in DTML, e.g., as dtml-var content, its __call__ method is called. The __call__ method is also called if the object appears in dtml-if content or dtml-with content. Is it possible to render these two cases differently from dtml-var content? Which two cases? What do you mean by 'differently'? cheers, Chris I would like dtml-var content dtml-with content... dtml-if content to call different functions. The first renders the object, the second returns a mapping of the content's attributes/properties, the third checks for trueness of the content. Rendering a content could be an expensive operation and I don't want to do it when doing dtml-with and dtml-if. ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Python method wrapping around DTML method
Title: Message Hi, This has been buggering me for ages, and I've spent too many hours trying to figure it out already, so I'm resorting to the list for help. :) I have two functions, PlainFunc and DTMLFunc, where PlainFunc is Python method in a file system product, and DTMLFunc is a DTML Methodin the ZODB. What I want to do is this: ZPublisher calls PlainFunc (publishes it) PlainFunc calls DTMLFunc in such a way that DTMLFunc gets everything it needs, e.g., namespace, but PlainFunc can do funky things to this namespace before-hand (like insert a few variables into it). In other words, I want a Python method to wrap around a DTML method. I've encountered many problems caused by the awkward calling conventions for DTML methods and the automagic switching between different calling conventions by the ZPublisher (isDocTemp; can I set that for a normal Python method?). Right now, I'm struggeling because I cannot get the namespace to be passed to PlainFunc, therefore PlainFunc cannot pass the namespace on to DTMLFunc. Any clues? Bye,-- Bjorn Stabell [EMAIL PROTECTED]Tel +86 (10) 65918490
RE: [Zope-dev] Why are ZClasses bad?
I would really like to see a hybrid between ZClasses and the CMF's portal_types, so that you can define methods in the Python class that you want portal_type instances of this class to be able to overload. I'm currently abusing the CMF portal_types' actions to overload methods of these types. This makes it possible for CMF portal_types to override some of the Python class' methods; that's usually all I need. The methods that you want to be able to overload have to look for a specific CMF action (for that portal_type) and call the skin method that is defined for that action, similar to the way the CMF overloads index_html/view. Regards, -- Bjorn -Original Message- From: Joachim Werner [mailto:[EMAIL PROTECTED]] Posted At: Wednesday, April 03, 2002 17:41 Posted To: Zope Developer Conversation: [Zope-dev] Why are ZClasses bad? Subject: Re: [Zope-dev] Why are ZClasses bad? Hi! I guess ZClasses are not evil or so. But as somebody who has worked with ZClasses for a long time and then switched to Python Products instead, I see a lot of problems/disadvantages ZClasses have: - Most important: It is rather hard to change the base classes with ZClasses. In Python, you can do that very easily. - Copypaste programming does not work with ZClasses. With Python Products, I can start writing my own version of an existing Product by just searching and replacing all the occurences of the original Product name by my own one. With ZClasses, copying an existing ZClass and changing it to fit will not work well. - If you use a decent editor (I am currently using PythonWin on Windows), it is much more convenient to have all the methods of your class in just one file than having to drill down into the ZMI and search for individual Scripts (Python) or DTML Methods - Debugging Python code is easier than debugging ZClasses. E.g., you can use a real debugger, or just add temporary print statements to the code. With Python code, the tracebacks are much more helpful than they are with ZClasses, especially if you use DTML ... - Working from Python gives you MUCH more power, and the code usually is more compact. - You can use CVS for the code, and there is a rather strict separation between instances of your Product/class and the code ... - ZClasses behave strange with regard to nested acquisition. I experienced cases where two instances of a ZClass acquired from each other in a way they shouldn't ... - ZClasses are relatively slow, especially if you use other ZClasses as base classes of ZClasses. One of the great disadvantages of Python-based Products was that you had to permanently restart your Zope to see the changes in action. But now we have refresh, which works great. That said, I can still imagine using ZClasses together with a custom-built Python-based base class. They are over-the-web, which is their greatest advantage. For Zope 3, I'd suggest a complete redesign of ZClasses to offer something similar without the disadvantages ... - Original Message - From: Dario Lopez-Kästen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 03, 2002 11:20 AM Subject: [Zope-dev] Why are ZClasses bad? Hello! I keep hearing people argue that ZClasse are bad, and I am curious as to why they are. I recall something about ZClasses and the catalog, but are there any other badness with ZClasses? /dario - curious - Dario Lopez-Kästen, [EMAIL PROTECTED]IT Systems Services System Developer/System Administrator Chalmers University of Tech. ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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] Manual object-to-relational persistency framework
Hello, I'm trying to use Zope without storing everything in ZODB while still having the perception of an object-oriented database. I want to control the object-to-relational mapping layer, but would like the loading and saving of objects to be automatic. Is there some way to do that using Zope? Where would I, e.g., hook into to get automatic loading/cacheing/saving of objects that weren't stored in ZODB, and where I could actually create the methods to load/save objects myself (I want to control the data structure). Regards, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] Manual object-to-relational persistency framework
I think the Storage interface wroks at a lower level, dealing with pickled Python objects. I'd like to do it at a higher level, so I can define my own object-relational mapping, unique for each object type I want to use the Zope framework (acquisition, access control, automatic persistence) and still have the objects stored in a nice domain specific relational schema, not storing anything (even ghost objects) in the ZODB, but having live objects available as usual. Ideally, it should be possible to get the the data for the objects from anywhere. I guess it would be possible to make a special Storage interface that calls hooks in objects that have them to actually implement the storage/persistency functionality, but that seems kind of overkill and it'd mean I have to mount another Storage etc. There must be any easier way? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Posted At: Friday, March 08, 2002 17:27 Posted To: Zope Developer Conversation: [Zope-dev] Manual object-to-relational persistency framework Subject: Re: [Zope-dev] Manual object-to-relational persistency framework On Friday, 8. March 2002 09:50, Bjorn Stabell wrote: I'm trying to use Zope without storing everything in ZODB while still having the perception of an object-oriented database. I want to control the object-to-relational mapping layer, but would like the loading and saving of objects to be automatic. Is there some way to do that using Zope? Where would I, e.g., hook into to get automatic loading/cacheing/saving of objects that weren't stored in ZODB, and where I could actually create the methods to load/save objects myself (I want to control the data structure). Sounds like changing the (default) backend of the ZODB. That way you use Zope with the ZODB but your objects are stored in a RDBMS too. ZODB comes with several backends (a.k.a Storages), the default FileStorage, DemoStorage, OracleStorage. The latter doing already object relational mapping to Oracle RDBMS. If you want to control the mapping, just define your own Storage (I do not know how hard it is, maybe the 'gurus' do?) and then tweak your Zope instance to use your custom Storage instead of the default FileStorage. That way you do not have to care about automatic loading/saving of your objects. Regards, Thomas -- Webmaster Innovationskolleg Theoretische Biologie http://itb.biologie.hu-berlin.de ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] symbolic link patch
Well, this would be similar to the approach used by the PortableHole product. It's more like a hard link than symbolic link; if you run your site through ZSync, ZSync will unwind all the links and make separate copies. -Original Message- From: Maik Jablonski [mailto:[EMAIL PROTECTED]] Posted At: Monday, February 18, 2002 23:26 Posted To: Zope Developer Conversation: [Zope-dev] symbolic link patch Subject: [Zope-dev] symbolic link patch hello, i found this patch for creating symbolic links within zope: http://lists.zope.org/pipermail/zope-dev/2001-August/012711.html snip - edited CopySupport.py - copied the manage_pasteObjects method to a manage_pasteMonikers method - commented the #ob=ob._getCopy(self) line (the duplicate object part) - added a Paste Ref button to the lib/python/OFS/dtml/main.dtml file that calls the pasteMonikers method /snip it seems to be great for my purposes works fine i plan to use it on a production system. has someone any information about problems with this kind of patching? something like breaking the database in long terms or even more ugly? thank you, Maik -- Maik Jablonski Zentrum fuer Lehrerbildung Universitaet Bielefeld Germany ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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] ZCatalog searching for missing values
Hi all, We've installed Kavio's CatalogQuery product and are very happy with it. Haven't looked at the ZOQLMethod from iuveno yet, but both look like great steps in the right direction. I have one question: is it possible using a normal catalog query or Kavio's catalog query to check if a value is not set? The representation returned is Missing.Value, but I seem to be unable to say, e.g, 'Description == Missing.Value' etc. How hard is it to add such functionality? Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] ZCatalog searching for missing values
Having an exists function would be great. I was trying to do the same using CatalogQuery, but I found no way to check for Missing.Value, which is the repr() of what's in the catalog's metadata field for objects that don't have that attribute/function. I also ran into problems doing more complex or'ing and and'ing, and I assume we'll have better luck with ZOQLMethod for that. I just tried out ZOQLMethod as well. Couldn't get it to work, but it looks like really solid craftsmanship. I like the user-friendly way of selecting base object and the complete syntax. :) Some questions: 1. I couldn't get any query to work. I keep getting exceptions.TypeError argument 2 to map() must be a sequence object Here's an example query that I've tried SELECT id WHERE title == '' RECURSIVE; 2. Is the ZCatalog searching implemented? How do I activate it? 3. Do you have any plans to implement JOIN? The exists function would be very cool. Keep up the great work. Hope this helps flush out some features :) Bye, -- Bjorn Stephan wrote: [...] I actually need to look at Casey's code and see what I can reuse. The efficiency of my version is not that great yet, but much more flexible. So I want to take Casey's code and optimize mine a little. BTW, I just added a mailing list and a poll for ZOQL. Please go to http://demo.iuveno-net.de/iuveno/Products/ZOQLMethod and vote in the poll, so I can get an estimate of the general interest. I have one question: is it possible using a normal catalog query or Kavio's catalog query to check if a value is not set? The representation returned is Missing.Value, but I seem to be unable to say, e.g, 'Description == Missing.Value' etc. How hard is it to add such functionality? You mean, whether the system checks, if a property exists at all or is set to None? I think both would be no problem. 1. Property exists or not: I could support a function, like: exists(Property) Example: SELECT * FROM Test WHERE exists(Property); 2. Property is set to None: Simply use equal: Property == None Note: That might work already? I have to check... Example: SELECT * FROM Test WHERE Property == None; Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development Technical Project Management ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] ZCatalog searching for missing values
Ahhh... Got it working now. Thanks. :) Not sure I know how to activate ZCatalog searching though, or if it is on all the time; the example only mentions ZCatalog once when it deletes it. What determines if a search is a raw object-database search and when it uses the ZCatalog? Always returning the objects is going to a bit slow, though. Couldn't it just return the Pluggable Brains if you search the ZCatalog; or at least have an option to only return them? Bye, -- Bjorn -Original Message- From: Stephan Richter [mailto:[EMAIL PROTECTED]] Sent: Monday, October 08, 2001 23:33 To: Bjorn Stabell Cc: [EMAIL PROTECTED] Subject: RE: [Zope-dev] ZCatalog searching for missing values I just tried out ZOQLMethod as well. Couldn't get it to work, but it looks like really solid craftsmanship. I like the user-friendly way of selecting base object and the complete syntax. :) Some questions: 1. I couldn't get any query to work. I keep getting exceptions.TypeError argument 2 to map() must be a sequence object Solved. See below. Here's an example query that I've tried SELECT id WHERE title == '' RECURSIVE; You can only select meta types (this is by design; I just don't want to deal with brains and all that stuff right now.)!! Did you see the help? It has a long example in there as well. But there is another bug. You have to specify FROM right now. I will fix that. Okay, is fixed for the next release. So, SELECT DTML Method FROM . WHERE title == '' RECURSIVE; should work. 2. Is the ZCatalog searching implemented? How do I activate it? Yes, see the Rather Lengthy Example. 3. Do you have any plans to implement JOIN? No, for the reasons given above. You select only objects, not attributes. BUT, patches are always welcomed!!! :-) The exists function would be very cool. I will look into this. Hopefully it will be not too hard to implement. Keep up the great work. Hope this helps flush out some features :) I hope I will. :-) Yes it does. If you and all the other Zope people could write me some arguments to support attribute selection, then I will look into it (but it will be not that easy). Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development Technical Project Management ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] Emailing html web pages: how can I render page as the anonymous user?
My favorite way is to support this is to create skins. We have two skins: printable emailable that fixes the standard_html_* stuff, and can even be used to override the content rendering at a deeper level, if needed (overriding document_view etc). We can use the same way to support WAP, Avantgo etc also. A printable version of a page is simply done by doing http://myurl/contenturl?portal_skin=printable Pretty cool. IMO, this is a better use of skins than to use it for languages; languages are better managed by Localizer or ZBabel. Bye, -- Bjorn [EMAIL PROTECTED] -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Posted At: Sunday, October 07, 2001 04:53 Posted To: Zope Developer Conversation: [Zope-dev] Emailing html web pages: how can I render page as the anonymous user? Subject: Re: [Zope-dev] Emailing html web pages: how can I render page as the anonymous user? Hi Don, Instead of including the rendered standard_html_header and standard_html_footer in the emailed page, why not have a emailed_html_header and emailed_html_footer, which are prerendered copies of a toolbar and other things as seen by the anonymous user? The setuid/setgid thing is tricky and since the outcomes will be about the same (always showing folks an anonymous-based toolbar), including static content is easier. - C Don Hopkins wrote: I'm using the CMF, and I've implement an email_this_page method, that prompts for an email address, then uses the sendmail tag to email the html contents of a page, like yahoo and other sites commonly do. I want to include the standard_html_header and standard_html_footer in the email message, so it's easy for the recipient to navigate to the web site. But when I tested it out, I noticed I got all the management buttons like Reject and Reconfigure portal in the email message! Of course they required authentication, but it'd rather render the page as it would be seen by the anonymous user. What I need is something like the effect of a setuid/seteuid system calls, that temporarily downgrades the Zope user to anonymous, while it renders the html headers and footers. As a stab in the dark, I tried changing the proxy role of the dtml script that uses the sendmail tag and renders the html, but I still got the management buttons. Is it as simple as temporarily changing some properties of the request? Or is there an extension or product that can do that? Thanks! http://www.WorldTradeCenterDisaster.com:8080/Memorial -Don ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 ) -- Chris McDonoughZope Corporation http://www.zope.org http://www.zope.com Killing hundreds of birds with thousands of stones ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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] RE: DTML-Python confusion (RE: [Zope] How to make a script return rendered dtml)
Wow, thanks Evan. I should've asked these questions a long time ago... From: Evan Simpson [mailto:[EMAIL PROTECTED]] From: Bjorn Stabell [EMAIL PROTECTED] How do you do dtml-with and dtml-let in a Python script? (I.e. put something on the namespace) You can't. Scripts can use the DTML namespace in the same way that Python expressions in DTML can, but that's it. On the other hand, you can create (and pass along) all the local variables you want. Is it possible to append an object to the namespace? Isn't that what dtml-with does? How do you give positional (not keyword) arguments to a DTML method; is there any difference? Keyword arguments are put on top of the namespace. You can't use positional arguments, except the standard (None, _) idiom. DTML was never meant to pass arguments around, that's what the namespace is for, for what that's worth :-P But the other way around, calling Python functions from DTML (via dtml-var func) the positional arguments are gotten from the namespace, right? [... good andswer to __call__ et al deleted :) ... ] When does RESPONSE need to be passed; it can always be gotten from the REQUEST, right? Right. So why do so many DTML methods / documents have REQUEST as an explicit argument? It looks like a convention that has to mean something. Are namespace, _, REQUEST, and context just different names for the same thing? Not quite. The namespace, accessible in DTML as _, is a pile of objects. The REQUEST is a particular object created by ZPublisher to hold information about the request, such as form variables and URL information. The context (or client, for DTML) is the object on which the method was called. If the DTML Method is the target of the request, or if you pass a client as the first argument when calling it, the Method pushes it onto the namespace. Also, the context (like any other Zope object) is acquisition wrapped. The ultimate acquisition parent of any publsihed object is a special wrapper for REQUEST. All this means that when you ask the namespace for the name foo, it will end up looking for it in the context, in the context's containers all the way to the root, and the REQUEST. I am a little bit confused about the fact that the acquisition path is related to how the document was called, not just to the containment relationships it is involved in. Or is it? myobj.aq_parent isn't necessarily the object that contains myobj? Is the namespace stack basically the same as the acquisition path? Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] DTML-Python confusion (RE: [Zope] How to make a script return rendered dtml)
I've spent hours, maybe days, being confused about this as well. According to the Zope API documentation and ZDP at http://zdp.zope.org/projects/zfaq/faq/DTML/959888072 http://zdp.zope.org/projects/zsnippet/snippets/DTMLTags/CallingDTMLMetho ds someDTMLMethod(_.None, _) should work. Because of the unclear/complex calling conventions and integration between DTML and Python I've had to keep some code in DTML. Other related questions are: How do you do dtml-with and dtml-let in a Python script? (I.e. put something on the namespace) How do you give positional (not keyword) arguments to a DTML method; is there any difference? When is __call__ called, when is __str__ called, and when is index_html called? Other basic functions worth knowing about for a class/object to be a good-behaving Zope object? When does RESPONSE need to be passed; it can always be gotten from the REQUEST, right? Calling a DTML method, when to use client and when to use REQUEST? Is calling with client and REQUEST the same as adding client to the namespace (REQUEST) and calling it with an client=None? Are namespace, _, REQUEST, and context just different names for the same thing? I've been dreaming about a FAQ answering all of this (and a bunch of ZClasses questions I have). Me thinks the ZDP should be integrated with Zope.org, and all Zope.org members given access to add FAQs (I am not allowed to add FAQs now). Ideally, somebody should be adding FAQs all the time, and the FAQ index should be posted regularly to zope-dev... Btw, I think http://zdp.zope.org/projects/zfaq/faq/DTML/959888072 gets the order of aMappingObject and aClient wrong in the first code line. Bye, -- Bjorn -Original Message- From: Tim Hicks [mailto:[EMAIL PROTECTED]] Posted At: Thursday, June 14, 2001 00:15 Posted To: Zope List Conversation: [Zope] How to make a script return rendered dtml Subject: Re: [Zope] How to make a script return rendered dtml - Original Message - From: Eric Balasbas [EMAIL PROTECTED] To: Tim Hicks [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 4:33 PM Subject: Re: [Zope] How to make a script return rendered dtml I'm not sure if this is the best way to do it, but if you want to render a DTML method or DTML document inside a Python script, use the syntax: someDTMLMethod(_.None, _) I tried this: print context(_.None, _) and got this error: Error Type: NameError Error Value: _ So I tried context.id(_.None,_) and got the same. So I tried 'print context(None,_)', with the same error resulting. Finally, I have tried: print context(None,) and got Error Type: KeyError Error Value: standard_html_header This last error at least seems like it's on the right track as it is parsing through the text of the file. What's going wrong, any idea? thanks tim Eric Balasbas Senior Developer [EMAIL PROTECTED] http://www.virtosi.com/ Virtosi Ltd. Design -- Branding -- Zope On Wed, 13 Jun 2001, Tim Hicks wrote: I have a ZClass (testclass) which subclasses DTMLDocument, and within this zclass, I have a script (python) called index_html. Obviously, this script is called each time an instance of testclass is requested. Based on the presence of a query string, I want to either return the document_src (although with a few modifications), or simply return the rendered instance... by this, I mean have all the dtml tags that are in the instance evaluated. So, my question is, how do I make Zope evaluate the dtml tags? Here is what I have so far in my script: if context.REQUEST.QUERY_STRING == 'editor': print context.raw else: print context return printed The 'else' statement simply gives me things like, lt;dtml-var standard_html_headergt; I also tried 'else: render(context)', which was simply a guess on my part, but I get a Zope error as follows: Error Type: AttributeError Error Value: validate Can anyone enlighten me? Cheers tim ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Personalization (was RE: [Zope-CMF] List of subject/metadata sets?)
is extended with two profile objects: behavior = implicit data; each keyword has an associated hit interests = explicit data; just a list of keywords the user has explicitly said he's interested in Just like with sessions, we could store personalization in the ZODB but it'll probably be too slow for many uses. We should use a storage that is fast both for writes and reads, which means it'll probably not be very persistent. We could have it synchronize regularly with a more persistent storage, e.g., ZODB. Interests are more like subscriptions, and like subscriptions, have their uses. This is still simple. I'm sure, e.g., Broadvision offers much more when it comes to personalization. These are just thoughts; I don' thave any plans to implement personalization yet. I'd be happy to help others, though :) Bye, -- Bjorn Stabell [EMAIL PROTECTED] Exoweb -Original Message- From: Jon Edwards [mailto:[EMAIL PROTECTED]] Posted At: Tuesday, June 05, 2001 23:17 Posted To: Zope CMF Conversation: [Zope-CMF] List of subject/metadata sets? Subject: RE: [Zope-CMF] List of subject/metadata sets? (Note to self : Remember to engage brain before typing!) Yes, you're right - and as Marc pointed out, you can have everything you need in one catalog. I guess where I'm coming from, is that the catalog is serving two purposes, and sometimes it gets confusing to a relative newbie like me - 1. For the end user it allows them to search the whole system, and is quite often used to construct the pages - topics and sub-topics - they are viewing. I'm assuming it will also be used in some way to construct composite-documents. With a large site, containing many sub-sections (or a large organisation with quasi-autonomous sub-organisations/departments) it needs a lot of planning to allow all the possible searches users are likely to want. 2. Behind the scenes it is interacting with workflow/workgroups to allow people to process documents from creation to publication. ...and I'm still trying to wrap my brains round how Composite Documents and Versioning will fit into it all. This is assuming you have a site with multiple editors/contributors working on many sections/subsections/pages in different workgroups. I guess at some scale the complexity reaches the point where you need to separate the two functions... and my needs are somewhere in that vicinity! :-) i.e. you have two portals/catalogs, one for the internal organisation to do its workflow, collaboration, discussions, document-sharing (perhaps on their intranet)... and one where the finished results are published, and the public can view, search, discuss. But you still want some two-way connection between the two. Is anyone else reaching similar levels of complexity? Maybe I should re-factor and divide and conquer!! Sorry if this makes no sense! I think I'm having a bad-brain day! Cheers, Jon -- Going off at a tangent, does anyone ever get the feeling that you maybe need two portal_catalogs? One for end-user searching, topics, etc. and one for the internals, composite-docs and that sort of stuff? How do you mean? Wouldn't that mean you end up with lots of objects being indexed in two places? seb ___ Zope-CMF maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-cmf See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] 60GB Data.fs?
Hi there, We're planning a Yahoo! Clubs like system that should scale to about 30, 000 users. Assuming about 3,000 groups and 20MB per group (group functionality includes photo albums), gives a database size of 60GB. Assuming on average 3,000 users per day, 20 page views per users, gives about 60,000 page views (not a lot, but if it's all dynamically generated?). We'd like to use Zope for this, if it is possible. Other options are ok too; anyone have any experience with other ready-made systems? At this scale, how would ZODB hold up with respect to memory use and speed? I've heard rumors that it loads an index into memory on start-up. How would using Oracle as a Storage (ZODB semantics) help? Going full-scale RDBMS means we'd have to reimplement a lot of existing useful tools, so we'd rather not do that if using Zope. I know we'll have to play with cacheing as well, and as I see there are these options: - SQL method cacheing - Using StandardCacheManagers to cache Python and DTML methods - Using StandardCacheManagers to cache pages (using, e.g., Squid as an HTTP accelerator) - ZEO client object cacheing Any other ideas? Bye, -- Bjorn Stabell [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)
Chris McDonough: [...] weeping (although grateful for the exchange), I'm sorry Chris. We didn't give you a very good debugging chase. I know how frustrating bug reports like Help! It doesn't work is, but I guess it's very hard to troubleshoot bugs in frameworks since there's so much customized code in there. To be a little bit more helpful I've included two functions: cart_add(sku, qty) (Python Script) This function adds qty amount of a skus (integer id for product items) to the cart cart_display (DTML Method) This method displayes the cart The bug appears even when these two functions are the only functions interacting with the session and the shopping. There are obviously some references to code not provided in there, so don't expect them to work just like that. If you can't see anything wrong from a simple code inspection, I volounteer to provide the whole site for you. It's quite refreshing to do a project for a sandwich shop, like we do now, but I hope we can get to the bottom of these disappearing cokes. :) Thank you for all the help. Open source sure beats the heck out of commercial solutions when it comes to support. Bye, -- Bjorn Stabell [EMAIL PROTECTED] cart_add(sku, qty) ___ session = context.session_mgr.getSessionData() cart = session.get('shopping_cart', {}) sku = int(sku) if not cart.has_key(sku): cart[sku] = 0 if int(qty)0: cart[sku] = cart[sku] + int(qty) session.set('shopping_cart', cart) container.cart_recalculate() context.REQUEST.RESPONSE.redirect(context.REQUEST['HTTP_REFERER']) cart_show() ___ dtml-call REQUEST.set('totalprice',0) dtml-comment Session token key, value: dtml-var session_mgr.getTokenKey(), dtml-var session_mgr.getToken()br /dtml-comment dtml-let cart=session_mgr.getSessionData().get('shopping_cart', {}) dtml-if cart.keys() dtml-in cart.keys() sort dtml-if sequence-start table border=0 cellspacing=0 cellpadding=0 width=100% tr td bgcolor=#FFDAAB form action=cart_change method=post table width=100% border=0 cellspacing=1 cellpadding=2 align=center tr td colspan=2 bgcolor=#006633 class=pagetitledtml-var gettext('Order Bag')/td /tr tr tddtml-var gettext('Category')/td td align=right width=20%dtml-var gettext('Qty')/td /tr /dtml-if sequence-start dtml-let shop_item=get_shop_item(_['sequence-item']) tr valign=top td bgcolor=#FF !--dtml-var shop_item.Description()-- dtml-var shop_item.Title() a href=cart_rm?sku=dtml-sequence-item;dtml-var gettext('remove')/a dtml-comment !--dtml-var shop_item.absolute_url() html_quote-- a href=cart_rm?sku=dtml-sequence-item;remove/a !--dtml-var shop_item.price /dtml-comment dtml-let qty=_.int(cart[_['sequence-item']]) dtml-call REQUEST.set('totalprice', totalprice + shop_item.price * qty) /td td nowrap bgcolor=#FFinput type=hidden name=skus:list value=dtml-sequence-item; input type=text name=sku_dtml-sequence-item;:int value=dtml-var cart[_['sequence-item']] size=1 /td /dtml-let /dtml-let /tr dtml-if sequence-end tr valign=top td colspan=2 align=right class=RMB bgcolor=#CCdtml-var gettext('TOTAL') dtml-var _.int(session_mgr.getSessionData().get('shopping_cart_amount', 0)) /td /tr tr valign=top td colspan=2 bgcolor=#FF bdtml-var gettext('Bonus points')/b br dtml-var gettext('This order is worth') dtml-var _.int(session_mgr.getSessionData().get('shopping_cart_bonus', 0)) br dtml-unless portal_membership.isAnonymousUser() dtml-var gettext('Bonus points to spend') dtml-var _.int(member.bonus_points) /dtml-unless /td /tr tr valign=top td colspan=2 bgcolor=#FF input type=submit name=Submit value=dtml-var gettext('update') a href=orderFormdtml-var gettext('Checkout')/a /td /tr /table /td /tr /table/dtml-if sequence-end dtml-else Empty /dtml-in /form /dtml-if /dtml-let ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Brought to you live: The Bug (RE: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8))
By the way, Chris, you can see the bug in action at our site by going to: http://www.beijingsammies.com:7380/sammies/ The website has not been launched yet, so be careful guys. Also, don't try ordering, unless you're in Chaoyang district, Beijing, China. :) The site may be slow since it's hosted in China. Try adding some items to the shopping cart, and then clicking on the navigation menu, browsing the various brochureware pages (only cart_show is called; no modification is done). At some point, the shopping cart should suddenly disappear. If you continue browsing, it may appear again. Actually, if you add items to the shopping cart while it is disappeared/empty, they'll get accepted and you'll have two different shopping carts. Which one you see is random. The session objects are set up like this: /session_id_mgr (session id manager) /sammies/session_mgr(session data manager) There are no other session id or data managers. The session data manager is using the default internal RAM-based session data container with no onStart or onEnd methods. Here's the test run I just did: - I added a few items to the shopping cart - Then I clicked on different brochureware pages for about one hundred clicks (2 minutes? a trial in patience :) I managed to get the error: - The shopping cart became emptied - Checking the session data manager, it still showed one item/session - I added more items to the new, blank session - After about 30-40 clicks, it changed into the old session again I notice that this kind of 'change' OFTEN HAPPENS WHEN I CLICK A NEW LINK BEFORE THE OLD PAGE HAS LOADED COMPLETELY, i.e., I interrupt the page half-way. Sometimes I also think that I notice a delay in Zope (the requests seems to take one second longer) when this kind of switch happens, but that may be me imagining things. There's nothing unusual in the STUPID_LOG_FILE when the switch occurs. I can, however, see that the previous time we ran zope we had the errors I've attached below (shouldn't make any difference). Bye, -- Bjorn [...] -- 2001-05-25T07:41:03 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000)\247' Traceback (innermost last): File /zope/zope-dc-2.3.2/lib/python/ZODB/Connection.py, line 508, in setstate AttributeError: 'None' object has no attribute 'load' -- 2001-05-25T07:43:58 INFO(0) ApplicationManager Shutdown requested by jey -- 2001-05-25T07:43:58 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\00 0\000)\247' Traceback (innermost last): File /zope/zope-dc-2.3.2/lib/python/ZODB/Connection.py, line 508, in setstate File /zope/zope-dc-2.3.2/lib/python/ZODB/FileStorage.py, line 595, in load (Object: /zope/site-cn:7300-sammies/var/Data.fs) File /zope/zope-dc-2.3.2/lib/python/ZODB/FileStorage.py, line 572, in _load (Object: /zope/site-cn:7300-sammies/var/Data.fs) ValueError: I/O operation on closed file -- 2001-05-25T07:43:58 PROBLEM(100) zdaemon zdaemon: Fri May 25 15:43:58 2001: The kid, 16615, died on me. -- 2001-05-25T07:47:23 INFO(0) zdaemon zdaemon: Fri May 25 15:47:23 2001: Houston, we have forked -- 2001-05-25T07:47:23 INFO(0) zdaemon zdaemon: Fri May 25 15:47:23 2001: Hi, I jus t forked off a kid: 18005 -- 2001-05-25T07:47:23 INFO(0) zdaemon zdaemon: Fri May 25 15:47:23 2001: Houston, we have forked -- 2001-05-25T07:47:27 INFO(0) ZServer HTTP server started at Fri May 25 15:47:27 2 001 Hostname: box.exoweb.net Port: 7380 -- 2001-05-25T07:47:27 INFO(0) ZServer FTP server started at Fri May 25 15:47:27 20 01 Hostname: box Port: 7321 ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)
Nope, couldn't have been, because: I couldn't set _p_changed from Python Script, but I changed the last line setting the shopping_cart object in the session to: session.set('shopping_cart', cart.copy()) This should create a fresh copy of the dict, which should be sufficent notice for the persistence machinery (or isn't a shallow copy enough? cart is a dict of integers). I also removed the call to cart_recalculate, just to make sure there were no spooky thing going on there. I'm still seeing the bug. Just a quick question. In: session.set('shopping_cart', cart) is cart call-by-reference or call by value (cart is a dict). I guess it depends if 'set' makes a copy of the dict or not before assignment? Also, do I really have to make a copy, or is there a way from Python Script to notify the persistence machinery about a change in a complex object, e.g., dict? Bye, -- Bjorn -Original Message- From: Matt Hamilton [mailto:[EMAIL PROTECTED]] Posted At: Saturday, May 26, 2001 00:37 Posted To: Zope Developer Conversation: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8) Subject: RE: Randomness (RE: [Zope-dev] CoreSessionTracking 0.8) On Fri, 25 May 2001, Bjorn Stabell wrote: session = context.session_mgr.getSessionData() cart = session.get('shopping_cart', {}) sku = int(sku) if not cart.has_key(sku): cart[sku] = 0 if int(qty)0: cart[sku] = cart[sku] + int(qty) Could this be the same problem that I was experiencing, in that dicts/btrees do not in themselves notify the persitence machinery that they have changed? try adding cart._p_changed = 1 to the code after modifying cart{}. -Matt -- Matt Hamilton [EMAIL PROTECTED] uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Hosting | Web Design | Domain Names | Co-location | DB Integration ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )
Randomness (RE: [Zope-dev] CoreSessionTracking 0.8)
Allright, let me try again. I wish I had a small piece of code to give you so you can reproduce it, but right now you'd have to get our entire CMF-based website. The bug basically manifests itself in that there are two versions of the variable we put in the session (a shopping cart dict). When I browse through the site (not even updating the shopping cart) it'll show one version for some links (1-40) before it switches to show the other, and so on. It looks like the website has two shopping carts that it switches back and forth between. You can see the shopping cart on every page in the website (it's embedded into the template). We were using frames, but I tried it several times without frames now and the bug remains. I even noticed that other variables disappeared randomly as well, e.g., USER_PREF_LANGUAGES which is set by the Localizer, resulting in a key error (I've probably seen 300 pages views, and then suddenly one going back to another page gives a key error?). I'm very curious what could possibly be causing such problems. I thought there might be something wrong in the shared memory between threads, as I can't see anything else changing but the threads (is there a way to display which thread is doing the publishing?). I've seen similar randomness displayed in other situations where I've been reloading pages that would sometimes (same interval, about every 1-40 times) show one character set, and other times another. I think nobody likes to see that kind of randomness. It gives me a very bad stomach feeling. I definately think it's something deeper than a CoreSessionTracking problem. Bye, -- Bjorn Stabell [EMAIL PROTECTED] -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 23, 2001 20:34 To: Howard Zhang Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Exoweb Subject: Re: [Zope-dev] CoreSessionTracking 0.8 I remember this problem, but I haven't been able to reproduce it. But maybe it's because I'm not understanding the steps to reproduce it. The sentence user adds coke to shopping cart and click link to add coke again before request finished is hard to understand. Can you explain? Are you using frames? Howard Zhang wrote: Hi The problem about CoreSessionTracking we describe before we can repeat again now. The step is: ( 1 ) User adds Burger to shopping cart ( 2 ) User adds coke to shopping cart and click link to add coke again before request finished ( 3 ) The Burger is disappear in shopping cart and just one coke ( not two ) ( 4 ) Repeat the step 2,Burger is back Anything you could tell me would be helpful. Regards, howard ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] CoreSessionTracking 0.8 strangeness
Yes, it is entirely with cookies, and we are using frames, although the there's only one sub-frame accessing the session object (that's where we show the shopping cart). -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 12, 2001 23:18 To: Bjorn Stabell Cc: [EMAIL PROTECTED]; Exoweb Subject: Re: [Zope-dev] CoreSessionTracking 0.8 strangeness Bjorn, Is this entirely with cookies? Or are you using url-encoding anywhere? Does your application make use of frames or multiple windows? - C Bjorn Stabell wrote: Chris, It is definately not what you expect, although it was a good guess :) Here's an example of what happens: 1. User adds Burger to shopping cart - Shopping cart shows Burger 2. User adds Coke to shopping cart - Shopping carts shows Burger and Coke 3. User adds Fries to shopping cart - Shoppping cart is empty(!) 4. User adds Fries to shopping cart - Shopping cart only shows Fries 4. User adds Apple Pie to shopping cart - Shopping cart shows Fries and Apple Pie 5. User adds Ice Cream to shopping cart - Shopping cart shows Burger, Coke, and Ice Cream(!) ...and so on... Sometimes, clicking links that don't even touch the shopping cart will make it disappear, e.g., viewing a new product category in the catalog. It seems pretty random, and it is hard to reproduce reliably. The shopping cart is displayed on the same page as the catalog. Any ideas? PS! I have noticed that in other cases Zope is a acting a little bit random too, e.g., when it comes to which character set is used; it will not obey our commands to set it to gb2312 about 1 out of 10 times. That could be an IE bug, but I doubt it. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] CoreSessionTracking 0.8 strangeness
Chris, It is definately not what you expect, although it was a good guess :) Here's an example of what happens: 1. User adds Burger to shopping cart - Shopping cart shows Burger 2. User adds Coke to shopping cart - Shopping carts shows Burger and Coke 3. User adds Fries to shopping cart - Shoppping cart is empty(!) 4. User adds Fries to shopping cart - Shopping cart only shows Fries 4. User adds Apple Pie to shopping cart - Shopping cart shows Fries and Apple Pie 5. User adds Ice Cream to shopping cart - Shopping cart shows Burger, Coke, and Ice Cream(!) ...and so on... Sometimes, clicking links that don't even touch the shopping cart will make it disappear, e.g., viewing a new product category in the catalog. It seems pretty random, and it is hard to reproduce reliably. The shopping cart is displayed on the same page as the catalog. Any ideas? PS! I have noticed that in other cases Zope is a acting a little bit random too, e.g., when it comes to which character set is used; it will not obey our commands to set it to gb2312 about 1 out of 10 times. That could be an IE bug, but I doubt it. Bye, -- Bjorn -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Friday, May 11, 2001 20:47 To: Bjorn Stabell Cc: [EMAIL PROTECTED]; Exoweb Subject: Re: [Zope-dev] CoreSessionTracking 0.8 strangeness This is very odd, as cst depends on ZODB locking just like everything else in Zope, and uses the same transaction facilities and semantics. Now this may *be* the problem... some other folks have explained a problem where newly-created session data disappears if the long-running request that created it is aborted... this may make sense, because the request never gets the chance to finish, and the session data object never gets committed to the database because the ZODB transaction is aborted. It may be the case (especially if you're using frames or multiple windows) that simultaneous concurrent initial requests for a session data object from the same client might cause one of two newly-created data objects to be lost. But I can't imagine a case where a session data object exists for a while (a few minutes), and then a client comes in with the same sessionid, and a new session data object is created for him, not *replacing* the old one, but in addition to the old one... the only possibility for something like this that I can see is on initial request, or if a particularly long-running method creates a session data object, and a user comes in directly after it... ah, wait. I think I see how this can happen. 1. User hits /longrunningmethod. 2. /longrunningmethod creates a session data object as part of its operation. 3. /longrunning method requires 1 minute to process completely. 4. In the meantime, the user (in a separate window or frame) visits /shortrunningmethod. 5. /shortrunningmethod creates a session data object as part of its operation. 6. /shortrunningmethod completes and the session data object it created is committed to the ZODB. 7. User visits /shortrunningmethod2, which modifies the existing session data object, /shortunningmethod3, which also does this, etc. 8. In the meantime, /longrunningmethod finishes and replaces the session data object which has stuff in it from the shortrunningmethods with the one it created. I'm not completely 100% sure about this, but at least it's something to test. Could this be what's happening to you? I may have been overzealous when dealing with confict error problems here... basically, the conflict error detection stuff is disabled for session data objects, which makes this sort of thing possible and likely. Conflict error detection is the ZODB equivalent of record-locking... and when it's ignored, you can have some of the same problems that happen in a nontransactional system (like the problem I outlined above). Sigh. - C Bjorn Stabell wrote: Hi, We're developing a shopping cart using the CoreSessionTracking product v0.8, but we've run into a strange problem; once in a while getSessionData() will create a new session data object (the token value remains the same), and us that for a while. Now we'll end up having two different shopping cart objects, with getSessionData() randomly returning one of them them. We're running Zope 2.3.1. Could it be that some threads can't find the shared session data object and creates their own? The only thing changing between each HTTP request is the thread serving the request, AFAIK. Regards, -- Bjorn Stabell [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] CoreSessionTracking 0.8 strangeness
Hi, We're developing a shopping cart using the CoreSessionTracking product v0.8, but we've run into a strange problem; once in a while getSessionData() will create a new session data object (the token value remains the same), and us that for a while. Now we'll end up having two different shopping cart objects, with getSessionData() randomly returning one of them them. We're running Zope 2.3.1. Could it be that some threads can't find the shared session data object and creates their own? The only thing changing between each HTTP request is the thread serving the request, AFAIK. Regards, -- Bjorn Stabell [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] Using Python script to create ZClass instances
After hours of fiddling around, I've already given up Python methods, but I can't even instantiate MySubZclass via External Methods?!?!? MyProduct . MyZClass . MySubZClass 1. folder.manage_addProduct['MyProduct'].MyZClass.MySubZClass_add(id) - AttributeError for MySubZClass_add 2. folder.manage_addProduct['MyProduct'].propertysheets.methods['MySubZClas s_add'](id) - NameError on MySubZClass (at least it gets to the constructor method) I really think one of the major pains of Zope is just instantiating objects... It's HELL hard, and NOT intuitive. -Original Message- From: Bjorn Stabell Posted At: Thursday, April 12, 2001 12:02 Posted To: Zope Developer Conversation: [Zope-dev] How do I call an HTMLFile in context provided by apath? Subject: [Zope-dev] Using Python script to create ZClass instances Hi there, Im having problems using Python script to create a ZClass instance from a ZClass that's inside of another ZClass. I have this addMyObject Python script as constructor script for "Scriptable Type Information" type object (CMF): ## Script (Python) "addMyObject" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=folder, id ##title= ## folder.Control_Panel.Products.MyProducts.MyObjects.MyObject_add(id) # folder.manage_addProduct('MyProduct')... doesn't work either item = getattr(folder, id) return item MyObjects is a ZClass that contains MyObject. The error I get is: Zope error Error type AttributeError Error value MyObjects There should be some explanation somewhere how to access resources inside of Control_Panel, but I fail to find it. Creating objects is very confusing and difficult at times... Bye, -- Bjorn Stabell [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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] Using Python script to create ZClass instances
Hi there, Im having problems using Python script to create a ZClass instance from a ZClass that's inside of another ZClass. I have this addMyObject Python script as constructor script for "Scriptable Type Information" type object (CMF): ## Script (Python) "addMyObject" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=folder, id ##title= ## folder.Control_Panel.Products.MyProducts.MyObjects.MyObject_add(id) # folder.manage_addProduct('MyProduct')... doesn't work either item = getattr(folder, id) return item MyObjects is a ZClass that contains MyObject. The error I get is: Zope error Error type AttributeError Error value MyObjects There should be some explanation somewhere how to access resources inside of Control_Panel, but I fail to find it. Creating objects is very confusing and difficult at times... Bye, -- Bjorn Stabell [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Multilingual websites
Hi there, I'm working on improving the support for multilingual websites in Zope. Already I've found some tools to be of great help: SiteAccess, Translator, and Transparent Folder (and zzLocale, although I'm mostly interested in ZODB objects). The Transparent Folder enabled me to separate the code, content, and design into separate folders (yeah! it should really be part of the core!), the Translator allows me to externalize strings and localize objects that I want to include (via dtml-lvar). I've run into a couple of problems with the Translator product, though, mainly because I want to localize whole documents, but let them keep the same URL. Let's say I have a "product_info" document. I could put it in a separate ISO language folder, e.g., zh/de/fr/en/no, but then the normal traversal engine can't find it (only dtml-lvar can) unless I explicitly say which folder it is in, which kind-of ruins the point. The ideal case is that: http://website/company/info would find and return zh/company/info de/company/info ... company/info based on the user's language preference. I thought about using SiteAccess to do that, but it's proving hard, and also would only allow me to do a "language split" at the top. A more interesting solution would be to patch the traversal engine (could I do it with SiteAccess?) to look for a particular language version of each object (designated by adding the language's ISO code to the name or some other such convention); in that way I could make company/ a global directory, or I would chose to make it into a localized directory, i.e., all of these would work: company:zh/info company/info:zh company:de/info etc... Could this be done with Zope? Another thought was to make a special Transparent Folder (maybe called Localized Folder) that would resolve accesses to subobjects based on the user's language preference. Different language versions of each object could be put in separate sub-folders, as it is for the Translator product. PS! Any chance of seeing an integration of the core (at least language matching) functionality of Translator and zzLocale? These two products should really become part of the core ASAP, in some form or another. Bye, -- Bjorn ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Login updating database (so ZEO is slow)
Hi, We've been experimenting with ZEO for a few months. The intended use is to have a ZEO client on our LAN, one on the Internet backbone in China, and one in the US, but there are two problems preventing us from using it: 1. updates are very slow, slower than accessing the ZEO client closest to the ZEO server directly 2. logging in updates the database, so they are consequently also very slow (in addition: to use it well we need a distributed director, and atomically updating a set of ZEO installations is not trivial.) Why does logins update the database? Is there any way to turn that off easily? We tested running the ZEO server on our LAN, and the ZEO client on the backbone of the Internet, communicating over a 64kbps DDN line... It took several minutes to log in! :) Most people thought our server had crashed. Would it be possible to support asynchronous updates (optimistic locking) and conflict resolution in the future, allowing for no wait time? (sort-of like Notes and CVS) Bye, -- Bjorn [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
RE: [Zope-dev] JPython Product?
Somehow I think the other way around would be even more interesting: a Java application server accessing Zope (Jope?). The platform market is really tough, and competing with Java isn't easy. If you can't beat them, join them... I guess there are millions of reasons why it can't be done, though? -Original Message- From: Casey Duncan [mailto:[EMAIL PROTECTED]] Posted At: Wednesday, November 08, 2000 23:20 Posted To: Zope Developer Conversation: [Zope-dev] JPython Product? Subject: RE: [Zope-dev] JPython Product? Steve: That is good to know, being a Mac fan myself. I'll have to play with and test the different browsers on the client side as well as server-side jdks. From what I have learned so far on the server end, the project seems reasonably feasible. I think the interesting part will be creating the precise dividing line between the JPython and CPython worlds. I doubt much JPython will exist in the product excepting some "glue" to get Zope/CPython to interact with it in a robust way. That will probably be the fun part. Thanks for the comments, Casey D. -Original Message- From: Steve Spicklemire [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 08, 2000 5:33 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope-dev] JPython Product? Hi Casey, I think this is a fine idea. The main thing that keeps me from doing it is that JPython doesn't work on Netscape (Mac) and so (at this point at least) I can't use it, unless I have a context where I can insist that users use a particular browser. The other annoyance is the long download time for the JPython implementation The other annoyance is the general flakiness of Java VMs out there But.. I think the concept is a good one.. and once the JPython implementation is cached it should be pretty fast. Then you just have to worry about all the JVM bugs. ;-) good luck! -steve ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 - [EMAIL PROTECTED] 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 )