From lists at andreas-jung.com Sun Apr 2 11:19:01 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sun Apr 2 11:19:37 2006 Subject: [z3-five] Calling a browser:page from a browser view Message-ID: <0086A86328E4245A32FC4789@[192.168.0.28]> For a Plone content-type I defined a browser view and some browser pages. Inside a method of the browser view I would like to call at PT configured as browser page using: return self.context.feedback_form(status=xxx, redirect=yyyy) However the 'feedback_form' raises an AttributeError...anything I am missing? Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060402/45d4ecb9/attachment.pgp From jhauser at zscout.de Sun Apr 2 12:48:47 2006 From: jhauser at zscout.de (Janko Hauser) Date: Sun Apr 2 12:48:52 2006 Subject: [z3-five] Re: Bug in eventconfigure in zope-2.8 In-Reply-To: <44281A98.8070103@nuxeo.com> References: <442173FE.2050308@palladion.com> <44218957.8030909@infrae.com> <44218A56.6080308@palladion.com> <4427E988.4070505@infrae.com> <4427EC95.4080704@weitershausen.de> <44281A98.8070103@nuxeo.com> Message-ID: <332BC3FA-6042-44B2-876F-AABD648BDB06@zscout.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 27.03.2006 um 19:02 schrieb Florent Guillaume: > Philipp von Weitershausen wrote: >> Martijn Faassen wrote: >>> Tres Seaver wrote: >>> [snip] >>>>> Instead you may just want to install Five 1.2 into Zope 2.8. It >>>>> might >>>>> have the fixes already (it at least has significant changes in >>>>> the event >>>>> story compared to Five 1.0). If the bug is still in Five 1.2, >>>>> then we >>>>> need to fix it and we could do another release. >>>> >>>> You're suggesting that Janko do that installation locally, >>>> rather than >>>> that we do that change in the Zope SVN, right? I don't think >>>> doing a >>>> major version change to the Five bundled with Zope 2.8 between >>>> 2.8.6 and >>>> 2.8.7 would fit the "maintenance only" policy for that branch. >>>> >>> My suggestion was for a local instal only. I now saw a suggestion by >>> Philipp on zope-dev to do this for Zope proper. >> For the record, it was Andreas's suggestion... >>> That's indeed completely going to destroy the maintenance-only >>> policy >>> for that branch. On the other hand, I imagine many developers >>> install >>> Five 1.2 on top of that anyway. Actually I'm not sure that the event stuff from 1.2 works without the corresponding changes in ObjectManager, but I have not tried it. >> Yup. >> Janko fixed one of his two problems for 1.0.3 (which hasn't been >> included into the Zope 2.8 branch due to the discussion whether >> Five 1.2 >> should be included instead). The other one he described to me >> briefly on >> IRC, but it was beyond my understanding of Five's event stuff. I >> suggest >> he described it here and CCs Florent so that we can solve whatever >> problem might exist. With a recent install of Zope-2.8.6 I can not reproduce the error, but I will describe it here for the record. The original code in eventconfigure is: 49 def manage_afterAdd(self, item, container): 50 original_location_path = getattr(self, '__five_location_path__', None) 51 self.__five_location_path__ = self.getPhysicalPath() 52 # if there still is an object in the original location, we're copied 53 # we cannot rely on manage_afterClone, as this gets triggered only 54 # *after* a manage_afterAdd. This logic might fail in the case where 55 # something *is* somehow left in the original location that can 56 # be traversed to. 57 is_copied = original_location_path and (self.unrestrictedTraverse( 58 original_location_path, None) is not None) 59 if is_copied: 60 notify(ObjectCopiedEvent(self)) 61 if original_location_path is None or is_copied: 62 notify(ObjectAddedEvent(self)) 63 else: 64 original_location = self.unrestrictedTraverse( 65 original_location_path[:-1]) 66 notify(ObjectMovedEvent(self, 67 original_location, original_location_path[-1 ], 68 container, self.id)) 69 # call original 70 method = getattr(self, '__five_original_manage_afterAdd', None) 71 if method is not None: 72 self.__five_original_manage_afterAdd(item, container) To handle copy and paste in our case I needed to change line 65 to original_location_path[:-1], None) Looking at the implementation of unrestrictedTraverse the "None" is used instead of a marker _marker=object(). But I find an interface definition in Five where default is "None". The error which sometimes occured looked like this traceback: Traceback (most recent call last): File "/opt/zope-2.8.6/lib/python/ZPublisher/Publish.py", line 114, in publish request, bind=1) File "/opt/zope-2.8.6/lib/python/ZPublisher/mapply.py", line 88, in mapply if debug is not None: return debug(object,args,context) File "/opt/zope-2.8.6/lib/python/ZPublisher/Publish.py", line 40, in call_object result=apply(object,args) # Type s to step into published object. File "/home/union/dgb/Products/uccore/core/ucbaseview.py", line 65, in before_action_hook File "/home/union/dgb/Products/uccore/composer2/ folder_editing.py", line 44, in rename File "/opt/zope-2.8.6/lib/python/OFS/CopySupport.py", line 253, in manage_renameObjects self.manage_renameObject(ids[i], new_ids[i], REQUEST) File "/home/union/dgb/Products/orderedbtreefolder/ orderedbtreefolder.py", line 184, in manage_renameObject File "/opt/zope-2.8.6/lib/python/OFS/CopySupport.py", line 282, in manage_renameObject self._setObject(new_id, ob, set_owner=0) File "/opt/zope-2.8.6/lib/python/Products/BTreeFolder2/ BTreeFolder2.py", line 431, in _setObject object.manage_afterAdd(object, self) File "/opt/zope-2.8.6/lib/python/Products/Five/eventconfigure.py", line 72, in manage_afterAdd self.__five_original_manage_afterAdd(item, container) File "/home/union/dgb/Products/CMFCore/CMFCatalogAware.py", line 148, in manage_afterAdd File "/home/union/dgb/Products/CMFCore/CMFCatalogAware.py", line 177, in __recurse File "/opt/zope-2.8.6/lib/python/Products/Five/ eventconfigure.py", line 64, in manage_afterAdd original_location = self.unrestrictedTraverse( File "/opt/zope-2.8.6/lib/python/OFS/Traversable.py", line 182, in unrestrictedTraverse next = bobo_traverse(REQUEST, name) File "/opt/zope-2.8.6/lib/python/Products/Five/traversable.py", line 85, in __bobo_traverse__ return self.__fallback_traverse__(REQUEST, name) File "/opt/zope-2.8.6/lib/python/Products/Five/traversable.py", line 55, in __fallback_traverse__ raise AttributeError, name AttributeError: copy_of_projektplanung I'm not sure, if the change should actually be applied. If Florent or someone else has a possible explanation for this, I think I could add it, as it seems to have a low possibilty to break something and the code never worked before, because of the other fix. Sorry to be not of more help, __Janko Hauser -----BEGIN PGP SIGNATURE----- iD8DBQFEL6wVe7bTUi4B2KARAmM1AJ4sjWiTFoq5GC5uxZeBQVvOzHqnawCeO5Or cEeDMCLFO9PMLr5sCV98J5A= =FZF5 -----END PGP SIGNATURE----- From zope-mailinglist at mopa.at Sun Apr 2 14:21:18 2006 From: zope-mailinglist at mopa.at (Bernd Dorn) Date: Sun Apr 2 14:21:51 2006 Subject: [z3-five] Calling a browser:page from a browser view In-Reply-To: <0086A86328E4245A32FC4789@[192.168.0.28]> References: <0086A86328E4245A32FC4789@[192.168.0.28]> Message-ID: <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> On 02.04.2006, at 11:19, Andreas Jung wrote: > For a Plone content-type I defined a browser view and some browser > pages. > Inside a method of the browser view I would like to call at PT > configured > as browser page using: > > return self.context.feedback_form(status=xxx, redirect=yyyy) a browser pagee is a multiadapter, so you have lookup it as such view = zope.component.getMultiAdapter((self.context, self.request), name='feedback_form') return view(status=xxx,redirect=yyy) > > However the 'feedback_form' raises an AttributeError...anything I > am missing? > > Andreas_______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five From lists at andreas-jung.com Sun Apr 2 14:54:33 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sun Apr 2 14:55:14 2006 Subject: [z3-five] Calling a browser:page from a browser view In-Reply-To: <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> References: <0086A86328E4245A32FC4789@[192.168.0.28]> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> Message-ID: <775858B90B96274663627498@[192.168.0.28]> --On 2. April 2006 14:21:18 +0200 Bernd Dorn wrote: > On 02.04.2006, at 11:19, Andreas Jung wrote: > >> For a Plone content-type I defined a browser view and some browser >> pages. >> Inside a method of the browser view I would like to call at PT >> configured >> as browser page using: >> >> return self.context.feedback_form(status=xxx, redirect=yyyy) > > a browser pagee is a multiadapter, so you have lookup it as such > > view = zope.component.getMultiAdapter((self.context, self.request), > name='feedback_form') > > return view(status=xxx,redirect=yyy) This does not work. getMultiAdapter() also need the interface as second argument. But this also won't work. However you pointed me into the right direction. zapi.getView(self.context, 'feedback_form', self.request) did the job. -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060402/5078c6e5/attachment.pgp From zope-mailinglist at mopa.at Sun Apr 2 15:25:46 2006 From: zope-mailinglist at mopa.at (Bernd Dorn) Date: Sun Apr 2 15:26:21 2006 Subject: [z3-five] Calling a browser:page from a browser view In-Reply-To: <775858B90B96274663627498@[192.168.0.28]> References: <0086A86328E4245A32FC4789@[192.168.0.28]> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> <775858B90B96274663627498@[192.168.0.28]> Message-ID: >> >> return view(status=xxx,redirect=yyy) > > This does not work. getMultiAdapter() also need the interface as > second argument. hm, that's odd, the interface defaults to Interface i use this in my zope3 tests all the time, maybe a version difference btw: getView is deprecated, at least on the zope3 trunk getView does exactly the same, but maybe the request in five is not the same as in zope3, and there is a special implementation From apm13 at columbia.edu Sun Apr 2 16:40:54 2006 From: apm13 at columbia.edu (Alec Mitchell) Date: Sun Apr 2 16:41:24 2006 Subject: [z3-five] Calling a browser:page from a browser view In-Reply-To: <775858B90B96274663627498@192.168.0.28> References: <0086A86328E4245A32FC4789@192.168.0.28> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> <775858B90B96274663627498@192.168.0.28> Message-ID: <365118370604020740l2dfc2c85r416ce146d4343468@mail.gmail.com> On 4/2/06, Andreas Jung wrote: > --On 2. April 2006 14:21:18 +0200 Bernd Dorn > wrote: > > > On 02.04.2006, at 11:19, Andreas Jung wrote: > > > >> For a Plone content-type I defined a browser view and some browser > >> pages. > >> Inside a method of the browser view I would like to call at PT > >> configured > >> as browser page using: > >> > >> return self.context.feedback_form(status=xxx, redirect=yyyy) > > > > a browser pagee is a multiadapter, so you have lookup it as such > > > > view = zope.component.getMultiAdapter((self.context, self.request), > > name='feedback_form') > > > > return view(status=xxx,redirect=yyy) > > This does not work. getMultiAdapter() also need the interface as second > argument. But this also won't work. However you pointed me into the right > direction. > > zapi.getView(self.context, 'feedback_form', self.request) zapi.getView() is deprecated, but it is your only option in Zope 2.8 (unless you are using Plone 2.5, in which case a small BBB patch has been applied to Zope 2.8 to give it a getMultiAdapter which is capable of looking up views). Under zope 2.9+, you can and should use getMultiAdapter((obj, request), name='feedback_form') to lookup views. Alec From y.2006_ at wcm-solutions.de Sun Apr 2 23:17:30 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sun Apr 2 23:19:36 2006 Subject: [z3-five] Re: How do deal with cmfcatalog-wrapped objects? In-Reply-To: <442D1C8E.6090708@weitershausen.de> References: <077EB1327A38A7F3B8D7B12C@suxmac.local> <442CFAB8.9020102@wcm-solutions.de> <442D1C8E.6090708@weitershausen.de> Message-ID: <44303F6A.5000307@wcm-solutions.de> Hi Philipp! Philipp von Weitershausen wrote: > yuppie wrote: >> >> The quick and dirty solution would be to remove the interface >> declaration from the wrapper. The clean solution would be to make sure >> that all the interfaces that are actually provided - the wrapper >> interface *and* the interfaces of the wrapped object - can be looked up. >> But implementing that seems to require deeper knowledge of the interface >> machinery than I have. > > This problem has already been solved in Zope 3. There we like to wrap > objects that don't provide ILocation (__parent__ and __name__ > attributes) in something that *does* provide ILocation. The resulting > object is a proxy for the original object and in addition that it > provides __parent__ and __name__ attributes. The proxy provides whatever > the original object provides plus ILocation. > > We call this concept a /decorator/. This is not to be confused with > Python 2.4's function decorators. In Zope 3's case, think of decorator > as a proxy that also adds stuff to the object (e.g. the ILocation API). > Hence, it decorates the original object, like a Christmas tree if you will. Great! Good to know. > There are two options: > > 1. I think for the long term, IndexableObjectWrapper could be made a > decorator. This works as follows: > > from zope.proxy import getProxiedObject > from zope.app.decorator import Decorator > > class IndexableObjectWrapper(Decorator): > > def allowedRolesAndUsers(self): > ob = getProxiedObject(self) > allowed = {} > for r in rolesForPermissionOn(View, ob): > allowed[r] = 1 > localroles = _mergedLocalRoles(ob) > for user, roles in localroles.items(): > for role in roles: > if allowed.has_key(role): > allowed['user:' + user] = 1 > if allowed.has_key('Owner'): > del allowed['Owner'] > return list(allowed.keys()) Why is this your preferred long term option? IndexableObjectWrapper does a lot of special stuff. It doesn't just proxy to an object and add a new method. It also allows to pass in a list of vars that are looked up first by __getattr__. To get this working I did have to provide __new__, __init__ and __getattr__ as well. So the base class doesn't make the code much simpler. > 2. In the short term we can apply the following trick > (IndexableObjectWrapper needs to be a new style class!): > > from zope.interface import providedBy > from zope.interface.declarations import ObjectSpecificationDescriptor > from zope.interface.declarations import getObjectSpecification > from zope.interface.declarations import ObjectSpecification > > class IndexableObjectSpecification(ObjectSpecificationDescriptor): > > def __get__(self, inst, cls=None): > if inst is None: > return getObjectSpecification(cls) > else: > provided = providedBy(inst.__ob) > cls = type(inst) > return ObjectSpecification(provided, cls) > > class IndexableObjectWrapper(object): # new-style! > implements(...) # it can implement as much as it wants > __providedBy__ = IndexableObjectSpecification() > > ... > > This is obviously untested, but I'm pretty confident that this would work. Yeah, works with a small modification: '__ob' has double leading underscores, so I did have to use '_IndexableObjectWrapper__ob' instead. And switching to a new style class has a side effect: 'object' has some attributes that now mask the attributes of the wrapped object. AFAICS this is only a problem with '__str__' that is the default method for getting the binary data of a file object. I checked in a fix using the second option. Cheers, Yuppie From philipp at weitershausen.de Sun Apr 2 23:22:32 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sun Apr 2 23:20:37 2006 Subject: [z3-five] Re: Calling a browser:page from a browser view In-Reply-To: <365118370604020740l2dfc2c85r416ce146d4343468@mail.gmail.com> References: <0086A86328E4245A32FC4789@192.168.0.28> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> <775858B90B96274663627498@192.168.0.28> <365118370604020740l2dfc2c85r416ce146d4343468@mail.gmail.com> Message-ID: <44304098.2060900@weitershausen.de> Alec Mitchell wrote: > On 4/2/06, Andreas Jung wrote: >> --On 2. April 2006 14:21:18 +0200 Bernd Dorn >> wrote: >> >>> On 02.04.2006, at 11:19, Andreas Jung wrote: >>> >>>> For a Plone content-type I defined a browser view and some browser >>>> pages. >>>> Inside a method of the browser view I would like to call at PT >>>> configured >>>> as browser page using: >>>> >>>> return self.context.feedback_form(status=xxx, redirect=yyyy) >>> a browser pagee is a multiadapter, so you have lookup it as such >>> >>> view = zope.component.getMultiAdapter((self.context, self.request), >>> name='feedback_form') >>> >>> return view(status=xxx,redirect=yyy) >> This does not work. getMultiAdapter() also need the interface as second >> argument. But this also won't work. However you pointed me into the right >> direction. >> >> zapi.getView(self.context, 'feedback_form', self.request) > > zapi.getView() is deprecated, but it is your only option in Zope 2.8 > (unless you are using Plone 2.5, in which case a small BBB patch has > been applied to Zope 2.8 to give it a getMultiAdapter which is capable > of looking up views). Under zope 2.9+, you can and should use > getMultiAdapter((obj, request), name='feedback_form') to lookup views. Yes. Also, make sure the view has a proper Acquisition context: view = zope.component.getWhatever(...) view = view.__of__(context) return view() Philipp P.S.: Please stop using zapi. It's stupid, it sucks and it'll be gone soon. From apm13 at columbia.edu Mon Apr 3 00:19:05 2006 From: apm13 at columbia.edu (Alec Mitchell) Date: Mon Apr 3 00:19:35 2006 Subject: [z3-five] Re: Calling a browser:page from a browser view In-Reply-To: <44304098.2060900@weitershausen.de> References: <0086A86328E4245A32FC4789@192.168.0.28> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> <775858B90B96274663627498@192.168.0.28> <365118370604020740l2dfc2c85r416ce146d4343468@mail.gmail.com> <44304098.2060900@weitershausen.de> Message-ID: <365118370604021519u66d25f33g6101b791d2c5ab69@mail.gmail.com> On 4/2/06, Philipp von Weitershausen wrote: .... > P.S.: Please stop using zapi. It's stupid, it sucks and it'll be gone soon. I no longer use it, but I suspect that the reason so many do is because of your very compelling book: "Using zapi not only shortens the list of long imports in Zope code. It also usually makes code easier to read." ;-) Alec From fairwinds at eastlink.ca Mon Apr 3 02:26:40 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Mon Apr 3 02:27:15 2006 Subject: [z3-five] SqlAlchemy thru Five Message-ID: <44306BC0.2060801@eastlink.ca> Hi. I have seen very little in the way of SqlAlchemy through Z3 or Five. Has anyone been working/experimenting with this that can provide some feedback, experiences or whether there is anything ZPL that is in the hopper that may be available in the future. It would be quite excellent to get away from zsql and work with this excellent ORM. Many thanks. Regards, David From lists at andreas-jung.com Mon Apr 3 06:31:09 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Mon Apr 3 06:31:44 2006 Subject: [z3-five] Re: Calling a browser:page from a browser view In-Reply-To: <365118370604021519u66d25f33g6101b791d2c5ab69@mail.gmail.com> References: <0086A86328E4245A32FC4789@192.168.0.28> <248A0903-63EE-4454-B909-6207CC3E2A96@mopa.at> <775858B90B96274663627498@192.168.0.28> <365118370604020740l2dfc2c85r416ce146d4343468@mail.gmail.com> <44304098.2060900@weitershausen.de> <365118370604021519u66d25f33g6101b791d2c5ab69@mail.gmail.com> Message-ID: <780D951600E68D32221EBFDA@[192.168.0.28]> --On 2. April 2006 15:19:05 -0700 Alec Mitchell wrote: > On 4/2/06, Philipp von Weitershausen wrote: > .... >> P.S.: Please stop using zapi. It's stupid, it sucks and it'll be gone >> soon. > > I no longer use it, but I suspect that the reason so many do is > because of your very compelling book: > > "Using zapi not only shortens the list of long imports in Zope code. > It also usually makes code easier to read." > Yeah, I took it from Philipp's book...maybe it would be time to burn it :-) -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060403/56dfc184/attachment.pgp From jinty at web.de Mon Apr 3 12:09:03 2006 From: jinty at web.de (Brian Sutherland) Date: Mon Apr 3 12:08:38 2006 Subject: [z3-five] SqlAlchemy thru Five In-Reply-To: <44306BC0.2060801@eastlink.ca> References: <44306BC0.2060801@eastlink.ca> Message-ID: <20060403100903.GB7346@minipas.home> On Sun, Apr 02, 2006 at 09:26:40PM -0300, David Pratt wrote: > Hi. I have seen very little in the way of SqlAlchemy through Z3 or Five. > Has anyone been working/experimenting with this that can provide some > feedback, experiences or whether there is anything ZPL that is in the > hopper that may be available in the future. It would be quite excellent > to get away from zsql and work with this excellent ORM. Many thanks. Hoi David, So I see you've moved away from SQLOS and SQLObject to SQLAlcehemy, mind giving us some feedback or experiences? Looking at the SQLAlchemy docs I guess you can use large pieces of SQLOS for this integration. At a minimum you would want to integrate the SQLAlchemy transaction and connection management. It might integrate easier with Zope2 as the object from the ORM is not a meta-class (as is the case with SQLObject). Though I have difficulty seeing how you would organise a Two Phase Commit with the interface that is shown in the docs. However, I don't think this is really a Five subject and perhaps is better discussed somewhere else. -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From fairwinds at eastlink.ca Mon Apr 3 17:14:46 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Mon Apr 3 17:15:22 2006 Subject: [z3-five] SqlAlchemy thru Five In-Reply-To: <20060403100903.GB7346@minipas.home> References: <44306BC0.2060801@eastlink.ca> <20060403100903.GB7346@minipas.home> Message-ID: <44313BE6.3050007@eastlink.ca> Hi Brian. This is something I have been considering for a few reasons. It is sort of on the drawing board at the moment. I have been working with a few ORM's including Django's as well. SQLAlchemy has some really nice features and I believe is the richer ORM. SQLObject is also going through reorganization as you are probably aware. This is not a bad thing but it will be different regardless so I believe now is the time. Licensing for SQLAlchemy is MIT which I also consider to be a benefit. I have also made the observation that much of SQLOS could likely be used in this integration and the whole so it will all be ZPL. My goal is to arrive at a better approach for sql in Five since the Zope3ECM will come incrementally through components in Z2 until it is all Z3. This gives me reason to believe that we could all benefit from a better sql solution sooner than later (but work from the Z3 end since all will be moving in this direction). Most of the work I am doing is CMF so CMF2 factors into things in the forseeable future. I am wanting to get things started if there is no one working on such an animal. I know you have had success with Five integration with your branch and hoping to follow your model and maintain our contact. Regards, David Brian Sutherland wrote: > On Sun, Apr 02, 2006 at 09:26:40PM -0300, David Pratt wrote: > >>Hi. I have seen very little in the way of SqlAlchemy through Z3 or Five. >>Has anyone been working/experimenting with this that can provide some >>feedback, experiences or whether there is anything ZPL that is in the >>hopper that may be available in the future. It would be quite excellent >>to get away from zsql and work with this excellent ORM. Many thanks. > > > Hoi David, > > So I see you've moved away from SQLOS and SQLObject to SQLAlcehemy, mind > giving us some feedback or experiences? > > Looking at the SQLAlchemy docs I guess you can use large pieces of SQLOS > for this integration. At a minimum you would want to integrate the > SQLAlchemy transaction and connection management. > > It might integrate easier with Zope2 as the object from the ORM is not a > meta-class (as is the case with SQLObject). Though I have difficulty > seeing how you would organise a Two Phase Commit with the interface that > is shown in the docs. > > However, I don't think this is really a Five subject and perhaps is > better discussed somewhere else. > From jbb at contradix.com Tue Apr 4 20:42:13 2006 From: jbb at contradix.com (Jordan Baker) Date: Tue Apr 4 20:42:57 2006 Subject: [z3-five] traversal bug with OFS.Application.Application Message-ID: <200604041442.14175.jbb@contradix.com> After upgrading to Zope 2.9.2 from 2.9.0 I found that one my applications wasn't working anymore. It depended on being able to bind a page template to OFS.Application.Application and through some examination I found a small bug in the traversal fallback changes that were made recently. It basically boils down to OFS.Application.Application's __bobo_traverse__ raises NotFound when there is a valid REQUEST. I've attached a unit test that demonstrates the problem and also the small patch which fixes it. PS. There are two questions I had for more experienced testers on this list: 1. Why does http() return 404 but then actually return the correct content in the test case I added? 2. Why must I use zope2.View instead of zope2.Public. If I use zope2.Public I get authentication errors? -- Jordan Baker (jbb@contradix.com) =================================================================== Index: browser/tests/test_traversable.py =================================================================== --- browser/tests/test_traversable.py (revision 66357) +++ browser/tests/test_traversable.py (working copy) @@ -258,7 +258,46 @@ >>> tearDown() """ +def test_traverse_ofs_application(): + """ + Test for Five fallback when traversing OFS.Application.Application. + In Zope 2.9.2 OFS.Application.Application.__bobo_traverse__ raises NotFound when it has a REQUEST and so its impossible to use Five traversal with it. + Set up: + + + >>> from zope.app.testing.placelesssetup import setUp, tearDown + >>> setUp() + + >>> configure_zcml = ''' + ... + ... + ... + ... ''' + + >>> import Products.Five + >>> from Products.Five import zcml + >>> zcml.load_config('configure.zcml', Products.Five) + >>> zcml.load_string(configure_zcml) + + >>> print http(r''' + ... GET /hello.html HTTP/1.1 + ... + ... ''') + HTTP/1.1 404 Not Found + Content-Length: 35 + Content-Type: text/html; charset=iso-8859-15 + +

The falcon has taken flight

+ + + Clean up: + + >>> tearDown() + """ + def test_suite(): from Testing.ZopeTestCase import FunctionalDocTestSuite return FunctionalDocTestSuite() Index: traversable.py =================================================================== --- traversable.py (revision 66357) +++ traversable.py (working copy) @@ -61,7 +61,7 @@ if hasattr(self, '__fallback_traverse__'): try: return self.__fallback_traverse__(REQUEST, name) - except (AttributeError, KeyError): + except (NotFound, AttributeError, KeyError): pass else: try: From regebro at gmail.com Wed Apr 5 17:52:04 2006 From: regebro at gmail.com (Lennart Regebro) Date: Wed Apr 5 17:52:34 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: Message-ID: <319e029f0604050852q3d9be7c9t4d2b55524cb37f0b@mail.gmail.com> On 4/5/06, Philipp von Weitershausen wrote: > I would like to know what other zope.app packages your 3rd party > software is using. Well, CMFonFive uses zope.app.publisher.browser, because that's where the menus hang. CPS uses zope.app.container for the container events and the IAdding interface all over the place. CPSMailAccess uses zope.app.cache, zope.app.dublincore, zope.app.copypastemove, and of course zope.app.mail. (And also zope.app.pagetemplate and zope.app.publisher.browser.BrowserView but I suspect those are special hacks or something, that may be avoidable now, Tarek might know more.) And we use zope.app.testing a lot, which you suggested not to move if I understand you correctly. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From pw_lists at slinkp.com Wed Apr 5 18:52:40 2006 From: pw_lists at slinkp.com (Paul Winkler) Date: Wed Apr 5 18:53:26 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: Message-ID: <20060405165240.GA11624@slinkp.com> On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: > I would like to know what other zope.app packages your 3rd party > software is using. If thereare any other used than the ones mentioned in > the proposal, we'll have to move them out of zope.app. I'd like to ask > for your help on that, otherwise future Zope 2 versions might not > anymore include the package you're using. Aside from stuff mentioned on your proposal, we are using macros from zope.app.rotterdam.standardmacros. -- Paul Winkler http://www.slinkp.com From regebro at gmail.com Wed Apr 5 19:35:08 2006 From: regebro at gmail.com (Lennart Regebro) Date: Wed Apr 5 19:35:40 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <319e029f0604050852q3d9be7c9t4d2b55524cb37f0b@mail.gmail.com> References: <319e029f0604050852q3d9be7c9t4d2b55524cb37f0b@mail.gmail.com> Message-ID: <319e029f0604051035o6d336b0dl8a88e63c6a875f79@mail.gmail.com> On 4/5/06, Lennart Regebro wrote: > CPSMailAccess uses zope.app.cache, zope.app.dublincore, > zope.app.copypastemove, and of course zope.app.mail. > (And also zope.app.pagetemplate and > zope.app.publisher.browser.BrowserView but I suspect those are special > hacks or something, that may be avoidable now, Tarek might know more.) On an unrelated note, I would like to point out how cool it is that the CPSMailAccess uses so many parts of Zope3 in Zope2, and how well it works. The calendar uses almost nothing of zope.app directly, although it's a heavy user of Five integrational stuff. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From philipp at weitershausen.de Wed Apr 5 19:39:45 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed Apr 5 19:37:49 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <319e029f0604050852q3d9be7c9t4d2b55524cb37f0b@mail.gmail.com> References: <319e029f0604050852q3d9be7c9t4d2b55524cb37f0b@mail.gmail.com> Message-ID: <443400E1.6000209@weitershausen.de> Lennart Regebro wrote: > On 4/5/06, Philipp von Weitershausen wrote: >> I would like to know what other zope.app packages your 3rd party >> software is using. > > Well, CMFonFive uses zope.app.publisher.browser, because that's where > the menus hang. Menu support will be moved to zope.menu. > CPS uses zope.app.container for the container events and the IAdding > interface all over the place. Container support will be moved to zope.container once I figure out how to sanely deal with existing pickles. Is anyone in Zope 2 persisting zope.app.container.btree.BTreeContainer, zope.app.container.ordered.OrderedContainern or using the contained proxy (which is also persistent)? > CPSMailAccess uses zope.app.cache, zope.app.dublincore, > zope.app.copypastemove, and of course zope.app.mail. I've added these four to my list. They'll appear in an updated version of the proposal. I propose to move them all down to zope.* as they are (zope.app.mail should probably be called zope.sendmail). They're all not very complicated cases except zope.app.cache which has zope.app.form dependencies. I'd be glad if you could help me with moving them. I'm working on the jim-adapter branch. Straight moves usually just entail 1. svn mv'ing the directory 2. fixing up imports inside and outside the package 3. running the tests 3. providing BBB (I'm still figuring out a good way to do this w/o getting in circular import troubles) > (And also zope.app.pagetemplate and > zope.app.publisher.browser.BrowserView but I suspect those are special > hacks or something, that may be avoidable now, Tarek might know more.) BrowserView will move to zope.publisher.browser. I haven't really made up my mind about zope.app.pagetemplate yet. Some use cases might be helpful. I'm also very much open for suggestions and, of course, for help :). The proposal still isn't finished regarding many important details. I myself am not sure what to do with some of the packages or the things we need from some packages. > And we use zope.app.testing a lot, which you suggested not to move if > I understand you correctly. Indeed. What from zope.app.testing are you using? If it's PlacelessSetup, I bet it's not needed (on Zope >2.9 that is). If you need Component Architecture setup and teardown, use zope.component.testing. Philipp From philipp at weitershausen.de Wed Apr 5 22:30:05 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed Apr 5 22:27:56 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <20060405165240.GA11624@slinkp.com> References: <20060405165240.GA11624@slinkp.com> Message-ID: <443428CD.4050106@weitershausen.de> Paul Winkler wrote: > On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: >> I would like to know what other zope.app packages your 3rd party >> software is using. If thereare any other used than the ones mentioned in >> the proposal, we'll have to move them out of zope.app. I'd like to ask >> for your help on that, otherwise future Zope 2 versions might not >> anymore include the package you're using. > > Aside from stuff mentioned on your proposal, we are using macros from > zope.app.rotterdam.standardmacros. Aha. Why? Are you actually using parts of the Rotterdam skin? Philipp From jinty at web.de Wed Apr 5 19:28:38 2006 From: jinty at web.de (Brian Sutherland) Date: Wed Apr 5 23:08:22 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: Message-ID: <20060405172838.GB14632@minipas.home> On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: > I would like to know what other zope.app packages your 3rd party > software is using. Er, FiveSQLOS is using quite a lot actually: https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies-meta.zcml https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies.zcml and zope.app.container zope.app.location zope.app.exception -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From philipp at weitershausen.de Wed Apr 5 23:18:46 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed Apr 5 23:16:49 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <20060405172838.GB14632@minipas.home> References: <20060405172838.GB14632@minipas.home> Message-ID: <44343436.4010501@weitershausen.de> Brian Sutherland wrote: > On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: >> I would like to know what other zope.app packages your 3rd party >> software is using. > > Er, FiveSQLOS is using quite a lot actually: > > https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies-meta.zcml > https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies.zcml Why are you loading zope.app.component/meta.zcml and zope.app.security/meta.zcml? Five should provide all the necessary directive registrations As for zope.app.rdb, I guess we'll have to move it down to zope.rdb. > zope.app.container Will move to zope.container. > zope.app.location Moved to zope.location. > zope.app.exception What from zope.app.exception are you using? If it's just UserError, than that's ok. It's moved to zope.exceptions now. Philipp From jinty at web.de Wed Apr 5 23:59:22 2006 From: jinty at web.de (Brian Sutherland) Date: Wed Apr 5 23:58:10 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <44343436.4010501@weitershausen.de> References: <20060405172838.GB14632@minipas.home> <44343436.4010501@weitershausen.de> Message-ID: <20060405215922.GA10668@minipas.home> On Wed, Apr 05, 2006 at 11:18:46PM +0200, Philipp von Weitershausen wrote: > Brian Sutherland wrote: > > On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: > >> I would like to know what other zope.app packages your 3rd party > >> software is using. > > > > Er, FiveSQLOS is using quite a lot actually: > > > > https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies-meta.zcml > > https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies.zcml > > Why are you loading zope.app.component/meta.zcml and > zope.app.security/meta.zcml? Five should provide all the necessary > directive registrations I havn't touched that code since the Zope2.8 days. I'll believe you for now and try testing it when the dust has settled. > As for zope.app.rdb, I guess we'll have to move it down to zope.rdb. I can probably take care of that in the next days. > > zope.app.container > > Will move to zope.container. > > > zope.app.location > > Moved to zope.location. > > > zope.app.exception > > What from zope.app.exception are you using? If it's just UserError, than > that's ok. It's moved to zope.exceptions now. Yep, only UserError > Philipp > _______________________________________________ > 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 ) > -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From philipp at weitershausen.de Thu Apr 6 00:12:05 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 00:10:12 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <20060405215922.GA10668@minipas.home> References: <20060405172838.GB14632@minipas.home> <44343436.4010501@weitershausen.de> <20060405215922.GA10668@minipas.home> Message-ID: <443440B5.6050002@weitershausen.de> Brian Sutherland wrote: > On Wed, Apr 05, 2006 at 11:18:46PM +0200, Philipp von Weitershausen wrote: >> Brian Sutherland wrote: >>> On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: >>>> I would like to know what other zope.app packages your 3rd party >>>> software is using. >>> Er, FiveSQLOS is using quite a lot actually: >>> >>> https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies-meta.zcml >>> https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies.zcml >> Why are you loading zope.app.component/meta.zcml and >> zope.app.security/meta.zcml? Five should provide all the necessary >> directive registrations > > I havn't touched that code since the Zope2.8 days. I'll believe you for > now and try testing it when the dust has settled. Ok. By the way, that "should" in "Five should provide..." also means that if Five doesn't provide the necessary directive registrations yet (which might very well be), then we need to make it. >> As for zope.app.rdb, I guess we'll have to move it down to zope.rdb. > > I can probably take care of that in the next days. Great. Note that I'm working on the jim-adapter branch. I suggest you do your modifications there as well. Philipp From y.2006_ at wcm-solutions.de Thu Apr 6 10:58:54 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Thu Apr 6 11:01:28 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: References: Message-ID: <4434D84E.7000606@wcm-solutions.de> Hi Philipp! Philipp von Weitershausen wrote: > I would like to know what other zope.app packages your 3rd party > software is using. If thereare any other used than the ones mentioned in > the proposal, we'll have to move them out of zope.app. I'd like to ask > for your help on that, otherwise future Zope 2 versions might not > anymore include the package you're using. What are your plans for zope.app.locales? Five uses its translations. And CMF uses zope.app.locales.extract. Not in the CMF products, but for a script that extracts i18n messages. That script is a quick hack and zope.app.locales.extract isn't really made for reuse. But it contains some useful code. Cheers, Yuppie From faassen at infrae.com Thu Apr 6 11:51:00 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu Apr 6 11:51:30 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: Message-ID: <4434E484.3070007@infrae.com> Philipp von Weitershausen wrote: > we don't really want to ship all of zope.app with Zope 2. zope.app is > supposed to be the Zope 3 application server. It shouldn't be included > in Zope 2, especially since it requires twisted and such. I'm worried about this approach, as it stops the Five project from exposing more Zope 3 functionality into Zope 2 directly, instead having to wait for a new release of Zope 2 that includes the missing bits. I'd therefore recommend an approach that includes as much of zope.app into Zope 2 as is possible, while leaving out the obvious bits that shouldn't be there, like Twisted. Regards, Martijn From faassen at infrae.com Thu Apr 6 11:59:29 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu Apr 6 11:59:58 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: Message-ID: <4434E681.20902@infrae.com> Hi everybody, Just to sketch out my general points to be clear: * I'm fine with a Zope 3 project that moves things from zope.app into zope. * I'm also fine with Zope 2 usage guiding which things should be moved first. * I'm not fine with a Zope 2 shipping with only parts of the library-like functionality of Zope 3. I think the Five project, along with Five users, should continue to have the ability to expose bits of Zope 3, no matter where they happen to be residing (zope or zope.app), into Zope 2. * I don't see why shipping zope.app (as long as it exists) with Zope 2 is a problem. It doesn't hurt except for taking up a bit more of cheap diskspace. * You could argue for removing those bits of zope.app that really have nothing to do with Zope 2, but I'd still be careful here. Someone might *want* to work on a new publisher for Zope 2 that uses Twisted, using bits of Zope 3 that integrate with Twisted, and why make life more difficult for them? * if you do not ship zope.app with Zope 2 anymore, the usage by Zope 2 will stop being a guide for which things to move from zope.app into zope next. Regards, Martijn From jinty at lentejasverdes.ath.cx Thu Apr 6 12:26:38 2006 From: jinty at lentejasverdes.ath.cx (Brian Sutherland) Date: Thu Apr 6 12:25:26 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <443440B5.6050002@weitershausen.de> References: <20060405172838.GB14632@minipas.home> <44343436.4010501@weitershausen.de> <20060405215922.GA10668@minipas.home> <443440B5.6050002@weitershausen.de> Message-ID: <20060406102638.GB7328@minipas.home> On Thu, Apr 06, 2006 at 12:12:05AM +0200, Philipp von Weitershausen wrote: > Brian Sutherland wrote: > > On Wed, Apr 05, 2006 at 11:18:46PM +0200, Philipp von Weitershausen wrote: > >> Brian Sutherland wrote: > >>> On Wed, Apr 05, 2006 at 05:29:41PM +0200, Philipp von Weitershausen wrote: > >>>> I would like to know what other zope.app packages your 3rd party > >>>> software is using. > >>> Er, FiveSQLOS is using quite a lot actually: > >>> > >>> https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies-meta.zcml > >>> https://codespeak.net/svn/z3/sqlos/trunk/Zope2/FiveSQLOS/dependencies.zcml > >> Why are you loading zope.app.component/meta.zcml and > >> zope.app.security/meta.zcml? Five should provide all the necessary > >> directive registrations > > > > I havn't touched that code since the Zope2.8 days. I'll believe you for > > now and try testing it when the dust has settled. > > Ok. By the way, that "should" in "Five should provide..." also means > that if Five doesn't provide the necessary directive registrations yet > (which might very well be), then we need to make it. Ok, I make some tests without importing any of those dependencies, the issues I have found thus far: * missing factory directive * missing class directive * zope.View permission not defined This is not an exhaustive list and all of them came from the file: http://codespeak.net/svn/z3/sqlos/trunk/src/sqlos/configure.zcml > > >> As for zope.app.rdb, I guess we'll have to move it down to zope.rdb. > > > > I can probably take care of that in the next days. > > Great. Note that I'm working on the jim-adapter branch. I suggest you do > your modifications there as well. sure. > > Philipp > > _______________________________________________ > 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 ) > -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From philipp at weitershausen.de Thu Apr 6 16:19:39 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 16:17:36 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <4434E484.3070007@infrae.com> References: <4434E484.3070007@infrae.com> Message-ID: <4435237B.4060904@weitershausen.de> Martijn Faassen wrote: > Philipp von Weitershausen wrote: >> we don't really want to ship all of zope.app with Zope 2. zope.app is >> supposed to be the Zope 3 application server. It shouldn't be included >> in Zope 2, especially since it requires twisted and such. > > I'm worried about this approach, as it stops the Five project from > exposing more Zope 3 functionality into Zope 2 directly, instead having > to wait for a new release of Zope 2 that includes the missing bits. That's why I want to make sure that we include as much of zope.app in Zope 2. But I'm just one man so I tried to focus on current usage. I'm sure we all want to use as much as possible from Zope 3 in our Zope 2 projects in the future, but we have to draw the line for this release. The freeze is 3 weeks away. I'm aware that we might not get it all done for Zope 2.10. That's ok, we can phase out Zope 2's zope.app usage over a longer time. > I'd therefore recommend an approach that includes as much of zope.app > into Zope 2 as is possible, while leaving out the obvious bits that > shouldn't be there, like Twisted. Then what's the point of zope.app at all? You're almost sounding like you want to move everything in zope.* to zope.app. I think in the past we didn't really understand what zope.app was. We just put everything in there. That didn't work. The twisted thing is just the biggest symptom. A much different, perhaps more subtle symptom is the fact that reusing stuff from zope.app is harder than reusing stuff that's independent of it. The fact that Zope 2 ships with zope.app is not because it wants to but because it needs to. All the things that *should* be reusable are tucked away there. If we continue to put everything in the zope.app bag, we won't be able to release more technology independently. I remember that you yourself suggested to put widgets into a more accessible and reusable location. I'm suggesting the same thing for all that other Zope 3 technology. Zope 2 is just the biggest motivator. Philipp From philipp at weitershausen.de Thu Apr 6 16:22:36 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 16:20:35 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <4434D84E.7000606@wcm-solutions.de> References: <4434D84E.7000606@wcm-solutions.de> Message-ID: <4435242C.5090402@weitershausen.de> yuppie wrote: > Philipp von Weitershausen wrote: >> I would like to know what other zope.app packages your 3rd party >> software is using. If thereare any other used than the ones mentioned in >> the proposal, we'll have to move them out of zope.app. I'd like to ask >> for your help on that, otherwise future Zope 2 versions might not >> anymore include the package you're using. > > What are your plans for zope.app.locales? Five uses its translations. Yes, that just occurred to me as well this morning. > And CMF uses zope.app.locales.extract. Not in the CMF products, but for > a script that extracts i18n messages. That script is a quick hack and > zope.app.locales.extract isn't really made for reuse. But it contains > some useful code. You're quite right. We should probably just move the whole zope.app.locales package. Perhaps to zope.translations? Perhaps it would also make sense to put the extractor and the ZCML directive handler for i18n:registerTranslations into zope.i18n and have zope.translations just contain the gettext files. Philipp From whit at burningman.com Thu Apr 6 16:42:34 2006 From: whit at burningman.com (whit) Date: Thu Apr 6 16:43:53 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <4434E681.20902@infrae.com> References: <4434E681.20902@infrae.com> Message-ID: <443528DA.30400@burningman.com> Martijn Faassen wrote: > Hi everybody, > > Just to sketch out my general points to be clear: > > * I'm fine with a Zope 3 project that moves things from zope.app into zope. > > * I'm also fine with Zope 2 usage guiding which things should be moved > first. > > * I'm not fine with a Zope 2 shipping with only parts of the > library-like functionality of Zope 3. I think the Five project, along > with Five users, should continue to have the ability to expose bits of > Zope 3, no matter where they happen to be residing (zope or zope.app), > into Zope 2. > > * I don't see why shipping zope.app (as long as it exists) with Zope 2 > is a problem. It doesn't hurt except for taking up a bit more of cheap > diskspace. > > * You could argue for removing those bits of zope.app that really have > nothing to do with Zope 2, but I'd still be careful here. Someone might > *want* to work on a new publisher for Zope 2 that uses Twisted, using > bits of Zope 3 that integrate with Twisted, and why make life more > difficult for them? > > * if you do not ship zope.app with Zope 2 anymore, the usage by Zope 2 > will stop being a guide for which things to move from zope.app into zope > next. > > Regards, > > Martijn > to echo Martijn, I've learned much more about zope3 thumbing through the z3 bundled with Zope 2 than I have looking at actual zope3 source, because I don't have a job that pays me to do pure zope3. I would argue sending the whole enchilada is good social programming. one less download before someone explores the codebase and a lower barrier to experimentation if someone gets the itch to integrate a z3 feature into zope2. -w From faassen at infrae.com Thu Apr 6 16:47:38 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu Apr 6 16:47:05 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <4435237B.4060904@weitershausen.de> References: <4434E484.3070007@infrae.com> <4435237B.4060904@weitershausen.de> Message-ID: <44352A0A.6090501@infrae.com> Philipp von Weitershausen wrote: > Martijn Faassen wrote: > >>Philipp von Weitershausen wrote: >> >>>we don't really want to ship all of zope.app with Zope 2. zope.app is >>>supposed to be the Zope 3 application server. It shouldn't be included >>>in Zope 2, especially since it requires twisted and such. >> >>I'm worried about this approach, as it stops the Five project from >>exposing more Zope 3 functionality into Zope 2 directly, instead having >>to wait for a new release of Zope 2 that includes the missing bits. > > > That's why I want to make sure that we include as much of zope.app in > Zope 2. But I'm just one man so I tried to focus on current usage. I'm > sure we all want to use as much as possible from Zope 3 in our Zope 2 > projects in the future, but we have to draw the line for this release. > The freeze is 3 weeks away. > > I'm aware that we might not get it all done for Zope 2.10. That's ok, we > can phase out Zope 2's zope.app usage over a longer time. Okay, that's fine, as long as we're clear that zope.app will still be part of Zope 2.10. >>I'd therefore recommend an approach that includes as much of zope.app >>into Zope 2 as is possible, while leaving out the obvious bits that >>shouldn't be there, like Twisted. > > > Then what's the point of zope.app at all? You're almost sounding like > you want to move everything in zope.* to zope.app. Sorry, I was unclear. zope.app getting smaller good. Leaving zope.app out of Zope 2 in the next Zope 2 release, bad. There's a lot of stuff in zope.app that a lot of projects are using, and we may break stuff significantly if code is suddenly not there anymore. [snip arguing against putting lots of stuff in zope.app] I'm not arguing in favor of zope.app, I'm just arguing in favor of keeping zope.app included into Zope 2 releases for the time being, until we're a lot further with this process of moving things out of zope.app. Regards, Martijn From philipp at weitershausen.de Thu Apr 6 17:26:52 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 17:24:48 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <44352A0A.6090501@infrae.com> References: <4434E484.3070007@infrae.com> <4435237B.4060904@weitershausen.de> <44352A0A.6090501@infrae.com> Message-ID: <4435333C.2090605@weitershausen.de> Martijn Faassen wrote: >> That's why I want to make sure that we include as much of zope.app in >> Zope 2. But I'm just one man so I tried to focus on current usage. I'm >> sure we all want to use as much as possible from Zope 3 in our Zope 2 >> projects in the future, but we have to draw the line for this release. >> The freeze is 3 weeks away. >> >> I'm aware that we might not get it all done for Zope 2.10. That's ok, we >> can phase out Zope 2's zope.app usage over a longer time. > > Okay, that's fine, as long as we're clear that zope.app will still be > part of Zope 2.10. In a realistic scenario that will still be the case. For example, I don't see the zope.app.form beast dissected for this release. >>> I'd therefore recommend an approach that includes as much of zope.app >>> into Zope 2 as is possible, while leaving out the obvious bits that >>> shouldn't be there, like Twisted. >> >> Then what's the point of zope.app at all? You're almost sounding like >> you want to move everything in zope.* to zope.app. > > Sorry, I was unclear. zope.app getting smaller good. Leaving zope.app > out of Zope 2 in the next Zope 2 release, bad. There's a lot of stuff in > zope.app that a lot of projects are using, and we may break stuff > significantly if code is suddenly not there anymore. > > [snip arguing against putting lots of stuff in zope.app] > > I'm not arguing in favor of zope.app, I'm just arguing in favor of > keeping zope.app included into Zope 2 releases for the time being, until > we're a lot further with this process of moving things out of zope.app. Agreed. Thanks for your input. Philipp From y.2006_ at wcm-solutions.de Thu Apr 6 17:38:46 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Thu Apr 6 17:40:09 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <4435242C.5090402@weitershausen.de> References: <4434D84E.7000606@wcm-solutions.de> <4435242C.5090402@weitershausen.de> Message-ID: <44353606.9040806@wcm-solutions.de> Hi Philipp! Philipp von Weitershausen wrote: > yuppie wrote: >> And CMF uses zope.app.locales.extract. Not in the CMF products, but for >> a script that extracts i18n messages. That script is a quick hack and >> zope.app.locales.extract isn't really made for reuse. But it contains >> some useful code. > > You're quite right. We should probably just move the whole > zope.app.locales package. Perhaps to zope.translations? > > Perhaps it would also make sense to put the extractor and the ZCML > directive handler for i18n:registerTranslations into zope.i18n and have > zope.translations just contain the gettext files. Sounds good to me. At least if someone finds time to refactor the extractor. For now it is quite specific code for creating the zope gettext files and would better fit in zope.translations. Cheers, Yuppie From philipp at weitershausen.de Thu Apr 6 17:45:23 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 17:43:17 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <44353606.9040806@wcm-solutions.de> References: <4434D84E.7000606@wcm-solutions.de> <4435242C.5090402@weitershausen.de> <44353606.9040806@wcm-solutions.de> Message-ID: <44353793.6010103@weitershausen.de> yuppie wrote: > Philipp von Weitershausen wrote: >> yuppie wrote: >>> And CMF uses zope.app.locales.extract. Not in the CMF products, but for >>> a script that extracts i18n messages. That script is a quick hack and >>> zope.app.locales.extract isn't really made for reuse. But it contains >>> some useful code. >> >> You're quite right. We should probably just move the whole >> zope.app.locales package. Perhaps to zope.translations? >> >> Perhaps it would also make sense to put the extractor and the ZCML >> directive handler for i18n:registerTranslations into zope.i18n and have >> zope.translations just contain the gettext files. > > Sounds good to me. At least if someone finds time to refactor the > extractor. For now it is quite specific code for creating the zope > gettext files and would better fit in zope.translations. On second thought, I think we should think about the zope.app.locales vs. zope.translation thing a bit harder. I don't think we should move it now. As for the extractor: it can very well be used for other projects than Zope 3. As you said, you guys are using it for the CMF. I would therefore still suggest moving it to zope.i18n. Philipp From philipp at weitershausen.de Thu Apr 6 17:56:01 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 6 17:53:58 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: <20060406102638.GB7328@minipas.home> References: <20060405172838.GB14632@minipas.home> <44343436.4010501@weitershausen.de> <20060405215922.GA10668@minipas.home> <443440B5.6050002@weitershausen.de> <20060406102638.GB7328@minipas.home> Message-ID: <44353A11.3040502@weitershausen.de> Brian Sutherland wrote: > Ok, I make some tests without importing any of those dependencies, the > issues I have found thus far: > > * missing factory directive Recent Five releases should have it. It's deprecated now, though. > * missing class directive It's in the recent bugfix releases. I just haven't gotten around announcing them since, partially because there's another important bugfix in the pipe that would classify for another round of bugfix releases. > * zope.View permission not defined This can easily be fixed by redefining the zope.View permission to the zope.View permission: By the way, I'm keeping an updated version of the proposal at http://codespeak.net/svn/user/philikon/MakeZopeAppSmaller.txt (will periodically sync this with the one at zope.org). Philipp From y.2006_ at wcm-solutions.de Thu Apr 6 18:06:21 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Thu Apr 6 18:08:19 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <44353793.6010103@weitershausen.de> References: <4434D84E.7000606@wcm-solutions.de> <4435242C.5090402@weitershausen.de> <44353606.9040806@wcm-solutions.de> <44353793.6010103@weitershausen.de> Message-ID: <44353C7D.4090702@wcm-solutions.de> Philipp von Weitershausen wrote: > yuppie wrote: >> Sounds good to me. At least if someone finds time to refactor the >> extractor. For now it is quite specific code for creating the zope >> gettext files and would better fit in zope.translations. > > On second thought, I think we should think about the zope.app.locales > vs. zope.translation thing a bit harder. I don't think we should move it > now. > > As for the extractor: it can very well be used for other projects than > Zope 3. As you said, you guys are using it for the CMF. I would > therefore still suggest moving it to zope.i18n. Yes. We are using it for CMF. But it was not fun to write the CMF code. Generally useful stuff is in utilities/i18nextract.py and zope specific stuff in zope.app.locales.extract. I did have to copy a lot from i18nextract.py and override many methods for changes that should be configurable. Extraction from ZCML still doesn't work. I don't want to blame anybody for that. Just say that the people who wrote it did not focus on writing reusable code. Cheers, Yuppie From pw_lists at slinkp.com Thu Apr 6 18:41:44 2006 From: pw_lists at slinkp.com (Paul Winkler) Date: Thu Apr 6 18:42:23 2006 Subject: [z3-five] Re: What from zope.app are you using In-Reply-To: <443428CD.4050106@weitershausen.de> References: <20060405165240.GA11624@slinkp.com> <443428CD.4050106@weitershausen.de> Message-ID: <20060406164144.GE13122@slinkp.com> On Wed, Apr 05, 2006 at 10:30:05PM +0200, Philipp von Weitershausen wrote: > Paul Winkler wrote: > > Aside from stuff mentioned on your proposal, we are using macros from > > zope.app.rotterdam.standardmacros. > > Aha. Why? Are you actually using parts of the Rotterdam skin? Heh. Actually, a closer look reveals that we're not at all. In fact we're doing: from zope.app.rotterdam.standardmacros import StandardMacros as BaseMacros class StandardMacros(BaseMacros): macro_pages = ('common_macros', 'mydnanews_macros', 'main_template',) ... which means we get exactly nothing from using rotterdam, since rotterdam.standardmacros looks just like the above, it merely defines a different macro_pages tuple and imports the macros from basicskin. So in fact we're not using rotterdam at all, we're just using a single class that we could get from zope.app.basicskin rather than rotterdam. -- Paul Winkler http://www.slinkp.com From faassen at infrae.com Thu Apr 6 18:59:42 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu Apr 6 18:59:06 2006 Subject: [z3-five] Re: [Zope-dev] Re: What from zope.app are you using In-Reply-To: <44353793.6010103@weitershausen.de> References: <4434D84E.7000606@wcm-solutions.de> <4435242C.5090402@weitershausen.de> <44353606.9040806@wcm-solutions.de> <44353793.6010103@weitershausen.de> Message-ID: <443548FE.5080407@infrae.com> Philipp von Weitershausen wrote: > As for the extractor: it can very well be used for other projects than > Zope 3. As you said, you guys are using it for the CMF. I would > therefore still suggest moving it to zope.i18n. > We've been using a slightly forked version for Silva for quite a while. I forget what changes were necessary, but one bit was hooking in support for extracting message ids from Formulator XML. Regards, Martijn From optilude at gmx.net Fri Apr 7 00:49:06 2006 From: optilude at gmx.net (Martin Aspeli) Date: Fri Apr 7 00:50:33 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using References: <4434E681.20902@infrae.com> <443528DA.30400@burningman.com> Message-ID: On Thu, 06 Apr 2006 15:42:34 +0100, whit wrote: > to echo Martijn, I've learned much more about zope3 thumbing through the > z3 bundled with Zope 2 than I have looking at actual zope3 source, > because I don't have a job that pays me to do pure zope3. > > I would argue sending the whole enchilada is good social programming. > one less download before someone explores the codebase and a lower > barrier to experimentation if someone gets the itch to integrate a z3 > feature into zope2. +10 zope.app smaller, better modularised - good zope.app gone for the sake of purity - bad (I suspect Philipp wasn't arging for this, though, only to use the Zope 2 comparison as a guide) Martin -- (muted) From lists at andreas-jung.com Fri Apr 7 07:38:46 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Fri Apr 7 07:39:22 2006 Subject: [z3-five] Re: [Zope-CMF] Re: How do deal with cmfcatalog-wrapped objects? In-Reply-To: <442D1C8E.6090708@weitershausen.de> References: <077EB1327A38A7F3B8D7B12C@suxmac.local> <442CFAB8.9020102@wcm-solutions.de> <442D1C8E.6090708@weitershausen.de> Message-ID: <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> Both solution appear a bit "heavy" to me. I solved this issue for TextIndexNG3 by adding generic support for wrapped objects by introducing an IObjectWrapper interface which is checked by the indexer. Using five:implements it is easy to attach this interface - if necessary - to any wrapper class (including IndexableObjectWrapper@CMFCore). Writing an adapter for adapting IndexableObjectWrapper to IObjectWrapper is trivial. I think this solution is more straight forward and does not require any changes to the CMF. -aj --On 31. M?rz 2006 14:11:58 +0200 Philipp von Weitershausen wrote: > > 1. I think for the long term, IndexableObjectWrapper could be made a > decorator. This works as follows: > > from zope.proxy import getProxiedObject > from zope.app.decorator import Decorator > > class IndexableObjectWrapper(Decorator): > > def allowedRolesAndUsers(self): > ob = getProxiedObject(self) > allowed = {} > for r in rolesForPermissionOn(View, ob): > allowed[r] = 1 > localroles = _mergedLocalRoles(ob) > for user, roles in localroles.items(): > for role in roles: > if allowed.has_key(role): > allowed['user:' + user] = 1 > if allowed.has_key('Owner'): > del allowed['Owner'] > return list(allowed.keys()) > > 2. In the short term we can apply the following trick > (IndexableObjectWrapper needs to be a new style class!): > > from zope.interface import providedBy > from zope.interface.declarations import ObjectSpecificationDescriptor > from zope.interface.declarations import getObjectSpecification > from zope.interface.declarations import ObjectSpecification > > class IndexableObjectSpecification(ObjectSpecificationDescriptor): > > def __get__(self, inst, cls=None): > if inst is None: > return getObjectSpecification(cls) > else: > provided = providedBy(inst.__ob) > cls = type(inst) > return ObjectSpecification(provided, cls) > > class IndexableObjectWrapper(object): # new-style! > implements(...) # it can implement as much as it wants > __providedBy__ = IndexableObjectSpecification() > > ... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060407/4ab90197/attachment.pgp From faassen at infrae.com Fri Apr 7 11:25:07 2006 From: faassen at infrae.com (Martijn Faassen) Date: Fri Apr 7 11:25:36 2006 Subject: [z3-five] Re: [Zope-dev] What from zope.app are you using In-Reply-To: References: <4434E681.20902@infrae.com> <443528DA.30400@burningman.com> Message-ID: <44362FF3.1070800@infrae.com> Martin Aspeli wrote: > On Thu, 06 Apr 2006 15:42:34 +0100, whit wrote: > >> to echo Martijn, I've learned much more about zope3 thumbing through >> the z3 bundled with Zope 2 than I have looking at actual zope3 source, >> because I don't have a job that pays me to do pure zope3. >> >> I would argue sending the whole enchilada is good social programming. >> one less download before someone explores the codebase and a lower >> barrier to experimentation if someone gets the itch to integrate a z3 >> feature into zope2. > > +10 > > zope.app smaller, better modularised - good > zope.app gone for the sake of purity - bad > > (I suspect Philipp wasn't arging for this, though, only to use the Zope > 2 comparison as a guide) > Yes, this is how I understood it too after reading more carefully. Sorry Philipp for assuming too much. Regards, Martijn From lists at andreas-jung.com Sat Apr 8 09:03:06 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sat Apr 8 09:03:54 2006 Subject: [z3-five] Priority CMF skins vs. Five views? Message-ID: What is the lookup order of context/foo inside a CMF site when I have both foo.pt inside portal_skins and a brower:page with name="foo" configured for the particular context object? -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060408/f51c70ba/attachment.pgp From y.2006_ at wcm-solutions.de Sat Apr 8 11:17:39 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat Apr 8 11:20:02 2006 Subject: [z3-five] Re: Priority CMF skins vs. Five views? In-Reply-To: References: Message-ID: <44377FB3.9000704@wcm-solutions.de> Hi Andreas! Not everybody on the Five list is interested in CMF specific questions. Since CMF builds on top of Five you are welcome to ask questions like this one on the Zope-CMF list. Andreas Jung wrote: > What is the lookup order of context/foo inside a CMF site when I have > both foo.pt inside portal_skins and a brower:page with name="foo" > configured > for the particular context object? Skin method lookup uses __getattr__, so the more general question would be attribute lookup. The lookup order was changed recently (Zope 2.9.2) as described here: http://codespeak.net/pipermail/z3-five/2006q1/001186.html So the answer to your question depends on the version you use. The CMF Method Aliases use __before_publishing_traverse__ which is called before Five traversal. They can be used to map 'foo' to '@@foo', making sure the view wins always over the skin method, regardless of the Five version used. Cheers, Yuppie From lists at andreas-jung.com Sat Apr 8 11:44:33 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sat Apr 8 11:45:17 2006 Subject: [z3-five] Re: [Zope-CMF] Re: Priority CMF skins vs. Five views? In-Reply-To: <44377FB3.9000704@wcm-solutions.de> References: <44377FB3.9000704@wcm-solutions.de> Message-ID: --On 8. April 2006 11:17:39 +0200 yuppie wrote: > > Skin method lookup uses __getattr__, so the more general question would > be attribute lookup. > > The lookup order was changed recently (Zope 2.9.2) as described here: > http://codespeak.net/pipermail/z3-five/2006q1/001186.html Well, I am using Plone 2.1.2, CMF-1.5.6, Zope 2.8.6 + Five 1.2.3. I am 99.9999% sure that I had been able in the past to overwrite skins views with a related Five view. Now this does not seem to work anymore. The only change I can remember was upgrading to Five 1.2.3 from 1.2.1 I think. Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060408/691d7388/attachment.pgp From y.2006_ at wcm-solutions.de Sat Apr 8 12:38:09 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat Apr 8 12:39:42 2006 Subject: [z3-five] Re: [Zope-CMF] Re: Priority CMF skins vs. Five views? In-Reply-To: References: <44377FB3.9000704@wcm-solutions.de> Message-ID: <44379291.3050900@wcm-solutions.de> Andreas Jung wrote: > >> The lookup order was changed recently (Zope 2.9.2) as described here: >> http://codespeak.net/pipermail/z3-five/2006q1/001186.html > > Well, I am using Plone 2.1.2, CMF-1.5.6, Zope 2.8.6 + Five 1.2.3. > I am 99.9999% sure that I had been able in the past to overwrite > skins views with a related Five view. Now this does not seem to work > anymore. The only change I can remember was upgrading to Five 1.2.3 > from 1.2.1 I think. http://svn.zope.org/Products.Five/tags/1.2.3/CHANGES.txt?rev=66288 The lookup order fix is also in Five 1.2.2 and higher, so upgrading from Five 1.2.1 explains the changed behavior. Cheers, Yuppie From lists at andreas-jung.com Sat Apr 8 12:53:36 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sat Apr 8 12:54:23 2006 Subject: [z3-five] Re: [Zope-CMF] Re: Priority CMF skins vs. Five views? In-Reply-To: <44379291.3050900@wcm-solutions.de> References: <44377FB3.9000704@wcm-solutions.de> <44379291.3050900@wcm-solutions.de> Message-ID: <6F6A0376685A2AECBB5A4C9D@[192.168.0.28]> --On 8. April 2006 12:38:09 +0200 yuppie wrote: > > The lookup order fix is also in Five 1.2.2 and higher, so upgrading from > Five 1.2.1 explains the changed behavior. Waahh...it was _extremely_ convenient to override skin methods this way. Is there any way to achieve that now with Five 1.2.3? -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060408/023fc8b4/attachment.pgp From y.2006_ at wcm-solutions.de Sat Apr 8 13:15:07 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat Apr 8 13:17:12 2006 Subject: [z3-five] Re: Priority CMF skins vs. Five views? In-Reply-To: <6F6A0376685A2AECBB5A4C9D@[192.168.0.28]> References: <44377FB3.9000704@wcm-solutions.de> <44379291.3050900@wcm-solutions.de> <6F6A0376685A2AECBB5A4C9D@[192.168.0.28]> Message-ID: <44379B3B.4050608@wcm-solutions.de> Andreas Jung wrote: > > --On 8. April 2006 12:38:09 +0200 yuppie wrote: >> >> The lookup order fix is also in Five 1.2.2 and higher, so upgrading from >> Five 1.2.1 explains the changed behavior. > > Waahh...it was _extremely_ convenient to override skin methods this way. > Is there any way to achieve that now with Five 1.2.3? You'll find some discussion about this change in the z3-five list archives. The old behavior was not in sync with the Zope3 behavior and made masked objects inaccessible. If you don't want to customize traversal the only option I see is using Method Aliases. CMF 2.0 hooks up browser views that way. As I already mentioned in my first reply mapping 'foo' explicitly to the view with '@@foo' will dispatch to the view and not look up the skin method. HTH, Yuppie From philipp at weitershausen.de Sun Apr 9 13:15:15 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sun Apr 9 13:13:21 2006 Subject: [z3-five] Re: [Zope-CMF] Re: How do deal with cmfcatalog-wrapped objects? In-Reply-To: <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> References: <077EB1327A38A7F3B8D7B12C@suxmac.local> <442CFAB8.9020102@wcm-solutions.de> <442D1C8E.6090708@weitershausen.de> <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> Message-ID: <4438ECC3.904@weitershausen.de> Andreas Jung wrote: > Both solution appear a bit "heavy" to me. I solved this issue for > TextIndexNG3 by adding generic support for wrapped objects by > introducing an IObjectWrapper interface which is checked by the > indexer. Using five:implements it is easy to attach this interface - > if necessary - to any wrapper class (including > IndexableObjectWrapper@CMFCore). Writing an adapter for adapting > IndexableObjectWrapper to IObjectWrapper is trivial. I think this > solution is more straight forward and does not require any changes to > the CMF. You are of course free to introduce adapters of your own, but I think the second solution suggested is not too heavy and easily implemented. After all, other code will also depend on the wrapper being as transparent as possible. Philipp From lists at andreas-jung.com Sun Apr 9 13:20:16 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sun Apr 9 13:20:59 2006 Subject: [z3-five] Re: [Zope-CMF] Re: How do deal with cmfcatalog-wrapped objects? In-Reply-To: <4438ECC3.904@weitershausen.de> References: <077EB1327A38A7F3B8D7B12C@suxmac.local> <442CFAB8.9020102@wcm-solutions.de> <442D1C8E.6090708@weitershausen.de> <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> <4438ECC3.904@weitershausen.de> Message-ID: --On 9. April 2006 13:15:15 +0200 Philipp von Weitershausen wrote: > > You are of course free to introduce adapters of your own, but I think > the second solution suggested is not too heavy and easily implemented. > After all, other code will also depend on the wrapper being as > transparent as possible. This solution requires changing CMF which is not acceptable for existing CMF installation and older CMF versions. Monkeypatching also is not really an option. My solution is highly portable across all CMF versions and not very much invasive. -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060409/118fcb59/attachment-0001.pgp From jhauser at zscout.de Sun Apr 9 17:16:57 2006 From: jhauser at zscout.de (Janko Hauser) Date: Sun Apr 9 17:17:22 2006 Subject: [z3-five] Re: [Zope-CMF] Re: How do deal with cmfcatalog-wrapped objects? In-Reply-To: <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> References: <077EB1327A38A7F3B8D7B12C@suxmac.local> <442CFAB8.9020102@wcm-solutions.de> <442D1C8E.6090708@weitershausen.de> <66A3E4140B34308BCAAF5A9D@[192.168.0.28]> Message-ID: <618BFB43-00A5-4160-ACFF-AECA9FC48F40@zscout.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just worked in the same area. I actually realised for our code, that we need two adapter, which reraises the question, how to reach for the real object for this adapters. Two adapters: Something like allowedRolesAndUsers is IMO a policy of the catalog or the overall system. Additionally there needs to be an adapter/ Interface to provide an object with the methods necessary for the selection of indices. This is more a descision of the developer of the object, or a particular application. I think it is not a good solution, that the object-specific adapter inherits from the catalog-specific adapter. So one ends up with a double wrapped object, where the outer catalog- specific adapter needs to have access to the real object. How is this handled best? Is there a generic unwrap()-method? __Janko Am 07.04.2006 um 07:38 schrieb Andreas Jung: > Both solution appear a bit "heavy" to me. I solved this issue for > TextIndexNG3 by adding generic support for wrapped objects by > introducing an > IObjectWrapper interface which is checked by the indexer. Using > five:implements it is easy to attach this interface - if necessary > - to any > wrapper class (including IndexableObjectWrapper@CMFCore). Writing > an adapter > for adapting IndexableObjectWrapper to IObjectWrapper is trivial. I > think this solution is more straight forward and does not require > any changes > to the CMF. > > -aj > > --On 31. M?rz 2006 14:11:58 +0200 Philipp von Weitershausen > wrote: >> >> 1. I think for the long term, IndexableObjectWrapper could be made a >> decorator. This works as follows: >> >> from zope.proxy import getProxiedObject >> from zope.app.decorator import Decorator >> >> class IndexableObjectWrapper(Decorator): >> >> def allowedRolesAndUsers(self): >> ob = getProxiedObject(self) >> allowed = {} >> for r in rolesForPermissionOn(View, ob): >> allowed[r] = 1 >> localroles = _mergedLocalRoles(ob) >> for user, roles in localroles.items(): >> for role in roles: >> if allowed.has_key(role): >> allowed['user:' + user] = 1 >> if allowed.has_key('Owner'): >> del allowed['Owner'] >> return list(allowed.keys()) >> >> 2. In the short term we can apply the following trick >> (IndexableObjectWrapper needs to be a new style class!): >> >> from zope.interface import providedBy >> from zope.interface.declarations import >> ObjectSpecificationDescriptor >> from zope.interface.declarations import getObjectSpecification >> from zope.interface.declarations import ObjectSpecification >> >> class IndexableObjectSpecification(ObjectSpecificationDescriptor): >> >> def __get__(self, inst, cls=None): >> if inst is None: >> return getObjectSpecification(cls) >> else: >> provided = providedBy(inst.__ob) >> cls = type(inst) >> return ObjectSpecification(provided, cls) >> >> class IndexableObjectWrapper(object): # new-style! >> implements(...) # it can implement as much as it wants >> __providedBy__ = IndexableObjectSpecification() >> >> ... > > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five - -- Janko Hauser email: jhauser@zscout.de mobile: +49 1721 641552 -----BEGIN PGP SIGNATURE----- iD8DBQFEOSV9e7bTUi4B2KARAoY2AJ9NG3tEJsnIjpjYZ/TNGMBck1DvTgCglyPI nTv9mO4vUhMRCXH0RldT2dY= =YFv7 -----END PGP SIGNATURE----- From optilude at gmx.net Sun Apr 9 22:25:39 2006 From: optilude at gmx.net (Martin Aspeli) Date: Sun Apr 9 22:35:44 2006 Subject: [z3-five] zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 Message-ID: Hi guys (sorry for the crosspost, this is rather a cross-area post), I'm reading the docs for zope.contentprovider and zope.viewlet, and there are many reasons why we'd like to use this in Plone. The way the release cycles work, Plone 3.0 would be the natural place to put some of this. Now, I have a few questions: - In what version of Zope 3 did zope.contentprovider and zope.viewlet appear? They're not in my Zope 2.9 lib/python/zope. - Are they scheduled to be in Zope 2.10? The main achilles heel as far as I can tell is the TALES 'provider:' expression. I'm guessing that without using the Zope 3 ZPT and TALES implementations, Zope 2 won't be able to use these. - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope 2.10? If not, are they scheduled for some other time? How much work is needed for this to be a reality? Now, I have a feeling that this could be faked in Zope 2 with something like: the object 'provider' would have to be defined globally (in global_defines.pt in Plone). Its implementation would basically be identical to the TALESProviderExpression in zope.contentprovider, with a __call__() method that called update() and render() on an IContentProvider looked up by the name it was passed. The tricky part is the ITALNamespaceData update magic that needs to read the TAL context: - Is there some way a python object referred in an expression like the one above could be passed or acquire (literally or figuratively) TAL objects defined in the current context at that point? - If not, based on your practical experience, how much is this used - would zope.contentprovider and zope.viewlet be useless if Plone had to say "we only support a subset of the zope.contentprovider API" (note: we really don't want to do that, I'm just looking at options here) The other problem with this implementation is that it would call viewlets/content providers sequentially, i.e. call update(), then render() for each object as it discovered them, not call all the update()'s and then all the render()'s. I note that the zope.contentprovider README.txt mentions that this is bad, but the TALESProviderExpression implementation seems to suffer from exactly the same problem. - Is this expected behaviour? Is it considered as "known issue"? Are there plans to improve on this? Thanks a lot! Martin -- (muted) From fairwinds at eastlink.ca Mon Apr 10 02:33:16 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Mon Apr 10 02:34:02 2006 Subject: [z3-five] zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 In-Reply-To: References: Message-ID: <4439A7CC.7040303@eastlink.ca> Hi Martin. I can think of the benefits of viewlets in for Zope2 in general, not just in Plone3 but the way they may integrate with CMF particularly. These are good questions you are asking and hopefully there will be a way to make this work sooner than later. I am very interested in how cpsskins v3 will be fitting into the picture also. The Z2 integration will be started soon at a sprint soon. Viewlets and portlets seem pretty synonymous and cpsskins provides a way to manipulate portlets visually which is very nice. The recent posts on formlib integration with viewlets also has my interest since it should make portlet development super easy as well. formlib by itself is pretty sweet on its own. :-) Regards, David Martin Aspeli wrote: > Hi guys (sorry for the crosspost, this is rather a cross-area post), > > I'm reading the docs for zope.contentprovider and zope.viewlet, and > there are many reasons why we'd like to use this in Plone. The way the > release cycles work, Plone 3.0 would be the natural place to put some of > this. Now, I have a few questions: > > - In what version of Zope 3 did zope.contentprovider and zope.viewlet > appear? They're not in my Zope 2.9 lib/python/zope. > > - Are they scheduled to be in Zope 2.10? > > The main achilles heel as far as I can tell is the TALES 'provider:' > expression. I'm guessing that without using the Zope 3 ZPT and TALES > implementations, Zope 2 won't be able to use these. > > - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope > 2.10? If not, are they scheduled for some other time? How much work is > needed for this to be a reality? > > Now, I have a feeling that this could be faked in Zope 2 with something > like: > > > > the object 'provider' would have to be defined globally (in > global_defines.pt in Plone). Its implementation would basically be > identical to the TALESProviderExpression in zope.contentprovider, with a > __call__() method that called update() and render() on an > IContentProvider looked up by the name it was passed. > > The tricky part is the ITALNamespaceData update magic that needs to read > the TAL context: > > - Is there some way a python object referred in an expression like the > one above could be passed or acquire (literally or figuratively) TAL > objects defined in the current context at that point? > > - If not, based on your practical experience, how much is this used - > would zope.contentprovider and zope.viewlet be useless if Plone had to > say "we only support a subset of the zope.contentprovider API" (note: we > really don't want to do that, I'm just looking at options here) > > The other problem with this implementation is that it would call > viewlets/content providers sequentially, i.e. call update(), then > render() for each object as it discovered them, not call all the > update()'s and then all the render()'s. I note that the > zope.contentprovider README.txt mentions that this is bad, but the > TALESProviderExpression implementation seems to suffer from exactly the > same problem. > > - Is this expected behaviour? Is it considered as "known issue"? Are > there plans to improve on this? > > Thanks a lot! > > Martin > > > > --(muted) > > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From tseaver at palladion.com Mon Apr 10 04:28:57 2006 From: tseaver at palladion.com (Tres Seaver) Date: Mon Apr 10 04:35:43 2006 Subject: [z3-five] Re: zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 In-Reply-To: References: Message-ID: <4439C2E9.7060104@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Martin Aspeli wrote: > Hi guys (sorry for the crosspost, this is rather a cross-area post), > > I'm reading the docs for zope.contentprovider and zope.viewlet, and > there are many reasons why we'd like to use this in Plone. The way the > release cycles work, Plone 3.0 would be the natural place to put some > of this. Now, I have a few questions: > > - In what version of Zope 3 did zope.contentprovider and zope.viewlet > appear? They're not in my Zope 2.9 lib/python/zope. > > - Are they scheduled to be in Zope 2.10? Either that, or we make make them available as egg-enabled add-ons. The current effort is actually to move non-essential packages out of 'zope.app' and into more reusable "top-level" packages. Most of those packages should have clearly-defined dependencies, and therefore make good candidates for eggification. For progress to date, see: http://download.zope.org/distribution/ and my blog postings on the eggification process: http://palladion.com/home/tseaver/obzervationz/2006/eggifying_zope_20060405 http://palladion.com/home/tseaver/obzervationz/2006/eggifying_zodb_20060406 > The main achilles heel as far as I can tell is the TALES 'provider:' > expression. I'm guessing that without using the Zope 3 ZPT and TALES > implementations, Zope 2 won't be able to use these. > > - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope > 2.10? If not, are they scheduled for some other time? How much work is > needed for this to be a reality? Andreas is still finishing this, but reports that he is very close. I would imagine that it will indeed land for 2.10: http://mail.zope.org/pipermail/zope-dev/2006-April/027280.html > Now, I have a feeling that this could be faked in Zope 2 with something > like: > > > > the object 'provider' would have to be defined globally (in > global_defines.pt in Plone). Its implementation would basically be > identical to the TALESProviderExpression in zope.contentprovider, with > a __call__() method that called update() and render() on an > IContentProvider looked up by the name it was passed. > > The tricky part is the ITALNamespaceData update magic that needs to > read the TAL context: > > - Is there some way a python object referred in an expression like the > one above could be passed or acquire (literally or figuratively) TAL > objects defined in the current context at that point? > > - If not, based on your practical experience, how much is this used - > would zope.contentprovider and zope.viewlet be useless if Plone had to > say "we only support a subset of the zope.contentprovider API" (note: > we really don't want to do that, I'm just looking at options here) I'm hoping none of the fakery will be required with Zope 2.10. > The other problem with this implementation is that it would call > viewlets/content providers sequentially, i.e. call update(), then > render() for each object as it discovered them, not call all the > update()'s and then all the render()'s. I note that the > zope.contentprovider README.txt mentions that this is bad, but the > TALESProviderExpression implementation seems to suffer from exactly the > same problem. > > - Is this expected behaviour? Is it considered as "known issue"? Are > there plans to improve on this? Dunno. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEOcLp+gerLs4ltQ4RAgB2AKCUalPNb1Cer6bXeAmr+SISWHStGwCgq/f3 udEiKV3JlzXZadLDGZFZhjE= =80pv -----END PGP SIGNATURE----- From ree at ree.hu Mon Apr 10 08:06:52 2006 From: ree at ree.hu (Balazs Ree) Date: Mon Apr 10 08:20:51 2006 Subject: [z3-five] Re: zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 References: Message-ID: On Sun, 09 Apr 2006 21:25:39 +0100, Martin Aspeli wrote: > Now, I have a feeling that this could be faked in Zope 2 with something > like: > > > > the object 'provider' would have to be defined globally (in > global_defines.pt in Plone). Its implementation would basically be > identical to the TALESProviderExpression in zope.contentprovider, with a > __call__() method that called update() and render() on an IContentProvider > looked up by the name it was passed. > > The tricky part is the ITALNamespaceData update magic that needs to read > the TAL context: > > - Is there some way a python object referred in an expression like the > one above could be passed or acquire (literally or figuratively) TAL > objects defined in the current context at that point? Precisely because I wanted to "emulate" something like viewlets, I have a ready solution to do this kind of reentrance in Zope2, see http://www.zope.org/Members/ree/zptcontext . It's a big time hack for more reasons, mostly because the pagetemplate code is not designed re-entrant. It works pretty stable, though, in practice. The usage is get the econtext from python via get_econtext, and then call the page template in a reentrant way via pt_render_in_econtext. You can also think about this as a way to substitute macros. However having the real viewlets that work in Plone would be a greater deal. Also the closer we get to Zope3 the more things we can reuse instead of duplicating them, so that's a very strong reason for switching to the Z3 template rendering engine asap. -- Balazs Ree jabber + email: ree@ree.hu ICQ: 75955071 AIM + skype: reebalazs From daniel.nouri at gmail.com Mon Apr 10 22:25:11 2006 From: daniel.nouri at gmail.com (Daniel Nouri) Date: Mon Apr 10 22:51:05 2006 Subject: [z3-five] Patch for testbrowser.py Message-ID: This patch adds 'Set-Cache' headers to the headers that are forwarded to PublisherResponse. Before, these headers would be suppressed. Index: testbrowser.py =================================================================== --- testbrowser.py (revision 66810) +++ testbrowser.py (working copy) @@ -35,6 +35,7 @@ headers.sort() headers.insert(0, ('Status', "%s %s" % (status, reason))) headers = '\r\n'.join('%s: %s' % h for h in headers) + headers += '\r\n' + '\r\n'.join(real_response._cookie_list()) content = real_response.body return testing.PublisherResponse(content, headers, status, reason) From whit at burningman.com Tue Apr 11 05:54:31 2006 From: whit at burningman.com (whit) Date: Tue Apr 11 05:55:54 2006 Subject: [z3-five] Re: zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 In-Reply-To: <8AFC7A5CD3BBAD9C7B134680@[192.168.0.28]> References: <200604100558.32125.srichter@cosmos.phy.tufts.edu> <8AFC7A5CD3BBAD9C7B134680@[192.168.0.28]> Message-ID: <443B2877.7020905@burningman.com> Andreas Jung wrote: > > > --On 10. April 2006 05:58:31 -0400 Stephan Richter > wrote: >> >> I don't think so. The TALES expressions engines in Zope 2 and 3 share the >> same API. So all you need to do is to generate a custom engine. If the >> Five developers port the tales:expressiontype directive, then you can >> actually just use the code as is. ;-) >> >>> - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope >>> 2.10? If not, are they scheduled for some other time? How much work is >>> needed for this to be a reality? >> >> You'll have to ask Andreas how far his work is. > > There are still some little problem when running the unittests for Five > with the new implementation. I *hope* find some time soon although I am > more than busy at the moment. Some help would be appreciated to get the > stuff ready for the 2.10 release. > > -aj > what can we do to help? -w From whit at burningman.com Tue Apr 11 06:21:11 2006 From: whit at burningman.com (whit) Date: Tue Apr 11 06:22:06 2006 Subject: [z3-five] events gripes Message-ID: when IObjectMoved events get dispatched to sublocations upon a container rename, are event.newName and event.oldName suppose to be the new and old name of the container(which, to me, seems meaningless to subscriber), or the old and new name of the object that is the focus of the event (as it is if you move an object)? I get the old and new name for the container for *every* object event involved in the container modification. is there some subtle wonderfulness I'm overlooking here? or is this just broken? -w From lists at andreas-jung.com Tue Apr 11 06:52:14 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Tue Apr 11 06:53:04 2006 Subject: [z3-five] Re: [Plone-developers] Re: zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3 In-Reply-To: <443B2877.7020905@burningman.com> References: <200604100558.32125.srichter@cosmos.phy.tufts.edu> <8AFC7A5CD3BBAD9C7B134680@[192.168.0.28]> <443B2877.7020905@burningman.com> Message-ID: --On 10. April 2006 22:54:31 -0500 whit wrote: >>>> - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope >>>> 2.10? If not, are they scheduled for some other time? How much work is >>>> needed for this to be a reality? >>> >>> You'll have to ask Andreas how far his work is. >> >> There are still some little problem when running the unittests for Five >> with the new implementation. I *hope* find some time soon although I am >> more than busy at the moment. Some help would be appreciated to get the >> stuff ready for the 2.10 release. >> >> -aj >> > All work is currently on this branch As far as I can remember there were some tests failing related to string interpolation and i18n (although all ZPT tests except some for Fives Zope2PageTemplate wrapper do fail). Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060411/9ece13ce/attachment.pgp From fg at nuxeo.com Tue Apr 11 20:25:07 2006 From: fg at nuxeo.com (Florent Guillaume) Date: Tue Apr 11 20:25:47 2006 Subject: [z3-five] Re: events gripes In-Reply-To: References: Message-ID: <443BF483.8050905@nuxeo.com> whit wrote: > when IObjectMoved events get dispatched to sublocations upon a container > rename, are event.newName and event.oldName suppose to be the new and > old name of the container(which, to me, seems meaningless to > subscriber), No. > or the old and new name of the object that is the focus of > the event (as it is if you move an object)? Yes. Assuming you mean the correct thing for "the focus of the event". > I get the old and new name for the container for *every* object event > involved in the container modification. > > is there some subtle wonderfulness I'm overlooking here? or is this just > broken? When a event is dispatched to sublocations, it doesn't change, it's still the same event. It's just redispatched. The doc in Five/doc/event.txt says this: The ``event`` won't change though, and ``event.object`` will still be the original object for which the event was initially sent (this corresponds to ``self`` and ``item`` in the ``manage_afterAdd`` method -- ``self`` is ``ob``, and ``item`` is ``event.object``). Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com From shivayogiks at gmail.com Wed Apr 12 11:34:42 2006 From: shivayogiks at gmail.com (shivayogi kumbar) Date: Wed Apr 12 11:35:24 2006 Subject: [z3-five] Dear Sir Message-ID: <6434a4300604120234k49a52708q8b931aad94aa2e8@mail.gmail.com> Sir, I am trying to import the project which is already built on zope2.7 to zope2.9. Because to use the FIVE1.3 features in my project ,but It's giving the "import error" ,please suggest me. Sincerely Shivayogi -- regards Shiv From lists at andreas-jung.com Wed Apr 12 11:37:27 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Wed Apr 12 11:38:10 2006 Subject: [z3-five] Dear Sir In-Reply-To: <6434a4300604120234k49a52708q8b931aad94aa2e8@mail.gmail.com> References: <6434a4300604120234k49a52708q8b931aad94aa2e8@mail.gmail.com> Message-ID: <61361A50C6C5D71EAEC6D07A@[192.168.0.28]> --On 12. April 2006 02:34:42 -0700 shivayogi kumbar wrote: > Sir, > I am trying to import the project which is already built on > zope2.7 to zope2.9. > Because to use the FIVE1.3 features in my project ,but It's giving the > "import error" ,please suggest me. > Sincerely > Shivayogi > -- > Export/Import is only supported for basically *identical* software versions. This means: same Zope major version and same major versions for all other 3rd-party products. -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060412/be1d18a1/attachment.pgp From regebro at gmail.com Wed Apr 12 12:18:57 2006 From: regebro at gmail.com (Lennart Regebro) Date: Wed Apr 12 12:19:38 2006 Subject: [z3-five] Dear Sir In-Reply-To: <6434a4300604120234k49a52708q8b931aad94aa2e8@mail.gmail.com> References: <6434a4300604120234k49a52708q8b931aad94aa2e8@mail.gmail.com> Message-ID: <319e029f0604120318o60c73762ie9bace5de4c375ac@mail.gmail.com> On 4/12/06, shivayogi kumbar wrote: > Sir, Sir? Ohh... now I feel all...important! :) > I am trying to import the project which is already built on > zope2.7 to zope2.9. > Because to use the FIVE1.3 features in my project ,but It's giving the > "import error" ,please suggest me. The best way to upgrade a project is to create a new instance with the new versions of the software, and copy over the Data.fs from the old instance. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From shivayogiks at gmail.com Thu Apr 13 11:23:05 2006 From: shivayogiks at gmail.com (shivayogi kumbar) Date: Thu Apr 13 11:23:47 2006 Subject: [z3-five] getting error in export and import on zope2.9 Message-ID: <6434a4300604130223q41f12e70l6233f0bd72538b67@mail.gmail.com> I am trying to import file from zope2.9 that has been exported in xml format from the same.I am getting error as follows. " Site Error An error was encountered while publishing this resource. Error Type: UnicodeDecodeError Error Value: 'ascii' codec can't decode byte 0x83 in position 10: ordinal not in range(128)" -- regards Shiv From regebro at gmail.com Thu Apr 13 11:37:48 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu Apr 13 11:38:36 2006 Subject: [z3-five] getting error in export and import on zope2.9 In-Reply-To: <6434a4300604130223q41f12e70l6233f0bd72538b67@mail.gmail.com> References: <6434a4300604130223q41f12e70l6233f0bd72538b67@mail.gmail.com> Message-ID: <319e029f0604130237t7f195b0cm7d345e7cb2e6cac9@mail.gmail.com> On 4/13/06, shivayogi kumbar wrote: > I am trying to import file from zope2.9 that has been exported in xml > format from the same.I am getting error as follows. > " > Site Error > > An error was encountered while publishing this resource. > > Error Type: UnicodeDecodeError > Error Value: 'ascii' codec can't decode byte 0x83 in position 10: > ordinal not in range(128)" That question was much better, but as I explained to you yesterday, the correct list is zope@zope.org. Please join that list and send your question there. Also explain what it is you are exporting and importing, and include the full traceback. http://www.catb.org/~esr/faqs/smart-questions.html -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From lists at andreas-jung.com Thu Apr 13 11:57:42 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Thu Apr 13 11:58:23 2006 Subject: [z3-five] getting error in export and import on zope2.9 In-Reply-To: <319e029f0604130237t7f195b0cm7d345e7cb2e6cac9@mail.gmail.com> References: <6434a4300604130223q41f12e70l6233f0bd72538b67@mail.gmail.com> <319e029f0604130237t7f195b0cm7d345e7cb2e6cac9@mail.gmail.com> Message-ID: <1AF425E1B2167C39B53B1E7D@[192.168.0.28]> My reply to the list bounced whoever he got a private copy as well containing the same reply :-) -aj --On 13. April 2006 11:37:48 +0200 Lennart Regebro wrote: > On 4/13/06, shivayogi kumbar wrote: >> I am trying to import file from zope2.9 that has been exported in xml >> format from the same.I am getting error as follows. >> " >> Site Error >> >> An error was encountered while publishing this resource. >> >> Error Type: UnicodeDecodeError >> Error Value: 'ascii' codec can't decode byte 0x83 in position 10: >> ordinal not in range(128)" > > That question was much better, but as I explained to you yesterday, > the correct list is zope@zope.org. Please join that list and send your > question there. > > Also explain what it is you are exporting and importing, and include > the full traceback. > > http://www.catb.org/~esr/faqs/smart-questions.html > > -- > Lennart Regebro, Nuxeo http://www.nuxeo.com/ > CPS Content Management http://www.cps-project.org/ > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060413/c40d3ca7/attachment.pgp From lists at andreas-jung.com Sun Apr 16 13:30:07 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Sun Apr 16 13:30:47 2006 Subject: [z3-five] browser:page not working with five:implements Message-ID: <7A15B864B5AFF21A19C94883@[192.168.0.28]> I have an AT content-type with an attached marker interface (using five:implements). Now I configured a browser:page for this marker face however when I try to call this page TTW I get a NotFound error. I am using Five 1.2.3. Is this a known issue? Happy easter, Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060416/207eb585/attachment.pgp From rocky.burt at adaptivewave.com Sun Apr 16 13:45:29 2006 From: rocky.burt at adaptivewave.com (Rocky Burt) Date: Sun Apr 16 13:46:28 2006 Subject: [z3-five] Re: browser:page not working with five:implements In-Reply-To: <7A15B864B5AFF21A19C94883@[192.168.0.28]> References: <7A15B864B5AFF21A19C94883@[192.168.0.28]> Message-ID: <1145187918.11845.4.camel@localhost> On Sun, 2006-16-04 at 13:30 +0200, Andreas Jung wrote: > I have an AT content-type with an attached marker interface (using > five:implements). Now I configured a browser:page for this marker face > however when I try to call this page TTW I get a NotFound error. > I am using Five 1.2.3. Is this a known issue? I haven't tested recently but I'm nearly positive I've had such an instance working before. Are you sure your content type is five:traversable? (and that all of the containerish types that is holding the instance you're testing are also five:traversable?) - Rocky -- Rocky Burt AdaptiveWave - Content Management as a Service http://www.adaptivewave.com Content Management Made Simple From philipp at weitershausen.de Tue Apr 18 15:55:58 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue Apr 18 15:53:51 2006 Subject: [z3-five] Re: browser:page not working with five:implements In-Reply-To: <1145187918.11845.4.camel@localhost> References: <7A15B864B5AFF21A19C94883@[192.168.0.28]> <1145187918.11845.4.camel@localhost> Message-ID: <4444EFEE.4020308@weitershausen.de> Rocky Burt wrote: > On Sun, 2006-16-04 at 13:30 +0200, Andreas Jung wrote: >> I have an AT content-type with an attached marker interface (using >> five:implements). Now I configured a browser:page for this marker face >> however when I try to call this page TTW I get a NotFound error. >> I am using Five 1.2.3. Is this a known issue? > > I haven't tested recently but I'm nearly positive I've had such an > instance working before. Are you sure your content type is > five:traversable? (and that all of the containerish types that is > holding the instance you're testing are also five:traversable?) Making the class of the object you're trying to display five:traversable is absolutely necessary. I bet that's the problem. Making the containers of the objects five:traversable isn't necessary. Philipp From rocky.burt at adaptivewave.com Tue Apr 18 17:38:03 2006 From: rocky.burt at adaptivewave.com (Rocky Burt) Date: Tue Apr 18 17:39:16 2006 Subject: [z3-five] Re: browser:page not working with five:implements In-Reply-To: <4444EFEE.4020308@weitershausen.de> References: <7A15B864B5AFF21A19C94883@[192.168.0.28]> <1145187918.11845.4.camel@localhost> <4444EFEE.4020308@weitershausen.de> Message-ID: <1145374669.15235.4.camel@localhost> On Tue, 2006-18-04 at 15:55 +0200, Philipp von Weitershausen wrote: > Making the containers of the objects five:traversable isn't necessary. Ah, for some unexplainable reason I thought the containers of the objects had to be five:traversable as well. This is good to know, thanks! - Rocky -- Rocky Burt AdaptiveWave - Content Management as a Service http://www.adaptivewave.com Content Management Made Simple From maciej.wisniowski at coig.katowice.pl Thu Apr 20 09:26:36 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu Apr 20 09:27:20 2006 Subject: [z3-five] Five 1.2.2 with Zope 2.8.4 - adapters not working for root folder? Message-ID: <444737AC.3080809@coig.katowice.pl> Hi I have Zope 2.8.5 and yesterday I've installed Five 1.2.2 - in my instance Products/ directory (according to install.txt) and ViewsTutorial product from Five/doc/products. I have folder 'mytest' in my instance. When I'm accessing URL like: http://localhost:8080/mytest/overview.html it shows me the list of objects in this folder what is correct. But when I'm trying to open URL: http://localhost:8080/overview.html I get: Site Error An error was encountered while publishing this resource. Resource not found Sorry, the requested resource does not exist. Check the URL and try again. Resource: overview.html GET As I can see other adapters or resources are not working with root folder too. Simple product that uses five:registerClass and browser:addform cannot be added in root folder because it cannot find /+ resource I've executed: bin/zopectl run Products/Five/runtests.py -v -s Products.Five and the result is: Ran 77 tests with 0 failures and 0 errors in 52.674 seconds. So what may be wrong? -- Maciej Wisniowski From philipp at weitershausen.de Thu Apr 20 10:05:42 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 20 10:03:33 2006 Subject: [z3-five] Re: Five 1.2.2 with Zope 2.8.4 - adapters not working for root folder? In-Reply-To: <444737AC.3080809@coig.katowice.pl> References: <444737AC.3080809@coig.katowice.pl> Message-ID: <444740D6.2030009@weitershausen.de> Maciej Wisniowski wrote: > I have Zope 2.8.5 and yesterday I've installed Five 1.2.2 - in > my instance Products/ directory (according to install.txt) > and ViewsTutorial product from Five/doc/products. > > I have folder 'mytest' in my instance. When I'm accessing URL like: > > http://localhost:8080/mytest/overview.html > > it shows me the list of objects in this folder what is > correct. But when I'm trying to open URL: > > http://localhost:8080/overview.html > > I get: > > Site Error > An error was encountered while publishing this resource. > Resource not found > Sorry, the requested resource does not exist. > Check the URL and try again. > Resource: overview.html GET > > As I can see other adapters or resources are not working with root > folder too. Simple product that uses five:registerClass and browser:addform > cannot be added in root folder because it cannot find /+ resource > ... > So what may be wrong? A bugfix that I haven't applied yet (see http://codespeak.net/pipermail/z3-five/2006q2/001309.html). This bugfix will be applied during the next coming days and appear in Five and Zope releases on Monday. Philipp From maciej.wisniowski at coig.katowice.pl Thu Apr 20 10:49:41 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu Apr 20 10:50:23 2006 Subject: [z3-five] Re: Five 1.2.2 with Zope 2.8.4 - adapters not working for root folder? In-Reply-To: <444740D6.2030009@weitershausen.de> References: <444737AC.3080809@coig.katowice.pl> <444740D6.2030009@weitershausen.de> Message-ID: <44474B25.8090201@coig.katowice.pl> >A bugfix that I haven't applied yet (see >http://codespeak.net/pipermail/z3-five/2006q2/001309.html). This bugfix >will be applied during the next coming days and appear in Five and Zope >releases on Monday. > > It did the thing! Thank you :) -- Maciej Wisniowski From fairwinds at eastlink.ca Thu Apr 20 15:58:04 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Thu Apr 20 15:58:43 2006 Subject: [z3-five] Viewlets in Five? Message-ID: <4447936C.5000809@eastlink.ca> Quick question. Are viewlets available in Five? Regards David From philipp at weitershausen.de Thu Apr 20 18:10:57 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 20 18:08:52 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: <4447936C.5000809@eastlink.ca> References: <4447936C.5000809@eastlink.ca> Message-ID: <4447B291.3030609@weitershausen.de> David Pratt wrote: > Quick question. Are viewlets available in Five? Quick answer: No. :) From fairwinds at eastlink.ca Thu Apr 20 18:25:03 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Thu Apr 20 18:25:44 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: <4447B291.3030609@weitershausen.de> References: <4447936C.5000809@eastlink.ca> <4447B291.3030609@weitershausen.de> Message-ID: <4447B5DF.3070305@eastlink.ca> Hi Phillip. Ok, thanks. I am just trying to figure out if I should hold off and wait for viewlets before writing a bunch of standard views for a raft of sql type stuff or not. Do you think this may land in Five soon? Philipp von Weitershausen wrote: > David Pratt wrote: >> Quick question. Are viewlets available in Five? > > Quick answer: No. > > :) > From philipp at weitershausen.de Thu Apr 20 18:34:58 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 20 18:32:46 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: <4447B5DF.3070305@eastlink.ca> References: <4447936C.5000809@eastlink.ca> <4447B291.3030609@weitershausen.de> <4447B5DF.3070305@eastlink.ca> Message-ID: <4447B832.5070400@weitershausen.de> David Pratt wrote: > Hi Phillip. Ok, thanks. I am just trying to figure out if I should hold > off and wait for viewlets before writing a bunch of standard views for a > raft of sql type stuff or not. Do you think this may land in Five soon? It will land when somebody does it. There are more people like you who want to use them but nobody is implementing them. Five 1.4 is feature-frozen, but there still is an opportunity for Five 1.5. Philipp From fairwinds at eastlink.ca Thu Apr 20 18:47:49 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Thu Apr 20 18:48:32 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: <4447B832.5070400@weitershausen.de> References: <4447936C.5000809@eastlink.ca> <4447B291.3030609@weitershausen.de> <4447B5DF.3070305@eastlink.ca> <4447B832.5070400@weitershausen.de> Message-ID: <4447BB35.7040803@eastlink.ca> Thanks Phillip, I hear you. I'll look at the code. Regards, David Philipp von Weitershausen wrote: > David Pratt wrote: >> Hi Phillip. Ok, thanks. I am just trying to figure out if I should hold >> off and wait for viewlets before writing a bunch of standard views for a >> raft of sql type stuff or not. Do you think this may land in Five soon? > > It will land when somebody does it. There are more people like you who > want to use them but nobody is implementing them. Five 1.4 is > feature-frozen, but there still is an opportunity for Five 1.5. > > Philipp > From optilude at gmx.net Thu Apr 20 21:05:27 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu Apr 20 21:06:21 2006 Subject: [z3-five] Re: Viewlets in Five? References: <4447936C.5000809@eastlink.ca> <4447B291.3030609@weitershausen.de> <4447B5DF.3070305@eastlink.ca> <4447B832.5070400@weitershausen.de> Message-ID: On Thu, 20 Apr 2006 17:34:58 +0100, Philipp von Weitershausen wrote: > David Pratt wrote: >> Hi Phillip. Ok, thanks. I am just trying to figure out if I should hold >> off and wait for viewlets before writing a bunch of standard views for a >> raft of sql type stuff or not. Do you think this may land in Five soon? > > It will land when somebody does it. There are more people like you who > want to use them but nobody is implementing them. Five 1.4 is > feature-frozen, but there still is an opportunity for Five 1.5. Philip, Do you have an understanding of what is required in *Five* for them to be a reality? From what I could tell reading the viewlet documentation, viewlets don't require that much magic, though they need a special provider: type in TAL, which should be backportable to Zope 2, and may just work in Zope 2.10. I'm not familiar enough with the low-level details of Five and the TAL engine to know what would be needed, but if you have an impression, it may be useful in getting something going. Martin -- (muted) From whit at burningman.com Thu Apr 20 23:09:40 2006 From: whit at burningman.com (whit) Date: Thu Apr 20 23:10:57 2006 Subject: [z3-five] Re: Priority CMF skins vs. Five views? In-Reply-To: <44379B3B.4050608@wcm-solutions.de> References: <44377FB3.9000704@wcm-solutions.de> <44379291.3050900@wcm-solutions.de> <6F6A0376685A2AECBB5A4C9D@[192.168.0.28]> <44379B3B.4050608@wcm-solutions.de> Message-ID: yuppie wrote: > Andreas Jung wrote: >> >> --On 8. April 2006 12:38:09 +0200 yuppie >> wrote: >>> >>> The lookup order fix is also in Five 1.2.2 and higher, so upgrading from >>> Five 1.2.1 explains the changed behavior. >> >> Waahh...it was _extremely_ convenient to override skin methods this way. >> Is there any way to achieve that now with Five 1.2.3? > this change broke a bunch of my code too. > You'll find some discussion about this change in the z3-five list > archives. The old behavior was not in sync with the Zope3 behavior and > made masked objects inaccessible. the latter fact was quite useful, allowing for straight forward replacement of UI elements without invasive surgery. > If you don't want to customize traversal the only option I see is using > Method Aliases. CMF 2.0 hooks up browser views that way. As I already > mentioned in my first reply mapping 'foo' explicitly to the view with > '@@foo' will dispatch to the view and not look up the skin method. which is all well and good if it is a content-type specific template. otherwhise, for global templates, you have to invade calling templates and change paths simply to have an prefix of @@. For systems with tons of templates, this can be a PITA. there seems to be a bigger problem here of having views sensibly interact with the existing architecture here. something akin to frostbite, a persistent wrapper around viewmapper placed in portal_skins, might be a way around this... then at least, one could be declarative about the precedence of views. -w From philipp at weitershausen.de Thu Apr 20 23:22:43 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Apr 20 23:20:33 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: References: <4447936C.5000809@eastlink.ca> <4447B291.3030609@weitershausen.de> <4447B5DF.3070305@eastlink.ca> <4447B832.5070400@weitershausen.de> Message-ID: <4447FBA3.5070106@weitershausen.de> Martin Aspeli wrote: > On Thu, 20 Apr 2006 17:34:58 +0100, Philipp von Weitershausen > wrote: > >> David Pratt wrote: >>> Hi Phillip. Ok, thanks. I am just trying to figure out if I should hold >>> off and wait for viewlets before writing a bunch of standard views for a >>> raft of sql type stuff or not. Do you think this may land in Five soon? >> >> It will land when somebody does it. There are more people like you who >> want to use them but nobody is implementing them. Five 1.4 is >> feature-frozen, but there still is an opportunity for Five 1.5. > > Philip, > > Do you have an understanding of what is required in *Five* for them to > be a reality? Not really. > From what I could tell reading the viewlet documentation, viewlets don't > require that much magic, though they need a special provider: type in > TAL, which should be backportable to Zope 2, and may just work in Zope > 2.10. > > I'm not familiar enough with the low-level details of Five and the TAL > engine to know what would be needed, but if you have an impression, it > may be useful in getting something going. I know that zope.contentprovider and zope.viewlet provide new TALES expression types. These are shortcuts, though. I would be very surprised if they couldn't be implemented in another way (simple API call). I have too many other things on my radar and viewlets aren't of interest to me in Five *at all*, so anything that happens in Five with viewlets will have to be done by someone else. That's all I have to say and will say on this subject. You guys figure out the rest :) Let me know when you have something ready. I'd like to see a code review before anything goes into the Five trunk, so that something like the 'interface utility' desaster can be avoided. That's all. Philipp From philipp at weitershausen.de Fri Apr 21 00:13:37 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri Apr 21 00:11:38 2006 Subject: [z3-five] Re: traversal bug with OFS.Application.Application In-Reply-To: <200604041442.14175.jbb@contradix.com> References: <200604041442.14175.jbb@contradix.com> Message-ID: <44480791.1060408@weitershausen.de> Jordan Baker wrote: > After upgrading to Zope 2.9.2 from 2.9.0 I found that one my applications > wasn't working anymore. > > It depended on being able to bind a page template to > OFS.Application.Application and through some examination I found a small bug > in the traversal fallback changes that were made recently. > > It basically boils down to OFS.Application.Application's __bobo_traverse__ > raises NotFound when there is a valid REQUEST. > > I've attached a unit test that demonstrates the problem and also the small > patch which fixes it. I've applied the patch to all current branches of Five. The fix will be in the next releases which will happen till next Monday, if everything goes as scheduled. > PS. There are two questions I had for more experienced testers on this list: > > 1. Why does http() return 404 but then actually return the correct content in > the test case I added? That's due to an implementation detail of REQUEST.RESPONSE.notFoundError() which is what OFS.Application.Application's. __bobo_traverse__ uses, instead of just raising NotFoundError. I fixed this by manually resetting the response status back to 200. > 2. Why must I use zope2.View instead of zope2.Public. If I use zope2.Public I > get authentication errors? zope2.Public needs to be mapped to zope.Public before it has the effect of 'publicness'. zope.Public should really be just 'public'. It's not a permission but a marker. But that's a different story. Thanks for providing the patch! Philipp From philipp at weitershausen.de Fri Apr 21 00:14:29 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri Apr 21 00:12:24 2006 Subject: [z3-five] Re: Five 1.2.2 with Zope 2.8.4 - adapters not working for root folder? In-Reply-To: <444740D6.2030009@weitershausen.de> References: <444737AC.3080809@coig.katowice.pl> <444740D6.2030009@weitershausen.de> Message-ID: <444807C5.1050404@weitershausen.de> Philipp von Weitershausen wrote: > Maciej Wisniowski wrote: >> I have Zope 2.8.5 and yesterday I've installed Five 1.2.2 - in >> my instance Products/ directory (according to install.txt) >> and ViewsTutorial product from Five/doc/products. >> >> I have folder 'mytest' in my instance. When I'm accessing URL like: >> >> http://local