Re: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)
On Thu, 14 Jun 2001, Chris McDonough wrote: Excellent! I haven't looked at it in detail, but thanks very much for contributing it! Maybe we can roll some of this work into a position-aware Text Index It is actually a TextIndex on steoroids. Remove the _proximity attribute and a couple of methods and what you are left with is a standard TextIndex. So I think what you already have is a position-aware TextIndex. That's how I'm planning to use it anyway :) or maybe even a new kind of Pluggable Index. :-) ___ 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] SearchIndex/ZCatalog comments.
When writing the PossitionIndex, a bunch of questions arrised (Zope 2.3.2): This is from UnTextIndex.py Zope 2.3.2 line 250 (or there abouts). Why is the wordMap needed? def getEntryForObject(self, rid, default=None): Get all information contained for a specific object. This takes the objects record ID as it's main argument. wordMap = self.getLexicon(self._lexicon)._lexicon.items() results = self._unindex.get(rid, None) if results is None: return default else: return tuple(map(self.getLexicon(self._lexicon).getWord, results)) I thought we didn't make it into a BTree 'till it was 5?: else: if indexRow.get(documentId, -1) != score: # score changed (or new entry) if type(indexRow) is DictType: indexRow[documentId] = score if len(indexRow) 3: # Big enough to give it's own database record indexRow=IIBTree(indexRow) index[entry] = indexRow else: indexRow[documentId] = score shouldn't objects be object?: def index_object(self, documentId, obj, threshold=None): Index an object: 'documentId' is the integer id of the document 'obj' is the objects to be indexed do we need this is ZCatalog.py?: from SearchIndex import UnIndex, UnTextIndex this isn't true? what about keywordindexes (only 'Field' and 'Text' mentioned)?: class ZCatalog(Folder, Persistent, Implicit): ZCatalog object A ZCatalog contains arbirary index like references to Zope objects. ZCatalog's can index either 'Field' values of object, or 'Text' values. do we need this in UnTextIndex.py?: from Splitter import Splitter from ResultList.py: def __or__(self, x): return self.__class__( weightedUnion(self._dict, x._dict)[1], union(self._words, x._words), self._index, ) return self.__class__(result, self._words+x._words, self._index) two returns? Sorry if this is all mambo-jambo, or if it is already fixed in 2.4. ___ 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] SearchIndex/ZCatalog comments.
Erik Enge wrote: When writing the PossitionIndex, a bunch of questions arrised (Zope 2.3.2): This is from UnTextIndex.py Zope 2.3.2 line 250 (or there abouts). Why is the wordMap needed? Doesn't look like it is. I removed this line in the trunk PluggableIndexes code. I thought we didn't make it into a BTree 'till it was 5?: I changed the comment (rather than the code) in the trunk. shouldn't objects be object?: Fixed in the trunk PluggableIndexes code. do we need this is ZCatalog.py?: from SearchIndex import UnIndex, UnTextIndex this isn't true? what about keywordindexes (only 'Field' and 'Text' mentioned)?: do we need this in UnTextIndex.py?: from Splitter import Splitter Pluggable indexes change this stuff significantly, so basically neither of these errors exists on the trunk in the Pluggable index code. from ResultList.py: def __or__(self, x): return self.__class__( weightedUnion(self._dict, x._dict)[1], union(self._words, x._words), self._index, ) return self.__class__(result, self._words+x._words, self._index) two returns? This is also fixed now. Sorry if this is all mambo-jambo, or if it is already fixed in 2.4. Many thanks! - C ___ 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] Where did DocumentTemplate/VSEval.py go in 2.4.0a1?
Morten W. Petersen wrote: one of my products landed flat on its face when an ImportError was raised trying to import VSEval from DocumentTemplate; is there a new class / function of some sort or simply another name for the class? See $ZOPE/lib/python/RestrictedPython. That replaces both DocumentTemplate's VSEval and PythonScripts' zbytecodehacks. It contains an Eval class that should be drop-in compatible with the old one. Cheers, Evan @ digicool ___ 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] Where did DocumentTemplate/VSEval.py go in 2.4.0a1?
On Fri, 15 Jun 2001, Evan Simpson wrote: Morten W. Petersen wrote: one of my products landed flat on its face when an ImportError was raised trying to import VSEval from DocumentTemplate; is there a new class / function of some sort or simply another name for the class? See $ZOPE/lib/python/RestrictedPython. That replaces both DocumentTemplate's VSEval and PythonScripts' zbytecodehacks. It contains an Eval class that should be drop-in compatible with the old one. Ok, (for future reference) replacing all the VSEval.Eval references with Eval.RestrictionCapableEval fixed it. Thanks Cheers, Morten ___ 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] zope t-shirts available!
for those who haven't noticed the little link on zope.org... digital creations is now selling a very stylish zope t-shirt! details and a picture are at: http://www.zope.org/Resources/Store melissa light ([EMAIL PROTECTED]) is available to answer any questions and take shirt orders. jens ___ 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] TypeError on FieldIndex
Hia guys, running the GUM product on a fresh BerkeleyDB based 2.4.0a1 instance on Linux raises the following issue for the field index type: Site Error An error was encountered while publishing this resource. Error Type: ('type', 0, type 'string', type 'int') Error Value: None Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: CatalogAware) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/App/special_dtml.py, line 127, in __call__ (Object: index_html) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/DocumentTemplate/DT_String.py, line 543, in __call__ (Object: index_html) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/DocumentTemplate/DT_In.py, line 681, in renderwob (Object: get_incoming_message_containers) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/GUM/gum.py, line 591, in get_incoming_message_containers (Object: CatalogAware) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/GUM/gum.py, line 858, in get_gum_message_containers (Object: CatalogAware) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/ZCatalog.py, line 582, in searchResults (Object: LockableItem) File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/Catalog.py, line 663, in searchResults File /home/morten/tmp/Zope-2.4.0a1-src/lib/python/Products/ZCatalog/Catalog.py, line 550, in _indexedSearch ('type', 0, type 'string', type 'int'): (see above) I added an extra try except block: if request.has_key(index.id) : try: if len(request[index.id])0: r=index._apply_index(request) except: raise str((index.id, request[index.id], type(index.id), type(request[index.id]))) The original exception was a TypeError, len() of unsized object. Cheers, Morten ___ 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: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)
On Thu, 14 Jun 2001, Erik Enge wrote: To be really useful I think the PossitionIndex' _proximity dictionary needs to be turned into a BTree of some sort, but apart from that I don't know what is missing. It's now using BTrees. And I renamed it to PositionIndex (thanks to Chris Withers for this :-). And speed might be a problem, haven't really tested that yet. Will during the weekend though. I indexed 30.000 objects using PositionIndex and searching (both exact-phrase and near) is very fast. It doesn't seem to be bloated, either (the _proximity-attribute, that is). Do you guys have a testing-suite for indexes? Maybe some I can apply to this index of mine? ___ 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: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexing revisited)
There is a *small* testsuite for testing TextIndex in Products/PluginIndexes/tests/testTextIndex.py Andreas - Original Message - From: Erik Enge [EMAIL PROTECTED] To: Chris McDonough [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 15, 2001 11:53 AM Subject: Re: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexing revisited) On Thu, 14 Jun 2001, Erik Enge wrote: To be really useful I think the PossitionIndex' _proximity dictionary needs to be turned into a BTree of some sort, but apart from that I don't know what is missing. It's now using BTrees. And I renamed it to PositionIndex (thanks to Chris Withers for this :-). And speed might be a problem, haven't really tested that yet. Will during the weekend though. I indexed 30.000 objects using PositionIndex and searching (both exact-phrase and near) is very fast. It doesn't seem to be bloated, either (the _proximity-attribute, that is). Do you guys have a testing-suite for indexes? Maybe some I can apply to this index of mine? ___ 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: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)
Erik, Once you're satisfied with the implementation, would you be willing submit the module to the collector? - C - Original Message - From: Erik Enge [EMAIL PROTECTED] To: Chris McDonough [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 15, 2001 11:53 AM Subject: Re: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited) On Thu, 14 Jun 2001, Erik Enge wrote: To be really useful I think the PossitionIndex' _proximity dictionary needs to be turned into a BTree of some sort, but apart from that I don't know what is missing. It's now using BTrees. And I renamed it to PositionIndex (thanks to Chris Withers for this :-). And speed might be a problem, haven't really tested that yet. Will during the weekend though. I indexed 30.000 objects using PositionIndex and searching (both exact-phrase and near) is very fast. It doesn't seem to be bloated, either (the _proximity-attribute, that is). Do you guys have a testing-suite for indexes? Maybe some I can apply to this index of mine? ___ 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] Where did DocumentTemplate/VSEval.py go in 2.4.0a1?
Should we make an alias for bw-compatability? -Michel On Fri, 15 Jun 2001, Evan Simpson wrote: Morten W. Petersen wrote: one of my products landed flat on its face when an ImportError was raised trying to import VSEval from DocumentTemplate; is there a new class / function of some sort or simply another name for the class? See $ZOPE/lib/python/RestrictedPython. That replaces both DocumentTemplate's VSEval and PythonScripts' zbytecodehacks. It contains an Eval class that should be drop-in compatible with the old one. Cheers, Evan @ digicool ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] security question
It seems to me that a User should not get to keep their roles in the acquired objects which are above the User Folder in which the user is defined... However, that does not seem to be true according my testing. This is what happens. Imagine a tree like this root-folder1-acl_users \folder2-object1 root has a role called 'User' with 'View' permissions (anonymous is disabled) and acl_users has a user called joe. joe can access objects in folder2 according to the permissions set on the root by using acquisition like this: http://server/folder1/folder2/object1 joe cannot however, access them directly: http://server/folder2/object1 Does this seem strange to anybody else, or have I just been working too long? _ Tim McLaughlin iterationZERO - www.iterationzero.com 703-481-2233 ___ 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] New Release of Zope Developer's Guide
I'm happy to announce a new release of the Zope Developer's Guide, available in HTML format here: http://www.zope.org/Documentation/ZDG/ The new guide contains many improvements and elaborations over the previous HTML release, and has benefited from the review and contributions from many community members including well-known object-orienteers Jim Fulton, Guido van Rossum and Bruce Eckel. This will be the last preview release of the Dev guide before we release the first edition alongside the release of Zope 2.4. As usual, any problems suggestions should be noted in the SourceForge tracker for the dev guide: http://sourceforge.net/projects/zope-devel/ Thanks! -Michel ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: [Zope] zope t-shirts available!
It would be great if someone going to the ZopeConference in Berlin, working at DC or living close to DC, could take a few t-shirts with him/her. If this would be possible, I would order a Zope and Python t-shirt directly. I'd pay the person in Berlin. This is much easier then sending a check across the ocean. Tom. - Original Message - From: Jens Vagelpohl [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 15, 2001 5:15 PM Subject: [Zope] zope t-shirts available! for those who haven't noticed the little link on zope.org... digital creations is now selling a very stylish zope t-shirt! details and a picture are at: http://www.zope.org/Resources/Store melissa light ([EMAIL PROTECTED]) is available to answer any questions and take shirt orders. jens ___ 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-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 )