[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py - replaced MessageDialog by less annoying manage_tabs_message
Log message for revision 30812: - replaced MessageDialog by less annoying manage_tabs_message - some related cleanup Changed: UU Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py === --- Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2005-06-16 16:19:33 UTC (rev 30811) +++ Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2005-06-16 16:24:13 UTC (rev 30812) @@ -22,7 +22,6 @@ import logging from random import random from thread import allocate_lock -from types import StringType, UnicodeType import Globals from Acquisition import aq_base @@ -117,9 +116,6 @@ temp_logs[self._p_oid] = log return log -# Exceptions that happen all the time, so we dont need -# to log them. Eventually this should be configured -# through-the-web. security.declareProtected(use_error_logging, 'forgetEntry') def forgetEntry(self, id, REQUEST=None): Removes an entry from the error log. @@ -132,10 +128,13 @@ i += 1 cleanup_lock.release() if REQUEST is not None: - return Globals.MessageDialog(title='Entry removed', -message='Error log entry was removed.', -action='./manage_main',) +REQUEST.RESPONSE.redirect( + '%s/manage_main?manage_tabs_message=Error+log+entry+was+removed.' % +self.absolute_url()) +# Exceptions that happen all the time, so we dont need +# to log them. Eventually this should be configured +# through-the-web. _ignored_exceptions = ( 'Unauthorized', 'NotFound', 'Redirect' ) security.declarePrivate('raising') @@ -155,8 +154,7 @@ if strtype in self._ignored_exceptions: return -if not isinstance(info[2], StringType) and not isinstance( -info[2], UnicodeType): +if not isinstance(info[2], basestring): tb_text = ''.join( format_exception(*info, **{'as_html': 0})) tb_html = ''.join( Property changes on: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py ___ Name: cvs2svn:cvs-rev - 1.17 ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py - replaced MessageDialog by less annoying manage_tabs_message
Log message for revision 30813: - replaced MessageDialog by less annoying manage_tabs_message - some related cleanup Changed: UU Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py -=- Modified: Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py === --- Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2005-06-16 16:24:13 UTC (rev 30812) +++ Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2005-06-16 16:25:27 UTC (rev 30813) @@ -22,7 +22,6 @@ import logging from random import random from thread import allocate_lock -from types import StringType, UnicodeType import Globals from Acquisition import aq_base @@ -117,9 +116,6 @@ temp_logs[self._p_oid] = log return log -# Exceptions that happen all the time, so we dont need -# to log them. Eventually this should be configured -# through-the-web. security.declareProtected(use_error_logging, 'forgetEntry') def forgetEntry(self, id, REQUEST=None): Removes an entry from the error log. @@ -132,10 +128,13 @@ i += 1 cleanup_lock.release() if REQUEST is not None: - return Globals.MessageDialog(title='Entry removed', -message='Error log entry was removed.', -action='./manage_main',) +REQUEST.RESPONSE.redirect( + '%s/manage_main?manage_tabs_message=Error+log+entry+was+removed.' % +self.absolute_url()) +# Exceptions that happen all the time, so we dont need +# to log them. Eventually this should be configured +# through-the-web. _ignored_exceptions = ( 'Unauthorized', 'NotFound', 'Redirect' ) security.declarePrivate('raising') @@ -155,8 +154,7 @@ if strtype in self._ignored_exceptions: return -if not isinstance(info[2], StringType) and not isinstance( -info[2], UnicodeType): +if not isinstance(info[2], basestring): tb_text = ''.join( format_exception(*info, **{'as_html': 0})) tb_html = ''.join( Property changes on: Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py ___ Name: cvs2svn:cvs-rev - 1.17 ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/App/dtml/manage_page_style.css.dtml - removed width 100% for .system-msg
Log message for revision 30814: - removed width 100% for .system-msg width 100% did cause an horizontal scrollbar in firefox and ie. This change breaks the ns4 layout a bit, but I guess we can live with that. Changed: U Zope/branches/Zope-2_8-branch/lib/python/App/dtml/manage_page_style.css.dtml -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/App/dtml/manage_page_style.css.dtml === --- Zope/branches/Zope-2_8-branch/lib/python/App/dtml/manage_page_style.css.dtml 2005-06-16 16:25:27 UTC (rev 30813) +++ Zope/branches/Zope-2_8-branch/lib/python/App/dtml/manage_page_style.css.dtml 2005-06-16 16:47:20 UTC (rev 30814) @@ -128,7 +128,6 @@ margin-bottom: 6px; margin-top: 6px; padding: 4px; - width: 100%; color: #660033; } ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/tempstorage/ Allow tempstorage to participate in MVCC. Also fix minor bug where conflict cache could be poisoned by a transaction that failed after store was called.
Log message for revision 30822: Allow tempstorage to participate in MVCC. Also fix minor bug where conflict cache could be poisoned by a transaction that failed after store was called. Changed: U Zope/trunk/lib/python/tempstorage/TemporaryStorage.py U Zope/trunk/lib/python/tempstorage/tests/testTemporaryStorage.py -=- Modified: Zope/trunk/lib/python/tempstorage/TemporaryStorage.py === --- Zope/trunk/lib/python/tempstorage/TemporaryStorage.py 2005-06-16 20:41:31 UTC (rev 30821) +++ Zope/trunk/lib/python/tempstorage/TemporaryStorage.py 2005-06-16 21:42:33 UTC (rev 30822) @@ -28,6 +28,7 @@ from ZODB.BaseStorage import BaseStorage from ZODB.ConflictResolution import ConflictResolvingStorage, ResolvedSerial import time +import bisect # keep old object revisions for CONFLICT_CACHE_MAXAGE seconds CONFLICT_CACHE_MAXAGE = 60 @@ -135,6 +136,31 @@ finally: self._lock_release() +def loadBefore(self, oid, tid): +Return most recent revision of oid before tid committed +(for MVCC) +. +# implementation stolen from ZODB.test_storage.MinimalMemoryStorage +self._lock_acquire() +try: +tids = [stid for soid, stid in self._conflict_cache if soid == oid] +if not tids: +raise KeyError, oid +tids.sort() +i = bisect.bisect_left(tids, tid) -1 +if i == -1: +return None +start_tid = tids[i] +j = i + 1 +if j == len(tids): +end_tid = None +else: +end_tid = tids[j] +data = self.loadSerial(oid, start_tid) +return data, start_tid, end_tid +finally: +self._lock_release() + def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) @@ -163,8 +189,6 @@ oserial = serial newserial=self._tid self._tmp.append((oid, data)) -now = time.time() -self._conflict_cache[(oid, newserial)] = data, now return serial == oserial and newserial or ResolvedSerial finally: self._lock_release() @@ -238,6 +262,8 @@ index[oid] = serial opickle[oid] = data +now = time.time() +self._conflict_cache[(oid, serial)] = data, now if zeros: for oid in zeros.keys(): Modified: Zope/trunk/lib/python/tempstorage/tests/testTemporaryStorage.py === --- Zope/trunk/lib/python/tempstorage/tests/testTemporaryStorage.py 2005-06-16 20:41:31 UTC (rev 30821) +++ Zope/trunk/lib/python/tempstorage/tests/testTemporaryStorage.py 2005-06-16 21:42:33 UTC (rev 30822) @@ -7,6 +7,11 @@ Synchronization, ConflictResolution, \ Corruption, RevisionStorage, MTStorage +from persistent import Persistent +import transaction +from ZODB.DB import DB +from ZODB.POSException import ReadConflictError + class TemporaryStorageTests( StorageTestBase.StorageTestBase, ##RevisionStorage.RevisionStorage, # not a revision storage, but passes @@ -49,6 +54,48 @@ TemporaryStorage.CONFLICT_CACHE_GCEVERY = old_gcevery TemporaryStorage.CONFLICT_CACHE_MAXAGE = old_maxage +def doreadconflict(self, db, mvcc): +tm1 = transaction.TransactionManager() +conn = db.open(mvcc=mvcc, transaction_manager=tm1) +r1 = conn.root() +obj = MinPO('root') +r1[p] = obj +obj = r1[p] +obj.child1 = MinPO('child1') +tm1.get().commit() + +# start a new transaction with a new connection +tm2 = transaction.TransactionManager() +cn2 = db.open(mvcc=mvcc, transaction_manager=tm2) +r2 = cn2.root() + +self.assertEqual(r1._p_serial, r2._p_serial) + +obj.child2 = MinPO('child2') +tm1.get().commit() + +# resume the transaction using cn2 +obj = r2[p] + +# An attempt to access obj.child1 should fail with an RCE +# below if conn isn't using mvcc, because r2 was read earlier +# in the transaction and obj was modified by the other +# transaction. + +obj.child1 +return obj + +def checkWithoutMVCCRaisesReadConflict(self): +db = DB(self._storage) +self.assertRaises(ReadConflictError, self.doreadconflict, db, False) + +def checkWithMVCCDoesntRaiseReadConflict(self): +db = DB(self._storage) +ob = self.doreadconflict(db, True) +self.assertEquals(ob.__class__, MinPO) +self.assertEquals(getattr(ob, 'child1', MinPO()).value, 'child1') +self.failIf(getattr(ob, 'child2', None)) + def test_suite(): suite
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/tempstorage/ Allow tempstorage to participate in MVCC. Also fix minor bug where conflict cache could be poisoned by a transaction that fa
Log message for revision 30823: Allow tempstorage to participate in MVCC. Also fix minor bug where conflict cache could be poisoned by a transaction that failed after store was called. Changed: U Zope/branches/Zope-2_8-branch/lib/python/tempstorage/TemporaryStorage.py U Zope/branches/Zope-2_8-branch/lib/python/tempstorage/tests/testTemporaryStorage.py -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/tempstorage/TemporaryStorage.py === --- Zope/branches/Zope-2_8-branch/lib/python/tempstorage/TemporaryStorage.py 2005-06-16 21:42:33 UTC (rev 30822) +++ Zope/branches/Zope-2_8-branch/lib/python/tempstorage/TemporaryStorage.py 2005-06-16 21:49:50 UTC (rev 30823) @@ -28,6 +28,7 @@ from ZODB.BaseStorage import BaseStorage from ZODB.ConflictResolution import ConflictResolvingStorage, ResolvedSerial import time +import bisect # keep old object revisions for CONFLICT_CACHE_MAXAGE seconds CONFLICT_CACHE_MAXAGE = 60 @@ -135,6 +136,31 @@ finally: self._lock_release() +def loadBefore(self, oid, tid): +Return most recent revision of oid before tid committed +(for MVCC) +. +# implementation stolen from ZODB.test_storage.MinimalMemoryStorage +self._lock_acquire() +try: +tids = [stid for soid, stid in self._conflict_cache if soid == oid] +if not tids: +raise KeyError, oid +tids.sort() +i = bisect.bisect_left(tids, tid) -1 +if i == -1: +return None +start_tid = tids[i] +j = i + 1 +if j == len(tids): +end_tid = None +else: +end_tid = tids[j] +data = self.loadSerial(oid, start_tid) +return data, start_tid, end_tid +finally: +self._lock_release() + def store(self, oid, serial, data, version, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) @@ -163,8 +189,6 @@ oserial = serial newserial=self._tid self._tmp.append((oid, data)) -now = time.time() -self._conflict_cache[(oid, newserial)] = data, now return serial == oserial and newserial or ResolvedSerial finally: self._lock_release() @@ -238,6 +262,8 @@ index[oid] = serial opickle[oid] = data +now = time.time() +self._conflict_cache[(oid, serial)] = data, now if zeros: for oid in zeros.keys(): Modified: Zope/branches/Zope-2_8-branch/lib/python/tempstorage/tests/testTemporaryStorage.py === --- Zope/branches/Zope-2_8-branch/lib/python/tempstorage/tests/testTemporaryStorage.py 2005-06-16 21:42:33 UTC (rev 30822) +++ Zope/branches/Zope-2_8-branch/lib/python/tempstorage/tests/testTemporaryStorage.py 2005-06-16 21:49:50 UTC (rev 30823) @@ -7,6 +7,11 @@ Synchronization, ConflictResolution, \ Corruption, RevisionStorage, MTStorage +from persistent import Persistent +import transaction +from ZODB.DB import DB +from ZODB.POSException import ReadConflictError + class TemporaryStorageTests( StorageTestBase.StorageTestBase, ##RevisionStorage.RevisionStorage, # not a revision storage, but passes @@ -49,6 +54,48 @@ TemporaryStorage.CONFLICT_CACHE_GCEVERY = old_gcevery TemporaryStorage.CONFLICT_CACHE_MAXAGE = old_maxage +def doreadconflict(self, db, mvcc): +tm1 = transaction.TransactionManager() +conn = db.open(mvcc=mvcc, transaction_manager=tm1) +r1 = conn.root() +obj = MinPO('root') +r1[p] = obj +obj = r1[p] +obj.child1 = MinPO('child1') +tm1.get().commit() + +# start a new transaction with a new connection +tm2 = transaction.TransactionManager() +cn2 = db.open(mvcc=mvcc, transaction_manager=tm2) +r2 = cn2.root() + +self.assertEqual(r1._p_serial, r2._p_serial) + +obj.child2 = MinPO('child2') +tm1.get().commit() + +# resume the transaction using cn2 +obj = r2[p] + +# An attempt to access obj.child1 should fail with an RCE +# below if conn isn't using mvcc, because r2 was read earlier +# in the transaction and obj was modified by the other +# transaction. + +obj.child1 +return obj + +def checkWithoutMVCCRaisesReadConflict(self): +db = DB(self._storage) +self.assertRaises(ReadConflictError, self.doreadconflict, db, False) + +def checkWithMVCCDoesntRaiseReadConflict(self): +db = DB(self._storage) +ob = self.doreadconflict(db, True) +self.assertEquals(ob.__class__, MinPO) +
[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
Log message for revision 30824: Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-06-16 21:49:50 UTC (rev 30823) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-06-16 21:51:34 UTC (rev 30824) @@ -30,6 +30,10 @@ removing the need for the VerboseSecurity product. See the documentation for the verbose-security option in zope.conf. + - TemporaryStorage (the storage that is used mainly to back the +default sessioning database) is now MVCC capable, which essentially +means that its usage will no longer generate ZODB ReadConflictErrors. + Bugs Fixed - Collector #1548: Fix 'httplib' usage in ZPublisher.Client. ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] Verbose security for Zope 2.8 or 2.9
Shane Hathaway [EMAIL PROTECTED] wrote: Florent Guillaume wrote: What is the dependency on the python implementation, is it just _embed_permission_in_roles ? Didn't you succeed in patching the C version too in some earlier versions of VerboseSecurity ? Currently, the C code makes no attempt to raise verbose errors. I've never patched the C code, although I doubt it would be very difficult. (Perhaps you're referring to previous monkey patches that replaced a method implemented in C with a Python version.) Yes that must have been that. Florent Anyone familiar with the security machinery is welcome to give it a shot. :-) -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ 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-dev] BTree vs dictionary
Now that I know how to use BTrees I grew fond of it and the features it offers. While the advantages of using BTrees are obvious when using it in a database context, I was wondering if it makes sense to use it instead of a dictionary routinely, just so I can take advantage of commands such as t(min=1, max=4). As I have no idea about the code that make the BTree tick, I was wondering: does anybody advise against it? Should I be extra careful about some things? Thanks for the help, Yair -- Yair Benita Utrecht University The Netherlands ___ 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-dev] BTree vs dictionary
--On 16. Juni 2005 17:32:15 +0200 Yair Benita [EMAIL PROTECTED] wrote: Now that I know how to use BTrees I grew fond of it and the features it offers. While the advantages of using BTrees are obvious when using it in a database context, I was wondering if it makes sense to use it instead of a dictionary routinely, just so I can take advantage of commands such as t(min=1, max=4). If you need BTree features then use BTrees. If you don't need any of them better use dictionaries. Dicts are somehwat faster than BTrees but BTrees should be used in any way when working with the ZODB. -aj pgpAgIHIR2IsH.pgp Description: PGP signature ___ 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-dev] BTree vs dictionary
[Yair Benita] Now that I know how to use BTrees I grew fond of it and the features it offers. Yup, they're very cool. While the advantages of using BTrees are obvious when using it in a database context, I was wondering if it makes sense to use it instead of a dictionary routinely, just so I can take advantage of commands such as t(min=1, max=4). As I have no idea about the code that make the BTree tick, I was wondering: does anybody advise against it? Should I be extra careful about some things? They're generally slower than dicts. Other than that, there are gotchas (surprises, pitfalls) in using BTrees, and in using dicts, but they're generally different gotchas. See the section on BTrees in the ZODB Programming Guide for some hideous details, section 5.3: http://www.zope.org/Wikis/ZODB/FrontPage/guide/index.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-dev] Nuxeo supports Zope Corp announces
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, Following the announces from Zope Corporation yesterday about their willingness to create a Zope Foundation (that would manage independently Zope 2 and Zope 3 projects) and to participate actively in the Z3ECM project, I would like to express briefly Nuxeo's position about all the news. First, we would like to thank Zope Corporation for Zope 2 and Zope 3 as Open Source software, they are amazing products ! For us as far as we know, the Zope Foundation is a really great news. This will probably solve the main issues we heard from people in the community and from some customers (brand and copyright security). It's really great news that Zope Corporation is now ready to go further on the community way and involvement. We are ready to help as much as needed in establishing the ZF as a vendor-neutral organisation with the mission to develop and promote a great technology (like the Apache or Eclipse Foundations). The Zope Foundation will, IOHO, a big step towards project 10X to establish Zope as a leading development platform for all kinds of web and internet applications. On the Z3ECM project, we are very glad that Zope Corporation wants to actively join the project ! We are certain that having ZC resources on this project will clearly help to build better products and solidify the platform. We will also support the move of the Z3ECM project to the ZF when the issues of copyright ownership will be discussed with the project stakeholders. It could definitely help unifying CMS zope community and will give more credibility to the platform from a customer point of view. We will also support the move of the Z3ECM project to the ZF when the issues of copyright ownership will be discussed with the project stakeholders In short, we are really happy and excited, and will definitely supports ZC to move forward on these topics with the other members of the Zope community. I'm pretty confident that the whole community will support this as well. Best regards, EB. - - -- ric Barroca, Tel: +33 6 21 74 77 64 (mobile). Nuxeo Collaborative Portal Server: http://www.nuxeo.com/cps Gestion de contenu web / portail collaboratif / groupware / open source! www.nuxeo.com - www.cps-project.org - www.indesko.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkKxrw4ACgkQz/zbrAllSZ5JPwCdF2kqwrOI4VvjltxaceblHypf vFgAnjuFiQj7qxA09GTmbr68Ntp7VNJq =IJAS -END PGP SIGNATURE- ___ 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-dev] Re: [Z3lab] Nuxeo supports Zope Corp announces
Eric Barroca wrote: Hello, Following the announces from Zope Corporation yesterday about their willingness to create a Zope Foundation (that would manage independently Zope 2 and Zope 3 projects) and to participate actively in the Z3ECM project, I would like to express briefly Nuxeo's position about all the news. First, we would like to thank Zope Corporation for Zope 2 and Zope 3 as Open Source software, they are amazing products ! For us as far as we know, the Zope Foundation is a really great news. This will probably solve the main issues we heard from people in the community and from some customers (brand and copyright security). It's really great news that Zope Corporation is now ready to go further on the community way and involvement. We are ready to help as much as needed in establishing the ZF as a vendor-neutral organisation with the mission to develop and promote a great technology (like the Apache or Eclipse Foundations). The Zope Foundation will, IOHO, a big step towards project 10X to establish Zope as a leading development platform for all kinds of web and internet applications. On the Z3ECM project, we are very glad that Zope Corporation wants to actively join the project ! We are certain that having ZC resources on this project will clearly help to build better products and solidify the platform. We will also support the move of the Z3ECM project to the ZF when the issues of copyright ownership will be discussed with the project stakeholders. It could definitely help unifying CMS zope community and will give more credibility to the platform from a customer point of view. We will also support the move of the Z3ECM project to the ZF when the issues of copyright ownership will be discussed with the project stakeholders In short, we are really happy and excited, and will definitely supports ZC to move forward on these topics with the other members of the Zope community. I'm pretty confident that the whole community will support this as well. Best regards, EB. -- ric Barroca, Tel: +33 6 21 74 77 64 (mobile). Nuxeo Collaborative Portal Server: http://www.nuxeo.com/cps Gestion de contenu web / portail collaboratif / groupware / open source! www.nuxeo.com - www.cps-project.org - www.indesko.com Hi! This is really great news! I am going to start working at getting Chalmers to be one of the key players in the foundation which would make the foundation even more vendor-neutral. I am confident that this will go through. regards /JM ___ 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] Pre-indexing filter and accented letters (mostly solved)
ZCTextindex to search and catalog accented words as non accented. - Step 1 Add to Lexicon.py (around line 190) this code, which filters the things in the pipeline: --- class RemoveAccented: def filter_word(self, w): filter the non ascii letters to ascii # trasformo la stringa w in unicode... parola = unicode(w,'latin-1') xlate={0xc0:'A', 0xc1:'A', 0xc2:'A', 0xc3:'A', 0xc4:'A', 0xc5:'A', 0xc6:'Ae', 0xc7:'C', 0xc8:'E', 0xc9:'E', 0xca:'E', 0xcb:'E', 0xcc:'I', 0xcd:'I', 0xce:'I', 0xcf:'I', 0xd0:'Th', 0xd1:'N', 0xd2:'O', 0xd3:'O', 0xd4:'O', 0xd5:'O', 0xd6:'O', 0xd8:'O', 0xd9:'U', 0xda:'U', 0xdb:'U', 0xdc:'U', 0xdd:'Y', 0xde:'th', 0xdf:'ss', 0xe0:'a', 0xe1:'a', 0xe2:'a', 0xe3:'a', 0xe4:'a', 0xe5:'a', 0xe6:'ae', 0xe7:'c', 0xe8:'e', 0xe9:'e', 0xea:'e', 0xeb:'e', 0xec:'i', 0xed:'i', 0xee:'i', 0xef:'i', 0xf0:'th', 0xf1:'n', 0xf2:'o', 0xf3:'o', 0xf4:'o', 0xf5:'o', 0xf6:'o', 0xf8:'o', 0xf9:'u', 0xfa:'u', 0xfb:'u', 0xfc:'u', 0xfd:'y', 0xfe:'th', 0xff:'y', 0xa1:'!', 0xa2:'{cent}', 0xa3:'{pound}', 0xa4:'{currency}', 0xa5:'{yen}', 0xa6:'|', 0xa7:'{section}', 0xa8:'{umlaut}', 0xa9:'{C}', 0xaa:'{^a}', 0xab:'', 0xac:'{not}', 0xad:'-', 0xae:'{R}', 0xaf:'_', 0xb0:'{degrees}', 0xb1:'{+/-}', 0xb2:'{^2}', 0xb3:'{^3}', 0xb4:', 0xb5:'{micro}', 0xb6:'{paragraph}', 0xb7:'*', 0xb8:'{cedilla}', 0xb9:'{^1}', 0xba:'{^o}', 0xbb:'', 0xbc:'{1/4}', 0xbd:'{1/2}', 0xbe:'{3/4}', 0xbf:'?', 0xd7:'*', 0xf7:'/' } r = '' for i in parola: if xlate.has_key(ord(i)): r += xlate[ord(i)] elif r += str(i) return r def process(self, lst): return [self.filter_word(w) for w in lst] element_factory.registerFactory('Remove Accented', 'Remove Accented', RemoveAccented) --- Step 2 Add the locale support for a latin-1 language, I added -L it_IT to zope start (in 2.7 you have to enable it in etc/zope.conf) Then you can search for aented and find accented ;-) ___ 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] Objects access
Yellow ppl, Is there a way to know how many times an object has been accessed during current Zope's uptime? Something like the activity tab in /Control_Panel/Database/main but specific to each object in ZODB. Regards -- Hugo Ramos - [EMAIL PROTECTED] ___ 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] Objects access
Am Donnerstag, den 16.06.2005, 11:24 +0100 schrieb Hugo Ramos: Yellow ppl, Is there a way to know how many times an object has been accessed during current Zope's uptime? Something like the activity tab in /Control_Panel/Database/main but specific to each object in ZODB. You can enable profiling (see ZMI in Control_Panel) (You need to create a file for the log in the filesystem, change config and restart zope) where you get refcounts on all object but it will also cause substantial slowdown. E.g. nothing you use in production environment. Next best be it to just analyze the logfiles, for example Z2.log - which gives you numbers based on URL (Not that in a publishing process not only the object on the specific URL is used but also a lot parent objects, user, etc. I guess it highly depends on what you really want to do. -- Tino Wildenhain [EMAIL PROTECTED] ___ 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] Objects access
Thanks Tino, Your answer really helped me. Basically I want to know what objects are accessed the most so that I can plan a cache strategy. This is also helpfull just to optimize the code in the objects that are used intensively. Also I can delete objects that are very old and not used anymore but in big web apps is dificult to maintain track of every tiny object that we don't use anymore. Regards Hugo On 6/16/05, Tino Wildenhain [EMAIL PROTECTED] wrote: Am Donnerstag, den 16.06.2005, 11:24 +0100 schrieb Hugo Ramos: Yellow ppl, Is there a way to know how many times an object has been accessed during current Zope's uptime? Something like the activity tab in /Control_Panel/Database/main but specific to each object in ZODB. You can enable profiling (see ZMI in Control_Panel) (You need to create a file for the log in the filesystem, change config and restart zope) where you get refcounts on all object but it will also cause substantial slowdown. E.g. nothing you use in production environment. Next best be it to just analyze the logfiles, for example Z2.log - which gives you numbers based on URL (Not that in a publishing process not only the object on the specific URL is used but also a lot parent objects, user, etc. I guess it highly depends on what you really want to do. -- Tino Wildenhain [EMAIL PROTECTED] -- Hugo Ramos - [EMAIL PROTECTED] ___ 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] Problems in file upload
Good morning, anyone ever had problems with the standard template file_edit_form Add new element - File? With some files (pdf) I obtain Document contains no data with Firefox, while Explorer gives me a blank page. I discovered it does NOT depends on file size (I uploaded without any problems a 5 MB file and I can't upload one of 1.6 MB). I never saw this problem on other sites I created with Plone, but only in this server. Nello. ___ 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: [Zope-Annce] [ANN] Zope 2.8.0 released
...and last but not leastvery special thanks to the incredible Jeremy Hylton for his tremendous work on MVCC. I hope this was the last one I forgot to mention :-) -aj --On 15. Juni 2005 15:28:08 +0200 Andreas Jung [EMAIL PROTECTED] wrote: Unfortunately I forgot to mention the whole Five team that contributed Five to Zope 2.8: Martijn Faassen, Sidnei da Silva, Philipp von Weitershausen, Lennart Regebro Forgetting to mention you was not intentional in any way...just the result of my bad memory...Sorry! pgpDBaOYtiboH.pgp Description: 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] Python Scripts
We have been seeing a number of instances where python scripts fail due to an apparent syntax error but the syntax is correct and simply storing the method restores it to functionality. Anyone else seeing this? -- Dennis Allison * Computer Systems Laboratory * Gates 227 * Stanford University * Stanford CA 94305 * (650) 723-9213 * (650) 723-0033 fax * [EMAIL PROTECTED] * [EMAIL PROTECTED] ___ 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] 3rd Party Search Engine
Hi, I'm in the process of integrating a 3rd party search engine with Zope and have a question about being able to make this work. I'd like to use the spidering capability of this search engine for it to build it's own index. What should the most ideal approach be? 1) Should I write an object in Zope that will interface between the search engine and the objects in Zope? For example, writing an object that uses a script that the search engine could call to Plone to return a list of objects of type 'documents' that were modified in a given range of time. 2) Should I write an object in Zope that will make calls to the Zcatalog to get back simliar results in 1)? I'm concerned about having to manage both the ZCatalog and the 3rd-party search engine's catalog. There may also be performance issues to consider. ___ 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] Problem with namespace
Ralph wrote at 2005-6-15 20:59 +0200: ... Method A in report1 is rendering B in util. B is rendering a ZSQL-object in sql and in the tag dtml-in is rendering C (python-method) in util, to render a table cell, but this isn't working, because E is unknown and I don't know why. Example: DTML-Method A: dtml-in sql.list_mytable prefix=pre dtml-var util.B(index=pre_index) I assume B is a DTML object... Then, you make one of the most frequent errors when dealing with DTML objects. They have 2 essential positional arguments. If you forget to pass them (usually as None, _), then the called DTML object gets a new empty namespace... For details, please the the Calling DTML objects section in http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html -- 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 )
[Zope] IE v. Firefox for viewing Zope sites
I've just put together a simple Zope website, but whilst it renders properly under Firefox, it looks dreadful using IE. Can anyone explain why? Could it be the CSS? -- John ___ 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] IE v. Firefox for viewing Zope sites
Can you show us? It'd be easier to tell you the problem... It could be the CSS, or it could be the HTML, particularly the DTD - IE renders pages differently depending on the validity of your DTD - a good DTD gets your page rendered in compliant mode, a bad one (or none...) gets your page rendered in quirks mode. Or it could be many other things. Send us a link ;-) Cheers, joe On 16 Jun 2005, at 19:15, John Poltorak wrote: I've just put together a simple Zope website, but whilst it renders properly under Firefox, it looks dreadful using IE. Can anyone explain why? Could it be the CSS? -- John ___ 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 ) ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com ___ 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] IE v. Firefox for viewing Zope sites
--On 16. Juni 2005 19:15:58 +0100 John Poltorak [EMAIL PROTECTED] wrote: I've just put together a simple Zope website, but whilst it renders properly under Firefox, it looks dreadful using IE. Can anyone explain why? Could it be the CSS? It could be your IE? It could be your HTML? It could be your CSS? -aj pgpevoKKzoUbA.pgp Description: 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] Python Scripts
We have been seeing a number of instances where python scripts fail due to an apparent syntax error but the syntax is correct and simply storing the method restores it to functionality. Anyone else seeing this? How do you mean fail? Often times, if you have an error, save, test, and then use the back button, you'll see the old syntax error, even though the contents are the new (and correct) version. If you just revisit the script (click on the id in the breadcrumbs) the message will go away. --jcc -- Building Websites with Plone http://plonebook.packtpub.com ___ 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] IE v. Firefox for viewing Zope sites
On 17/06/05, John Poltorak [EMAIL PROTECTED] wrote: I've just put together a simple Zope website, but whilst it renders properly under Firefox, it looks dreadful using IE. Can anyone explain why? Could it be the CSS? It could be your CSS, but it's probably IE. I usually end up writing two stylesheets, one for IE and one for everything else. Getting IE to read its on is just a case of using the IE-only conditional includes feature: !--[if IE] link href=/stylesheets/ie type=text/css rel=stylesheet / ![endif]-- though you'll have to hard code the URL - ZPT won't parse it ;) -- Phillip Hutchings http://www.sitharus.com/ [EMAIL PROTECTED] / [EMAIL PROTECTED] ___ 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] IE v. Firefox for viewing Zope sites
On Thu, Jun 16, 2005 at 08:30:15PM +0200, Andreas Jung wrote: --On 16. Juni 2005 19:15:58 +0100 John Poltorak [EMAIL PROTECTED] wrote: I've just put together a simple Zope website, but whilst it renders properly under Firefox, it looks dreadful using IE. Can anyone explain why? Could it be the CSS? It could be your IE? It could be your HTML? It could be your CSS? I was advised to change base href=/ / to base href=http://www.mysite.org/; / and that seemed to sort out most of the problems. Do I really need to hard code the site name like this, or is there some variable I can use? -aj -- John ___ 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] Newbie Questions - many-many relationships? Zope 2 or 3?
Database Question Hello, I'm a newbie, so this is a newbie question! I am currently preparing to build a web application for property lettings, and I'm very interested in what Zope has to offer. The application will need to recognise a number of different objects, such as houses, prospective tenants and property owners (the latter of which I may implement as user types, which would allow these people to log in and amend some of their own information.) I'm very interested in the Object Oriented way of doing things; for example, I'm thinking about implementing houses as a folder-ish object, so it would be able to contain photos of the house in question. The biggest stumbling block I am facing is how to do something Relational in an OO environment. Specifically, I've been scratching my head for a while about how to handle a many-many relationship: a property owner may own more than one house; conversely, a house may have more than one co-owner - consequently it's not appropriate to have either containing the other. I've googled for general information about handling many-many relationships in OO, and most of what I've come across has only indicated that it can be tricky! Having a look through past threads on this mailing list I've noticed a few references to mxmRelations (http://www.zope.org/Members/maxm/products/mxmRelations) which seems to match up - have I got the right end of the stick? Before I jump in with this I'd appreciate any advice or guidance you could provide - it'd be greatly appreciated. While I?m on, I?ve noticed that Zope 3 has been released. Is this now the recommended development environment, or am I better off sticking with Zope 2 for now, and porting my application once Zope 3 is a bit further down the line? I?d greatly appreciate any guidance that can be provided on these subjects. Thanks in advance, Jim ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com ___ 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: Newbie Questions - many-many relationships? Zope 2 or 3?
Jim Vine wrote: Having a look through past threads on this mailing list I've noticed a few references to mxmRelations (http://www.zope.org/Members/maxm/products/mxmRelations) which seems to match up - have I got the right end of the stick? Before I jump in with this I'd appreciate any advice or guidance you could provide - it'd be greatly appreciated. Use Plone and references instead ;-) -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science ___ 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] Newbie Questions - many-many relationships? Zope 2 or 3?
On 6/17/05, Jim Vine [EMAIL PROTECTED] wrote: I'm very interested in the Object Oriented way of doing things; for example, I'm thinking about implementing houses as a folder-ish object, so it would be able to contain photos of the house in question. The biggest stumbling block I am facing is how to do something Relational in an OO environment. Specifically, I've been scratching my head for a while about how to handle a many-many relationship: a property owner may own more than one house; conversely, a house may have more than one co-owner - consequently it's not appropriate to have either containing the other. I've googled for general information about handling many-many relationships in OO, and most of what I've come across has only indicated that it can be tricky! Nah. You either let every PropertyOwner have a list of the ids of HouseProperty objects, or the other way around. Then you index this is the catalog so you can search. Tada! Having a look through past threads on this mailing list I've noticed a few references to mxmRelations (http://www.zope.org/Members/maxm/products/mxmRelations) which seems to match up - have I got the right end of the stick? Relation products often are aimed at making arbitrary relations between different objects. it's cool, and useful. It may be overkill in this case, unless you want to for example have different types of owners. Then it fits perfectly. http://zemantic.org/ Is the relations tool that seems to emerge as the preferred one in the zope3 environment. While I'm on, I've noticed that Zope 3 has been released. Is this now the recommended development environment, or am I better off sticking with Zope 2 for now, and porting my application once Zope 3 is a bit further down the line? For applications development, zope3 is definitely recommended. Zope2 is only recommended if you you want to use a CMS application, like Plone, CPS, or something else. There isn't one for zope3 yet. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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] Newbie Questions - many-many relationships? Zope 2 or 3?
On 16.Jun 2005 - 23:17:43, Jim Vine wrote: Specifically, I've been scratching my head for a while about how to handle a many-many relationship: a property owner may own more than one house; conversely, a house may have more than one co-owner - consequently it's not appropriate to have either containing the other. I've googled for general information about handling many-many relationships in OO, and most of what I've come across has only indicated that it can be tricky! Hmm, what I would start with is an attribute for a house containing a list of references to owners. And vice versa, each owner has a list of references to houses. Now in Zope references could be implemented via storing the URL of the house and references to Users could be stored via the username (the one the user uses to log in). While I?m on, I?ve noticed that Zope 3 has been released. Is this now the recommended development environment, or am I better off sticking with Zope 2 for now, and porting my application once Zope 3 is a bit further down the line? Read the archive, short answer is: If you depend only on Zope, you don't want TTW and you want to write a file based product: Zope3 would be possible If you need some existing products or if you need TTW-Code, then you have to stick to Zope2 Andreas -- You're ugly and your mother dresses you funny. ___ 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] Python Scripts
Yeah, I do see that every once in a while. I have a very simple script, that looks perfect, but will always return syntax error. I copied the text, pasted into a text editor and checked all the indents and tabs, then recreated the script. Problem went away. What was interesting is that I didnt change the code. And even thought the indents were the same, re-adding them might have solved it. Dont know for sure, but I dont see this enough to cause me problems. Greg On 6/16/05, J Cameron Cooper [EMAIL PROTECTED] wrote: We have been seeing a number of instances where python scripts fail due to an apparent syntax error but the syntax is correct and simply storing the method restores it to functionality. Anyone else seeing this? How do you mean fail? Often times, if you have an error, save, test, and then use the back button, you'll see the old syntax error, even though the contents are the new (and correct) version. If you just revisit the script (click on the id in the breadcrumbs) the message will go away. --jcc -- Building Websites with Plone http://plonebook.packtpub.com ___ 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 ) -- Greg Fischer 1st Byte Solutions http://www.1stbyte.com ___ 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 )