[Zope-Checkins] SVN: Products.Five/branches/1.5/ Merge security fix from 1.4 branch r71418:71419
Log message for revision 71459: Merge security fix from 1.4 branch r71418:71419 Changed: U Products.Five/branches/1.5/CHANGES.txt U Products.Five/branches/1.5/browser/metaconfigure.py U Products.Five/branches/1.5/browser/tests/defaultview.zcml U Products.Five/branches/1.5/browser/tests/pages.txt U Products.Five/branches/1.5/browser/tests/pages.zcml U Products.Five/branches/1.5/browser/tests/pages_ftest.txt -=- Modified: Products.Five/branches/1.5/CHANGES.txt === --- Products.Five/branches/1.5/CHANGES.txt 2006-12-06 17:02:26 UTC (rev 71458) +++ Products.Five/branches/1.5/CHANGES.txt 2006-12-06 17:50:26 UTC (rev 71459) @@ -5,6 +5,9 @@ Five 1.5.2 (unreleased) === +* View methods which aren't explicitly declared as allowed must be marked + private explicitly to avoid being web publishable. + * i18n: Synced FiveTranslationService implementation with Zope 3.3. This makes sure that the TestMessageFallbackDomain is used if registered. Modified: Products.Five/branches/1.5/browser/metaconfigure.py === --- Products.Five/branches/1.5/browser/metaconfigure.py 2006-12-06 17:02:26 UTC (rev 71458) +++ Products.Five/branches/1.5/browser/metaconfigure.py 2006-12-06 17:50:26 UTC (rev 71459) @@ -19,6 +19,7 @@ $Id$ import os +from inspect import ismethod from zope import component from zope.interface import Interface @@ -41,6 +42,7 @@ from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile from Products.Five.metaclass import makeClass from Products.Five.security import getSecurityInfo, protectClass, protectName +from Products.Five.security import CheckerPrivateId from Globals import InitializeClass as initializeClass @@ -138,6 +140,19 @@ callable = protectName, args = (new_class, attr, permission) ) +# Make everything else private +allowed = [attribute] + (allowed_attributes or []) +private_attrs = [name for name in dir(new_class) + if (not name.startswith('_')) and +(name not in allowed) and +ismethod(getattr(new_class, name))] +for attr in private_attrs: +_context.action( +discriminator = ('five:protectName', new_class, attr), +callable = protectName, +args = (new_class, attr, CheckerPrivateId) +) +# Protect the class _context.action( discriminator = ('five:initialize:class', new_class), callable = initializeClass, Modified: Products.Five/branches/1.5/browser/tests/defaultview.zcml === --- Products.Five/branches/1.5/browser/tests/defaultview.zcml 2006-12-06 17:02:26 UTC (rev 71458) +++ Products.Five/branches/1.5/browser/tests/defaultview.zcml 2006-12-06 17:50:26 UTC (rev 71459) @@ -18,6 +18,11 @@ permission=zope2.Public / + class class=Products.Five.tests.testing.simplecontent.IIndexSimpleContent +require permission=zope2.Public + attributes=index_html/ + /class + browser:defaultView for=Products.Five.tests.testing.simplecontent.IIndexSimpleContent name=index_html Modified: Products.Five/branches/1.5/browser/tests/pages.txt === --- Products.Five/branches/1.5/browser/tests/pages.txt 2006-12-06 17:02:26 UTC (rev 71458) +++ Products.Five/branches/1.5/browser/tests/pages.txt 2006-12-06 17:50:26 UTC (rev 71459) @@ -277,7 +277,7 @@ self.login('manager') Being logged in as a manager again, we find that the protected pages -are not accessible to us: +are accessible to us: for view_name in protected_view_names: ... checkRestricted( @@ -288,7 +288,13 @@ ... self.folder, ... 'context.restrictedTraverse(testoid/eagle.method).eagle()') +Even when logged in though the private methods should not be accessible: + checkUnauthorized( self.folder, + ... 'context.restrictedTraverse(testoid/eagle.method).mouse()') + + + Other - Modified: Products.Five/branches/1.5/browser/tests/pages.zcml === --- Products.Five/branches/1.5/browser/tests/pages.zcml 2006-12-06 17:02:26 UTC (rev 71458) +++ Products.Five/branches/1.5/browser/tests/pages.zcml 2006-12-06 17:50:26 UTC (rev 71459) @@ -19,7 +19,7 @@ for=Products.Five.tests.testing.simplecontent.ISimpleContent class=.pages.SimpleView name=eagle.method - permission=zope2.ViewManagementScreens + permission=zope2.View allowed_attributes=eagle / Modified: Products.Five/branches/1.5/browser/tests/pages_ftest.txt === ---
[Zope-Checkins] SVN: Products.Five/branches/1.2/ Merge security fix from 1.4 branch r71418:71419
Log message for revision 71473: Merge security fix from 1.4 branch r71418:71419 Changed: U Products.Five/branches/1.2/CHANGES.txt U Products.Five/branches/1.2/browser/metaconfigure.py U Products.Five/branches/1.2/browser/tests/defaultview.zcml U Products.Five/branches/1.2/browser/tests/pages.txt U Products.Five/branches/1.2/browser/tests/pages.zcml U Products.Five/branches/1.2/browser/tests/pages_ftest.txt U Products.Five/branches/1.2/browser/tests/test_defaultview.py -=- Modified: Products.Five/branches/1.2/CHANGES.txt === --- Products.Five/branches/1.2/CHANGES.txt 2006-12-06 22:48:54 UTC (rev 71472) +++ Products.Five/branches/1.2/CHANGES.txt 2006-12-06 23:05:40 UTC (rev 71473) @@ -5,6 +5,9 @@ Bugfixes +* View methods which aren't explicitly declared as allowed must be marked + private explicitly to avoid being web publishable. + * Made the __call__ method of ViewMixinForAttributes have the same signature as the original attribute. This aids some pathological request parameter marshalling. Modified: Products.Five/branches/1.2/browser/metaconfigure.py === --- Products.Five/branches/1.2/browser/metaconfigure.py 2006-12-06 22:48:54 UTC (rev 71472) +++ Products.Five/branches/1.2/browser/metaconfigure.py 2006-12-06 23:05:40 UTC (rev 71473) @@ -19,6 +19,7 @@ $Id$ import os +from inspect import ismethod from zope.interface import Interface from zope.component import getGlobalService, ComponentLookupError @@ -42,6 +43,7 @@ from Products.Five.metaclass import makeClass from Products.Five.security import getSecurityInfo, protectClass, \ protectName, initializeClass +from Products.Five.security import CheckerPrivateId import ExtensionClass @@ -140,6 +142,19 @@ callable = protectName, args = (new_class, attr, permission) ) +# Make everything else private +allowed = [attribute] + (allowed_attributes or []) +private_attrs = [name for name in dir(new_class) + if (not name.startswith('_')) and +(name not in allowed) and +ismethod(getattr(new_class, name))] +for attr in private_attrs: +_context.action( +discriminator = ('five:protectName', new_class, attr), +callable = protectName, +args = (new_class, attr, CheckerPrivateId) +) +# Protect the class _context.action( discriminator = ('five:initialize:class', new_class), callable = initializeClass, Modified: Products.Five/branches/1.2/browser/tests/defaultview.zcml === --- Products.Five/branches/1.2/browser/tests/defaultview.zcml 2006-12-06 22:48:54 UTC (rev 71472) +++ Products.Five/branches/1.2/browser/tests/defaultview.zcml 2006-12-06 23:05:40 UTC (rev 71473) @@ -30,6 +30,11 @@ five:defaultViewable class=Products.Five.tests.testing.simplecontent.IndexSimpleContent / + class class=Products.Five.tests.testing.simplecontent.IIndexSimpleContent +require permission=zope2.Public + attributes=index_html/ + /class + browser:defaultView for=Products.Five.tests.testing.simplecontent.IIndexSimpleContent name=index_html Modified: Products.Five/branches/1.2/browser/tests/pages.txt === --- Products.Five/branches/1.2/browser/tests/pages.txt 2006-12-06 22:48:54 UTC (rev 71472) +++ Products.Five/branches/1.2/browser/tests/pages.txt 2006-12-06 23:05:40 UTC (rev 71473) @@ -277,7 +277,7 @@ self.login('manager') Being logged in as a manager again, we find that the protected pages -are not accessible to us: +are accessible to us: for view_name in protected_view_names: ... checkRestricted( @@ -288,7 +288,13 @@ ... self.folder, ... 'context.restrictedTraverse(testoid/eagle.method).eagle()') +Even when logged in though the private methods should not be accessible: + checkUnauthorized( self.folder, + ... 'context.restrictedTraverse(testoid/eagle.method).mouse()') + + + Other - Modified: Products.Five/branches/1.2/browser/tests/pages.zcml === --- Products.Five/branches/1.2/browser/tests/pages.zcml 2006-12-06 22:48:54 UTC (rev 71472) +++ Products.Five/branches/1.2/browser/tests/pages.zcml 2006-12-06 23:05:40 UTC (rev 71473) @@ -19,7 +19,7 @@ for=Products.Five.tests.testing.simplecontent.ISimpleContent class=.pages.SimpleView name=eagle.method - permission=zope2.ViewManagementScreens + permission=zope2.View allowed_attributes=eagle / Modified: Products.Five/branches/1.2/browser/tests/pages_ftest.txt
[Zope-dev] Zope Tests: 8 OK, 1 Failed
Summary of messages to the zope-tests list. Period Tue Dec 5 12:00:00 2006 UTC to Wed Dec 6 12:00:00 2006 UTC. There were 9 messages: 9 from Zope Unit Tests. Test failures - Subject: FAILED (failures=2) : Zope-2.8 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:35:35 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006760.html Tests passed OK --- Subject: OK : Zope-2.6 Python-2.1.3 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:28:04 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006755.html Subject: OK : Zope-2.6 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:29:34 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006756.html Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:31:05 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006757.html Subject: OK : Zope-2.7 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:32:35 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006758.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:34:05 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006759.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:37:05 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006761.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:38:35 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006762.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Tue Dec 5 21:40:05 EST 2006 URL: http://mail.zope.org/pipermail/zope-tests/2006-December/006763.html ___ 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 )
[Zope] changing the meta_type for python product class
Hi everybody, I am stuck with the following problem for witch I don't have a solution. I would appreciate it very much if you could help me with it. I have a very simple Python product with only one class that extends Folder. The name of the product is MyClass and the MyClass.py module is below: from OFS.Folder import Folder from Products.PageTemplates.PageTemplateFile import PageTemplateFile from constants import * manage_addMyClass_html = PageTemplateFile('zpt/myclass_manage_add', globals()) def manage_addMyClass(self, id, title='', REQUEST=None): ob = MyClass(id, title) self._setObject(id, ob) if REQUEST: return self.manage_main(self, REQUEST, update_menu=1) class MyClass(Folder): meta_type = METATYPE_MYCLASS def __init__(self, id, title): #constructor self.id = id self.title = title And the constants.py module contains: import Globals MYCLASS_PRODUCT_NAME = 'MyClass' MYCLASS_PRODUCT_PATH = Globals.package_home(globals()) METATYPE_MYCLASS = 'My Class' PERMISSION_ADD_MYCLASS = 'MyClass - Add Components' In the ROOT folder I create the following python script (listing): for x in container.objectValues(['My Class']): print '[%s] - [%s]' % (x.meta_type, x.absolute_url()) return printed Then I follow the steps: 1. Create an instance with the id 'instance1' (in the drop down I have 'My Class'). 2. I run the 'listing' script and I get: [My Class] - [http://10.0.0.37:8080/instance1] 3. I change the constant METATYPE_MYCLASS into 'My New Class' 4. I run the 'listing' script and I get: [My New Class] - [http://10.0.0.37:8080/instance1] 5. I create a second instance with the id 'instance2' (in the drop down I have 'My New Class'). 6. I run the 'listing' script and I get: [My New Class] - [http://10.0.0.37:8080/instance1] 7. I modify the python script by changing the 'My Class' with 'My New Class' 8. I run the 'listing' script and I get: [My New Class] - [http://10.0.0.37:8080/instance2] In the ZMI for both instances the meta_type 'My New Class' is displayed. I don't understand why the first instance is not displayed after I change the meta_type value in the python Product. Moreover, if I try to explicit update the meta_type property for the first instance to the new value, the result is the same. What I am trying to accomplish is to be able to change the meta_type value and this to work (e.g. with no effect on python scripts like 'listing') Thank you very much, Dragos ___ 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] Adding HTML to Python
In Python I'm building this error message: l_errorMessage = These IDs have Errors Loop l_errorMessage = l_errorMessage + %s % (ID) end loop return l_errorMessage. How can I put breaks (returns) between the IDs so each ID will be displayed on it's own line? like: These IDs have Errors: 1 46 76 45 ___ 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] Adding HTML to Python
maybe you can try to add new lines l_errorMessage = l_errorMessage + %s\n % (ID) regards, Dragos On 12/6/06, April Lekin [EMAIL PROTECTED] wrote: In Python I'm building this error message: l_errorMessage = These IDs have Errors Loop l_errorMessage = l_errorMessage + %s % (ID) end loop return l_errorMessage. How can I put breaks (returns) between the IDs so each ID will be displayed on it's own line? like: These IDs have Errors: 1 46 76 45 ___ 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] Adding HTML to Python
Hi, I tried that and it will print the BR, like this These IDs have Errors:BR 1BR 46 BR 76BR 45BR At 09:43 AM 12/6/2006, Roberto Benitez wrote: add BR to the end of each line example: l_errorMessage = These IDs have ErrorsBR #ADD BR AT END OF HEADER LINE Loop l_errorMessage = l_errorMessage + %sBR % (ID) #ADD BR AT END OF EACH ID ENTRY end loop - Original Message From: April Lekin [EMAIL PROTECTED] To: zope@zope.org Sent: Wednesday, December 6, 2006 11:12:20 AM Subject: [Zope] Adding HTML to Python In Python I'm building this error message: l_errorMessage = These IDs have Errors Loop l_errorMessage = l_errorMessage + %s % (ID) end loop return l_errorMessage. How can I put breaks (returns) between the IDs so each ID will be displayed on it's own line? like: These IDs have Errors: 1 46 76 45 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zopehttp://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announcehttp://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) Everyone is raving about http://us.rd.yahoo.com/evt=45083/*http://advision.webevents.yahoo.com/mailbetathe all-new Yahoo! Mail beta. ___ 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] Adding HTML to Python
if you are using ZPT to display the result of the method use 'structure', if you are usign DTML make sure you dont't encode the result if is plain text use new line character as I sad above. regards, Dragos On 12/6/06, April Lekin [EMAIL PROTECTED] wrote: Hi, I tried that and it will print the BR, like this These IDs have Errors:BR 1BR 46 BR 76BR 45BR At 09:43 AM 12/6/2006, Roberto Benitez wrote: add BR to the end of each line example: l_errorMessage = These IDs have ErrorsBR #ADD BR AT END OF HEADER LINE Loop l_errorMessage = l_errorMessage + %sBR % (ID) #ADD BR AT END OF EACH ID ENTRY end loop - Original Message From: April Lekin [EMAIL PROTECTED] To: zope@zope.org Sent: Wednesday, December 6, 2006 11:12:20 AM Subject: [Zope] Adding HTML to Python In Python I'm building this error message: l_errorMessage = These IDs have Errors Loop l_errorMessage = l_errorMessage + %s % (ID) end loop return l_errorMessage. How can I put breaks (returns) between the IDs so each ID will be displayed on it's own line? like: These IDs have Errors: 1 46 76 45 ___ 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 ) Everyone is raving about the all-new Yahoo! Mail beta. ___ 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 ) -- Dragos Chirila [EMAIL PROTECTED] (+4) 0722 395375 ___ 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] Adding HTML to Python
Hi, That doesn't work either! It doesn't print anything. Weird! At 09:44 AM 12/6/2006, Dragos Chirila wrote: maybe you can try to add new lines l_errorMessage = l_errorMessage + %s\n % (ID) regards, Dragos On 12/6/06, April Lekin [EMAIL PROTECTED] wrote: In Python I'm building this error message: l_errorMessage = These IDs have Errors Loop l_errorMessage = l_errorMessage + %s % (ID) end loop return l_errorMessage. How can I put breaks (returns) between the IDs so each ID will be displayed on it's own line? like: These IDs have Errors: 1 46 76 45 ___ 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 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] Re: Adding HTML to Python
I tried that and it will print the BR, like this These IDs have Errors:BR 1BR 46 BR 76BR 45BR If you are using zpt, then you have to call it like this: div tal:replace=structure here/myScript/ Otherwise it will be rendered as text. Regards Josef ___ 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] changing the meta_type for python product class
Hi! Thank you very much for your response. Ok, you are right, but if I do it why the ZMI is showing to me the new meta type for both instances? This is wrong... Also, I don't understand why if I explicit change the meta_type property for the old instance (e.g. a method of MyClass that is called via URL) still nothing happens? I also tried to add the following lines to the MyClass: _properties = ( Folder._properties + ( {'id': 'meta_type', 'type': 'string', 'mode': 'w'}, ) ) In the Properties tab for both instances the same value is shown for the meta_type property. Thank you very much once again for taking time to consider my problem. Regards, Dragos. On 12/6/06, Dieter Maurer [EMAIL PROTECTED] wrote: Dragos Chirila wrote at 2006-12-6 15:48 +0200: ... What I am trying to accomplish is to be able to change the meta_type value and this to work (e.g. with no effect on python scripts like 'listing') The best way is *NOT* to change the meta type (at least not when you have places that require it unchanged). Instead derive a new class from it and give this new class a new meta_type. -- Dieter ___ 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] MailHost with SSL
Oh, you should belive me. It appears just 'after' adding SecureMailHost to the Folder. (I'm not coding, just adding new Zope Object via management Interface) After then you can configure user/ password. But this was not, what I was looking for, becaus I was not able to bind it with my existing Mail Template. The dropdownmenu shows only the old MailHost and not the new added SecureMailHost instance while configuring the Mail Template Greets, Ferhat On Dec 6, 2006, at 6:25 AM, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 5. Dezember 2006 22:18:09 +0100 Ferhat Ayaz [EMAIL PROTECTED] wrote: I've installed it. But there is no way to set user/password. At least I didn't found anyway. We don't believe that. The API tells you clearly that the constructors accepts a username and a password. Triple check yourself. - -aj -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFdlQuCJIWIbr9KYwRAtM7AKCh8eUNgB1/6rauXeIXB4y8WqOfgQCfS4tF 62MPlv8vSqkoPjRk+/Ovn1c= =9ik5 -END PGP SIGNATURE- ___ 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] Zope/Cache/Memory
I have a database that is just under 200K objects with plans that it will grow larger. The objects are created by using another object with methods that read files and create the objects from the data in the files. When creating the objects, I find I have to manually clear the cache or else zope eventually crashes with an out of memory error. There are 4GB of ram on the server. The same issue arises when I catalog the objects. I am trying maintain as much speed as possible, so I do not want to catalog until the end of the import. Is there a way to programmatically clear the cache during a large indexing to avoid out of memory errors? I am using zeo storages and setting the cache on those to a smaller size has no real effect in this case, because the cache seems to outgrow its defined size when it is very active. Is zope even good for this? Should I consider another database? It still seems that cataloging is an issue whether the objects are stored in the zodb or elsewhere. -Kevin ___ 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] Zope/Cache/Memory
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 6. Dezember 2006 14:30:40 -0500 kevin7kal [EMAIL PROTECTED] wrote: I have a database that is just under 200K objects with plans that it will Is there a way to programmatically clear the cache during a large indexing to avoid out of memory errors? You're indexing with the ZCatalog? Are you sure that you're using subtransactions (or savepoints as they are called now). There is a ZCatalog parameter that controls this behavior. For large indexing operations this might cause the OutOfMember error. When using subtransactions changes will be written to disk after N objects. Please check that. - -aj -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFdykGCJIWIbr9KYwRAsz/AJ9kUeK+Vd8guq8EnxR+bajzKvAPGgCeNG1L jxZ9z8CZUjYbGAsTxZmWi+A= =YIf2 -END PGP SIGNATURE- ___ 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] Zope/Cache/Memory
- Original Message - From: kevin7kal [EMAIL PROTECTED] To: zope@zope.org Sent: Wednesday, December 06, 2006 2:30 PM Subject: [Zope] Zope/Cache/Memory I have a database that is just under 200K objects with plans that it will grow larger. The objects are created by using another object with methods that read files and create the objects from the data in the files. When creating the objects, I find I have to manually clear the cache or else zope eventually crashes with an out of memory error. There are 4GB of ram on the server. The same issue arises when I catalog the objects. I am trying maintain as much speed as possible, so I do not want to catalog until the end of the import. Make sure you have correctly set the cache parameters in zope.conf, and make sure that the ZCatalog subtransactions are enabled - and you can play around with the threshold values to improve performance (I am assuming that the database you mentioned was a ZCatalog). hth Jonathan ___ 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] MailHost with SSL
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 6. Dezember 2006 20:21:19 +0100 Ferhat Ayaz [EMAIL PROTECTED] wrote: Oh, you should belive me. It appears just 'after' adding SecureMailHost to the Folder. (I'm not coding, just adding new Zope Object via management Interface) After then you can configure user/password. Where is the problem? You also don't have to fill in your creditcard number first when entering an online shop. But this was not, what I was looking for, becaus I was not able to bind it with my existing Mail Template. No idea what Mail template means for you? You mean the product of Chris Withers? The dropdownmenu shows only the old MailHost and not the new added SecureMailHost instance while configuring the Mail Template Likely you have to massage the code in order to check for the 'meta_type' of the SecureMailHost instead of the 'meta_type' for the standard Zope Mailhost. Reading and analyzing the code is always a good idea to track down such issues. I am pretty sure that there is some code using superValues() - grep -r is your best friend in such a case. - -aj -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFdypdCJIWIbr9KYwRAoZOAKDbev1GT98LoALO40S6F6+Xrf9aPQCgsgjG /x8NvHqo14ApCkcy3dew/NQ= =ma6u -END PGP SIGNATURE- ___ 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] MailHost with SSL
On Dec 6, 2006, at 9:38 PM, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 6. Dezember 2006 20:21:19 +0100 Ferhat Ayaz [EMAIL PROTECTED] wrote: Oh, you should belive me. It appears just 'after' adding SecureMailHost to the Folder. (I'm not coding, just adding new Zope Object via management Interface) After then you can configure user/password. Where is the problem? You also don't have to fill in your creditcard number first when entering an online shop. With MailHost, you can do it! I'm _configuring_ a server (in this case my MailHost) but not _buy_ a server. But this was not, what I was looking for, becaus I was not able to bind it with my existing Mail Template. No idea what Mail template means for you? You mean the product of Chris Withers? Yes, indeed. The dropdownmenu shows only the old MailHost and not the new added SecureMailHost instance while configuring the Mail Template Likely you have to massage the code in order to check for the 'meta_type' of the SecureMailHost instead of the 'meta_type' for the standard Zope Mailhost. Reading and analyzing the code is always a good idea to track down such issues. I am pretty sure that there is some code using superValues() - grep -r is your best friend in such a case. hmm. Ok, thanks. I thought it will much eleganter to ask for some experience. I want use the product and not refactor the code. Greets, Ferhat ___ 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] MailHost with SSL
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 6. Dezember 2006 21:48:24 +0100 Ferhat Ayaz [EMAIL PROTECTED] wrote: On Dec 6, 2006, at 9:38 PM, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 6. Dezember 2006 20:21:19 +0100 Ferhat Ayaz [EMAIL PROTECTED] wrote: Oh, you should belive me. It appears just 'after' adding SecureMailHost to the Folder. (I'm not coding, just adding new Zope Object via management Interface) After then you can configure user/password. Where is the problem? You also don't have to fill in your creditcard number first when entering an online shop. With MailHost, you can do it! I'm _configuring_ a server (in this case my MailHost) but not _buy_ a server. You did not get the punch line :-) The dropdownmenu shows only the old MailHost and not the new added SecureMailHost instance while configuring the Mail Template Likely you have to massage the code in order to check for the 'meta_type' of the SecureMailHost instead of the 'meta_type' for the standard Zope Mailhost. Reading and analyzing the code is always a good idea to track down such issues. I am pretty sure that there is some code using superValues() - grep -r is your best friend in such a case. hmm. Ok, thanks. I thought it will much eleganter to ask for some experience. I want use the product and not refactor the code. Modifying likely one line of code is elegant enough. If you want a better car you have to pimp it. If you can't pimp it yourself: either don't try it or let someone else pimp it for you. Got the punch line now? - -aj -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFd6rICJIWIbr9KYwRAi7PAJ9ZJFmcumI9/Xng7MyPEN8FUjVGJACfdSDT xTeRJnsvJo0J/oIssU+1IIU= =R65g -END PGP SIGNATURE- ___ 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 )