Re: [Zope] zope timeouts
Hm, just some quick ideas -- thread 3 is busy doing a stat64() , should usually done quickly. And thread 4 is doing some kind of string operation (comparison), which also shouldn't take long except if you have a huge dataset. Is this backtrace repeatable, ie. does it hang in the same syscalls? Are you maybe running on NFS or something like that? hth, peter. On Tue, 2010-07-20 at 17:00 +0200, Michele Marcionelli wrote: Ciao Jens thank you for your answer. Now since I'm new with gdb I have some questions. I did following. I created a file called gdb_batch with following content: info threads thread 1 bt thread 2 bt thread 3 bt thread 4 bt thread 5 bt and run the gdb command like this gdb python $(cat Z2.pid) --batch -x gdb_batch gdb_bt.log 21 Can you maybe help me to decode the output (see attachment)? For instance: what does this mean? (gdb) info threads 5 Thread 0xb712bb90 (LWP 7532) 0x005fd410 in __kernel_vsyscall () 4 Thread 0xb672ab90 (LWP 7533) lookdict_string (mp=0xb78c4714, key=0xb7c19db8, hash=1293002269) at Objects/dictobject.c:331 3 Thread 0xb5d29b90 (LWP 7534) 0x005fd410 in __kernel_vsyscall () 2 Thread 0xb5328b90 (LWP 7535) 0x005fd410 in __kernel_vsyscall () * 1 Thread 0xb7fc16c0 (LWP 7174) 0x005fd410 in __kernel_vsyscall () What does mean the *? And what is the difference between the threads 1,2,3,5 (with the __kernel_vsyscall) and the 4? What should I look for? Thank you, Michele On Jul 20, 2010, at 14:54 , Jens Vagelpohl wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Michele, I would consider the coincience with strace reviving the process a red herring. When strace runs it does not influence the process you are watching with it, except for telling you what OS-level calls are made. The most common reason for such timeouts are problems with software that tries to use other network resources during the running request to talk to services like RDBMS systems, LDAP, etc. If these background connections hang for some reason you'll end up with a hanging Zope thread. Enough of them and Zope itself appears to hang. When your process hangs you should be able to attach to it using gdb and printing a stack trace for each thread. That may give you a big clue where the problem is. jens On 7/20/10 13:53 , Michele Marcionelli wrote: Hello I'm running an old version of Zope which is required by our corporate design using also an older version of the CMS Silva: Linux Distribution: Red Hat Enterprise Linux Server release 5.5 Linux Kernel: 2.6.18-194.8.1.el5PAE Zope: 2.8.9.1 Python: 2.3.6 (with several modules, like: ldap, pil, mysql, pyxml, ...) Silva: 1.5.13 My problem ist that my zope server hat timeouts on displaying pages after a while that it has been started (currently this while is approx. 15 minutes). The only thing that helps is restarting zope. By accident I discovered about two month ago, that running an strace -f on the zope process, reactivated it... so I could live with this hack until yesterday. Now I'm running strace permanently (with all the disadvantages) and zope works fine for about 1 to 1.5 hours. Here is a short recurring output of strace: [pid 13408] ... futex resumed ) = 0 [pid 13406] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13405] futex(0xbcc12c0, FUTEX_WAKE_PRIVATE, 1 unfinished ... [pid 13408] futex(0xbcc12c0, FUTEX_WAKE_PRIVATE, 1 unfinished ... [pid 13407] ... futex resumed ) = 0 [pid 13405] ... futex resumed ) = 1 [pid 13408] ... futex resumed ) = 1 [pid 13405] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13408] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13406] ... futex resumed ) = 0 [pid 13406] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13407] futex(0xbcc12c0, FUTEX_WAKE_PRIVATE, 1) = 1 [pid 13405] ... futex resumed ) = 0 [pid 13407] futex(0xbcc12c0, FUTEX_WAKE_PRIVATE, 1 unfinished ... [pid 13405] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13408] ... futex resumed ) = 0 [pid 13407] ... futex resumed ) = 1 [pid 13407] futex(0xbcc12c0, FUTEX_WAIT_PRIVATE, 0, NULL unfinished ... [pid 13405] ... futex resumed ) = -1 EAGAIN (Resource temporarily unavailable) I need definitively help... Any idea? Thx, Michele ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev ) signature.asc Description: This is a digitally signed message part
Re: [Zope-DB] Question Concerning Z SQL Method and Class Bindings
On Mon, 2010-05-24 at 21:33 -0700, Mark Phillips wrote: I am reading the zope 2 book (relational database section) and it talks about binding classes by putting them in the Extensions directory and then associating them with a Z SQL Method. That seems to be rather straight forward, but where can I find some examples of accessing the values returned from the Z SQL Method in Python. For example, Z SQL Method select * from offense where gameID=some input value from a form This returns ~10 rows. Each row has columns playerID, PB, BB, SacBunt, HBP as well as other columns, all containing integer values. class GameStats Reads the database for the stats for every player in a game and calculates the stats def AtBat(self, player_id): Calculate the AB for a player. AB = PA - (BB + SacBunt + HBP - SF) How do I get the columns PA, BB, etc for a particular playerID to calculate the BA from the result returned by the Z SQL method? Is there some documentation for how to access the results of the query within this class? Individual columns should be accessible as attributes of the Brain object, eg. self.playerID etc. If there's a column PA, it should be named self.PA. Btw., usually when I'm in doubt which attributes or methods are available for a given object, I just put a breakpoint at the location in question and poke at it with pdb, the Python debugger. See eg. http://wiki.zope.org/zope2/DebuggingWithPdb , under breakpoint in the code how to invoke the debugger. See http://docs.python.org/library/pdb.html for pdb docs. hth, peter. Thanks! Mark ___ Zope-DB mailing list Zope-DB@zope.org https://mail.zope.org/mailman/listinfo/zope-db signature.asc Description: This is a digitally signed message part ___ Zope-DB mailing list Zope-DB@zope.org https://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Question Concerning Z SQL Method and Class Bindings
On Tue, 2010-05-25 at 12:21 -0700, Mark Phillips wrote: Peter, I don't think I phrased my question very well. Also, I am coming from a Java background, so I am thinking about result sets, which may not be applicable to Python. If I have a Z SQL Method query that returns multiple rows to a brains class, how do I (1) reference the returned object that has all the rows (2) reference a particular row in the returned object (3) reference a particular piece of data in the returned object. Brain objects are bound to individual record objects; each brain object has access to the columns of the record it is bound to. There is no way to access the whole result object this way. This is not something Python-specific but rather the way brains are designed -- they are used to enhance individual records, not the result set. What is the returned object - list, dictionary, some special object with associated APIs? The whole result set is an object of type Shared.DC.ZRDB.Results.Results. Individual records are instances of an inner class r which inherits from Record.Record and the brain class you specify (Python supports multiple inheritance). Result objects can roughly be treated like lists (eg. iterable, allow individual record access, have a length). Where is this documented? I can't seem to find it in the Zope 2 book. Unfortunately this is largely undocumented. peter. Thanks! Mark On Tue, May 25, 2010 at 12:03 PM, Peter Sabaini pe...@sabaini.at wrote: On Mon, 2010-05-24 at 21:33 -0700, Mark Phillips wrote: I am reading the zope 2 book (relational database section) and it talks about binding classes by putting them in the Extensions directory and then associating them with a Z SQL Method. That seems to be rather straight forward, but where can I find some examples of accessing the values returned from the Z SQL Method in Python. For example, Z SQL Method select * from offense where gameID=some input value from a form This returns ~10 rows. Each row has columns playerID, PB, BB, SacBunt, HBP as well as other columns, all containing integer values. class GameStats Reads the database for the stats for every player in a game and calculates the stats def AtBat(self, player_id): Calculate the AB for a player. AB = PA - (BB + SacBunt + HBP - SF) How do I get the columns PA, BB, etc for a particular playerID to calculate the BA from the result returned by the Z SQL method? Is there some documentation for how to access the results of the query within this class? Individual columns should be accessible as attributes of the Brain object, eg. self.playerID etc. If there's a column PA, it should be named self.PA. Btw., usually when I'm in doubt which attributes or methods are available for a given object, I just put a breakpoint at the location in question and poke at it with pdb, the Python debugger. See eg. http://wiki.zope.org/zope2/DebuggingWithPdb , under breakpoint in the code how to invoke the debugger. See http://docs.python.org/library/pdb.html for pdb docs. hth, peter. Thanks! Mark ___ Zope-DB mailing list Zope-DB@zope.org https://mail.zope.org/mailman/listinfo/zope-db signature.asc Description: This is a digitally signed message part ___ Zope-DB mailing list Zope-DB@zope.org https://mail.zope.org/mailman/listinfo/zope-db
[Zope] Dependent ZCA utility registration ?
I have trouble registering utilities which depend on the presence of other utilities; eg. I have a package A where I want to register utility B which depends on registration of utility C. I tried to register B by putting registration in the __init__.py of A, which fails because at import time C is not yet registered. Registration by subscribing to the utility registration event handler for C also failed, because by the time the handler gets called, the utility C is not yet installed. My current workaround involves registration upon the IDatabaseOpen event, which is doubly ugly because Zope 2.10 doesnt send that event out of the box -- I send it in a monkey-patched Zope2.App.startup module. What is the canonical way to do this? Thanks, peter. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope2 + Twisted
On Thursday 05 March 2009 18:46:33 you wrote: could this be satisficed by putting an apache proxy in front of both zope and twisted? No, not really -- I'd like to use a client written on top of Twisted in a Zope product. So, I'd need the twisted reactor and libraries running in the Python VM that runs Zope. Which should be no problem except I suspect that I shouldn't be using the (threaded) ZServer then, because I think that would mess with twisted (which is not threadsafe for the most part). I thought if I'd switch to the twisted http server implementation that would take care of that -- no threaded ZServer, no problem. Except that doesn't seem to work as advertised, since the zope.app.twisted package is not present, and the one on PyPI seems to be geared towards Zope3, AFAICT. Is that so? Is there an alternative zope.app.twisted package for Zope2? thx, peter. On Thu, Mar 5, 2009 at 6:17 AM, Peter Sabaini pe...@sabaini.at wrote: I'd like to run a Twisted client in Zope 2.10 (for a legacy app). How do I do that? Simply loading twisted.internet is probably not a good idea since Twisted would not work well with ZServer threads, right? One thing I tried was enabling Twisted in zope.conf but that gives me the following stacktrace (abbr): ... File /usr/local/zope/2.10/src/Zope-2.10.7- final/lib/python/ZConfig/matcher.py, line 188, in constuct s = st.datatype(s) File /usr/local/zope/2.10/src/Zope-2.10.7- final/lib/python/Zope2/Startup/datatypes.py, line 349, in __init__ raise ImportError(You do not have twisted installed.) ImportError: You do not have twisted installed. I've got Twisted on my Pythonpath though. TIA, peter. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) signature.asc Description: This is a digitally signed message part. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope2 + Twisted
On Thursday 05 March 2009 23:33:40 you wrote: On Thu, Mar 5, 2009 at 18:59, Peter Sabaini pe...@sabaini.at wrote: So, I'd need the twisted reactor and libraries running in the Python VM that runs Zope. Which should be no problem except I suspect that I shouldn't be using the (threaded) ZServer then, because I think that would mess with twisted (which is not threadsafe for the most part). Well, then you could probably set the ZServer to only use one thread. That means you need many ZServers with a load balancer in front instead. I thought if I'd switch to the twisted http server implementation that would take care of that -- no threaded ZServer, no problem. Except that doesn't seem to work as advertised, since the zope.app.twisted package is not present, and the one on PyPI seems to be geared towards Zope3, AFAICT. I'm pretty sure the Zope2 implementation doesn't use zope.app.twisted. Zope2/Startup/datatypes.py tries to import it However, the Zope 2 implementation is again not thread safe, and will only work with one thread per server, so you don't actually gain anything in using it. Besides, I don't think anyone actually used it after I implemented it. Which is why it's still marked as experimental, and would probably best be removed again. Hm, the default zope.conf says twisted should be supported as an HTTP server replacement -- is that a bug? Thanks, peter. signature.asc Description: This is a digitally signed message part. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Multithreading sessions
On Friday 23 May 2008 17:09:49 Jon Emmons wrote: Jaroslav and everyone, I have made the changes Jaroslav suggested and I cannot get Zope to serve even 2 sessions simultaneously. In our testing, one client will start a query to the data servers. Another will try to simply get the logon page to be served. Zope will simply sit there and wait until the DB returns its results for the first user before doing anything at all for the second. The 2nd user is not hitting the DB server. The python script accessing the data is waiting for the results for the first user. Could python be the problem? I very much doubt it. Zope (and Python) can easily serve many concurrent sessions. You'll need to find out what exactly makes Zope hang and where it hangs. One option to do this is to attach with gdb to the Python process and figure it out from the backtrace. http://www.upfrontsystems.co.za/Members/jean/zope-notes/debug-spinning-zope talks about that a bit Another option is to use the Deadlock Debugger product (I haven't used that personally though): http://www.zope.org/Members/nuxeo/Products/DeadlockDebugger hth, peter. I am running python 2.4.4. Is it possible that I missed a flag or something when I build the Zope? Thanks for your suggestions so far, but I think I have missed a fundamental setup step that allows zope to multithread sessions. If I were echoing what was being served to the clients, shouldn't I see it interwoven? I don't, it is always (client 1's results) then (client 2's results)... very atomic. Thanks again, Jon Emmons -Original Message- From: Jaroslav Lukesh [mailto:[EMAIL PROTECTED] Sent: Friday, May 23, 2008 9:37 AM To: Jon Emmons; zope@zope.org Subject: Re: [Zope] Multithreading sessions Hi Jon, I use 24 zserver-threads and I have here defined number of ZoDB connections (pool-size): in your instance etc/zope.conf look for that section: zodb_db main # Main FileStorage database filestorage path $INSTANCE/var/Data.fs /filestorage mount-point / cache-size 1000 pool-size 24 /zodb_db Please pay attention, if you have bunch of cache, your RAM shoul be exhausted. Regards, JL. - Original Message - From: Jon Emmons [EMAIL PROTECTED] I had already gone into zope.conf and added the line: zserver-threads 10 This seemed to have no effect. Is that what you mean? You think I should bump it higher? 100 maybe? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) signature.asc Description: This is a digitally signed message part. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] define a class in a python script
On Wednesday 05 March 2008 10:21:32 Yuri wrote: Hi, all! I would like to define a class inside a python script (so I can catalog it and use catalog to store info, as the tutorial about catalog everything suggests). The default Script(Python) objects dont support class definition, because of security constraints. One easy option would be to just use some other object, eg. a File and use its properties. Another option (with more initial effort, but easier to maintain later on) is to implement a custom Product; have a look at http://www.zope.org/Documentation/Books/ZDG/current on how to do this. hth peter. So I've done: class Autore: classe per il catalogo def set_autore(self, autore=''): setta l'autore self.autore=autore def set_variante(self, variante=''): setta l'autore self.variante = variante def variante(self): ritorna la variante return self.variante def set_qualificazione(self, qualificazione=''): setta la qualificazione self.qualificazione = qualificazione def qualificazione(self): ritorna la qualificazione return self.qualificazione un_autore = Autore() un_autore.set_autore('prova') un_autore.set_variante('una variante') un_autore.set_qualificazione('una qualificazione') print un_autore.variante() print un_autore.qualificazione() return printed == but zope complains about I can call the methods of this class: *Error Type: Unauthorized* *Error Value: You are not allowed to access set_autore in this context So, what can I do? How can I create virtual objects to be cataloged? * ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Managing Zope objects in Subversion
On Sunday 02 March 2008 14:17:31 [EMAIL PROTECTED] wrote: Dear all We use Zope for the user interface part of our software product. We currently export the whole folder hierarchy into a .zexp file and maintain this file in Subversion. I'm looking for a way to manage a folder structure as individual Zope objects in Subversion. If read-only access is enough, maybe this is for you: http://www.infrae.com/download/FileSystemSite hth, peter. In fact, maintaining the Zope objects in the file system would suffice, there is no need to edit them with external editors or to be able to use Subversion from within Zope (we use TurtoiseSVN). We're using: - Zope 2.10 - Windows - DTML (yes) Documents and Methods; lots of external methods; some images; and a low number of various other Zope objects. - Zope Objects and particularly Folders have security settings using custom roles I've browsed/googled and looked into books, and found a few products and hints, but most of them seem to be very outdated or not applicable to a Windows environment. Hence I would be very grateful for hints about the state-of-the-art way to achieve this. Thank you and best regards Martin COMIT AG - A Swisscom Company Martin Gfeller, Senior Manager Risk Management - Quantax Pflanzschulstrasse 7 CH-8004 Zurich Switzerland mailto:[EMAIL PROTECTED] http://www.comit.ch/ http://www.quantax.com/ - Market Risk Return ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition / proxying object
On Monday 25 February 2008 23:52:26 Joerg Baach wrote: Hi *, But somehow I have the feeling it has more to do with the 'and the container is not wrapped' part of the message. Not that I can make sense of it ;-) Mmm, after even more searching, and not understanding I found http://www.mail-archive.com/[EMAIL PROTECTED]/msg11438.html and changed my code to: def __of__(self, parent): '''foo''' if not hasattr(parent,'aq_base'): return self folder,id = self.remoteid.split(':') acl = parent.unrestrictedTraverse(folder) You're now doing no security checks on traversal, probably thats why you don't get any Unauthorized exceptions :-) - peter. remote = acl.getUser(id) return Acquisition.ImplicitAcquisitionWrapper(aq_base(self), aq_base(remote).__of__(parent)) Now, this actually seems to work. If only I knew why Cheers, Joerg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition / proxying object
On Monday 25 February 2008 20:45:37 Joerg Baach wrote: Hi *, I am trying to have a folderish object that acquires from a user object (ldapuserfolder). It should have its own properties and contents, but fall back to the ones of the ldap user. I have created an object, extending Folder, and it behaves nicely in zopectl debug. When I try to access it through e.g. a python script I get an: Error Type: Unauthorized Error Value: Unable to find __roles__ in the container and the container is not wrapped. Access to 'dn' of test, acquired through (LDAPProxy at /testfolder/ldapproxy), denied. I am sure its my lack of understanding of acquisition. I am trying to bascially put ldap user object 'on top' of the aquisition line (with the ldapproxy at the bottom), but obviously failing in doing so. Any ideas? I'm not familiar with LDAPUserFolder (its not really a user object but a user container, isn't it?) but the error you're getting is a security error -- the Python Script checks for security attributes before it accesses attributes. You need to add the appropriate security declarations in your product before it can be used inside PyScript You might try the verbose-security directive in zope.conf to debug stuff like that; I hope it is available in the version of Zope you're running (I'm on 2.10) As a hack to disable all security checks on a class you can add the attribute __allow_access_to_unprotected_subobjects__ = 1 , effectively disabling security. This of course should only be done if you trust your users! hth peter. Cheers, Joerg 8 excerpt from code --- class LDAPProxy(Folder): meta_type='LDAPProxy' def __init__(self, id, remoteid,title='',REQUEST=None): self.id = id self.title = title self.remoteid = remoteid def __of__(self, parent): if not hasattr(parent,'aq_base'): return self folder,id = self.remoteid.split(':') acl = parent.restrictedTraverse(folder) remote = acl.getUser(id) return Folder.__of__(self,parent.__of__(remote)) --- teststructure-- /testfolder/ ldapproxy (LDAPProxy) acl_users/ testscript (.py) 8 testscript - return context.ldapproxy.dn traceback-- Traceback (most recent call last): File /home/joerg/zope/Zope-2.8.5/lib/python/ZPublisher/Publish.py, line 113, in publish request, bind=1) File /home/joerg/zope/Zope-2.8.5/lib/python/ZPublisher/mapply.py, line 88, in mapply if debug is not None: return debug(object,args,context) File /home/joerg/zope/Zope-2.8.5/lib/python/ZPublisher/Publish.py, line 40, in call_object result=apply(object,args) # Type scr to step into published object. File /home/joerg/zope/Zope-2.8.5/lib/python/Shared/DC/Scripts/Bindings.py, line 311, in __call__ return self._bindAndExec(args, kw, None) File /home/joerg/zope/Zope-2.8.5/lib/python/Shared/DC/Scripts/Bindings.py, line 348, in _bindAndExec return self._exec(bound_data, args, kw) File /home/joerg/zope/Zope-2.8.5/lib/python/Products/PythonScripts/PythonScript .py, line 323, in _exec result = f(*args, **kw) File Script (Python), line 1, in testscript File /home/joerg/zope/Zope-2.8.5/lib/python/AccessControl/ImplPython.py, line 727, in guarded_getattr aq_acquire(inst, name, aq_validate, validate) File /home/joerg/zope/Zope-2.8.5/lib/python/AccessControl/ImplPython.py, line 669, in aq_validate return validate(inst, object, name, v) File /home/joerg/zope/Zope-2.8.5/lib/python/AccessControl/ImplPython.py, line 563, in validate self._context) File /home/joerg/zope/Zope-2.8.5/lib/python/AccessControl/ImplPython.py, line 293, in validate accessed, container, name, value, context) File /home/joerg/zope/Zope-2.8.5/lib/python/AccessControl/ImplPython.py, line 808, in raiseVerbose raise Unauthorized(text) Unauthorized: Unable to find __roles__ in the container and the container is not wrapped. Access to 'dn' of test, acquired through (LDAPProxy at /testfolder/ldapproxy), denied. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition / proxying object
On Monday 25 February 2008 22:45:24 Joerg Baach wrote: I should have mentioned that in order for verbose-security to work you also need to switch to the python security implementation -- did you do that? Yes, I did. If yes, you should see lines like these in your event.log: No, don't :-( Strange... But somehow I have the feeling it has more to do with the 'and the container is not wrapped' part of the message. Not that I can make sense of it ;-) Yes, definitely. Its just with VerboseSecurity its easier to debug... Another option: put a debugger breakpoint (eg. import pdb; pdb.set_trace()) at the place where the Unauthorized exception is raised and inspect the objects peter. Cheers, Joerg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition / proxying object
On Monday 25 February 2008 21:31:46 Joerg Baach wrote: Hi Peter, I'm not familiar with LDAPUserFolder (its not really a user object but a user container, isn't it?) but the error you're getting is a security error -- the Python Script checks for security attributes before it accesses attributes. You need to add the appropriate security declarations in your product before it can be used inside PyScript Well, even with: __allow_access_to_unprotected_subobjects__ = 1 I get the same error. VerboseSecurity is also on. :-( I should have mentioned that in order for verbose-security to work you also need to switch to the python security implementation -- did you do that? security-policy-implementation python in zope.conf If yes, you should see lines like these in your event.log: 2008-02-25T22:30:18 DEBUG ImplPython Unauthorized: Your user account does not have the required permission. Access to 'manage' of (Application at ) denied. Your user account, Anonymous User, exists at /acl_users. Access requires one of the following roles: ['Manager']. Your roles in this context are ['Anonymous']. peter. Cheers, Joerg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition / proxying object
ps.: http://www.zope.org/Documentation/Books/ZDG/current/Security.stx has old but AFAIK still good info On Monday 25 February 2008 22:45:24 Joerg Baach wrote: I should have mentioned that in order for verbose-security to work you also need to switch to the python security implementation -- did you do that? Yes, I did. If yes, you should see lines like these in your event.log: No, don't :-( But somehow I have the feeling it has more to do with the 'and the container is not wrapped' part of the message. Not that I can make sense of it ;-) Cheers, Joerg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Re: Zope on Python 2.5?
On Thursday 01 November 2007 06:18:18 Andreas Jung wrote: --On 31. Oktober 2007 22:00:46 -0700 Alexander Limi [EMAIL PROTECTED] wrote: On Wed, 31 Oct 2007 21:29:36 -0700, Andreas Jung [EMAIL PROTECTED] wrote: The recommendation is still System python is evil, evil, evil (quoting Jim). Sure, but if you ever want to be able to tell users to do: easy_install plone Would be fine but as long as several distros contain brain-dead or castrated Python installations there is little we can do - even if we would support Python 2.5. I always wondered -- I never had any trouble with the system Pythons, or at least not a problem that I could attribute to a system Python (Debian Stable and Ubuntu LTS) Its just so damn convenient if you have to maintain a few dozen VServers to manage the Pythons including add-on libraries exclusively via apt-get Which system Pythons do you think are brain dead, and why? Thanks, peter. to get their Plone site, it's a necessary evil evil evil. ;) We generally encourage not to use the system Python in everything we ship (Windows, Mac and Unified installers all ship their own Python) — but I really hope we won't be stuck with Python 2.4 after the world has moved on to Python 2.5 and 2.6. Bring the word to the Python packagers. I agree that for proper deployments, you shouldn't use the system Python, but there's the case of letting people get started with Plone easily from their Ubuntu or Mac OS X (Leopard ships with Python 2.5 and easy_install by default) — we should be able to let them do that too. See above. Stepping forward with Python 2.5/2.6 support would be fine but it basically does not solve the problem that system python installation are often broken. Installation a Python from the sources is usually much more faster than trying to figure out why a system python is broken once more. ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: Five: Adapter registry not working?
FTR: I tracked this down again some more -- the culprit is not the adapter registry but a failing getUtility() call. I really wish component lookup / adapation would be easier to debug; IMHO this is pretty opaque -- but then again I'm a newb at this. peter. On Wednesday 30 May 2007 18:51:18 Peter Sabaini wrote: On Wed 2007-05-30 17:14:13 Tres Seaver wrote: Peter Sabaini wrote: Hi list, I am clearly doing something wrong here. I try to use an Adapter from zope.app.session with an HTTPRequest object, but the Adapterregistry doesnt quite cooperate. Specifically, I try to adapt a HTTPRequest object to zope.app.session.interfaces.IClientId via the Adapter zope.app.session.session.ClientId A short demo: % ./zopectl debug [ ... ] Import stuff: from ZPublisher.HTTPRequest import * from StringIO import StringIO from zope.app.session.session import ClientId from zope.app.session.interfaces import IClientId from zope import component from zope.interface import * Create ourselves a faux request object: env = {'SERVER_NAME': '', 'SERVER_PORT' : ''} request = HTTPRequest(StringIO(), env, None) ClientId implements IClientId: list(implementedBy(ClientId)) [InterfaceClass zope.app.session.interfaces.IClientId] It seems ClientId is an Adapter for IRequest: component.adaptedBy(ClientId) (InterfaceClass zope.publisher.interfaces.IRequest,) request implements IBrowserRequest, which is a subclass of IRequest: list(providedBy(request)) [InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest] issubclass(list(providedBy(request))[0], component.adaptedBy(ClientId) [0]) True ...so I'd expect to get ClientId as an Adapter for IClientId(request), but I dont: IClientId(request) Traceback (most recent call last): File stdin, line 1, in ? TypeError: ('Could not adapt', HTTPRequest, URL=http://:, InterfaceClass zope.app.session.interfaces.IClientId) Shouldnt this work? Obviously I am missing something here. This is on Zope 2.10.2 with the built-in Five, and Python 2.4.4 Any help greatly appreciated! You have verified that 'ClientID' is a suitable candidate for adapting 'IRequest' to 'IClientID', but not that it has been actually registered as the factory for that adaptaion. Ah, I see. I thought component.adaptedBy() checked the actual registration... Does adding the following help? from zope.component import provideAdapter provideAdapter(ClientID) Nope, I still get the Could not adapt ... error. Besides, zope/app/session/configure.zcml has the following: adapter factory=.session.ClientId permission=zope.Public / and ClientId has: class ClientId(str): implements(IClientId) adapts(IRequest) Does that take care of registration? I wonder if I need to do some special Five incantation to make the global registration work? This, on the other hand, works quite well (lifted from some unit tests): from cStringIO import StringIO from zope.app.testing import ztapi, placelesssetup from zope.app.session.interfaces import IClientId, IClientIdManager from zope.app.session.session import ClientId from zope.app.session.http import CookieClientIdManager from zope.publisher.interfaces import IRequest from zope.publisher.http import HTTPRequest placelesssetup.setUp() ztapi.provideAdapter(IRequest, IClientId, ClientId) ztapi.provideUtility(IClientIdManager, CookieClientIdManager()) request = HTTPRequest(StringIO(), {}, None) IClientId(request) 'WiKfis240zXEVZ0UWM6H6AsWc6kYwJyviHNXhGqd835xsnZhKlzfjc' The difference: zope.publisher.http.HTTPRequest is a new-style class (is that required?), and placelesssetup.setUp() is executed (what does it do?) Also, at the point where the lookup fails, you can try: import pdb; pdb.pm() and be in a postmortem traceback of the failed component tookup. I'm afraid I'm not sure what I should be looking for... Thanks a lot, peter. Tres. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Five: Adapter registry not working?
Hi list, I am clearly doing something wrong here. I try to use an Adapter from zope.app.session with an HTTPRequest object, but the Adapterregistry doesnt quite cooperate. Specifically, I try to adapt a HTTPRequest object to zope.app.session.interfaces.IClientId via the Adapter zope.app.session.session.ClientId A short demo: % ./zopectl debug [ ... ] Import stuff: from ZPublisher.HTTPRequest import * from StringIO import StringIO from zope.app.session.session import ClientId from zope.app.session.interfaces import IClientId from zope import component from zope.interface import * Create ourselves a faux request object: env = {'SERVER_NAME': '', 'SERVER_PORT' : ''} request = HTTPRequest(StringIO(), env, None) ClientId implements IClientId: list(implementedBy(ClientId)) [InterfaceClass zope.app.session.interfaces.IClientId] It seems ClientId is an Adapter for IRequest: component.adaptedBy(ClientId) (InterfaceClass zope.publisher.interfaces.IRequest,) request implements IBrowserRequest, which is a subclass of IRequest: list(providedBy(request)) [InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest] issubclass(list(providedBy(request))[0], component.adaptedBy(ClientId) [0]) True ...so I'd expect to get ClientId as an Adapter for IClientId(request), but I dont: IClientId(request) Traceback (most recent call last): File stdin, line 1, in ? TypeError: ('Could not adapt', HTTPRequest, URL=http://:, InterfaceClass zope.app.session.interfaces.IClientId) Shouldnt this work? Obviously I am missing something here. This is on Zope 2.10.2 with the built-in Five, and Python 2.4.4 Any help greatly appreciated! - peter. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Five: Adapter registry not working?
On Wed 2007-05-30 17:14:13 Tres Seaver wrote: Peter Sabaini wrote: Hi list, I am clearly doing something wrong here. I try to use an Adapter from zope.app.session with an HTTPRequest object, but the Adapterregistry doesnt quite cooperate. Specifically, I try to adapt a HTTPRequest object to zope.app.session.interfaces.IClientId via the Adapter zope.app.session.session.ClientId A short demo: % ./zopectl debug [ ... ] Import stuff: from ZPublisher.HTTPRequest import * from StringIO import StringIO from zope.app.session.session import ClientId from zope.app.session.interfaces import IClientId from zope import component from zope.interface import * Create ourselves a faux request object: env = {'SERVER_NAME': '', 'SERVER_PORT' : ''} request = HTTPRequest(StringIO(), env, None) ClientId implements IClientId: list(implementedBy(ClientId)) [InterfaceClass zope.app.session.interfaces.IClientId] It seems ClientId is an Adapter for IRequest: component.adaptedBy(ClientId) (InterfaceClass zope.publisher.interfaces.IRequest,) request implements IBrowserRequest, which is a subclass of IRequest: list(providedBy(request)) [InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest] issubclass(list(providedBy(request))[0], component.adaptedBy(ClientId) [0]) True ...so I'd expect to get ClientId as an Adapter for IClientId(request), but I dont: IClientId(request) Traceback (most recent call last): File stdin, line 1, in ? TypeError: ('Could not adapt', HTTPRequest, URL=http://:, InterfaceClass zope.app.session.interfaces.IClientId) Shouldnt this work? Obviously I am missing something here. This is on Zope 2.10.2 with the built-in Five, and Python 2.4.4 Any help greatly appreciated! You have verified that 'ClientID' is a suitable candidate for adapting 'IRequest' to 'IClientID', but not that it has been actually registered as the factory for that adaptaion. Ah, I see. I thought component.adaptedBy() checked the actual registration... Does adding the following help? from zope.component import provideAdapter provideAdapter(ClientID) Nope, I still get the Could not adapt ... error. Besides, zope/app/session/configure.zcml has the following: adapter factory=.session.ClientId permission=zope.Public / and ClientId has: class ClientId(str): implements(IClientId) adapts(IRequest) Does that take care of registration? I wonder if I need to do some special Five incantation to make the global registration work? This, on the other hand, works quite well (lifted from some unit tests): from cStringIO import StringIO from zope.app.testing import ztapi, placelesssetup from zope.app.session.interfaces import IClientId, IClientIdManager from zope.app.session.session import ClientId from zope.app.session.http import CookieClientIdManager from zope.publisher.interfaces import IRequest from zope.publisher.http import HTTPRequest placelesssetup.setUp() ztapi.provideAdapter(IRequest, IClientId, ClientId) ztapi.provideUtility(IClientIdManager, CookieClientIdManager()) request = HTTPRequest(StringIO(), {}, None) IClientId(request) 'WiKfis240zXEVZ0UWM6H6AsWc6kYwJyviHNXhGqd835xsnZhKlzfjc' The difference: zope.publisher.http.HTTPRequest is a new-style class (is that required?), and placelesssetup.setUp() is executed (what does it do?) Also, at the point where the lookup fails, you can try: import pdb; pdb.pm() and be in a postmortem traceback of the failed component tookup. I'm afraid I'm not sure what I should be looking for... Thanks a lot, peter. Tres. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Permissions, files and folders
On Friday 21 April 2006 10:15, Tino Wildenhain wrote: Erik Billing schrieb: Ah! Thanx! DocFinder will shore come very useful in time =) Btw, what editor would you recommend for writing python outside Zope. I've frequently used Eclipse with PyDev before, but it's a bit slow and heavy. I've looked around a bit on the free editors without finding anything I like so I'm thinking it might be worth trying a commercial editor. What do you guys use? Linux/KDE: kate and/or eric3 (nice because of seamless sftp/webdav) Linux: vim, some will use (x)emacs, pida Windows: hm. I've used the ide that comes with the win32 extensions from Marc Hammond. You bend some paths and get nice module view and hinting for zope classes too. I've used WingIDE a bit lately and am quite impressed by its feature set: * Good editor: Syntax coloring, folding, autocompletion, ... * Auto-lookup of documentation * Visual Debugger: watches, breakpoints, lots of goodies * Code / Class browser * Zope support Last but not least: great support staff. It uses quite a bit of resources though. Review of Python IDEs: http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html peter. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] APE and Zope 2.9?
It seems APE 1.0 doesnt run out of the box with Zope 2.9 -- has anyone tried hacking APE up so it can run inside Zope 2.9? Any thoughts as to what would be necessary / how hard this would be? Thanks, peter. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] MVC Approach
On Wednesday 03 August 2005 22:06, Thomas Adams wrote: Hi all, I'm a newbie to Zope, using version 2.7.3 (okay it is not the newest one) and I want to know if there is something like a MVC approach available for Zope, i.e. Model-View-Controller approach, as it is for instance in Java with the Struts framework from Apache. Sure its possible to implement MVC in Zope2 (we did it for our product), especially if youre not afraid of Python Products, though theres no special support for this in Zope 2.7 You really should be looking at Zope3 or Zope2 + Five (which is part of Zope2.8) for this though. See the Zope3 Developers Book, eg. http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/components.html - peter. To be more specific: - The Model consists of several python classes implementing business logic (the pendant to Enterprise Java Beans or simple Java Beans) - The Views producing the visual appearance of the business objects (in java or more specific in Struts these are the custom tag libraries) - The Controller, as a kind of glue between the two above, is controlling the work/process-flow (in java with servlets and in struts with actions classes (as a minimum) ) To transfer this appraoch to Zope, I'm not sure: Views: DTML-Document and/or DTML-Methods? Controller: PythonScripts? Models: I'm absolutely not sure, Pluggable brains? (the Zope book has a example but only as a handling of resultsets) So if has anybody a hint if there are some resources in the web, please post it. P.S: I don't know Zope 3 (Is that apossible answer of my questions?) Thasnks in advance Regards Thomas Adams ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] The bleak Future of Zope?!
is there an URL for the original? Martin Kretschmar wrote: Hello, Maik Jablonski of the german speaking Zope Users Group DZUG issued a pretty bleak outlook for the future of Zope. What are your oppinions? Here comes the translation of his oppoion: smime.p7s Description: S/MIME Cryptographic Signature ___ 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 Book, was Re: [Zope-dev] The bleak Future of Zope?
Stephan Richter wrote: On Wednesday 21 April 2004 03:58, Martin Kretschmar wrote: -- snip -- 2. Maik is is frustrated with the releases of both Zope 2 and Zope 3, including their merging. -- snip -- The situation is even more obvious with the Zope book. All the community has to do is to give a particular part/chapter/section to a couple of people for maintenance. But oh wait, that would need someone to manage this effort and *that* would be just too much work. -- snip -- Hmph, as one of the people that works on the Zope Book I feel a little stung by a comment like this one. While its true that a 2.7 Edition of the Zope book is overdue, I still think that the 2.6 Edition was both quite a step forward and still largely applicable for 2.7 Zopes That being said, I wonder if there are people interested to make an effort for a 2.7 Edition of the Zope book? cheers, peter. smime.p7s Description: S/MIME Cryptographic Signature ___ 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 Book, was Re: [Zope-dev] The bleak Future of Zope?
Chris McDonough wrote: On Wed, 2004-04-21 at 10:18, Peter Sabaini wrote: That being said, I wonder if there are people interested to make an effort for a 2.7 Edition of the Zope book? I am. I think Paul is too. It won't be nearly as much work as 2.5 - 2.6. Let's just do it. Wanna pick chapters? I'll get the new book set up on Zope.org (another BT book) and send the link to whomever is interested. Ok then... I think the following issues would deserve attention: * Installing chapter: I'm working on it and hope to finish soon (no really this time!) * Maintaining chapter update * Creating Basic Zope Applications: I've been wanting to extend and incorporate Jon Whiteners version but never got around to it * Using Zope Page Templates: judging by the comments there seem to be some trouble spots there * Reference: IMHO one of the trickier things, especially for the API Ref. because one would first have to decide what constitutes the API and what is simply Zope core... * A chapter TOC: it would be great if we could have an inter-chapter table of contents; would greatly help navigation esp. in longer chapters -- I seem to recall that someone once mentioned working on such a feature -- Paul maybe? * Lots of weeding out comments resp. incorporating answers * Generating PDFs Anything else? - peter. smime.p7s Description: S/MIME Cryptographic Signature ___ 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: Call for Zope Book volunteers (was Re: Zope Book, was Re: [Zope-dev] The bleak Future of Zope?)
Chris McDonough wrote: I've set up a development BackTalk sandbox for the 2.7 edition of the Zope book at http://zope.org/Documentation/Books/ZopeBook/2_7Edition. Currently it's just an exact copy of the 2.6 Edition book (comments and all). I think the plan should be for people to: 1. take ownership of a chapter or two 2. address all the comments in the chapter and get rid of comments in places you've addressed. 3. update any material that is wrong wrt to differences between 2.6 and 2.7. The prize for taking ownership and updating two complete chapters is your name as a coauthor on the front page (as before ;-). Erm, there is no front page... you need to realise the truth: its you who is the front page /lame-matrix-quoting Another thing to do is to incorporate some of John Whitener's changes the lost chapter referenced all over the place within book comments. I wonder if he's still around. Yes he is, I talked about this to him some time ago. In light of this its maybe best if I do the incorporating At some point in the future, we can backport some of the changes to the 2.6 book if someone wants to take on that responsibility. It's advisable to use external editor to make the changes or to maybe use FTP to get sandboxed local copies of the book and make changes reuploading them as necessary. I've lost track of whether FTP access is possible or not on Zope.org at this point, however. Does anyone know? I've tried a few ports but nothing. Hm, we should make the sources available somewhere. Once Zope.org starts working again. Also, Zope.org is so slow for each request when you're logged in that we may need to move development to another system. As a data point, I've been waiting 4 minutes for Z.org to save a Wiki page... still waiting. Hilarious. Admittedly, it takes a unique brand of apathy to ignore this, but I've got an excuse. I'm waiting for the Zope.org steering committee to solve it! Chuckle. In the meantime, what slowness.. I don't know what you're talking about.. Nono not slow at all merely... andante. Or broken down. Or something. I have given Manager role in the entirety of the 2.7 edition book to both Peter and Paul. Anyone else who wants to contribute, please let me know which chapter(s) you'd like to sign up to revise and I will provide you access as necessary. I've set up a project wiki for the project at http://zope.org/Members/mcdonc/ZB_project where people can get a sense of which chapters are still available. It may not be available yet... still waiting for it to save. I will take ownership of the Installation chapter for now (I will probably take ownership of some other chapters, but I'll start small...) Erm, I'd like the Installation chapter. Already started on it. Really, I promise :-) opening-a-bottle-of-favourite-austrian-beer-and-hacking-away'ly peter. - C smime.p7s Description: S/MIME Cryptographic Signature ___ 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 Book, was Re: [Zope-dev] The bleak Future of Zope?
Paul Winkler wrote: On Wed, Apr 21, 2004 at 08:10:26PM +0200, Peter Sabaini wrote: * Reference: IMHO one of the trickier things, especially for the API Ref. because one would first have to decide what constitutes the API and what is simply Zope core... The long-term solution, I think, is to fix the API mess itself. Eek. I have a proposal about this here: http://dev.zope.org/Wikis/DevSite/Proposals/SanitizeHelpSysAndAPIReference ... but I think this will take a while, and I'd rather get the book updated first. I think it's worth hand-massaging the API reference chapter for the 2.7 book and fixing the embedded docs later. Yes, I volunteer to do this :-) Brave... and while I'd really like to have a clean API Reference, you are probably right that its more important to get the main book updated first. * A chapter TOC: it would be great if we could have an inter-chapter table of contents; would greatly help navigation esp. in longer chapters -- I seem to recall that someone once mentioned working on such a feature -- Paul maybe? The book already has an inter-chapter TOC at the beginning ;-) Chris and I worked on an intra-chapter TOC at Pycon. My stuff is in backtalk CVS on sourceforge. http://cvs.sourceforge.net/viewcvs.py/backtalk/BackTalk/ Just needs a bit of cleanup and it'll be ready to go. Yay! And, judging by the CVS, done pretty straightforward (I was afraid of having to do several parsing passes and such). Cool. smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Re: [patch] More secure cookie crumbler?
Shane Hathaway wrote: On Tue, 20 Apr 2004, Chris Withers wrote: I wonder how many Plone users are aware their passwords are stored unencrypted in client cookies which fly back and forth waiting to be snapped up by packet sniffers, XSS, and JS attacks ;-) Even with unbreakable encryption of credentials after login, you still send the username and password in the clear at login time, and sniffers can reuse the session ID with ease. You really shouldn't tell the Plone users they will be safer with a session token, because they won't. Shane Why not make the login page itself SSL-protected then? peter. smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Re: [patch] More secure cookie crumbler?
Chris Withers wrote: Shane Hathaway wrote: Hmm. I really wasn't expecting any new code yet. Session cookies are a very significant maintenance burden in Zope, and it's not in my interest to support them. If you don't mind, I think I'll release a version of CC without any session support, then I'll give Chris Withers the maintainer hat. He'll start with your latest version. I'll certainly take that on, if only because Cookie Crumbler is in such wide use. I wonder how many Plone users are aware their passwords are stored unencrypted in client cookies which fly back and forth waiting to be snapped up by packet sniffers, XSS, and JS attacks ;-) That said, basic auth ain't much better, but at least that's protectable by SSL... Cookies and Basic Auth both are transmitted via HTTP headers, so both should benefit from SSL Another question of course is what happens afterwards; in my experience at least IE has a tendency to even store Session cookies longer than one might expect (ie. the lifetime of the browser instance) I made a patch to CC to crypt auth tokens with AES, though thats not ideal it should help a little Hmmm, I wonder about sticking the token in the URL as an option, as with the SESSION stuff... Chris smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Re: [patch] More secure cookie crumbler?
Shane Hathaway wrote: On Tue, 20 Apr 2004, Peter Sabaini wrote: Shane Hathaway wrote: Even with unbreakable encryption of credentials after login, you still send the username and password in the clear at login time, and sniffers can reuse the session ID with ease. You really shouldn't tell the Plone users they will be safer with a session token, because they won't. Why not make the login page itself SSL-protected then? If you're going to go to the trouble of setting up SSL, why not encrypt the whole session? Let anonymous users come in via HTTP, then go all-SSL for logged in users. Sourceforge is a great example of this. Yes, thats what I was talking about. In our Zope apps this is standard procedure -- we have one non-SSL welcome page at the most, everything else goes through HTTPS, makes sense IMHO for data acquisition applications with at least moderately sensitive data peter. smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Re: How to make Zope fail nicely under high load?
Tres Seaver wrote: Bjorn Stabell wrote: 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. Impatient clients often force reloads; I don't *think* Apache has a knob which allows a surrogate / acceloerator proxy to ignore the spec (which is written assuming forward proxies), and serve from cache anyway. I think I did find some sort of knob for this For Apache 2.0, mod_cache, dir. CacheIgnoreCacheControl could be used for this http://httpd.apache.org/docs-2.0/mod/mod_cache.html For Apache 1.3 mod_proxy, dir. CacheMaxExpire could do http://httpd.apache.org/docs/mod/mod_proxy.html#cachemaxexpire - peter. Tres. smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Re: How to make Zope fail nicely under high load?
Bjorn Stabell wrote: Hi Peter, I think I did find some sort of knob for this For Apache 2.0, mod_cache, dir. CacheIgnoreCacheControl could be used for this http://httpd.apache.org/docs-2.0/mod/mod_cache.html For Apache 1.3 mod_proxy, dir. CacheMaxExpire could do http://httpd.apache.org/docs/mod/mod_proxy.html#cachemaxexpire I think this will force Apache to cache content no matter if the content's headers have cache control settings, but will it force Apache to not re-request the content if the browser forces a reload? (Ctrl-refresh in IE.) This really should be tested, but as far as I can remember it did serve from cache rather than rerequest. Its been some time since I did this (and at another company) and unfortunately I cant remember this too clearly... From the 'CacheIgnoreCacheControl' at least it does sound like it would ignore the spec and serve cached content though. cheers, peter. smime.p7s Description: S/MIME Cryptographic Signature ___ 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?
This very much depends on your application and requirements (and your definition of nicely :-)), but I'd argue that it rarely make sense to handle this at the TCP Connection level (just to think about browsers opening multiple connections, HTTP/1.0 or /1.1 compliant browsers, proxies etc.) As an example, one client of ours had the following requirements wrt. to this problem which I think should be fairly common: * Allow X logged-in users till a certain responsiveness threshold is reached * If said threshold is reached: - inform all users trying to log that the site is too loaded - while allowing already-logged-in users to still use the site with acceptable speed This means we had to a) measure responsiveness (which we did with some cobbled together heuristic involving the rate of user logins (something like 5 users per minute) and an external script effectively HTTP Pinging the site every X minutes) and b) redirecting users to a statically hosted page (which can be served cheaply) if said conditions were met. This kind of thing clearly cannot be done at the TCP level because TCP Connection != User session cheers, peter. Bjorn Stabell wrote: 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, smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Zope Start Script Woes
I'm no big shell scripter, some suggestions anyway... * I think you might be missing an INSTANCE_HOME parameter here, something like # what we'd like but won't recognize instance home # exec /usr/bin/python $ZOPE_BASE/z2.py -z $ZOPE_BASE -u $USER \ # -w $HTTP_PORT -f $FTP_PORT -t $THREADS -Z $MANAGER \ # -l $INSTANCE_HOME$ZOPE_LOGFILE \ INSTANCE_HOME=$INSTANCE_HOME \ # -D $@ $INSTANCE_HOME/var/startup.log or export the INSTANCE_HOME * Are you shure you want to start Zope in debug mode? * You might want to check http://zope.org/Documentation/Books/ZopeBook/2_6Edition/MaintainingZope.stx , I put some (very much simpler) startup scripts there * Finally, the upcoming Zope 2.7 should behave much better wrt this (if thats any help to you :-)) - peter. Sean Duffy wrote: Hi, These are probably more shell scripting issues, but I'm hoping that some scripter with an agile mind will show me the error of my ways, so here goes. I have borrowed a script from the zope site and modified it for my purposes, and it 'sort of' works. The issues are: Can't seem to get the Instance-Home stuff to work right without local start scripts in each directory. Right below the $INSTANCE_HOME/start is the line I'd like to use to simplify the management of the instances. Can't get stop to work right. First 'stop' is not an instance, then the first instance does appear to get stopped, but it errors on the other two. I get a 'start0' for the value of $WAIT in the starting text display. (should just be a big fat zero or one!) And for some reason, the script dumps the entire local environment to the display before it does anything; any ideas why? All constructive criticism welcome, and I'll take some flames (high of 22 today). System is RedHat-9.0 Zope-2.6.2 Python-2.2.3 Zope is installed in /usr/local/zope Instances are /var/zope-sites/ Here's the script: #!/bin/sh # /etc/init.d/zope-instances # # Starts or stops multiple instances of zope one by one or all at ones. # Configuration is done all through one configuration file # /etc/zope-instances.conf which defines the location of the data-files, # the user to run the instance, FTP portnrs, number of threads and if the # zdaemon should be used (to start a new instance should the one crash) # all configurable per instance. # # Steps for creating and running a new instance: # - start with a normal working (fresh) distribution of Zope # ... snip ... # - edit /etc/zope-instances.conf to run the new instance as you desire # - start the new instance (/etc/init.d/zope-instances start instance-name) # # Note: this script is only tested for Red Hat distributions. # Locations of scripts may vary from various distributions. # Use at own risk. # # created: Chaim Zax (chaim at climbing.nl) # version 0.02, dd. 29-3-'03 # version 0.02a, stuffduff 20-01-'04 INSTANCES_CONF=/etc/zope-instances.conf DEFAULT_USER=www-data ZOPE_BASE=/usr/local/zope PS=ps wax # Log- and pid-files ZDAEMON_PIDFILE=/var/zProcessManager.pid ZDAEMON_LOGFILE=/var/Z2_debug.log ZOPE_PIDFILE=/var/Z2.pid ZOPE_LOGFILE=/var/Z2.log ZOPE_DEBUGFILE=/var/zope-debug.log # Function for showing help-text how to use this script helpText () { echo Starts or stops multiple instances of zope one by one or all at ones. echo echo zope-instance [start/stop/restart/info/kill] [instance-name] [-w] [-h] echo echo start/stop: starts or stops one or all zope-instances echo restart : restarts one or all zope- instances echo info : gets instance info as well as their current status echo kill : kills one or all zope-instances, even if orphaned echo USE THIS ONLY WHEN ZOPE SPINS OUT OF CONTROL echo instance-name : if not provided or 'all' indicates all instances, echo else acts only on the given instance echo -w: Do not wait for instance to startup echo -h: This help-text } startZope () { startingAndStopping start $1 $2 } stopZope () { startingAndStopping stop $1 - } restartZope () { startingAndStopping restart $1 $2 } infoZope () { startingAndStopping info $1 - } killZope () { if [[ $1 == all ]]; then killAll else killInstance $1 fi } # Start one or more instances depending of $1 and $2 startingAndStopping () { MODE=$1 # mode is 'start', 'restart', 'stop' or 'info' INSTANCE=$2 WAIT=$3 if [ ! -e $INSTANCES_CONF ]; then echo ERROR: No configuration file '$INSTANCES_CONF' exit 1 fi SETUP=no # sift through the configuration file, one line at a time while read LINE; do if [[ ${LINE::1} != # ]]; then set $LINE if [[ $1 != ]]; then # starts, restarts or stops all instances (one per loop) if [[ $INSTANCE == all ]]; then STARTUP_MODE=$8 if [[ $STARTUP_MODE == 'start'
Re: [Zope-dev] Newbie Question
Aaron Paxson wrote: I hope I'm posting to the right mailing list. There were so many to decide from. This should've probably been directed to the main Zope list; zope-dev is for development *of* Zope. I've just been introduced to Zope, and am curious on how it will fit into my company's plans. I'm currently learning Java, and was starting to learn the RedHat Web Application Framework. I've found Zope in an article on the web, and started to look into it. It looks to be just as scalable, but I'm curious on how extensible it is, as well as, it's power in a corporate environment. For example, how extensible is it, to modify the security module and have it authenticate against LDAP? (I don't want all my users to remember yet another password) Also, how powerful is Python as compared to Java? Since it uses a native compiler, it stands to reason that it would be faster than Java, but what of it's objects and packages? (i.e. Does it have an image manipulation package, or networking packages?) There are Add-ons that do User authentification against LDAP servers, and its also not very hard to roll your own. Zope is, generally speaking, *very* extensible -- see for example the long list of 3rd pary add-on products at http://www.zope.org/Products I think Python is one of the greatest strengths of Zope. Its not only a modern full-fledged OOP language, comes with great libraries (see http://python.org/doc/current/modindex.html, and has even more to download separately) but is simply a joy to program in. Bruce Eckel put it very nicely IMHO: http://mindview.net/FAQ/FAQ-012 ) Also see: http://csdl.computer.org/comp/mags/co/2000/10/rx023abs.htm http://www.cis.udel.edu/~silber/470STUFF/article.pdf http://www.twistedmatrix.com/users/glyph/rant/python-vs-java.html There are good networking modules in the standard Python distribution; image manipulation can be done with eg. PIL (http://www.pythonware.com/products/pil/) or PythonMagick (http://www.procoders.net/moinmoin/PythonMagick) I must say, seeing the documentation and books alone, tells me the product is good, and something I can learn. I see alot of Hope for Zope grin, couldn't resist, but I don't want to get into it, just to see if it doesn't fit into my plans. For those who want a couple of examples, I have 3 projects for our intranet/extranet/internet applications: 1). Images and cataloging (where, our development team can upload their images, and the intranet application will take that image and export it to a JPG to update the web catalog, and move the original file to our FTP site for our photographers. 2). Document Management (Uploading of files, and inputting data to index on those files for searching) 3). Obviously the usual (Content Management and Portals) which I'm sure Zope does a good job at. Those are certainly suited for Zope - peter. Thanks in advance!! Again, my apologies if there is a better list for this post. Aaron Paxson Network Operations Manager Decorative Concepts, Inc http://www.decorativeconcepts.com smime.p7s Description: S/MIME Cryptographic Signature ___ 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] calling DTML method from python script in Zope
Hm, I would hope that the Zope book answers this kind of questions, see: http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx search for Calling DTML from Scripts This should solve your problem -- please leave a comment if it doesn't. Thanks, peter. [EMAIL PROTECTED] wrote: of course I looked over at ZopeLabs; http://www.zopelabs.com/cookbook/992031125 and while this shed some light on the situtation, it hardly solved the problem. the script calls a DTML method in the same folder from which it resides was called from -thanks in advance -josh ___ 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 ) smime.p7s Description: S/MIME Cryptographic Signature ___ 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] Using propertysheets?
Lennart Regebro wrote: I'm making a Zope product (in python) where I want the users to have control over what properties that exist. At the same time I don't want the users to have to deal with having all properties in one big mess under the standard Property-tab. So, my question is then: Should I use the PropertySheets class for this, and if yes, does anybody have any example code, becuase it's not immediately obvious how to use it. I think it should work well with PropertyManager Usage (works for me): - Define your own edit form - Derive your class from PropertyManager - Add a propertysheet to a class instance, eg.: def __init__(self): self.propertysheets.manage_addPropertySheet('advanced', 'advanced') - Add a prop: advanced.manage_addProperty('something', 0, 'int') - Do something with your propsheet, eg. update it: adv = self.propertysheets.get('advanced') if REQUEST is not None: return self.manage_advancedForm( REQUEST, manage_tabs_message='Advanced Settings updated.', ) - Or read a property: self.propertysheets.get('advanced').something If you're having problems just shout. cheers! peter. Best Regards Lennart Regebro Torped Strategi och Kommunikation AB ___ 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] ZSQL and Normalized databases (or why ZSQL sucks)
On Fri, 20 Apr 2001, Bryan Baszczewski wrote: ...I mean that: SELECT tab1.col1, tab2.col1 FROM ... etc ... Does not expose 'tab1.col1' and 'tab2.col1'. In otherwords, it doesn't gracefully handle name clashes. I realize that calling out the variable 'tab1.col1' out of the namespace is a pain, but (hopefully) in the future it would be made easier I havent followed the entire conversation so forgive me if we are on the same page but in different books. Have you tried to alias the column names? e.g.: SELECT tab1.col1 AS COL1_A, tab2.col1 AS COL1_B FROM etc... Aliasing works for me. (ZOracleDA). -- _ peter sabaini, mailto: [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] Caching/http-acceleration and proxying Zope-served content
not sure if thats what you want, but squid _can_ act as a frontend to multiple backend-servers. check out the squid users guide (http://squid-docs.sourceforge.net/latest/html/book1.htm) specifically http://squid-docs.sourceforge.net/latest/html/x2544.htm which deals with "accelerator" options peter. On Mon, 8 Jan 2001 [EMAIL PROTECTED] wrote: :Hmm. That's been my thought on squid as well, given its ground-up design :for caching in the first place. My worry, though, is that with squid I lose :support for virtual hosts on seperate boxes, because I need to support Zope, :static content, and some legacy stuff running ColdFusion on an NT box. My :impression is that Squid's http accelerator mode (inverse transparent proxy, :or whatever you want to call it) is somewhat of an afterthought compared to :the standard proxy use case. If it supports the ability to direct traffic :based upon the virtual host address, then squid works - if not, I think I :have to go the Apache route... I also wonder just how good Apache's :mod_proxy caching is? Any thoughts? : :Sean : :-Original Message- :From: Shane Hathaway [mailto:[EMAIL PROTECTED]] :Sent: Monday, January 08, 2001 12:59 PM :To: [EMAIL PROTECTED] :Subject: Re: [Zope] Caching/http-acceleration and proxying Zope-served :content : : :[EMAIL PROTECTED] wrote: : : I have a question, for anyone experienced in working with Zope and caching : proxies: : : I'm setting up a load-balanced server farm that has nodes that will run : Apache and proxy (via mod_proxy) to ZEO clients running ZServer. This :farm : is routed (both ways) through a layer 4 load-balancing appliance, and all : these boxes (both nodes and the balancer) are sitting inside a DMZ with : private IP addresses. The public world will access these servers via a : firewall box running transparent proxy (actually, I guess, similar to : squid's http_accel mode; the semantics here are a bit tricky, as it's more : of a inverse trans-proxy). Between Apache and Zope, there would be :several : virtual hosts, and I'd be using the SiteAccess product. It gets a bit : tricky in that I need to access several different virtual hosts inside the : DMZ (one for the ZEO farm, and another for a dedicated CGI-based ad server : on another box) via the proxy. A more detailed (ascii art) diagram of :what : I am trying to do, is at http://209.132.8.98/server_ascii_art.txt : : My question is this: does anybody have any thoughts on the merits of Squid : (http accelerator mode) versus Apache/mod_proxy in terms of caching, :virtual : hosts, and the like when working with Zope sites? Any big pitfalls to :this : kind of setup with Zope sites? : :I would prefer Squid since its only purpose in life is caching. It :follows the "do one thing and do it well" mantra. : :But whatever your choice, I hope you make use of the new CacheManagement :feature in Zope 2.3. It is designed to make things like this :straightforward and easy. There's a recent news announcement that links :to everything you need--including complete help docs! : :Shane : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _________ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Caching/http-acceleration and proxying Zope-served content
On Tue, 9 Jan 2001, Toby Dickenson wrote: :On Tue, 9 Jan 2001 09:31:35 +0100 (CET), Peter Sabaini :[EMAIL PROTECTED] wrote: : :actually i use a combination of squid / apache because i need some :re-writing, you could as well use squid for caching and apache for :(name-based) virtual hosting. this of course introduces additional :latency, but this shouldnt be a problem if your objects are fairly :cacheable, ie. most content would be served out of squid anyway. : :That's an interesting configuration. For a while Ive been considering :a solution based on longer-than-usual chains of http proxies, and a :"do one thing well" principal. In my case: : :Apache (for rewriting and SSL) : - Squid accelerator : - A custom load-balancing redirector :- Multiple Zopes : :Have you had any significant latency, or other problems? : :Toby Dickenson :[EMAIL PROTECTED] my configuration was: -- squid -- apache w/ rewriting and logging -- zserver / zope there was of course some latency added but nothing significant -- 0.5s afai can remember. and, since squid was the first stage, most content would be served of squid (and thus with no added latency) anyway. ssl was not an issue. the problem i had with zserver-only was that the most-requested pages (frontpage and index pages) were also the most expensive to render (drawing in content from diverse categories etc.) with the proxy setup, the most-requested pages would be in the cache, and little-requested pages (article views) are a) simple to render and therefore dont contribute much to load and latency and b) there's more willingness for users to wait half a second longer for a detailed view than for an index page, where they decide if they want to read anything at all (imho). i needed apache for logging and also served all static images via apache -- all those small gifs can have quite an impact of subjective load times. and since these dont change often you dont need manageability via zope. you just have to write img src="dtml-spacer_gif_path;" instead of dtml-var spacer_gif (or whatever)... ru, peter. -- _________ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Inserting LONGs with DCOracle
do something like: from DCOracle import * conn=Connect( "%s/%s@%s" % (user,pw,srv) ) h=conn.prepare("insert into table_x (x,y,z) values :p1, p2:, :p3") long_str = 'a'*8000 h.execute(1,2,long_str) assuming column z is declared as LONG hth peter. On Fri, 17 Nov 2000, Dorothea Kuehn wrote: :Hi, :If I try to insert an ca.5000 char string with DCOracle(1.3.2) into a LONG :column in Oracle (8i) I keep getting ORA-1704 'string literal too :long'-Errors. : :Ok, I read here :http://osi.oracle.com/~tkyte/Misc/LargeStrings.html :that it will work (a) with bind variables or (b) that I have to use :ODBC,OCI or alike. : :Questions: (a) Can I use bind variables with DCOracle? How? :(b) I thought DCOracle is using OCI, so why the heck this isn't working? :Any workarounds? : :thanks for help, :dekay : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _________ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] DCOracle + LOB
hi all, i have this shiny brand new oracle 8i server and now read (on the mailinglist) that there's no lob support for oracle 8i in dcoracle 1.3.2, and indeed it does not appear to work. is that true? i need lob support! is there any workaround? through stored procedures maybe? thanks a lot! peter. -- _ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] overriding __str__ method?
so if i'm not mistaken you want to be able to include an object instance with say dtml-var myinstance and, depending on the user being authenticated, have that object render with "edit this" button or without? overriding the __str__ method can afaik only be done inside a python product (read the python product tutorial) you could use lalo's "Renderable Base ZClass" product or call your instance like so: dtml-with myinstance dtml-var method_that_renders_myinstance /dtml-with (or call it dtml-var "myinstance.method_that_renders_myinstance(_.None,_)") and in the "method_that_renders_myinstance" you'd render those "edit" buttons only if theres the correct role in AUTHENTICATED_USER hth peter sabaini. On Mon, 9 Oct 2000, Seb Bacon wrote: :Thanks for the reply, : : Either I don't understand the problem or you're making it too : complicated. g : :I think both, but mostly the latter ;) : :Explanation MK II: : :I know how to create a form that does what I want (update properties, :whatever). What I don't know is how to include it as part of the rendered :content programmatically. At the moment users have to go to :www.widgets.com/manage_content, log in, and see a set of forms loosely based :on the Zope manage interface. Instead, I'd like them to go to the same url, :and see exactly the same website as someone who's not logged in, except they :have these lovely little "edit this" buttons next to each editable content :element (by which I mean image, text snippet, etc). : :Now I *could* do a : : dtml-if "AUTHENTICATED_USER.has_role('content manager')" :a href="edit_this"edit this/a : /dtml-if : :in each content element. But I'd much rather be able to subclass or mixin an :'editable' class for each content element in question. The question is, :what methods should I be providing to manipulate how the content is :rendered? For example, I can provide a new 'view' method in the 'views' tab :for a ZClass, but this does not get called when an object is rendered as :part of another document. The reason I was going on about __str__ is :because that seems to be the only place that you can interfere with how the :content is rendered inline? : :Hope that's clearer, : :seb. : : : : : : : You have a form to edit the properties. : ... : input type="text" name="last_name" value="dtml-last_name;" : ... : : The action method of this form sets the REQUEST variables to the : property names: : ... : dtml-call "REQUEST.set('last_name', REQUEST['last_name'])" : ... : (I generally use the same names for form vars and property names : to avoid confusing myself) : : then: : dtml-call "manage_changeProperties(REQUEST)" : : Does this help? : : : Seb Bacon wrote: : : My strategy: : Each element that I want the user to be able to edit is a ZClass with a : manage_content method. This provides the custom management view (e.g. : combines properties and title/data into a single form). : Now I want a way to give the user access to this screen. I : could do a new : version of the folders tree view (manage_menu), but what I'd : really like to : do is have a button next to each of these elements ("edit : this") which calls : its manage_content method. The button would only appear when : the user was : authenticated / authorised. : : My problem: : The only place I can think of doing this is in each object's : __str__ method. : But AFAIK there's no convenient way of overriding its default behaviour. : What I'd like to do is override it in the ZClass views interface. I can : override the 'View' method (from the ZClass 'views' tab), but : that doesn't : get called in the course of rendering a component in a page. : The problem : would seem to be that there's no equivalent of the __str__ : method available : to override... Or is there? : : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Property problem - still the same...
hi afaik its not possible to nest properties. what about dtml method mytitle in the root folder consisting of dtml-var enterprisename - dtml-var title or something like this? this will acquire title from the current document and enterprisename from the rootfolder provided theres not another enterprisename in the acquisition path. hth peter. On Fri, 29 Sep 2000, Lars Heber wrote: :Hello again, : :I recently set a question about nested properties. : :Unfortunately, we didn't come to a proper solution. : :I was told to use ZClasses, and I read a lot of documentation about it. :But I found out that this isn't the thing I was searching for. : :So, now I'll try it again, very concrete this time: : :In my root folder, I have a property enterpriseName (string) = :"myEnterprise". : :Furthermore I have an arbitrary DTML document, and I want to include my :global property enterpriseName in the title property of this document so :that the title of the document is "myEnterprise" at the end. : :The sense of that is that when I change the value of enterpriseName :automatically all titles are updated. : :It is not possible to include this enterpriseName into :standard_html_header or similar, because there will be many documents, :and only some of them need the enterpriseName in their titles, others :want to add an own text to the enterpriseName resulting in e. g. "This :is the Homepage of XYZ, who is working at myEnterprise". : :I generally just want to insert one property into another... : :Please, please help me, I'm despairing in the meantime... : :Lars : : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _____ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML
this should work too (untestet): dtml-in "active_category_method()" dtml-in "category_method(id=id)" size=100 start=query_start id=dtml-var idseq=dtml-var seqvid=dtml-var vid /dtml-in /dtml-in ('id' var should be put on the namespace by 'active_category_method()' and gets passed in to 'category_method()' (which, being a zsqlmethod, wouldnt take a var from the namespace) peter. -- _________ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] another zope site gone...
...finally online! http://druck.kleinezeitung.at/ now holds the 'as printed' version of the 'Kleine Zeitung', one of the bigger austrian newspapers. doing the zope part was the fun bit... thanks to DC for a great product and to the list for real good ressources. hope i get management to adopt zope as our primary platform! ru, peter sabaini. -- _ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DTML newbie question on summation
try dtml-let total="_.int(SUNDAY) + _.int( ... _.int() method tells zope you want (integer) numbers. hth peter. On Fri, 2 Jun 2000, Coleman, Bryan wrote: :I can't seem to add variables using let. I just get a concatination of the :integers. I am using ... : :dtml-let total="SUNDAY + MONDAY + TUESDAY + WEDNESDAY + THURSDAY + FRIDAY + :SATURDAY" : :The days represent hours but are stored as integers in the database. : :- Bryan Patrick Coleman : Questcon Technologies : (336)273-2428 : [EMAIL PROTECTED] : : :___ :Zope maillist - [EMAIL PROTECTED] :http://lists.zope.org/mailman/listinfo/zope :** No cross posts or HTML encoding! ** :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _________ peter sabaini, mailto: [EMAIL PROTECTED] - ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )