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://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. Done on 1.2, 1.3, 1.4 branches. Philipp From philipp at weitershausen.de Fri Apr 21 00:17:37 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri Apr 21 00:15:28 2006 Subject: [z3-five] Re: Patch for testbrowser.py In-Reply-To: References: Message-ID: <44480881.4070003@weitershausen.de> Daniel Nouri wrote: > 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) > Brian, since you added Five.testbrowser, perhaps you can say something about this patch and, if you think it's sound, apply it to 1.4 and the trunk? Thanks Philipp From jinty at web.de Fri Apr 21 12:45:07 2006 From: jinty at web.de (Brian Sutherland) Date: Fri Apr 21 12:44:20 2006 Subject: [z3-five] Re: Patch for testbrowser.py In-Reply-To: <44480881.4070003@weitershausen.de> References: <44480881.4070003@weitershausen.de> Message-ID: <20060421104507.GA8457@minipas.home> On Fri, Apr 21, 2006 at 12:17:37AM +0200, Philipp von Weitershausen wrote: > Daniel Nouri wrote: > > 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) > > > > Brian, > > since you added Five.testbrowser, perhaps you can say something about > this patch and, if you think it's sound, apply it to 1.4 and the trunk? Thanks for kicking me on this, I've been meaning to reply a for a while. I think the best principle for the testbrowser in Five would be to keep it as close to the Zope3 one as possible. As we would probably want to merge the two if Zope2 uses the Zope3 publisher. To be honest I am not enough into the zen of publishers to know the answer but I don't see any analogue in the Zope3 testbrowser. I'm CC'ing Z3-dev to see if anyone there knows better. -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From daniel.nouri at gmail.com Fri Apr 21 16:07:43 2006 From: daniel.nouri at gmail.com (Daniel Nouri) Date: Fri Apr 21 16:08:14 2006 Subject: [z3-five] Re: Patch for testbrowser.py In-Reply-To: <20060421104507.GA8457@minipas.home> References: <44480881.4070003@weitershausen.de> <20060421104507.GA8457@minipas.home> Message-ID: The relevant code in Zope2's ZPublisher.HTTPResponse.__str__: # ... we just built a headersl list using self.heders if self.cookies: headersl = headersl+self._cookie_list() headersl[len(headersl):] = [self.accumulated_headers, body] return '\n'.join(headersl) Maybe this can shed some light on whether we want to include that patch. Daniel From pw_lists at slinkp.com Fri Apr 21 18:23:55 2006 From: pw_lists at slinkp.com (Paul Winkler) Date: Fri Apr 21 18:24:46 2006 Subject: [z3-five] Re: Patch for testbrowser.py In-Reply-To: References: <44480881.4070003@weitershausen.de> <20060421104507.GA8457@minipas.home> Message-ID: <20060421162355.GA9625@slinkp.com> On Fri, Apr 21, 2006 at 04:07:43PM +0200, Daniel Nouri wrote: > The relevant code in Zope2's ZPublisher.HTTPResponse.__str__: > > # ... we just built a headersl list using self.heders > if self.cookies: > headersl = headersl+self._cookie_list() > headersl[len(headersl):] = [self.accumulated_headers, body] > return '\n'.join(headersl) > > Maybe this can shed some light on whether we want to include that patch. As an aside: What's with assigning to headersl[len(headersl):] instead of calling headersl.extend(...)? I've seen this idiom a couple of times and I always wonder why, it's much less readable IMO. I doubt it's supposed to be an optimization, since this code runs only once per request; anyway, the two idioms are about equivalent in speed AFAICT. If it were in a performance-sensitive loop, a bit faster and still quite readable would be: headersl += [self.accumulated_headers, body] timeit confirms this, here on python 2.4.2: >>> import timeit >>> slicer = timeit.Timer('x[len(x):] = [4,5,6]', 'x=[1,2,3]') >>> adder = timeit.Timer('x += [4,5,6]', 'x=[1,2,3]') >>> extender = timeit.Timer('x.extend([4,5,6])', 'x=[1,2,3]') >>> n = 1000000) >>> slicer.timeit(n) 2.6605889797210693 >>> extender.timeit(n) 2.5256669521331787 >>> adder.timeit(n) 1.9388060569763184 -- Paul Winkler http://www.slinkp.com From jmo at chalmers.se Fri Apr 21 20:42:29 2006 From: jmo at chalmers.se (Jean-Marc Orliaguet) Date: Fri Apr 21 21:01:53 2006 Subject: [z3-five] Intids missing adapter declarations? Message-ID: <44492795.6000506@chalmers.se> Hi, I had to add this to my configure.zcml file to get IntIds running: Otherwise I'd get: File "/home/jmo/philikon-local-components/lib/python/zope/app/intid/__init__.py", line 110, in register key = IKeyReference(ob) File "/home/jmo/philikon-local-components/lib/python/zope/interface/interface.py", line 691, in __call__ raise TypeError("Could not adapt", obj, self) TypeError: ('Could not adapt', Theme('A theme'), ) ref: http://svn.z3lab.org/trac/z3lab/file/CPSSkins4Five/trunk/configure.zcml cheers /JM From philipp at weitershausen.de Fri Apr 21 21:34:11 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri Apr 21 21:32:03 2006 Subject: [z3-five] Re: Intids missing adapter declarations? In-Reply-To: <44492795.6000506@chalmers.se> References: <44492795.6000506@chalmers.se> Message-ID: <444933B3.5040703@weitershausen.de> Jean-Marc Orliaguet wrote: > I had to add this to my configure.zcml file to get IntIds running: [snip] Or you could just have done :) Five doesn't load every single bit of ZCML that Zope 3 provides. Mostly because this might open cans of worms. So before someone hasn't tested it, we won't include it. It is pretty safe to just include the packages you need from your package. You don't need Five to include it. Philipp From tseaver at palladion.com Fri Apr 21 23:45:29 2006 From: tseaver at palladion.com (Tres Seaver) Date: Fri Apr 21 23:50:43 2006 Subject: [z3-five] Re: Patch for testbrowser.py In-Reply-To: <20060421162355.GA9625@slinkp.com> References: <44480881.4070003@weitershausen.de> <20060421104507.GA8457@minipas.home> <20060421162355.GA9625@slinkp.com> Message-ID: <44495279.7060202@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Paul Winkler wrote: > On Fri, Apr 21, 2006 at 04:07:43PM +0200, Daniel Nouri wrote: > >>The relevant code in Zope2's ZPublisher.HTTPResponse.__str__: >> >> # ... we just built a headersl list using self.heders >> if self.cookies: >> headersl = headersl+self._cookie_list() >> headersl[len(headersl):] = [self.accumulated_headers, body] >> return '\n'.join(headersl) >> >>Maybe this can shed some light on whether we want to include that patch. > > > As an aside: > > What's with assigning to headersl[len(headersl):] instead of calling > headersl.extend(...)? > > I've seen this idiom a couple of times and I always wonder > why, it's much less readable IMO. > > I doubt it's supposed to be an optimization, since this code runs only > once per request; anyway, the two idioms are about equivalent in speed > AFAICT. > > If it were in a performance-sensitive loop, a bit faster > and still quite readable would be: > > headersl += [self.accumulated_headers, body] > > timeit confirms this, here on python 2.4.2: I think this may be a fossil from a much earlier version of Python, in which 'list.extend' had undesirable performance (the new one is O(1)-amortized, I think). 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 iD8DBQFESVJ5+gerLs4ltQ4RAlseAKDVL5ABbRYGSzNtaLUVeu37WPTBCwCfW9pp c1gst1YN+xssxW2ZFhHWt88= =bcvP -----END PGP SIGNATURE----- From jmo at chalmers.se Sun Apr 23 20:56:53 2006 From: jmo at chalmers.se (Jean-Marc Orliaguet) Date: Sun Apr 23 21:16:23 2006 Subject: [z3-five] [ANN] CPSSkins4Five and CPS4/Z3ECM Paris sprint report Message-ID: <444BCDF5.7000501@chalmers.se> Hi! I've written a report on the work I did during the CPS4/Z3ECM sprint i Paris: http://www.z3lab.org/sections/blogs/jean-marc-orliaguet/2006_04_23_cps4-z3ecm-paris-sprint there is also a new zope2 product called CPSSkins4Five for running cpsskins (for zope3) on zope2 . http://svn.z3lab.org/trac/z3lab/browser/CPSSkins4Five/trunk/ here is an animation too: http://www.z3lab.org/sections/front-page/design-features/cpsskins4five-preview all this is very experimental and requires branches that haven't been merged into zope2/zope3/five trunks yet. But as a proof-of-concept it works. Regards /JM From jmo at chalmers.se Mon Apr 24 16:14:53 2006 From: jmo at chalmers.se (Jean-Marc Orliaguet) Date: Mon Apr 24 16:34:25 2006 Subject: [z3-five] path adapters in Five? Message-ID: <444CDD5D.4030604@chalmers.se> Hi, are path adapters supported in Five? http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/TALESPathExpressionAdapters /JM From philipp at weitershausen.de Fri Apr 28 15:34:21 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri Apr 28 15:32:14 2006 Subject: [z3-five] Re: SVN: Products.Five/branches/regebro-traversal_refactor/ Removed last rests of Traversable usage. Deprecated Traversable and FiveTraversable. In-Reply-To: <20060428092534.222BE2032C8@mail.zope.org> References: <20060428092534.222BE2032C8@mail.zope.org> Message-ID: <445219DD.1050002@weitershausen.de> Lennart Regebro wrote: > Log message for revision 67698: > Removed last rests of Traversable usage. Deprecated Traversable and FiveTraversable. YAY! > Modified: Products.Five/branches/regebro-traversal_refactor/traversable.py > =================================================================== > --- Products.Five/branches/regebro-traversal_refactor/traversable.py 2006-04-28 08:54:44 UTC (rev 67697) > +++ Products.Five/branches/regebro-traversal_refactor/traversable.py 2006-04-28 09:25:33 UTC (rev 67698) > @@ -15,6 +15,10 @@ > > $Id$ > """ > + > +import warnings > +import zope.deprecation > + > from zope.component import getMultiAdapter, ComponentLookupError > from zope.interface import implements, Interface > from zope.publisher.interfaces import ILayer > @@ -58,6 +62,13 @@ > # 2. Otherwise do attribute look-up or, if that doesn't work, > # key item lookup. > > + if zope.deprecation.__show__(): This is usage of the show switch doesn't make any sense, by the way, especially not when you're using warnings.warn afterwards. DeprecationWarnings are disabled via the Python command line and a global warning filter. > + warnings.warn("The view lookup done by Traversable." \ > + "__bobo_traverse__ is now done by the standard " \ > + "traversal. This class is no longer needed and " > + "will be removed in Zope 2.12.", > + DeprecationWarning, 2) > + > if hasattr(self, '__fallback_traverse__'): > try: > return self.__fallback_traverse__(REQUEST, name) > @@ -119,6 +130,14 @@ This deprecation warning doesn't make sense to me. IMO, the Traversable class should become a deprecated and *empty* class, just so that importing and subclassing it will still work. The rest of its functionality should be useless now. Note that in case you merge this branch after my 'zope33-port' branch, you'll get a conflict on the Traversable class because I modified it on the branch. That's ok, though. As said, Traversable should probably just be completely empty. > class FiveTraversable(DefaultTraversable): > > + def __init__(self, subject): > + if zope.deprecation.__show__(): > + warnings.warn("The FiveTraversable class is no longer needed, " \ > + "and will be removed in Zope 2.12.", > + DeprecationWarning, 2) > + > + self._subject = subject > + > def traverse(self, name, furtherPath): > context = self._subject > __traceback_info__ = (context, name, furtherPath) > You can remove this deprecation warnings again :). Five's 'zope33-port' branch already got rid of FiveTraversable. By the way, don't forget to put your estimate on when you'll be able to merge your two branches into the Zope 2.10 wiki: http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks. Otherwise the release managers might decide on an early feature freeze date. I will merge my changes either Tuesday or Wednesday next week. Perhaps we should coordinate, especially regarding Five. Being-away-from-the-internet-for-the-weekend-ly, Philipp From regebro at gmail.com Fri Apr 28 20:33:10 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri Apr 28 20:33:50 2006 Subject: [z3-five] Re: SVN: Products.Five/branches/regebro-traversal_refactor/ Removed last rests of Traversable usage. Deprecated Traversable and FiveTraversable. In-Reply-To: <445219DD.1050002@weitershausen.de> References: <20060428092534.222BE2032C8@mail.zope.org> <445219DD.1050002@weitershausen.de> Message-ID: <319e029f0604281133u4c62deceoa27653d46a48c71d@mail.gmail.com> On 4/28/06, Philipp von Weitershausen wrote: > > + if zope.deprecation.__show__(): > > This is usage of the show switch doesn't make any sense, by the way, > especially not when you're using warnings.warn afterwards. > DeprecationWarnings are disabled via the Python command line and a > global warning filter. OK. I just did it to get rid of warnings in the unit tests. I can get rid of them, no problemo. > This deprecation warning doesn't make sense to me. IMO, the Traversable > class should become a deprecated and *empty* class, just so that > importing and subclassing it will still work. The rest of its > functionality should be useless now. Sure. I actually did this mostly because I didn't know how to issue a deprecation warning for subclassing a class. :) > By the way, don't forget to put your estimate on when you'll be able to > merge your two branches into the Zope 2.10 wiki: > http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks. Righto! > Being-away-from-the-internet-for-the-weekend-ly, Well, welcome back on Tuesday, when the branches are merged! ;) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From Jean-Francois.Doyon at CCRS.NRCan.gc.ca Sat Apr 29 00:24:20 2006 From: Jean-Francois.Doyon at CCRS.NRCan.gc.ca (Doyon, Jean-Francois) Date: Sat Apr 29 00:25:03 2006 Subject: [z3-five] Problem overriding IUserPreferredLanguages Message-ID: <7CDD7B94357FD5119E800002A537C46E0B8B7EE5@s5-ccr-r1.ccrs.nrcan.gc.ca> Hello, First of all, note that is my very first forry into Five/Zope 3 ... (Though I know 2.7 well!) I'm using 2.9.2 right now. I'm trying to use my own system of determining the language to use, based on the URL. Using Five/i18n.py and http://codespeak.net/z3/five/i18n.html, I've created a very small product to start with: i18n.py: from zope.interface import implements from zope.i18n.interfaces import IUserPreferredLanguages class PathLanguages(object): implements(IUserPreferredLanguages) def __init__(self, context): self.context = context def getPreferredLanguages(self): request = self.context stack = request['TraversalRequestNameStack'] if stack and len(stack) > 0 and stack[-1] in ['en', 'fr']: # A language entry is in the path lang = stack.pop(-1) # Rewrite the path so all links will have the language path entry base_parts = request['VIRTUAL_URL_PARTS'][1] request.setVirtualRoot([base_parts] + [lang]) return [lang] else: return ['en'] And overrides.zcml: But this seems to do absolutely nothing :( I've tried adding raises or prints in the code and so on, but as best I can tell, it never gets called. The __init__ for the Product is empty. Basically, it's my first Five product, and it's only supposed to set the language, but I can't even get it to do that. Anyone care to point me in the right direction? Thanks in advance for the help ... Jean-Fran?ois Doyon Internet Service Development and Systems Support / Sp?cialiste de d?veloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de t?l?d?tection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./T?l.: (613) 992-4902 Fax: (613) 947-2410 From optilude at gmx.net Sun Apr 30 22:00:44 2006 From: optilude at gmx.net (Martin Aspeli) Date: Sun Apr 30 22:01:33 2006 Subject: [z3-five] How the hell do I debug assert _context.stack[-1].context is context Message-ID: Hi guys, We're diving into Z3/Five very seriously for the future Plone 3.0 release, and mostly it's proving a great benefit. However, I have one recurring problem (that I'm sure I'm not alone about). Products/CMFPlone/configure.zcml includes an . This in turn has an (not in svn yet, but you get the idea - I doubt the second include makes any difference anyway). This file references interfaces (for=".interfaces.IFooBar"), classes (class=".menu.ActionsMenu") etc. If there are any errors in that file - if I refer to an interface that doesn't exist, for example, or if there are syntax errors or run-time errors reading in the modules .interfaces or .menu, I get this: LOG('Five', ERROR, 'Could not import Product %s' % product.__name__, error=exc) Traceback (most recent call last): File "testMenu.py", line 9, in ? from Products.CMFPlone.tests import PloneTestCase File "/Users/optilude/Development/Plone/Personal/plone3.0-zope2.9/Products/CMFPlone/tests/PloneTestCase.py", line 7, in ? from Products.PloneTestCase.ptc import * File "/Users/optilude/Development/Plone/Personal/plone3.0-zope2.9/Products/PloneTestCase/ptc.py", line 16, in ? from Products.PloneTestCase.setup import PLONE21 File "/Users/optilude/Development/Plone/Personal/plone3.0-zope2.9/Products/PloneTestCase/setup.py", line 54, in ? ZopeTestCase.installProduct('Five') File "/Users/optilude/Development/Plone/Zope/2.9/current/lib/python/Testing/ZopeTestCase/ZopeLite.py", line 157, in installProduct get_folder_permissions(), raise_exc=1) File "/Users/optilude/Development/Plone/Zope/2.9/2.9.2/lib/python/OFS/Application.py", line 790, in install_product initmethod(context) File "/Users/optilude/Development/Plone/Zope/2.9/2.9.2/lib/python/Products/Five/__init__.py", line 29, in initialize zcml.load_site() File "/Users/optilude/Development/Plone/Zope/2.9/2.9.2/lib/python/Products/Five/zcml.py", line 41, in load_site _context = xmlconfig.file(file) File "/Users/optilude/Development/Plone/Zope/2.9/current/lib/python/zope/configuration/xmlconfig.py", line 554, in file include(context, name, package) File "/Users/optilude/Development/Plone/Zope/2.9/current/lib/python/zope/configuration/xmlconfig.py", line 492, in include assert _context.stack[-1].context is context AssertionError It must swallow an exception somewhere, but I can't figure out where. The code is confusing to me, and my attempts at pdb didn't get me any closer. I'm wondering if I'm doing something wrong - in which case, please let me know. I've lost probably a few hours to this thing over the past week, because things that are very simple become nearly impossible to locate without significant amounts of trial-and-error. :-( Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From optilude at gmx.net Sun Apr 30 22:02:29 2006 From: optilude at gmx.net (Martin Aspeli) Date: Sun Apr 30 22:05:44 2006 Subject: [z3-five] Re: Viewlets in Five? References: <4447936C.5000809@eastlink.ca> Message-ID: On Thu, 20 Apr 2006 14:58:04 +0100, David Pratt wrote: > Quick question. Are viewlets available in Five? Alec Mitchell spent a good part of last week fixing these up. I believe they are working now (and he made a heroic effort to make them do so - most of that time, of course, was spent writing tests). He's on his way to the states, but when he lands, I'm sure he'll have more to say. It's my understanding this will go into Five proper imminently. Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From fairwinds at eastlink.ca Mon May 1 00:32:49 2006 From: fairwinds at eastlink.ca (David Pratt) Date: Mon May 1 00:33:27 2006 Subject: [z3-five] Re: Viewlets in Five? In-Reply-To: References: <4447936C.5000809@eastlink.ca> Message-ID: <44553B11.3030204@eastlink.ca> Hi Martin. This is some very good news! Many thanks Alec for this effort. Regards, David Martin Aspeli wrote: > On Thu, 20 Apr 2006 14:58:04 +0100, David Pratt > wrote: > >> Quick question. Are viewlets available in Five? > > Alec Mitchell spent a good part of last week fixing these up. I believe > they are working now (and he made a heroic effort to make them do so - > most of that time, of course, was spent writing tests). He's on his way > to the states, but when he lands, I'm sure he'll have more to say. It's > my understanding this will go into Five proper imminently. > > Martin > > --"You can just adapt yourself out of it..." // Archipelago sprint > 26/04/2006 > > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From philipp at weitershausen.de Tue May 2 18:03:20 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue May 2 18:01:07 2006 Subject: [z3-five] Five: Feature freeze and release fest tomorrow Message-ID: There will be a feature freeze for the Five trunk tomorrow evening, let's say around 20:00 hrs CET. At that time I will create the Five 1.5 branch, tag Five 1.5 beta and include it in the Zope 2 trunk which I expect will see a release in a few days as Zope 2.10 beta. At the same time, I will also cut a Five 1.4c (candidate) release. Five 1.4 has the same features as Five 1.5, but works with Zope 2.9 instead of Zope 2.10. There will also be Five 1.3.x and 1.2.x bugfixes. So, if everything goes well we'll see tomorrow: * Five 1.5b * Five 1.4c * Five 1.3.5 * Five 1.2.4 Please get your patches in by tomorrow. Philipp From philipp at weitershausen.de Tue May 2 19:00:42 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue May 2 18:58:24 2006 Subject: [z3-five] Re: How the hell do I debug assert _context.stack[-1].context is context In-Reply-To: References: Message-ID: <4457903A.2020401@weitershausen.de> Martin Aspeli wrote: > Hi guys, > > We're diving into Z3/Five very seriously for the future Plone 3.0 > release, and mostly it's proving a great benefit. However, I have one > recurring problem (that I'm sure I'm not alone about). > > Products/CMFPlone/configure.zcml includes an />. This in turn has an (not in svn > yet, but you get the idea - I doubt the second include makes any > difference anyway). > > This file references interfaces (for=".interfaces.IFooBar"), classes > (class=".menu.ActionsMenu") etc. If there are any errors in that file - > if I refer to an interface that doesn't exist, for example, or if there > are syntax errors or run-time errors reading in the modules .interfaces > or .menu, I get this: > ... > ZopeTestCase.installProduct('Five') Bad, bad boy. Bad, bad, bad, bad, bad, bad... You get the idea :) I'm not sure that this is the cause of your problems, but I wouldn't be surprised. Other than that, I've *never* seen this error. If you can put together a small test case (NOT Plone) that demonstrates this weird error (could be a product with some failing imports, perhaps), I'd be happy to take a look at it. Philipp From daniel.nouri at gmail.com Tue May 2 19:42:42 2006 From: daniel.nouri at gmail.com (Daniel Nouri) Date: Tue May 2 19:43:48 2006 Subject: [z3-five] Re: Five: Feature freeze and release fest tomorrow In-Reply-To: References: Message-ID: Can we put the one line testbrowser patch in, please? Without it, testbrowser never gets to see Cookie headers, which I consider quite a PIA. Currently, I'm including the patched version of Five's testbrowser module in a test for the PasswordResetTool Product here: http://dev.plone.org/collective/browser/PasswordResetTool/trunk/tests/utils/testbrowser.py The patch: 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) Daniel From optilude at gmx.net Tue May 2 21:16:29 2006 From: optilude at gmx.net (Martin Aspeli) Date: Tue May 2 21:17:16 2006 Subject: [z3-five] Re: How the hell do I debug assert _context.stack[-1].context is context References: <4457903A.2020401@weitershausen.de> Message-ID: On Tue, 02 May 2006 18:00:42 +0100, Philipp von Weitershausen wrote: >> ZopeTestCase.installProduct('Five') > > Bad, bad boy. Bad, bad, bad, bad, bad, bad... You get the idea :) > > I'm not sure that this is the cause of your problems, but I wouldn't be > surprised. Other than that, I've *never* seen this error. If you can put > together a small test case (NOT Plone) that demonstrates this weird > error (could be a product with some failing imports, perhaps), I'd be > happy to take a look at it. Right, bad PloneTestCase, I think. Apparently whit has a branch that works better, but it's not working for every case. I guess we're onto it. However, I could've sworn this happened on regular startup, too, but I can't reproduce now, so maybe it was just my imagination. Thanks for the pointer! Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From daniel.nouri at gmail.com Wed May 3 01:32:49 2006 From: daniel.nouri at gmail.com (Daniel Nouri) Date: Wed May 3 01:33:52 2006 Subject: [z3-five] Re: Five: Feature freeze and release fest tomorrow In-Reply-To: References: Message-ID: So, after talking to philiKON and jinty on IRC, I wrote this rather kludgy test that shows that there's a problem with the current implementation of testbrowser in Five and cookies. Attached is a patch that contains both the test and the fix. Note that I couldn't find the time to write a test for Zope 3 that would show that the Zope 3 setup does *not* eat away your cookies. jinty suggested I should do that, but I think the included test makes things clear enough. Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: Five.testbrowser-trunk.diff Type: text/x-patch Size: 3487 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060503/e5388d14/Five.testbrowser-trunk.bin From jinty at web.de Wed May 3 03:03:49 2006 From: jinty at web.de (Brian Sutherland) Date: Wed May 3 03:02:43 2006 Subject: [z3-five] Re: Five: Feature freeze and release fest tomorrow In-Reply-To: References: Message-ID: <20060503010349.GE12606@minipas.home> On Wed, May 03, 2006 at 01:32:49AM +0200, Daniel Nouri wrote: > So, after talking to philiKON and jinty on IRC, I wrote this rather > kludgy test that shows that there's a problem with the current > implementation of testbrowser in Five and cookies. > > Attached is a patch that contains both the test and the fix. Note that > I couldn't find the time to write a test for Zope 3 that would show that > the Zope 3 setup does *not* eat away your cookies. jinty suggested I > should do that, but I think the included test makes things clear enough. I just wanted an example of what Zope3 does, but was too lazy to find one myself. But yeah, your test makes it absolutely clear to me that this is a bug we need to fix. I'll commit your patch (or something like it) to the trunk and Five 1.4 branches. Sometimes it's easier to understand tests than patches or english. > + >>> response = self.publish('/test_folder_1_') > + >>> print str(response) # doctest: +ELLIPSIS > + Status: 200 OK > + X-Powered-By: Zope (www.zope.org), Python (www.python.org) > + Content-Length: 0 > + Set-Cookie: evil="cookie" Interesting, Zope3 does not put quotes around cookie values, but Zope2 always does. I wonder which is right? -- 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 May 4 01:51:33 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu May 4 01:49:26 2006 Subject: [z3-five] Five release fest: 1.2.4, 1.3.5, 1.4c and 1.5b released! Message-ID: <44594205.4070206@weitershausen.de> The Five team is happy to announce the release of two Five bugfix releases, 1.2.4 and 1.3.5, as well as two Five betas, 1.4c and 1.5b today. What is Five ------------ Five is a Zope 2 product that allows you to integrate Zope 3 technologies into Zope 2, today. Among others, it allows you to use Zope 3 interfaces, ZCML-based configuration, adapters, browser pages (including skins, layers, and resources), automated add and edit forms based on schemas, object events, as well as Zope 3-style i18n message catalogs. We've tried to keep the Five experience as close to Zope 3 as possible, so this means that what you learn while using Five should also be applicable to Zope 3, and viceversa. More information about Five can be found on our website, http://codespeak.net/z3/five/. About Five 1.4 and 1.5 ---------------------- Five 1.4 and 1.5 are feature releases. They are basically equivalent except that Five 1.4 works with Zope 2.9/3.2 (only) and 1.5 works with Zope 2.10/3.3 (only). Five 1.5 will be included in Zope 2.10. Most important features are: * Added viewlet and content provider support. A big thanks to Alec Mitchell and his helpers at the Archipelago sprint for making this possible. * Add zope.formlib support. Please see ``doc/formlib.txt`` for more information. A big thanks to Jan-Wijbrand Kolman for this. * Port zope.testbrowser to Zope 2. You can now use Products.Five.testbrowser.Browser in functional tests. Much thanks to Brian Sutherland. * Add python-packages-as-zope-products support which basically allows for using any python package as a zope product without it having to live in Products/. Much thanks to Rocky Burt for this. Zope 2.10 and Five 1.5 are also a big milestone in the convergence of Zope 2 and Zope 3, for it is no longer necessary to mark classes with five:traversable and five:defaultViewable to enable Zope 3 view lookup functionality. A big thanks goes to Lennart Regebro and Michael Kerrin for making this possible! Changes in Five 1.2.4, 1.3.5 and 1.4c (compared to 1.4b) -------------------------------------------------------- * Made sure that events are fired as expected in add and edit forms. * Made sure LocalizerLanguages class normalized language codes to xx-yy, instead of xx_YY or xx-YY. * Fixed a problem with the new traversal look-up order and the root object (OFS.Application.Application). About the Zope 3 Base --------------------- Five is part of the *Zope 3 Base* project, which aims to offer an approachable area for developers of Zope 3 related software. More about the Zope 3 base and its projects can be found on the project website, http://codespeak.net/z3/. From pete-lists at bcmpweb.com Thu May 4 11:53:10 2006 From: pete-lists at bcmpweb.com (Peter Simmons) Date: Thu May 4 11:53:54 2006 Subject: [z3-five] I have a content type as a zope 3 class how do I add it to a site? Message-ID: <4459CF06.4050902@bcmpweb.com> Hi, I am missing something here but how would I go about adding a content type that I created using the Zope 3 way of doing things to a Zope 2 site? Do I need to subclass my type and also from SimpleItem (or some similar class like BaseObject or Folder or whatever)? Cheers, Pete From plone at kevinkal.com Thu May 4 16:31:19 2006 From: plone at kevinkal.com (kevin7kal) Date: Thu May 4 16:32:06 2006 Subject: [z3-five] Error in Product - works under Five 1.31, not under 1.33 or 1.35 Message-ID: <445A1037.7080409@kevinkal.com> I have a product/application that works well under Zope 2.91 with Five 1.31 but not under Zope 2.92 with Five 1.33 or Five 1.35. The product adds a menu item to the ZMI add drop down menu. When I add a new object through the ZMI the object is added, I can enter a value in a field and click add and every thing works as expected. Under Zope 2.92 with both Five 1.33 and 1.35 I recieve an error Site Error Resource Not Found Sorry, the requested resource was not found check the resource and try again Resource: + GET I thought that adding the line to configure.zcml was the fix for this? I also have There is no error event.log, this looks more like a 404 error. As always, all help is appreciated. -Kevin From plone at kevinkal.com Thu May 4 17:15:06 2006 From: plone at kevinkal.com (kevin7kal) Date: Thu May 4 17:15:52 2006 Subject: [z3-five] Error in Product - works under Five 1.31, not under 1.33 or 1.35 In-Reply-To: <445A1037.7080409@kevinkal.com> References: <445A1037.7080409@kevinkal.com> Message-ID: <445A1A7A.5080506@kevinkal.com> Ok, I found the problem. The issue was with I can say that Zope 2.9.1 built with Python 2.3.5 allowed for where Zope 2.9.2 built with either Python 2.4.1 or Python 2.4.3 needs to have -Kevin kevin7kal wrote: > I have a product/application that works well under Zope 2.91 with Five > 1.31 but not under Zope 2.92 with Five 1.33 or Five 1.35. > > The product adds a menu item to the ZMI add drop down menu. When I > add a new object through the ZMI the object is added, I can enter a > value in a field and click add and every thing works as expected. > > Under Zope 2.92 with both Five 1.33 and 1.35 I recieve an error > Site Error > Resource Not Found > Sorry, the requested resource was not found > check the resource and try again > Resource: + GET > > I thought that adding the line > to configure.zcml was > the fix for this? > I also have > > There is no error event.log, this looks more like a 404 error. > As always, all help is appreciated. > > -Kevin > > > > > > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From philipp at weitershausen.de Thu May 4 20:02:24 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu May 4 20:00:02 2006 Subject: [z3-five] Five release fest: 1.2.4, 1.3.5, 1.4c and 1.5b released! In-Reply-To: <1146720392.17743.7.camel@fafhrd> References: <44594205.4070206@weitershausen.de> <1146720392.17743.7.camel@fafhrd> Message-ID: <445A41B0.4060903@weitershausen.de> Nikolay Kim wrote: > Hi Philip, > > i found bug in Five/browser/decode.py in setPageEncoding > > actually problems with IE it sends prefered charset iso-8859-1 > and setPageEncoding sets content-type to iso-8859-1, so with IE i get > UnicodeDecodeError even if i don't use national chars. > i don't know how to solve this problem right, right now locally i > hardcode utf-8 charset. I'm sorry I don't understand the problem. Perhaps you can write a functional test that demonstrates it? Take a look at Five's testbrowser functionality, it makes that very easy... Philipp From philipp at weitershausen.de Thu May 4 20:03:50 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu May 4 20:01:27 2006 Subject: [z3-five] Five release fest: 1.2.4, 1.3.5, 1.4c and 1.5b released! In-Reply-To: <1146720658.17743.11.camel@fafhrd> References: <44594205.4070206@weitershausen.de> <1146720658.17743.11.camel@fafhrd> Message-ID: <445A4206.4060202@weitershausen.de> Hi Nikolay, > it happens when browser:editform is used with "for" and "schema" > attributes and object support schema with adapter. > > Index: form/__init__.py > =================================================================== > --- form/__init__.py (revision 67959) > +++ form/__init__.py (working copy) > @@ -19,6 +19,7 @@ > from datetime import datetime > > import Acquisition > +from Acquisition import aq_base > import transaction > from zope.event import notify > from zope.schema.interfaces import ValidationError > @@ -63,7 +64,7 @@ > > def _setUpWidgets(self): > adapted = self.schema(self.context) > - if adapted is not self.context: > + if aq_base(adapted) is not aq_base(self.context): > if not ILocation.providedBy(adapted): > adapted = LocationProxy(adapted) > adapted.__parent__ = self.context > > Thanks for the patch. Can you please also create a test that exercises this code and include it in the patch? Thank you Philipp From pete-lists at bcmpweb.com Fri May 5 05:29:47 2006 From: pete-lists at bcmpweb.com (Peter Simmons) Date: Fri May 5 05:30:27 2006 Subject: [z3-five] I have a content type as a zope 3 class how do I add it to a site? In-Reply-To: <4459CF06.4050902@bcmpweb.com> References: <4459CF06.4050902@bcmpweb.com> Message-ID: <445AC6AB.9070500@bcmpweb.com> Hi All, I worked this one out I think. registerClass directive. cheers, Pete Peter Simmons wrote: > Hi, > > I am missing something here but how would I go about adding a content > type that I created using the Zope 3 way of doing things to a Zope 2 > site? > > Do I need to subclass my type and also from SimpleItem (or some > similar class like BaseObject or Folder or whatever)? > > Cheers, > Pete > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From pete-lists at bcmpweb.com Fri May 5 05:32:05 2006 From: pete-lists at bcmpweb.com (Peter Simmons) Date: Fri May 5 05:32:45 2006 Subject: [z3-five] Five 1.4c error with zope2.9 Message-ID: <445AC735.2080002@bcmpweb.com> Hi all, I tried installing the Five1.4c release under Python2.4.2, Zope2.9. On startup I get the following error. I went and had a look at Zope-2.9/lib/python/zope and there isn't any contentprovider package just like it says. Any ideas of the best way to fix? "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/ProviderExpression.py", line 28, in ? from zope.contentprovider import interfaces ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/etc/site.zcml", line 7.2-7.37 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/configure.zcml", line 4.2-4.30 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/meta.zcml", line 6.2-6.49 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/meta.zcml", line 43.4 ImportError: No module named contentprovider Full traceback below----------------- 2006-05-05T15:27:36 ERROR Zope Couldn't install Five Traceback (most recent call last): File "/opt/Zope-2.9/lib/python/OFS/Application.py", line 790, in install_product initmethod(context) File "/var/lib/zope2.9/instance/smart-trade/Products/Five/__init__.py", line 31, in initialize zcml.load_site() File "/var/lib/zope2.9/instance/smart-trade/Products/Five/zcml.py", line 41, in load_site _context = xmlconfig.file(file) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 554, in file include(context, name, package) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 353, in start_element_ns AttributesNSImpl(newattrs, qnames)) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 222, in startElementNS self.context.begin(name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 541, in begin self.stack.append(self.stack[-1].contained(__name, __data, __info)) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 840, in contained return RootStackItem.contained(self, name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 711, in contained adapter = factory(self.context, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 1184, in factory args = toargs(context, schema, data) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 1381, in toargs args[str(name)] = field.fromUnicode(s) File "/opt/Zope-2.9/lib/python/zope/configuration/fields.py", line 139, in fromUnicode value = self.context.resolve(name) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 184, in resolve mod = __import__(mname, *_import_chickens) File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/metaconfigure.py", line 39, in ? from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/pagetemplatefile.py", line 29, in ? from Products.Five.browser.TrustedExpression import getEngine, ModuleImporter File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/TrustedExpression.py", line 28, in ? from Products.Five.browser.ProviderExpression import ProviderExpr File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/ProviderExpression.py", line 28, in ? from zope.contentprovider import interfaces ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/etc/site.zcml", line 7.2-7.37 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/configure.zcml", line 4.2-4.30 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/meta.zcml", line 6.2-6.49 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/Five/browser/meta.zcml", line 43.4 ImportError: No module named contentprovider From philipp at weitershausen.de Fri May 5 07:19:37 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri May 5 07:17:25 2006 Subject: [z3-five] Re: Five 1.4c error with zope2.9 In-Reply-To: <445AC735.2080002@bcmpweb.com> References: <445AC735.2080002@bcmpweb.com> Message-ID: <445AE069.3040700@weitershausen.de> Peter Simmons wrote: > Hi all, > > I tried installing the Five1.4c release under Python2.4.2, Zope2.9. > > On startup I get the following error. I went and had a look at > Zope-2.9/lib/python/zope and there isn't any contentprovider package > just like it says. Any ideas of the best way to fix? ... > 2006-05-05T15:27:36 ERROR Zope Couldn't install Five > Traceback (most recent call last): ... > ImportError: No module named contentprovider > Ah, I forgot to mention that Five 1.4c currently requires Zope 2.9 branch. There hasn't been a release of Zope 2.9 yet that includes the (previously forgotten) contentprovier and viewlet packages. I expect Zope 2.9.3 isn't too far away. In the meantime you can just copy these packages over from a Zope 3.2 installation. Philipp From philipp at weitershausen.de Fri May 5 11:38:53 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri May 5 11:37:55 2006 Subject: [z3-five] Five release fest: 1.2.4, 1.3.5, 1.4c and 1.5b released! In-Reply-To: <1146811004.17743.18.camel@fafhrd> References: <44594205.4070206@weitershausen.de> <1146720392.17743.7.camel@fafhrd> <445A41B0.4060903@weitershausen.de> <1146811004.17743.18.camel@fafhrd> Message-ID: <445B1D2D.2000607@weitershausen.de> Nikolay Kim wrote: >> Nikolay Kim wrote: >>> Hi Philip, >>> >>> i found bug in Five/browser/decode.py in setPageEncoding >>> >>> actually problems with IE it sends prefered charset iso-8859-1 >>> and setPageEncoding sets content-type to iso-8859-1, so with IE i get >>> UnicodeDecodeError even if i don't use national chars. >>> i don't know how to solve this problem right, right now locally i >>> hardcode utf-8 charset. >> I'm sorry I don't understand the problem. Perhaps you can write a >> functional test that demonstrates it? Take a look at Five's testbrowser >> functionality, it makes that very easy... > > if browser sends prefered encoding different from site encoding add/edit > forms are used browser preffered encoding and for plone very easy get > UnicodeDecodeError Yes, please write a functional test that demonstrates the problem. I won't do anything before I can see how to reproduce the problem. Also, please post Five problems to the Five list (z3-five@codespeak.net). I'm just the release manager and not responsible for every bug... Philipp From apm13 at columbia.edu Fri May 5 16:35:44 2006 From: apm13 at columbia.edu (Alec Mitchell) Date: Fri May 5 16:36:22 2006 Subject: [z3-five] Five release fest: 1.2.4, 1.3.5, 1.4c and 1.5b released! In-Reply-To: <445A4206.4060202@weitershausen.de> References: <44594205.4070206@weitershausen.de> <1146720658.17743.11.camel@fafhrd> <445A4206.4060202@weitershausen.de> Message-ID: <365118370605050735mf4f29d8na6659ab22358c983@mail.gmail.com> The new releases of Five should all check aq_base, not the objects themselves. It actually uses obj.aq_base, instead of aq_base(obj) because the two differ in some cases and there seem to be cases where 'aq_base(context) != aq_base(adapted)' even though 'context.aq_base == adapted.aq_base'. Frightening stuff really. Alec On 5/4/06, Philipp von Weitershausen wrote: > Hi Nikolay, > > it happens when browser:editform is used with "for" and "schema" > > attributes and object support schema with adapter. > > > > Index: form/__init__.py > > =================================================================== > > --- form/__init__.py (revision 67959) > > +++ form/__init__.py (working copy) > > @@ -19,6 +19,7 @@ > > from datetime import datetime > > > > import Acquisition > > +from Acquisition import aq_base > > import transaction > > from zope.event import notify > > from zope.schema.interfaces import ValidationError > > @@ -63,7 +64,7 @@ > > > > def _setUpWidgets(self): > > adapted = self.schema(self.context) > > - if adapted is not self.context: > > + if aq_base(adapted) is not aq_base(self.context): > > if not ILocation.providedBy(adapted): > > adapted = LocationProxy(adapted) > > adapted.__parent__ = self.context > > > > > > Thanks for the patch. Can you please also create a test that exercises > this code and include it in the patch? > > Thank you > > Philipp > _______________________________________________ > z3-five mailing list > z3-five@codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From pete-lists at bcmpweb.com Sun May 7 01:15:24 2006 From: pete-lists at bcmpweb.com (Peter Simmons) Date: Sun May 7 01:16:11 2006 Subject: [z3-five] Re: Five 1.4c error with zope2.9 In-Reply-To: <445AE069.3040700@weitershausen.de> References: <445AC735.2080002@bcmpweb.com> <445AE069.3040700@weitershausen.de> Message-ID: <445D2E0C.1010409@bcmpweb.com> Hi Philip, And SQLOS list. I did what you said and am now getting the errors below with FiveSQLOS (and my TradeLoyalty based on FiveSQLOS) which I didn't get before. Its like the custom directives of sqlos are nolonger being loaded. Any ideas? Cheers, Pete 2006-05-06T12:43:15 ERROR Five Could not import Product Products.FiveSQLOS Traceback (most recent call last): File "/var/lib/zope2.9/instance/smart-trade/Products/Five/fiveconfigure.py", line 81, in loadProducts xmlconfig.include(_context, zcml, package=product) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns self._cont_handler.endElementNS(pair, None) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 326, in endElementNS self.context.end() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 544, in end self.stack.pop().finish() File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 690, in finish actions = self.handler(context, **args) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 353, in start_element_ns AttributesNSImpl(newattrs, qnames)) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 222, in startElementNS self.context.begin(name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 541, in begin self.stack.append(self.stack[-1].contained(__name, __data, __info)) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 840, in contained return RootStackItem.contained(self, name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 708, in contained factory = self.context.factory(self.context, name) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 487, in factory raise ConfigurationError("Unknown directive", ns, n) ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/FiveSQLOS/configure.zcml", line 7.2-7.37 ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/FiveSQLOS/dependencies.zcml", line 11.2-11.40 ZopeXMLConfigurationError: File "/opt/Zope-2.9/lib/python/zope/app/security/configure.zcml", line 22.2-22.39 ZopeXMLConfigurationError: File "/opt/Zope-2.9/lib/python/zope/app/security/globalmodules.zcml", line 5.2 ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/zope', u'module') ------ 2006-05-06T12:43:15 ERROR Five Could not import Product Products.TradeLoyalty Traceback (most recent call last): File "/var/lib/zope2.9/instance/smart-trade/Products/Five/fiveconfigure.py", line 81, in loadProducts xmlconfig.include(_context, zcml, package=product) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 490, in include processxmlfile(f, context) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 345, in processxmlfile parser.parse(src) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 353, in start_element_ns AttributesNSImpl(newattrs, qnames)) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 222, in startElementNS self.context.begin(name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 541, in begin self.stack.append(self.stack[-1].contained(__name, __data, __info)) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 840, in contained return RootStackItem.contained(self, name, data, info) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 708, in contained factory = self.context.factory(self.context, name) File "/opt/Zope-2.9/lib/python/zope/configuration/config.py", line 487, in factory raise ConfigurationError("Unknown directive", ns, n) ZopeXMLConfigurationError: File "/var/lib/zope2.9/instance/smart-trade/Products/TradeLoyalty/configure.zcml", line 8.2 ConfigurationError: ('Unknown directive', u'http://namespaces.sqlobject.org/sqlos', u'connectionName') ------ 2006-05-06T12:43:15 ERROR Zope Couldn't install Five Traceback (most recent call last): File "/opt/Zope-2.9/lib/python/OFS/Application.py", line 790, in install_product initmethod(context) File "/var/lib/zope2.9/instance/smart-trade/Products/Five/__init__.py", line 31, in initialize zcml.load_site() File "/var/lib/zope2.9/instance/smart-trade/Products/Five/zcml.py", line 41, in load_site _context = xmlconfig.file(file) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 554, in file include(context, name, package) File "/opt/Zope-2.9/lib/python/zope/configuration/xmlconfig.py", line 492, in include assert _context.stack[-1].context is context AssertionError Philipp von Weitershausen wrote: > Peter Simmons wrote: > >> Hi all, >> >> I tried installing the Five1.4c release under Python2.4.2, Zope2.9. >> >> On startup I get the following error. I went and had a look at >> Zope-2.9/lib/python/zope and there isn't any contentprovider package >> just like it says. Any ideas of the best way to fix? >> > ... > >> 2006-05-05T15:27:36 ERROR Zope Couldn't install Five >> Traceback (most recent call last): >> > ... > >> ImportError: No module named contentprovider >> >> > > Ah, I forgot to mention that Five 1.4c currently requires Zope 2.9 > branch. There hasn't been a release of Zope 2.9 yet that includes the > (previously forgotten) contentprovier and viewlet packages. I expect > Zope 2.9.3 isn't too far away. > > In the meantime you can just copy these packages over from a Zope 3.2 > installation. > > Philipp > > From emmanuel.masker at gednius.com Sun May 14 18:27:05 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Sun May 14 18:27:43 2006 Subject: [z3-five] To use view five in Plone Message-ID: <1147624026.8396.5.camel@localhost.localdomain> The problem is that you are using Zope3's SimpleViewClass, which uses z3 templates, which are not at all suported in Zope 2 at the moment. You need to be using the Five equivalents ZopeTwoPagetTemplateFile, MakeClassForTemplate, ... (or to make your life easier, just use browser:page which will use the Five stuff automatically). This is really a Five question, so perhaps it is best asked on the Five list. Good luck, Alec On 5/13/06, Emmanuel Masker wrote: > It does not work. > My view is correctly displayed but render by Zope3 machinery (i think) > since tales expression like 'here/...' is not recognize. Instead of > 'here' i have to use 'context' but pages macro from plone are not > accessed from there > Alec Mitchell a ?crit : > > Tray making your view inherit from Acquisition.Explicit or > > Five.browser.BrowserView, acquisition is necessary for the Zope 2 > > security mechanisms to allow the view lookup. > > > > Alec > > > > On 5/12/06, Emmanuel Masker wrote: > >> Hi, > >> > >> I 'm using five view for my own product in Plone. > >> But when page template is render, this tales expresion > >> tal="here/main_template/macros/master" is not recognized. I think > >> because my five view is a page template for Zope3. > >> > >> Five view is configured like that: > >> >> for="Products.ProductPharma.interfaces.ISynthese" > >> provides="Products.ProductPharma.interfaces.ISyntheseRead" > >> type="zope.publisher.interfaces.IRequest" > >> factory=".view.syntheseRead" > >> /> > >> > >> > >> Multi adaptator of this view is defined like that: > >> class syntheseRead(object): > >> implements(ISyntheseRead) > >> def __init__(self, context=None, request=None): > >> self.data = SimpleViewClass('SyntheseRead.pt')(context, request) > >> self.data.request.debug = False > >> > >> How can i five view and use render of Zope 2. It should be a solution > >> because when i defined a browser:page where template="SyntheseRead.pt', > >> there is no pb. I can put this page in plone context. > >> > >> Emmanuel. From regebro at gmail.com Sun May 14 18:46:49 2006 From: regebro at gmail.com (Lennart Regebro) Date: Sun May 14 18:47:25 2006 Subject: [z3-five] To use view five in Plone In-Reply-To: <1147624026.8396.5.camel@localhost.localdomain> References: <1147624026.8396.5.camel@localhost.localdomain> Message-ID: <319e029f0605140946m2b19cf7dhbc93883ff34db4b0@mail.gmail.com> On 5/14/06, Emmanuel Masker wrote: > The problem is that you are using Zope3's SimpleViewClass, which uses > z3 templates, which are not at all suported in Zope 2 at the moment. I don't understand why a view class is used there at all. > > >> class syntheseRead(object): > > >> implements(ISyntheseRead) > > >> def __init__(self, context=None, request=None): > > >> self.data = SimpleViewClass('SyntheseRead.pt')(context, > request) Why? I don't understand that at all. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From Cliff.Ford at ed.ac.uk Thu May 18 09:40:20 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Thu, 18 May 2006 08:40:20 +0100 Subject: [z3-five] Product location Message-ID: <446C24E4.4040504@ed.ac.uk> I guess I must have missed a key piece of documentation because I have fallen at the first hurdle. I produced an application for Zope 3 and I wanted to see how it would fare under Zope 2 (2.9.3) with Five (1.3.5 bundled). Some things are obviously missing (e.g. site.zcml.in) but I have put a site.zcml in INSTANCE/etc and xxx-configure.zcml in etc/package-includes. I get this in the event log: 2006-05-18T08:28:50 ERROR Zope Couldn't install Five Traceback (most recent call last): File "/usr/local/Zope-2.9.3/lib/python/OFS/Application.py", line 790, in install_product initmethod(context) File "/usr/local/Zope-2.9.3/lib/python/Products/Five/__init__.py", line 29, in initialize ... snip .... ZopeXMLConfigurationError: File "/usr/local/Zope293i/etc/site.zcml", line 11.2-11.55 ZopeXMLConfigurationError: File "/usr/local/Zope293i/etc/package-includes/montisite-configure.zcml", line 1.0-1.31 ConfigurationError: ('Invalid value for', 'package', "ImportError: Couldn't import montisite, No module named montisite") I have tried moving the package into the instance/Products folder and I have tried setting the PYTHONPATH and I have tried searching the mail archives. I do not know where my application is supposed to be located (I see some stuff in Five/doc/Products but they don't show up anywhere) and I do not know what I am supposed to see in the ZMI. Can anybody point me in the right direction? Cliff From rocky at serverzen.com Thu May 18 13:45:39 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 18 May 2006 09:15:39 -0230 Subject: [z3-five] Product location In-Reply-To: <446C24E4.4040504@ed.ac.uk> References: <446C24E4.4040504@ed.ac.uk> Message-ID: <1147952727.10142.4.camel@localhost> On Thu, 2006-18-05 at 08:40 +0100, Cliff Ford wrote: > I guess I must have missed a key piece of documentation because I have > fallen at the first hurdle. I produced an application for Zope 3 and I > wanted to see how it would fare under Zope 2 (2.9.3) with Five (1.3.5 > bundled). Some things are obviously missing (e.g. site.zcml.in) but I > have put a site.zcml in INSTANCE/etc and xxx-configure.zcml in > etc/package-includes. I get this in the event log: > > > 2006-05-18T08:28:50 ERROR Zope Couldn't install Five > Traceback (most recent call last): > File "/usr/local/Zope-2.9.3/lib/python/OFS/Application.py", line 790, > in install_product > initmethod(context) > File "/usr/local/Zope-2.9.3/lib/python/Products/Five/__init__.py", > line 29, in initialize > ... > snip > .... > ZopeXMLConfigurationError: File "/usr/local/Zope293i/etc/site.zcml", > line 11.2-11.55 > ZopeXMLConfigurationError: File > "/usr/local/Zope293i/etc/package-includes/montisite-configure.zcml", > line 1.0-1.31 > ConfigurationError: ('Invalid value for', 'package', "ImportError: > Couldn't > import montisite, No module named montisite") > > I have tried moving the package into the instance/Products folder and I > have tried setting the PYTHONPATH and I have tried searching the mail > archives. I do not know where my application is supposed to be located > (I see some stuff in Five/doc/Products but they don't show up anywhere) > and I do not know what I am supposed to see in the ZMI. Can anybody > point me in the right direction? Typically what I do is simply install my python code into $INSTANCE_HOME/lib/python (which is always on the PYTHONPATH when launching that particular instance). But you should be able to insert it anywhere that is on the PYTHONPATH. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060518/d5c32e68/attachment.pgp From Cliff.Ford at ed.ac.uk Thu May 18 20:47:27 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Thu, 18 May 2006 19:47:27 +0100 Subject: [z3-five] Product location In-Reply-To: <1147952727.10142.4.camel@localhost> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> Message-ID: <446CC13F.10700@ed.ac.uk> Hi Rocky, Thanks for helping me over the first hurdle. I managed to create one of the content objects from my Z3 project. Unfortunately I can't get it to display in its Z3 skin (/++skin++Skinname/path), and I can't edit it with its Z3 edit form (/path/edit.html). It seems that back-porting a Z3 app is not simple and I am inclined to go fishing instead. Still, useful experience. Cliff Rocky Burt wrote: > On Thu, 2006-18-05 at 08:40 +0100, Cliff Ford wrote: > >>I guess I must have missed a key piece of documentation because I have >>fallen at the first hurdle. I produced an application for Zope 3 and I >>wanted to see how it would fare under Zope 2 (2.9.3) with Five (1.3.5 >>bundled). Some things are obviously missing (e.g. site.zcml.in) but I >>have put a site.zcml in INSTANCE/etc and xxx-configure.zcml in >>etc/package-includes. I get this in the event log: >> >> >>2006-05-18T08:28:50 ERROR Zope Couldn't install Five >>Traceback (most recent call last): >> File "/usr/local/Zope-2.9.3/lib/python/OFS/Application.py", line 790, >>in install_product >> initmethod(context) >> File "/usr/local/Zope-2.9.3/lib/python/Products/Five/__init__.py", >>line 29, in initialize >>... >>snip >>.... >>ZopeXMLConfigurationError: File "/usr/local/Zope293i/etc/site.zcml", >>line 11.2-11.55 >> ZopeXMLConfigurationError: File >>"/usr/local/Zope293i/etc/package-includes/montisite-configure.zcml", >>line 1.0-1.31 >> ConfigurationError: ('Invalid value for', 'package', "ImportError: >>Couldn't >>import montisite, No module named montisite") >> >>I have tried moving the package into the instance/Products folder and I >>have tried setting the PYTHONPATH and I have tried searching the mail >>archives. I do not know where my application is supposed to be located >>(I see some stuff in Five/doc/Products but they don't show up anywhere) >>and I do not know what I am supposed to see in the ZMI. Can anybody >>point me in the right direction? > > > Typically what I do is simply install my python code into > $INSTANCE_HOME/lib/python (which is always on the PYTHONPATH when > launching that particular instance). But you should be able to insert > it anywhere that is on the PYTHONPATH. > > - Rocky > > From regebro at gmail.com Thu May 18 21:19:35 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 18 May 2006 21:19:35 +0200 Subject: [z3-five] Product location In-Reply-To: <446CC13F.10700@ed.ac.uk> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> Message-ID: <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> On 5/18/06, Cliff Ford wrote: > Thanks for helping me over the first hurdle. I managed to create one of > the content objects from my Z3 project. Unfortunately I can't get it to > display in its Z3 skin (/++skin++Skinname/path), and I can't edit it > with its Z3 edit form (/path/edit.html). It seems that back-porting a Z3 > app is not simple and I am inclined to go fishing instead. Still, useful > experience. It?s not expected to work, but it's very good to know what did not work. :-) Skins, this time, it seems. That means the situation is improving. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From philipp at weitershausen.de Thu May 18 23:31:18 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu, 18 May 2006 23:31:18 +0200 Subject: [z3-five] Product location In-Reply-To: <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> Message-ID: <446CE7A6.7050600@weitershausen.de> Lennart Regebro wrote: > On 5/18/06, Cliff Ford wrote: >> Thanks for helping me over the first hurdle. I managed to create one of >> the content objects from my Z3 project. Unfortunately I can't get it to >> display in its Z3 skin (/++skin++Skinname/path), and I can't edit it >> with its Z3 edit form (/path/edit.html). It seems that back-porting a Z3 >> app is not simple and I am inclined to go fishing instead. Still, useful >> experience. > > It?s not expected to work, but it's very good to know what did not work. :-) > > Skins, this time, it seems. That means the situation is improving. :-) Skins *are* supposed to work, in particular ++skin++ too. You just need a recentish Zope 2.8 or just get Zope 2.9. Philipp From Cliff.Ford at ed.ac.uk Fri May 19 09:36:27 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Fri, 19 May 2006 08:36:27 +0100 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <446CE7A6.7050600@weitershausen.de> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> Message-ID: <446D757B.3010103@ed.ac.uk> I decided to persevere with backporting a Z3 app to Z2 with Five, rather than go fishing, because there is a large potential payoff. My comment about skins may have been a red herring. This is the current situation: I am sub-classing a Zope Page Template so that I can use a view in a particular skin. I can create the PT object. If I call it TTW it displays its content (http://localhost:8080/test/mp.html). It does not seem to know that it is supposed to be a Z3 object. Called with the Z3 default view (http://localhost:8080/test/mp.html/@@index.html) I get this in the browser window: Site Error An error was encountered while publishing this resource. exceptions.TypeError Sorry, a site error occurred. Traceback (innermost last): * Module ZPublisher.Publish, line 194, in publish_module_standard * Module ZPublisher.Publish, line 146, in publish * Module ZPublisher.Publish, line 106, in publish * Module ZPublisher.BaseRequest, line 323, in traverse * Module Products.Five.traversable, line 109, in __bobo_traverse__ TypeError: attempt to wrap extension method using an object that is not an extension class instance. There is nothing in the error log. Same if a call the edit view. This is a fragment of browser/configure.zcml ... snip other stuff ... And this is a fragment of the ViewPage class: from Products.Five import BrowserView from AccessControl.SecurityInfo import ClassSecurityInfo from Globals import InitializeClass class ViewPage(BrowserView): """ Helper functions for page view templates """ security = ClassSecurityInfo() security.declarePublic('showme') # not used ... snip several functions not used by a simple template ... InitializeClass(ViewPage) I have looked at Five/doc/products/ViewsTutorial without result. Once again, any pointers on what I need to do would be appreciated. Cliff Philipp von Weitershausen wrote: > Lennart Regebro wrote: > >>On 5/18/06, Cliff Ford wrote: >> >>>Thanks for helping me over the first hurdle. I managed to create one of >>>the content objects from my Z3 project. Unfortunately I can't get it to >>>display in its Z3 skin (/++skin++Skinname/path), and I can't edit it >>>with its Z3 edit form (/path/edit.html). It seems that back-porting a Z3 >>>app is not simple and I am inclined to go fishing instead. Still, useful >>>experience. >> >>It?s not expected to work, but it's very good to know what did not work. :-) >> >>Skins, this time, it seems. That means the situation is improving. :-) > > > Skins *are* supposed to work, in particular ++skin++ too. You just need > a recentish Zope 2.8 or just get Zope 2.9. > > Philipp From regebro at gmail.com Fri May 19 09:55:58 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 19 May 2006 09:55:58 +0200 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <446D757B.3010103@ed.ac.uk> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <446D757B.3010103@ed.ac.uk> Message-ID: <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> On 5/19/06, Cliff Ford wrote: > I am sub-classing a Zope Page Template so that I can use a view in a > particular skin. Why would you need to subclass ZPT for that? > I can create the PT object. If I call it TTW it > displays its content (http://localhost:8080/test/mp.html). > It does not seem to know that it is supposed to be a Z3 object. There are no such thing as a Z3 object. :-) > Called with the Z3 > default view (http://localhost:8080/test/mp.html/@@index.html) That makes no sense to me. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From Cliff.Ford at ed.ac.uk Fri May 19 10:56:02 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Fri, 19 May 2006 09:56:02 +0100 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <446D757B.3010103@ed.ac.uk> <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> Message-ID: <446D8822.5010200@ed.ac.uk> Hello Lennart, Lennart Regebro wrote: > On 5/19/06, Cliff Ford wrote: > >> I am sub-classing a Zope Page Template so that I can use a view in a >> particular skin. > > > Why would you need to subclass ZPT for that? The use case: I built a Z2 system in which our content providers only needed to know about h, p, a, and img tags, although they can use more. That minimised our training and support overheads - important as many come from the sort of typing pool background where it seems common practice to hold the Tab key down to force page layout. The system involves a page template containing metadata and macro calls and a dtml document containing html. The content providers don't see and don't need to know about page templates. The system works wonderfully! However, my computing officer buddy (the stubborn guy in the REMOTE_USER story) keeps saying we shouldn't use two objects to do one job. So I did an implementation in Z3 that only uses page templates, and that seems to work just as well too. I think there is a better chance of persuading the CO to adopt a backport than a complete switch to Z3. >> I can create the PT object. If I call it TTW it >> displays its content (http://localhost:8080/test/mp.html). >> It does not seem to know that it is supposed to be a Z3 object. > > > There are no such thing as a Z3 object. :-) What I meant was: the page template renders itself directly rather than the view template being invoked to render it. >> Called with the Z3 >> default view (http://localhost:8080/test/mp.html/@@index.html) > > > That makes no sense to me. Again, what I meant was: the view templates default view is index.html and here I am calling it directly through the web, which works in Z3. Cliff From regebro at gmail.com Fri May 19 11:09:16 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 19 May 2006 11:09:16 +0200 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <446D8822.5010200@ed.ac.uk> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <446D757B.3010103@ed.ac.uk> <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> <446D8822.5010200@ed.ac.uk> Message-ID: <319e029f0605190209n34ee9689k912b5a932750a76a@mail.gmail.com> On 5/19/06, Cliff Ford wrote: > Hello Lennart, > > Lennart Regebro wrote: > > On 5/19/06, Cliff Ford wrote: > > > >> I am sub-classing a Zope Page Template so that I can use a view in a > >> particular skin. > > > > > > Why would you need to subclass ZPT for that? > > The use case: I built a Z2 system in which our content providers only > needed to know about h, p, a, and img tags, although they can use more. > That minimised our training and support overheads - important as many > come from the sort of typing pool background where it seems common > practice to hold the Tab key down to force page layout. The system > involves a page template containing metadata and macro calls and a dtml > document containing html. The content providers don't see and don't need > to know about page templates. The system works wonderfully! However, my > computing officer buddy (the stubborn guy in the REMOTE_USER story) > keeps saying we shouldn't use two objects to do one job. So I did an > implementation in Z3 that only uses page templates, and that seems to > work just as well too. I think there is a better chance of persuading > the CO to adopt a backport than a complete switch to Z3. OK, I have to admit I didn't understand that answer, but fine, you subclassed PageTemplates f?r some good reason. :) This may be a problem, becuase Zope2 and Zope3 has different page template implementations, and you can't call macros in one implementation from the other. But you'll get extremely weird errors when that happens, so you'll know. ;) > >> I can create the PT object. If I call it TTW it > >> displays its content (http://localhost:8080/test/mp.html). > >> It does not seem to know that it is supposed to be a Z3 object. > > > > There are no such thing as a Z3 object. :-) > > What I meant was: the page template renders itself directly rather than > the view template being invoked to render it. Oh, so you have a view, that subclasses from PageTemplate, and then you use a second page template to view it? I agree with your friend, don't use two objects to do one job. :-) > >> Called with the Z3 > >> default view (http://localhost:8080/test/mp.html/@@index.html) > > > > > > That makes no sense to me. > > Again, what I meant was: the view templates default view is index.html Can views have default views? In any case, they rarely do. :) The views are called, it's __call__ that is used to render them. The above url only makes sense to me if mp.html is not a view, but some sort of a content object. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From Cliff.Ford at ed.ac.uk Fri May 19 11:46:56 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Fri, 19 May 2006 10:46:56 +0100 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <319e029f0605190209n34ee9689k912b5a932750a76a@mail.gmail.com> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <446D757B.3010103@ed.ac.uk> <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> <446D8822.5010200@ed.ac.uk> <319e029f0605190209n34ee9689k912b5a932750a76a@mail.gmail.com> Message-ID: <446D9410.6060008@ed.ac.uk> Lennart Regebro wrote: > On 5/19/06, Cliff Ford wrote: > >> Hello Lennart, >> >> Lennart Regebro wrote: >> > On 5/19/06, Cliff Ford wrote: >> > >> >> I am sub-classing a Zope Page Template so that I can use a view in a >> >> particular skin. >> > >> > >> > Why would you need to subclass ZPT for that? >> >> The use case: I built a Z2 system in which our content providers only >> needed to know about h, p, a, and img tags, although they can use more. >> That minimised our training and support overheads - important as many >> come from the sort of typing pool background where it seems common >> practice to hold the Tab key down to force page layout. The system >> involves a page template containing metadata and macro calls and a dtml >> document containing html. The content providers don't see and don't need >> to know about page templates. The system works wonderfully! However, my >> computing officer buddy (the stubborn guy in the REMOTE_USER story) >> keeps saying we shouldn't use two objects to do one job. So I did an >> implementation in Z3 that only uses page templates, and that seems to >> work just as well too. I think there is a better chance of persuading >> the CO to adopt a backport than a complete switch to Z3. > > > OK, I have to admit I didn't understand that answer, but fine, you > subclassed PageTemplates f?r some good reason. :) > This may be a problem, becuase Zope2 and Zope3 has different page > template implementations, and you can't call macros in one > implementation from the other. But you'll get extremely weird errors > when that happens, so you'll know. ;) The sub class: from zope.app.zptpage.zptpage import ZPTPage I think Z2 templates are here:Products.PageTemplates.ZopePageTemplate But you may have put your finger on something. >> >> I can create the PT object. If I call it TTW it >> >> displays its content (http://localhost:8080/test/mp.html). >> >> It does not seem to know that it is supposed to be a Z3 object. >> > >> > There are no such thing as a Z3 object. :-) >> >> What I meant was: the page template renders itself directly rather than >> the view template being invoked to render it. > > > Oh, so you have a view, that subclasses from PageTemplate, and then > you use a second page template to view it? I agree with your friend, > don't use two objects to do one job. :-) No, the view is derived from BrowserView. >> >> Called with the Z3 >> >> default view (http://localhost:8080/test/mp.html/@@index.html) >> > >> > >> > That makes no sense to me. >> >> Again, what I meant was: the view templates default view is index.html > > > Can views have default views? In any case, they rarely do. :) > The views are called, it's __call__ that is used to render them. The > above url only makes sense to me if mp.html is not a view, but some > sort of a content object. A piece of configure.zcml: which should mean that I can get at the subclassed page content object via its id (mp.html) or its Z3 style name (mp.html/@@index.html) [name is not the right technical term, which I can't remember off hand]. And it ought to be using the viewpage.pt. If you think I am wasting my time on this please feel free to say so. I can always tell the CO we have something that works and there is no need to break it, despite his hunch that there ought to be a better way. Cliff From regebro at gmail.com Fri May 19 11:58:53 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 19 May 2006 11:58:53 +0200 Subject: [z3-five] TypeError (was Product location) In-Reply-To: <446D9410.6060008@ed.ac.uk> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <446D757B.3010103@ed.ac.uk> <319e029f0605190055g5b787c67ib85f5a7ce084b9a0@mail.gmail.com> <446D8822.5010200@ed.ac.uk> <319e029f0605190209n34ee9689k912b5a932750a76a@mail.gmail.com> <446D9410.6060008@ed.ac.uk> Message-ID: <319e029f0605190258m5862be7cr94778543a0ce6dbe@mail.gmail.com> On 5/19/06, Cliff Ford wrote: > The sub class: from zope.app.zptpage.zptpage import ZPTPage > I think Z2 templates are here:Products.PageTemplates.ZopePageTemplate Yup. > > Can views have default views? In any case, they rarely do. :) > > The views are called, it's __call__ that is used to render them. The > > above url only makes sense to me if mp.html is not a view, but some > > sort of a content object. > > A piece of configure.zcml: > > for="montisite.interfaces.IMontiPage" > class=".viewpage.ViewPage" > permission="zope2.View" > > > > name="index.html" > template="viewpage.pt" > /> > > > > for="montisite.interfaces.IMontiPage" > name="index.html" > /> Ah, indeed, mp.html is not a view at all then, but some sort of content object that implements IMontiPage. And since that object is callable (you subclass from pagetemplate, which is), when you go to mp.html it will get called. So far so good. > which should mean that I can get at the subclassed page content object > via its id (mp.html) or its Z3 style name (mp.html/@@index.html) [name > is not the right technical term, which I can't remember off hand]. And > it ought to be using the viewpage.pt. Yup. browser:defaultView should create a __browser_default__ on the object, and that should be returned. on the other hand, you say that @@index.html doesn't work either, so there must be something fishy going on. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From rnd at onego.ru Sun May 21 08:15:42 2006 From: rnd at onego.ru (Roman Susi) Date: Sun, 21 May 2006 09:15:42 +0300 Subject: [z3-five] Can it be done simpler? In-Reply-To: <446CE7A6.7050600@weitershausen.de> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> Message-ID: <4470058E.3070808@onego.ru> Hi! (This is yet another piece of my critic on Zope3/Five... I hope this will give hints to those who develop Zope to pay more attention to KISS principle) To make myself more proficient in Five, I tried to make a simple app (namely: a recipe book which is a Folder of reccipes - SimpleItem. Each Recipe has source text and metadata associated with it. No search mechanism yet, only view and add recipe at the moment). The description above creates a very simple (persistent) Python classes + a couple of templates. (at least, that is what would be needed in Zope2 + some stupid class initialisation, ZMI integration code). The data model is trivial, so I expected it to be done in no time. No! The whole thing grew into this: . |-- CHANGES.txt |-- __init__.py |-- browser | |-- __init__.py | |-- add_recipe.pt | |-- configure.zcml | |-- interfaces.py | |-- recipebookview.pt | |-- recipebookview.py | |-- recipeview.pt | `-- recipeview.py |-- configure.zcml |-- interfaces.py |-- locales ... |-- recipe.py |-- recipebook.py |-- refresh.txt `-- www |-- manage_addRecipeBookForm.zpt `-- manage_addRecipeForm.zpt I needed to create a lot of things around it. Interfaces, description of views, browser things, ... While everything is kinda trivial, the amount of that triviality overhelms. It gives a feeling that most of the things could be quite easily be automated given the data model (classes and schemas). Also, recipebook is not a thing in itself yet. I can't make its interfaces "widgetlike" into some part of a page - for this I will need to write another views... There is nothing of "drop in" kind where end user can choose add Recipe Book and it automatically appears there (for this, I guess, I need to use one (?) of the conventions for standard macros or whatever... So, kind of I do not see any advantages why should I care to describe a lot of things for nothing... (And I have not described any tests, as you can see, but this is another issue). And if I will want to build a much larger project with Zope/Five? I will certainly get drown in the own trivial wirings. And this is in the case I will not need any 3d party components. In that case I will need to make even more wirings... IMHO, this is counterproductive... Even in OO languages one can simply import and inherit. In Zope one receives (when using a foreign component) a bunch of wires, and not a nice outlet which could be plugged. Or maybe a bunch of wires with small sockets each of which need to be cared of... And this complexity at programming level... There is even no sligtest hint for the (e.g.) nonprogrammer how to bring the ability to glue components together the way s/he likes! While all that componentness is targeted at flexibility, I see no way how can I create recipebook-like apps purely on the basis of user input (that is, if I do not know user wants a recipe book or bookmark app or maybe a todo list or whatever with known schema). Of course, this is one abstraction level above, but I see no such apps even in a vapour form... Or maybe I am mistaken and anybody could prove me being wrong... Sorry for this post being only negative. I'd liked it to be more constructive but I do not even see what could be done. I think one of the Zope2 good point was that ability for the almost nonprogrammer to build something TTW... Component architecture is potentially more powerful but I see no glimpse yet that the same nonprogrammer user will be able to benefit... Regards, Roman From philipp at weitershausen.de Mon May 22 01:11:47 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 22 May 2006 01:11:47 +0200 Subject: [z3-five] Can it be done simpler? In-Reply-To: <4470058E.3070808@onego.ru> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <4470058E.3070808@onego.ru> Message-ID: <4470F3B3.50700@weitershausen.de> Hi, > (This is yet another piece of my critic on Zope3/Five... I hope this > will give hints to those who develop Zope to pay more attention to KISS > principle) It is arguable whether Zope is KISS software. Zope's strengths typically are mission-critical and complex systems. I'll also note that this is probably the wrong list you're posting to. It's Five's job to bring Zope 3 technology into Zope 2. If you're questioning the whole Zope 3 approach, don't blame Five :). > |-- CHANGES.txt Ahem. You're just trying to make that list look longer, huh? ;) > |-- __init__.py > |-- browser > | |-- __init__.py Yah, ok. The __init__.py's are always there, yes? > | |-- add_recipe.pt > | |-- configure.zcml > | |-- interfaces.py Interesting. Why do you need browser.interfaces? > | |-- recipebookview.pt > | |-- recipebookview.py > | |-- recipeview.pt > | `-- recipeview.py > |-- configure.zcml > |-- interfaces.py > |-- locales ... > |-- recipe.py > |-- recipebook.py > |-- refresh.txt refresh.txt is a Zope artefact. And it breaks horribly with Five. > `-- www > |-- manage_addRecipeBookForm.zpt > `-- manage_addRecipeForm.zpt > > > I needed to create a lot of things around it. Interfaces, description of > views, browser things, ... Yes. These are called components. This is what Zope3/Five are about. The Component Architecture. You don't have to use it, but it sure helps a lot. As said, it's not for KISS software. It's for complex systems. > While everything is kinda trivial, the amount of that triviality > overhelms. It gives a feeling that most of the things could be quite > easily be automated given the data model (classes and schemas). What kind of things would you like to be automated? A form framework (either zope.app.form or zope.formlib) already helps you with the automated forms. The storage class (recipe.py) can be really really stupid (5 lines max). > Also, recipebook is not a thing in itself yet. I can't make its > interfaces "widgetlike" into some part of a page - for this I will need > to write another views... There is nothing of "drop in" kind where end > user can choose add Recipe Book and it automatically appears there (for > this, I guess, I need to use one (?) of the conventions for standard > macros or whatever... Sorry, I have no idea what you're talking about here... > So, kind of I do not see any advantages why should I care to describe a > lot of things for nothing... (And I have not described any tests, as you > can see, but this is another issue). Not sure what you're describing for nothing. An interface is not useless description. It can be used to make security declarations very easy, and it can be used to render and validate forms. Sorry, perhaps you can be a bit more specific? > And if I will want to build a much larger project with Zope/Five? I will > certainly get drown in the own trivial wirings. And this is in the case > I will not need any 3d party components. In that case I will need to > make even more wirings... > > IMHO, this is counterproductive... Even in OO languages one can simply > import and inherit. Yes. You can do that in Zope as well. Zope 2 did this extensively. Look to where it got us. Open an arbitrary file in Zope 2 (I suggest something in OFS) and be amazed by the wonders of the Zope 2 API. > In Zope one receives (when using a foreign > component) a bunch of wires, and not a nice outlet which could be > plugged. Or maybe a bunch of wires with small sockets each of which need > to be cared of... And this complexity at programming level... There is > even no sligtest hint for the (e.g.) nonprogrammer how to bring the > ability to glue components together the way s/he likes! That's hardly the case. Interfaces, for once, give you the ability to tell exactly what a component is about. To quote one my tutorials on Five (http://worldcookery.com/files/ploneconf05-five/step1.html): For example, compare >>> catalog = getToolByName('portal_catalog') with >>> catalog = getUtility(ICatalog) Now, which line do you think says more about the catalog object? > While all that > componentness is targeted at flexibility, I see no way how can I create > recipebook-like apps purely on the basis of user input (that is, if I do > not know user wants a recipe book or bookmark app or maybe a todo list > or whatever with known schema). Of course, this is one abstraction level > above, but I see no such apps even in a vapour form... Or maybe I am > mistaken and anybody could prove me being wrong... What you seem to want is a way to create content schemas (and ultimately content components and their views) through the web. There are prototypes for this. This is an advanced and highly non-trivial feature. And it's certainly not what the Component Architecture is primarily about. If it's what you expected it to be, then I'm sorry to disappoint you. The Component Architecture is about a) describing responsbilities explicitly in interfaces, b) diving up this responsibility into different components if possible and c) not being tied to a particular implementation but rather the abstract description of a responsibility (the interface). That's why we say >>> getUtility(ICatalog) instead of >>> from zope.app.catalog import Catalog to give you the freedom of plugging in your own catalog implementation. That's the flexibility the CA promises. Nothing more. > Sorry for this post being only negative. You're also not to the point, I'm afraid. It's hard to see what exactly you're negative about. Is it the lack of TTW tools in Zope 3? The complexity of the Component Architecture? The file cluttering in typical Five projects? > I'd liked it to be more > constructive but I do not even see what could be done. I think one of > the Zope2 good point was that ability for the almost nonprogrammer to > build something TTW... That is indeed where Zope 2 is powerful and certainly serves a use case for certain scenarios. However, the aims of the Component Architecture are potentially orthogonal to TTW development. The Component Architecture doesn't care about where development happens. It just so happens that most people nowadays do all serious development on the file system and that's the scenario the current tools serve. As the CA is being embraced by other projects like Plone, TTW plays a more important role. There has been some development in that direction, but as long as this path is not embraced on a broad basis, there cna't be a lot of progress... > Component architecture is potentially more > powerful but I see no glimpse yet that the same nonprogrammer user will > be able to benefit... What can I say... Python *is* a programming language. Expecting non-programmers to work with Python is... well... ignorance. Making a nice clicky-coloury UI for non-programmers is not a Component Architecture thing. It's a UI thing. These are orthogonal to each other and don't contradict. If you're still wondering how you can be constructive, perhaps you could make some suggestions (and perhaps prototypes ;)) on how to improve the TTW story of the Zope 3 approach? Philipp From Cliff.Ford at ed.ac.uk Mon May 22 11:07:15 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Mon, 22 May 2006 10:07:15 +0100 Subject: [z3-five] Views for Zope2 objects - demo? Message-ID: <44717F43.4080409@ed.ac.uk> The Five features list includes: * Zope 3 views, even for standard Zope objects I assume that means exisitng Zope 2 type objects. Is there a simple demo or recipe to illustrate that? I looked at CPSSkins but that is not 'simple'. I would like to use a Zope3 type view for a Zope2 type page template. Also, can Zope2 type objects be used for annotations? Cliff From r.ritz at biologie.hu-berlin.de Mon May 22 11:40:51 2006 From: r.ritz at biologie.hu-berlin.de (Raphael Ritz) Date: Mon, 22 May 2006 11:40:51 +0200 Subject: [z3-five] Can it be done simpler? In-Reply-To: <4470058E.3070808@onego.ru> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <4470058E.3070808@onego.ru> Message-ID: Roman Susi wrote: > Hi! Hi Roman, while I can understand your frustration to a certain extend I think you are missing the point here. First, as Philipp already pointed out, this isn't a Five issue at all. Next, Zope 3 is the basis for many things people do - from trivial to complex - and it rightly concentrates on being powerful, flexible, and extensible - not necessarily simple (or rather simple-minded). From what I hear you saying, you are missing tools for easy high-level development, like we have ArchGenXML (for code generation) or ATSchemaEditorNG (for TTW schema management) for the Zope 2/CMF/Plone/Archetypes stack. Note that AGX (or whatever it's called today - the next generation of ArchGenXML) will be made to produce Zope 3 as well (or does so already), 'plone_schemas' http://svn.plone.org/view/collective/plone_schemas by Alec Mitchell let's you define content types for Plone based on a Zope 3 schema/interface declaration already today and many other projects out there today work on leveraging Zope 3's CA for various use cases. So if you want to be constructive, join any of those projects or start a new one if you don't see your use case addressed at the moment. Just my 2 cents, Raphael From regebro at gmail.com Mon May 22 13:43:39 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 22 May 2006 13:43:39 +0200 Subject: [z3-five] Views for Zope2 objects - demo? In-Reply-To: <44717F43.4080409@ed.ac.uk> References: <44717F43.4080409@ed.ac.uk> Message-ID: <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> On 5/22/06, Cliff Ford wrote: > I assume that means exisitng Zope 2 type objects. Is there a simple demo > or recipe to illustrate that? It's no different from any other kind of view For example. > Also, can Zope2 type objects be used for annotations? Don't know. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From ra at burningman.com Mon May 22 19:30:12 2006 From: ra at burningman.com (Rob Miller) Date: Mon, 22 May 2006 10:30:12 -0700 Subject: [z3-five] Views for Zope2 objects - demo? In-Reply-To: <44717F43.4080409@ed.ac.uk> References: <44717F43.4080409@ed.ac.uk> Message-ID: <4471F524.60408@burningman.com> Cliff Ford wrote: > The Five features list includes: > > * Zope 3 views, even for standard Zope objects > > I assume that means exisitng Zope 2 type objects. Is there a simple demo > or recipe to illustrate that? I looked at CPSSkins but that is not > 'simple'. I would like to use a Zope3 type view for a Zope2 type page > template. what lennart said. > Also, can Zope2 type objects be used for annotations? yes. you first need to put in your configure.zcml file. then you can import IAnnotations, IAttributeAnnotatable, or any other annotations interfaces and use them w/o trouble. -r From Cliff.Ford at ed.ac.uk Mon May 22 22:14:47 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Mon, 22 May 2006 21:14:47 +0100 Subject: [z3-five] Views for Zope2 objects - demo? In-Reply-To: <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> References: <44717F43.4080409@ed.ac.uk> <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> Message-ID: <44721BB7.8070403@ed.ac.uk> Thanks to Lennart and Rob for trying to answer my previous question. I have since figured out how to compose a simple demo to illustrate how to use Five for views of standard Zope 2 objects. However, I have not figured out why I have been banging my head against a wall. The files for the demo are appended below (non-standard organisation for brevity, could be useful to others). The current story is that the Folder view demo works as expected. The analogous Page Template view demo does not. The ZCML configured page template never gets used. The browser display is that expected directly from the Page Template. There are no error messages or warnings anywhere. So either I have forgotten something or Five just can't do this job. This is all with the Zope 2.9.3 tarball. Cliff There are the urls used for the two tests: http://localhost:8080/geos/@@folderview http://localhost:8080/geos/zptpage.html/@@pageview And these are the files: ========== __init__.py # No content ========== folderview.py from Products.Five import BrowserView from AccessControl.SecurityInfo import ClassSecurityInfo from Globals import InitializeClass class SimpleFolderView(BrowserView): """ Demo of Zope 3 Technology in Zope 2 using Five: """ security = ClassSecurityInfo() security.declarePublic('folderview') def folderview(self): """ return a simple list of folder contents """ return self.context.objectIds() InitializeClass(SimpleFolderView) class SimplePageView(BrowserView): """ Demo of Zope 3 Technology in Zope 2 using Five: """ security = ClassSecurityInfo() security.declarePublic('pageview') def pageview(self): """ return a page template content """ #raise 'Test', 'Bah' return 'Testing' # self.context.document_src InitializeClass(SimplePageView) from zope.app.rotterdam.standardmacros import StandardMacros as BaseMacros class StandardMacros(BaseMacros): macro_pages = ('folderview_macros',) + BaseMacros.macro_pages ========== configure.zcml ========== folderview.pt

Info: This is the context/title_and_id

========== pageview.pt

Info: This line should not dispaly!

========== folderview_macros.pt ViewFolder Demo

ViewFolder Demo

User area:
========== From regebro at gmail.com Tue May 23 08:37:34 2006 From: regebro at gmail.com (Lennart Regebro) Date: Tue, 23 May 2006 08:37:34 +0200 Subject: [z3-five] Views for Zope2 objects - demo? In-Reply-To: <44721BB7.8070403@ed.ac.uk> References: <44717F43.4080409@ed.ac.uk> <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> <44721BB7.8070403@ed.ac.uk> Message-ID: <319e029f0605222337y3436bd87we2ee4f4d0cb3f5b4@mail.gmail.com> On 5/22/06, Cliff Ford wrote: > The ZCML configured page template never gets used. The > browser display is that expected directly from the Page Template I guess that's a bug then. Why do you want to make views for page templates, though? These parts are uncessary, btw: > security = ClassSecurityInfo() > security.declarePublic('folderview') ... > InitializeClass(SimpleFolderView) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From Cliff.Ford at ed.ac.uk Tue May 23 08:39:46 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Tue, 23 May 2006 07:39:46 +0100 Subject: [z3-five] Views for Zope2 objects - demo? Cracked it! In-Reply-To: <44721BB7.8070403@ed.ac.uk> References: <44717F43.4080409@ed.ac.uk> <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> <44721BB7.8070403@ed.ac.uk> Message-ID: <4472AE32.7070803@ed.ac.uk> Please forget my previous posts! I had missed the defaultViewable directive (which is not needed in Zope2.10 anyway) and I was confused by talk of eagles. So here are the files for my working bare-bones demo: I think I can now go back to trying to backport my Zope3 app to Zope2 with Five. Cliff Folder view demo url: http://localhost:8080/geos/ Page view demo url: http://localhost:8080/geos/zptpage.html ========== folderview.py from Products.Five import BrowserView from AccessControl.SecurityInfo import ClassSecurityInfo from Globals import InitializeClass class SimpleFolderView(BrowserView): """ Demo of Zope 3 Technology in Zope 2 using Five: """ security = ClassSecurityInfo() security.declarePublic('folderview') def folderview(self): """ return a simple list of folder contents """ return self.context.objectIds() InitializeClass(SimpleFolderView) class SimplePageView(BrowserView): """ Demo of Zope 3 Technology in Zope 2 using Five: """ security = ClassSecurityInfo() security.declarePublic('pageview') def pageview(self): """ return a page template content """ return self.context.document_src() InitializeClass(SimplePageView) from zope.app.rotterdam.standardmacros import StandardMacros as BaseMacros class StandardMacros(BaseMacros): macro_pages = ('folderview_macros',) + BaseMacros.macro_pages ========== configure.zcml ========== folderview.pt

Info: This is the context/title_and_id

========== pageview.pt

Info: This line should not dispaly!

========== folderview_macros.pt ViewFolder Demo

ViewFolder Demo

User area:
========== From Cliff.Ford at ed.ac.uk Tue May 23 09:14:28 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Tue, 23 May 2006 08:14:28 +0100 Subject: [z3-five] Views for Zope2 objects - demo? In-Reply-To: <319e029f0605222337y3436bd87we2ee4f4d0cb3f5b4@mail.gmail.com> References: <44717F43.4080409@ed.ac.uk> <319e029f0605220443n57f9487fj47264961284eea9d@mail.gmail.com> <44721BB7.8070403@ed.ac.uk> <319e029f0605222337y3436bd87we2ee4f4d0cb3f5b4@mail.gmail.com> Message-ID: <4472B654.40905@ed.ac.uk> Hi Lennart, Lennart Regebro wrote: > On 5/22/06, Cliff Ford wrote: > >> The ZCML configured page template never gets used. The >> browser display is that expected directly from the Page Template > > > I guess that's a bug then. No - it was a directive I missed that is needed in the Zope 2.9.3 distribution, and something I misunderstood. > Why do you want to make views for page > templates, though? In our Zope 2 powered site all our pages use the same macro, so every page looks like this: ... We have arranged for our typists never to see the page macro call, on the grounds that if the can break it they will break it and will need help to fix it. I am looking for a better solution than the current one. So far I have four workable solutions! I don't want special views for standard page templates. I would subclass the page template class and use a special view for the subclass. The demo was just to help me understand how things are supposed to work. > These parts are uncessary, btw: > >> security = ClassSecurityInfo() >> security.declarePublic('folderview') > > ... > >> InitializeClass(SimpleFolderView) Yes - I had forgotten that these things are declared in zcml. Cliff From rnd at onego.ru Wed May 24 21:35:11 2006 From: rnd at onego.ru (Roman Susi) Date: Wed, 24 May 2006 22:35:11 +0300 Subject: [z3-five] Can it be done simpler? In-Reply-To: <4470F3B3.50700@weitershausen.de> References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <4470058E.3070808@onego.ru> <4470F3B3.50700@weitershausen.de> Message-ID: <4474B56F.80200@onego.ru> Hi! Philipp von Weitershausen wrote: > Hi, > > >>(This is yet another piece of my critic on Zope3/Five... I hope this >>will give hints to those who develop Zope to pay more attention to KISS >>principle) > > > It is arguable whether Zope is KISS software. Zope's strengths typically > are mission-critical and complex systems. I do not want to argue here, but I really think Zope is not complex, its made too complex. Still, KISS scales well to systems of any size. And large systems are even in greater need to fight complexity... > I'll also note that this is probably the wrong list you're posting to. > It's Five's job to bring Zope 3 technology into Zope 2. If you're > questioning the whole Zope 3 approach, don't blame Five :). > > >>|-- CHANGES.txt > > > Ahem. You're just trying to make that list look longer, huh? ;) > > >>|-- __init__.py >>|-- browser >>| |-- __init__.py > > > Yah, ok. The __init__.py's are always there, yes? > > >>| |-- add_recipe.pt >>| |-- configure.zcml >>| |-- interfaces.py > > > Interesting. Why do you need browser.interfaces? >>| |-- recipebookview.pt >>| |-- recipebookview.py >>| |-- recipeview.pt >>| `-- recipeview.py >>|-- configure.zcml >>|-- interfaces.py >>|-- locales ... >>|-- recipe.py >>|-- recipebook.py >>|-- refresh.txt > > > refresh.txt is a Zope artefact. And it breaks horribly with Five. > > >>`-- www >> |-- manage_addRecipeBookForm.zpt >> `-- manage_addRecipeForm.zpt >> >> >>I needed to create a lot of things around it. Interfaces, description of >>views, browser things, ... > > > Yes. These are called components. This is what Zope3/Five are about. The > Component Architecture. You don't have to use it, but it sure helps a > lot. As said, it's not for KISS software. It's for complex systems. I have nothing against interfaces and component architecture... The problem is that the "feel" of Zope2/Five is like it is far away from those design goals Python was built with. It reminds me of Java... I can't just write the logic and it works, I need to add a lot of additional code... >>While everything is kinda trivial, the amount of that triviality >>overhelms. It gives a feeling that most of the things could be quite >>easily be automated given the data model (classes and schemas). > > > What kind of things would you like to be automated? A form framework > (either zope.app.form or zope.formlib) already helps you with the > automated forms. The storage class (recipe.py) can be really really > stupid (5 lines max). Probably I need to try it with form (or formlib?) to say anything here... >>Also, recipebook is not a thing in itself yet. I can't make its >>interfaces "widgetlike" into some part of a page - for this I will need >>to write another views... There is nothing of "drop in" kind where end >>user can choose add Recipe Book and it automatically appears there (for >>this, I guess, I need to use one (?) of the conventions for standard >>macros or whatever... > > > Sorry, I have no idea what you're talking about here... I can not just add recipe book and have as a widget in some other pages... If I will need to add it, I will need to make new ZCML wirings. >>So, kind of I do not see any advantages why should I care to describe a >>lot of things for nothing... (And I have not described any tests, as you >>can see, but this is another issue). > > > Not sure what you're describing for nothing. An interface is not useless > description. It can be used to make security declarations very easy, and > it can be used to render and validate forms. Sorry, perhaps you can be a > bit more specific? In ZCML I need to repeat all method names (or interface names) to bind them to the views... In fact, what I have in mind is that the object model of Zope3 doesnt give a sense of object system, where I need to know just class interfaces to be able to build something from the objects. Objects ("widgets") are described in many places (content class/zcml/view class/view zcml) and it is hard to use something as simple as an object... Too much ZCML wirings are needed just make it appear somewhere else (with some other view)... Of course, mixins are no better solution, but somehow too much implicitness is lurking behind. >>And if I will want to build a much larger project with Zope/Five? I will >>certainly get drown in the own trivial wirings. And this is in the case >>I will not need any 3d party components. In that case I will need to >>make even more wirings... >> >>IMHO, this is counterproductive... Even in OO languages one can simply >>import and inherit. > > > Yes. You can do that in Zope as well. Zope 2 did this extensively. Look > to where it got us. Open an arbitrary file in Zope 2 (I suggest > something in OFS) and be amazed by the wonders of the Zope 2 API. I know... Zope3 way is indeed cleaner (and Zope3 is quite natural step), I admit. What buggers me is that my intuition tells me that it could be made even simpler, without so many wirings... Its hard to argue, that is why I have wrote here, to share my novice experience... >>In Zope one receives (when using a foreign >>component) a bunch of wires, and not a nice outlet which could be >>plugged. Or maybe a bunch of wires with small sockets each of which need >>to be cared of... And this complexity at programming level... There is >>even no sligtest hint for the (e.g.) nonprogrammer how to bring the >>ability to glue components together the way s/he likes! > > > That's hardly the case. Interfaces, for once, give you the ability to > tell exactly what a component is about. To quote one my tutorials on > Five (http://worldcookery.com/files/ploneconf05-five/step1.html): > > For example, compare > > >>> catalog = getToolByName('portal_catalog') > > with > > >>> catalog = getUtility(ICatalog) > > Now, which line do you think says more about the catalog object? Of course the second one! You can look up what does ICatalog mean... However, misuses are also inevitable. For example, we are using PAS (PluggableAuthService) with Zope2.9. ANd for some reason it doesnt have change password in interfaces (there is one similar method but it has not worked)! However, the method is there! in order to use it, I made a trick of getUtility(IUserAdderplugin) and then used the method EVEN though it is not in the interface! (of course, this is not about Zope3, its about specific software...) If I'd used Java, this hardly happened and I'd needed to do something else... >>While all that >>componentness is targeted at flexibility, I see no way how can I create >>recipebook-like apps purely on the basis of user input (that is, if I do >>not know user wants a recipe book or bookmark app or maybe a todo list >>or whatever with known schema). Of course, this is one abstraction level >>above, but I see no such apps even in a vapour form... Or maybe I am >>mistaken and anybody could prove me being wrong... > > > What you seem to want is a way to create content schemas (and ultimately > content components and their views) through the web. There are > prototypes for this. This is an advanced and highly non-trivial feature. It is highly non-trivial only in Zope context. For example, if I'd wanted to make a database, I (and even nonprogrammer user!) could get something like FileMaker and create db schema and screen forms. And I remember CPS has some nifty editor for web-layout, so it is not technological problem either. The problem is that new level of abstraction is needed to enable such things. And this cant happen before Zope3 APIs stabilize... > And it's certainly not what the Component Architecture is primarily > about. If it's what you expected it to be, then I'm sorry to disappoint > you. The Component Architecture is about a) describing responsbilities > explicitly in interfaces, b) diving up this responsibility into > different components if possible and c) not being tied to a particular > implementation but rather the abstract description of a responsibility > (the interface). > > That's why we say > > >>> getUtility(ICatalog) > > instead of > > >>> from zope.app.catalog import Catalog > > to give you the freedom of plugging in your own catalog implementation. > That's the flexibility the CA promises. Nothing more. > > >>Sorry for this post being only negative. > > > You're also not to the point, I'm afraid. It's hard to see what exactly > you're negative about. Is it the lack of TTW tools in Zope 3? The > complexity of the Component Architecture? The file cluttering in typical > Five projects? Probably, the problem is that Zope3 turned away from TTW... Of course, stable core architecture is of more priority with limited manhours, but it was probably one of the string points of Zope2 that advanced users were able to make at least something TTW... Well, sometimes it produced messy results (how much of us has ideal folder structures in the home folder?), but Zope3 doesn't suggest any standard way for the same... Its up to the programmer to provide goodies for Zope3 ZMI... As for complexity of CA, the problem, as I see it, is not with the CA as it is implemented but with the conventions set by usage of it. I was already talking on this earlier (dont remember was it here or Zope3-users). File cluttering is not a problem. The problem is that things need to be mentioned in ZCML instead of having alternative ways to do it (I think ZCML will be replaced with something more convenient for humans or its coding will be automated). >>I'd liked it to be more >>constructive but I do not even see what could be done. I think one of >>the Zope2 good point was that ability for the almost nonprogrammer to >>build something TTW... > > > That is indeed where Zope 2 is powerful and certainly serves a use case > for certain scenarios. However, the aims of the Component Architecture > are potentially orthogonal to TTW development. The Component > Architecture doesn't care about where development happens. It just so > happens that most people nowadays do all serious development on the file > system and that's the scenario the current tools serve. As the CA is > being embraced by other projects like Plone, TTW plays a more important > role. There has been some development in that direction, but as long as > this path is not embraced on a broad basis, there cna't be a lot of > progress... This also seem to be a vicious circle... >>Component architecture is potentially more >>powerful but I see no glimpse yet that the same nonprogrammer user will >>be able to benefit... > > > What can I say... Python *is* a programming language. Expecting > non-programmers to work with Python is... well... ignorance. Making a > nice clicky-coloury UI for non-programmers is not a Component > Architecture thing. It's a UI thing. These are orthogonal to each other > and don't contradict. My concern is mostly how to get business logic closer to UI, so users can "program" new things in business logic layer... If CA is orthogonal, then there is something in Zope3 which is NOT orthogonal and which gets in between UI and BL... Application layer? > If you're still wondering how you can be constructive, perhaps you could > make some suggestions (and perhaps prototypes ;)) on how to improve the > TTW story of the Zope 3 approach? I am not ready for it yet... Every TTW feature requires more conventions, more "hooks" in the code one writes... One of the powerful things I saw is sqlobject. Probably bringing it to the web could have advantages. > Philipp Roman From rnd at onego.ru Wed May 24 21:44:56 2006 From: rnd at onego.ru (Roman Susi) Date: Wed, 24 May 2006 22:44:56 +0300 Subject: [z3-five] Can it be done simpler? In-Reply-To: References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <4470058E.3070808@onego.ru> Message-ID: <4474B7B8.7040206@onego.ru> hi! Raphael Ritz wrote: > Roman Susi wrote: > >>Hi! > > > Hi Roman, > > while I can understand your frustration to a certain extend > I think you are missing the point here. First, as Philipp already > pointed out, this isn't a Five issue at all. Next, Zope 3 is the > basis for many things people do - from trivial to complex - and > it rightly concentrates on being powerful, flexible, and extensible > - not necessarily simple (or rather simple-minded). ...I have not meant it to be simple-minded. Complexity of the tool must be adequate to the complexity of the tasks it solves. Right now Zope3 seems to be harder than it should be. > From what I hear you saying, you are missing tools for easy > high-level development, like we have ArchGenXML (for code generation) > or ATSchemaEditorNG (for TTW schema management) for the > Zope 2/CMF/Plone/Archetypes stack. Well... while I am not totally comfortable with the idea of code generation from UML (I consider UML being, again, too hard for the nonprogrammer), you are right. Thanks for pointing those tools! > Note that AGX (or whatever it's called today - the next generation > of ArchGenXML) will be made to produce Zope 3 as well (or does so > already), 'plone_schemas' > > http://svn.plone.org/view/collective/plone_schemas > > by Alec Mitchell let's you define content types > for Plone based on a Zope 3 schema/interface declaration already > today and many other projects out there today work on leveraging > Zope 3's CA for various use cases. > > So if you want to be constructive, join any of those projects > or start a new one if you don't see your use case addressed > at the moment. The use case is probably too specific and its implementation hardly will go mainstream anytime soon... > Just my 2 cents, > > Raphael > Regards, Roman From Cliff.Ford at ed.ac.uk Wed May 24 22:05:08 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Wed, 24 May 2006 21:05:08 +0100 Subject: [z3-five] Non-callable subclass problem Message-ID: <4474BC74.3020709@ed.ac.uk> I have a sub-class of a Zope 2 page template that I am trying to use with Five. I get this message in the event.log: 2006-05-24T20:45:54 ERROR Zope Couldn't install Five Traceback (most recent call last): ... snip ... File "/usr/local/Zope-2.9.3/lib/python/zope/interface/declarations.py", line 365, in implementedByFallback raise TypeError("ImplementedBy called for non-factory", cls) ConfigurationExecutionError: exceptions.TypeError: ('ImplementedBy called for non-factory', ) in: File "/usr/local/Zope293i/lib/python/montisite4z2/configure.zcml", line 13.0-15.19 I found a reference to this problem on DZUG but my grasp of German is essentially zero, and I found an essay on the Python.ord site that explained why subclasses are not callable, but without giving me an idea of what to do about it. Here is a section of configure.zcml: IMontiPage4Z2 is an interface essentialy the same as IZPTPage I think I need to make the Zope 2 page template callable - and I don't know how to do that as it works fine in Zope 2 (2.9.3). Any pointers would be appreciated. Cliff From optilude at gmx.net Thu May 25 01:45:13 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 25 May 2006 00:45:13 +0100 Subject: [z3-five] Can it be done simpler? References: <446C24E4.4040504@ed.ac.uk> <1147952727.10142.4.camel@localhost> <446CC13F.10700@ed.ac.uk> <319e029f0605181219n5c87a5a1iee0c0181ed4797cb@mail.gmail.com> <446CE7A6.7050600@weitershausen.de> <4470058E.3070808@onego.ru> <4470F3B3.50700@weitershausen.de> <4474B56F.80200@onego.ru> Message-ID: On Wed, 24 May 2006 20:35:11 +0100, Roman Susi wrote: >> It is arguable whether Zope is KISS software. Zope's strengths typically >> are mission-critical and complex systems. > > I do not want to argue here, but I really think Zope is not complex, its > made too complex. Still, KISS scales well to systems of any size. And > large systems are even in greater need to fight complexity... > I have nothing against interfaces and component architecture... The > problem is that the "feel" of Zope2/Five is like it is far away from > those design goals Python was built with. It reminds me of Java... I > can't just write the logic and it works, I need to add a lot of > additional code... Can you name me a system that is really, really dead simple and still powerful enough for serious applications? Why do you keep referring to the non-programmer, when Zope is clearly a framework designed for programmers to be productive and get things done? > I can not just add recipe book and have as a widget in some other > pages... If I will need to add it, I will need to make new ZCML wirings. Sure you can. Schemas will do that for you. Just because you don't know how doesn't mean it can't be done. And honestly, a few lines of XML are no worse than a few lines of a python API in the sense that you still need to learn it. > In ZCML I need to repeat all method names (or interface names) to bind > them to the views... And what if you want to re-use them for different purposes and not tightly couple the two? In real, large applications, doing so will hurt your ability to scale the application up. > In fact, what I have in mind is that the object model of Zope3 doesnt > give a sense of object system, where I need to know just class > interfaces to be able to build something from the objects. Objects > ("widgets") are described in many places (content class/zcml/view > class/view zcml) and it is hard to use something as simple as an > object... Too much ZCML wirings are needed just make it appear somewhere > else (with some other view)... Of course, mixins are no better solution, > but somehow too much implicitness is lurking behind. It's not an object syustem, it's a component system. It's a different way of thinking, thinking in terms of concepts like adapters and interfaces. It takes some getting used to for sure, but Zope 3 actually has a remarkably small, but flexible, set of concepts. It's not meant to be totally intuitive the first time around - it's not PHP, because PHP doesn't scale up. > I know... Zope3 way is indeed cleaner (and Zope3 is quite natural step), > I admit. What buggers me is that my intuition tells me that it could be > made even simpler, without so many wirings... Its hard to argue, that is > why I have wrote here, to share my novice experience... The problem is that you're arguing with your intuition against the real world experience of dozens of incredibly talented architects and programmers. > It is highly non-trivial only in Zope context. For example, if I'd > wanted to make a database, I (and even nonprogrammer user!) could get > something like FileMaker and create db schema and screen forms. And I > remember CPS has some nifty editor for web-layout, so it is not > technological problem either. Have you ever tried making a real, live, complex appliction with FileMaker? If you just need a simple database... use FileMaker. :) > The problem is that new level of abstraction is needed to enable such > things. And this cant happen before Zope3 APIs stabilize... Zope 3 has problems of marketing, of documentation, and is both helped and hindered by the fact that it grows so quickly, that people don't always keep up with it. But I've programmed in a lot of systems, and Zope 3's component architecture is incredibly compelling... once you get your head around it. You have to invest in it perhaps more than in something like Filemaker or even PHP, but the comparison is ridiculous - they are completely different things for completely different purposes. If you want a magic bullet that can build you a scalable, real-world web application in four button clicks, well... sorry :) > Probably, the problem is that Zope3 turned away from TTW... TTW programming a false premise. The kind of applications people want to build can't be build through the web, a web browse is an incredibly poor programming environment. It's important, I believe, to be able to do TTW customisation and overrides the way we do in CMF and Plone with portal_skins/custom - of UI elements (page templates). But building whole systems through the web is brittle and ultimately futile. > Of course, > stable core architecture is of more priority with limited manhours, but > it was probably one of the string points of Zope2 that advanced users > were able to make at least something TTW... Well, sometimes it produced > messy results (how much of us has ideal folder structures in the home > folder?), Precisely. > but Zope3 doesn't suggest any standard way for the same... At least not yet. But if that's the model you want, we already have a good platform for that, and it's called Zope 2. > Its > up to the programmer to provide goodies for Zope3 ZMI... As for > complexity of CA, the problem, as I see it, is not with the CA as it is > implemented but with the conventions set by usage of it. I was already > talking on this earlier (dont remember was it here or Zope3-users). File > cluttering is not a problem. The problem is that things need to be > mentioned in ZCML instead of having alternative ways to do it (I think > ZCML will be replaced with something more convenient for humans or its > coding will be automated). It's XML. I mean, they're files with a simple, predicable syntax. They're documented as well as python APIs are. Yes, sometimes ZCML statements do difficult-to-debug magic, and there is work going on to improve those instances. But the basic premise of keeping some of the wiring and declarative configuration out of your code is very good. > My concern is mostly how to get business logic closer to UI, so users > can "program" new things in business logic layer... If CA is orthogonal, > then there is something in Zope3 which is NOT orthogonal and which gets > in between UI and BL... Application layer? Yes. If you have a need for such an application, then Zope 3 isn't it. Of course, a general business-logic-implementing application may be built on top of Zope 3, possibly quite sensibly so. But people have searched for that kind of thing forever, and it doesn't exist anywhere, really. Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From Cliff.Ford at ed.ac.uk Thu May 25 06:36:21 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Thu, 25 May 2006 05:36:21 +0100 Subject: [z3-five] Non-callable subclass problem In-Reply-To: <4474BC74.3020709@ed.ac.uk> References: <4474BC74.3020709@ed.ac.uk> Message-ID: <44753445.4050602@ed.ac.uk> I took a break, during which it dawned on me that I don't need a Zope 2 Page Template sub-class, all I need is a property, set to call a particular macro in the view, or unset to do something else. So the callable problem has gone away and I am happy again. Cliff Cliff Ford wrote: > I have a sub-class of a Zope 2 page template that I am trying to use > with Five. I get this message in the event.log: > > 2006-05-24T20:45:54 ERROR Zope Couldn't install Five > Traceback (most recent call last): > ... > snip > ... > File > "/usr/local/Zope-2.9.3/lib/python/zope/interface/declarations.py", line > 365, in implementedByFallback > raise TypeError("ImplementedBy called for non-factory", cls) > ConfigurationExecutionError: exceptions.TypeError: ('ImplementedBy > called for non-factory', from '/usr/local/Zope293i/Products/MontiPage4Z2/MontiPage4Z2.pyc'>) > in: > File "/usr/local/Zope293i/lib/python/montisite4z2/configure.zcml", > line 13.0-15.19 > interface=".interfaces.IMontiPage4Z2" > /> > > > I found a reference to this problem on DZUG but my grasp of German is > essentially zero, and I found an essay on the Python.ord site that > explained why subclasses are not callable, but without giving me an idea > of what to do about it. Here is a section of configure.zcml: > > > > > > > interface=".interfaces.IMontiPage4Z2" > /> > class="Products.MontiPage4Z2.MontiPage4Z2" > /> > > for=".interfaces.IMontiPage4Z2" > name="someview.html" /> > > for=".interfaces.IMontiPage4Z2" > class=".folderview.SimplePageView" > template="pageview.pt" > name="someview.html" > permission="zope2.ViewManagementScreens" > /> > > IMontiPage4Z2 is an interface essentialy the same as IZPTPage > > I think I need to make the Zope 2 page template callable - and I don't > know how to do that as it works fine in Zope 2 (2.9.3). Any pointers > would be appreciated. > > Cliff > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five From rocky at serverzen.com Fri May 26 13:33:47 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 26 May 2006 09:03:47 -0230 Subject: [z3-five] five and formlib Message-ID: <1148643226.13916.13.camel@localhost> Hi all, I recently was able to setup some of the named template stuff for formlib in Five. This enables views to extend the zope.formlib.form base classes to have views work rather than having to use the new superclasses defined in Five.formlib.formbase. Would anyone mind if we did away with those Five formlib base classes before the final Five 1.4 and 1.5 releases since they've been only released in beta form so far? Or is there still a good reason to keep them around? Another issue I bumped up against was the fact that pageform.pt as provided by Five's formlib doesn't use @@standard_macros. I consider this a bug but before I fixed it to use @@standard_macros I wanted to make sure no one knows of any good reason why it shouldn't use it (the standard z3 one uses @@standard_macros and @@standard_macros seems to work fine in z2). Regards, Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060526/cd764664/attachment.pgp From faassen at infrae.com Fri May 26 19:37:45 2006 From: faassen at infrae.com (Martijn Faassen) Date: Fri, 26 May 2006 19:37:45 +0200 Subject: [z3-five] five and formlib In-Reply-To: <1148643226.13916.13.camel@localhost> References: <1148643226.13916.13.camel@localhost> Message-ID: <44773CE9.4050402@infrae.com> Rocky Burt wrote: > Hi all, > > I recently was able to setup some of the named template stuff for > formlib in Five. This enables views to extend the zope.formlib.form > base classes to have views work rather than having to use the new > superclasses defined in Five.formlib.formbase. Would anyone mind if we > did away with those Five formlib base classes before the final Five 1.4 > and 1.5 releases since they've been only released in beta form so far? > Or is there still a good reason to keep them around? How do you deal with acquisition? The base classes in Five mix in Acquisition.Explicit to make security work. Did something in Five change so make that unnecessary? Looking at the code, there's also an override to remove a dependency on request.locale. The templates are simpler too than the ones that ship with formlib. > Another issue I bumped up against was the fact that pageform.pt as > provided by Five's formlib doesn't use @@standard_macros. I consider > this a bug but before I fixed it to use @@standard_macros I wanted to > make sure no one knows of any good reason why it shouldn't use it (the > standard z3 one uses @@standard_macros and @@standard_macros seems to > work fine in z2). I don't know about that. I cc-ed JW who did the original work. Perhaps he can answer this one. Regards, Martijn From rocky at serverzen.com Fri May 26 19:58:45 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 26 May 2006 15:28:45 -0230 Subject: [z3-five] five and formlib In-Reply-To: <44773CE9.4050402@infrae.com> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> Message-ID: <1148666311.13916.18.camel@localhost> On Fri, 2006-26-05 at 19:37 +0200, Martijn Faassen wrote: > How do you deal with acquisition? The base classes in Five mix in > Acquisition.Explicit to make security work. Did something in Five change > so make that unnecessary? Hmm... mixes in BrowserView which has Acquisition.Explicit. I've not tried or whatever, perhaps it would have the problem you describe? > Looking at the code, there's also an override to remove a dependency on > request.locale. The templates are simpler too than the ones that ship > with formlib. Hmm... yeah, I overlooked the request.locale fix. Perhaps the proper solution would be to make five set locale up on the request? It makes plenty of sense for Five.formlib to have its own templates, thats the purpose of using named templates. Other than the fact that Five.formlib's pageform.pt doesn't use @@standard_macros which I think it should. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060526/031d86d4/attachment-0001.pgp From philipp at weitershausen.de Fri May 26 22:25:12 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri, 26 May 2006 22:25:12 +0200 Subject: [z3-five] five and formlib In-Reply-To: <1148666311.13916.18.camel@localhost> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> Message-ID: <44776428.1020109@weitershausen.de> Rocky Burt wrote: >> Looking at the code, there's also an override to remove a dependency on >> request.locale. The templates are simpler too than the ones that ship >> with formlib. > > Hmm... yeah, I overlooked the request.locale fix. Perhaps the proper > solution would be to make five set locale up on the request? This isn't as trivial as you make it sound. Unless, of course, you have a suggestion :). Philipp From rocky at serverzen.com Sat May 27 23:21:19 2006 From: rocky at serverzen.com (Rocky Burt) Date: Sat, 27 May 2006 18:51:19 -0230 Subject: [z3-five] five and formlib In-Reply-To: <44776428.1020109@weitershausen.de> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> <44776428.1020109@weitershausen.de> Message-ID: <1148764862.20291.25.camel@localhost> On Fri, 2006-26-05 at 22:25 +0200, Philipp von Weitershausen wrote: > Rocky Burt wrote: > >> Looking at the code, there's also an override to remove a dependency on > >> request.locale. The templates are simpler too than the ones that ship > >> with formlib. > > > > Hmm... yeah, I overlooked the request.locale fix. Perhaps the proper > > solution would be to make five set locale up on the request? > > This isn't as trivial as you make it sound. Unless, of course, you have > a suggestion :). Well, as a matter of fact I do have a very trivial solution. Unfortunately its quite hideous as well. Lets hack locale into ZPublisher's HTTPRequest ! I've attached a patch to Five (against trunk) that gets the locale info on the request in a very brute force approach. In a nutshell it: 1) monkey patches ZPublisher.HTTPRequest to be FiveHTTPRequest 2) FiveHTTPRequest instantiates a z3 request object inside of its constructor 3) FiveHTTPRequest sets the locale attribute on itself based on the z3 request's locale value The patch includes a simple test that shows it in action as well. Obviously this isn't the "correct" approach to dealing with this issue so I've asked the question on the zope-devel mailing list what we should do about uniting z2 and z3 requests. You can see the post here: http://article.gmane.org/gmane.comp.web.zope.devel/11560 What do you all think? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: fives-locale-on-request.diff Type: text/x-patch Size: 3730 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20060527/3f386ebc/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060527/3f386ebc/attachment.pgp From philipp at weitershausen.de Sun May 28 16:37:24 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sun, 28 May 2006 16:37:24 +0200 Subject: [z3-five] five and formlib In-Reply-To: <1148764862.20291.25.camel@localhost> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> <44776428.1020109@weitershausen.de> <1148764862.20291.25.camel@localhost> Message-ID: <4479B5A4.8070203@weitershausen.de> Rocky Burt wrote: > On Fri, 2006-26-05 at 22:25 +0200, Philipp von Weitershausen wrote: >> Rocky Burt wrote: >>>> Looking at the code, there's also an override to remove a dependency on >>>> request.locale. The templates are simpler too than the ones that ship >>>> with formlib. >>> Hmm... yeah, I overlooked the request.locale fix. Perhaps the proper >>> solution would be to make five set locale up on the request? >> This isn't as trivial as you make it sound. Unless, of course, you have >> a suggestion :). > > Well, as a matter of fact I do have a very trivial solution. > Unfortunately its quite hideous as well. Lets hack locale into > ZPublisher's HTTPRequest ! It's not like I hadn't thought of that already ;). Btw, I find your approach... interesting :). > I've attached a patch to Five (against trunk) that gets the locale info > on the request in a very brute force approach. > > In a nutshell it: > 1) monkey patches ZPublisher.HTTPRequest to be FiveHTTPRequest > 2) FiveHTTPRequest instantiates a z3 request object inside of its > constructor This is weird... You're using the Z3 request just to get at the locale object. Obviously, there is a much simpler way :). > 3) FiveHTTPRequest sets the locale attribute on itself based on the z3 > request's locale value > > The patch includes a simple test that shows it in action as well. > > Obviously this isn't the "correct" approach to dealing with this issue > so I've asked the question on the zope-devel mailing list what we should > do about uniting z2 and z3 requests. You can see the post here: > http://article.gmane.org/gmane.comp.web.zope.devel/11560 > > What do you all think? The real problem, as I've pointed out on zope-dev, is attribute access on the HTTP request. In particular, extending the API of the Zope 2 request should be handled with extreme care. The reason is that currently attribute access primarily looks up request variables. That means request.locale is expected to find request.form['locale']. If you now introduce request.locale as part of the official request API, existing apps that use a locale form variable break. That can't happen... IMO we should therefore disallow attribute access on the Zope 2 request for everything other than the request API. This step needs to come first. Philipp From rocky at serverzen.com Sun May 28 20:17:49 2006 From: rocky at serverzen.com (Rocky Burt) Date: Sun, 28 May 2006 15:47:49 -0230 Subject: [z3-five] five and formlib In-Reply-To: <4479B5A4.8070203@weitershausen.de> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> <44776428.1020109@weitershausen.de> <1148764862.20291.25.camel@localhost> <4479B5A4.8070203@weitershausen.de> Message-ID: <1148840252.31844.7.camel@localhost> On Sun, 2006-28-05 at 16:37 +0200, Philipp von Weitershausen wrote: > Rocky Burt wrote: > > Well, as a matter of fact I do have a very trivial solution. > > Unfortunately its quite hideous as well. Lets hack locale into > > ZPublisher's HTTPRequest ! > > It's not like I hadn't thought of that already ;). Btw, I find your > approach... interesting :). Haha, as interesting as a hideous hack like this can be. > > I've attached a patch to Five (against trunk) that gets the locale info > > on the request in a very brute force approach. > > > > In a nutshell it: > > 1) monkey patches ZPublisher.HTTPRequest to be FiveHTTPRequest > > 2) FiveHTTPRequest instantiates a z3 request object inside of its > > constructor > > This is weird... You're using the Z3 request just to get at the locale > object. Obviously, there is a much simpler way :). Obviously there is a much simpler way, the reason I did it this way was to demonstrate the easiest way of providing *all* of the z3 request logic right in a z2 request. > > 3) FiveHTTPRequest sets the locale attribute on itself based on the z3 > > request's locale value > > > > The patch includes a simple test that shows it in action as well. > > > > Obviously this isn't the "correct" approach to dealing with this issue > > so I've asked the question on the zope-devel mailing list what we should > > do about uniting z2 and z3 requests. You can see the post here: > > http://article.gmane.org/gmane.comp.web.zope.devel/11560 > > > > What do you all think? > > The real problem, as I've pointed out on zope-dev, is attribute access > on the HTTP request. In particular, extending the API of the Zope 2 > request should be handled with extreme care. The reason is that > currently attribute access primarily looks up request variables. That > means request.locale is expected to find request.form['locale']. If you > now introduce request.locale as part of the official request API, > existing apps that use a locale form variable break. That can't happen... > > IMO we should therefore disallow attribute access on the Zope 2 request > for everything other than the request API. This step needs to come first. Indeed, this all makes sense to me now. I see the larger problem/picture. And I agree this seems like the eventual path. But in the short-term, is there anyway we could ensure that any z3 component built on z2 that some how acquires a request (ie the request passed into a view component in its constructor) gets a z3 request that wraps the z2 request instead of simply getting the z2 request? I think applications built with the z3 CA shouldn't need to expect a z2 request. Any idea? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060528/ccac1df9/attachment.pgp From faassen at infrae.com Mon May 29 18:59:58 2006 From: faassen at infrae.com (Martijn Faassen) Date: Mon, 29 May 2006 18:59:58 +0200 Subject: [z3-five] five and formlib In-Reply-To: <1148666311.13916.18.camel@localhost> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> Message-ID: <447B288E.5030209@infrae.com> Rocky Burt wrote: > On Fri, 2006-26-05 at 19:37 +0200, Martijn Faassen wrote: >> How do you deal with acquisition? The base classes in Five mix in >> Acquisition.Explicit to make security work. Did something in Five change >> so make that unnecessary? > > Hmm... mixes in BrowserView which has > Acquisition.Explicit. I've not tried or whatever, > perhaps it would have the problem you describe? Oh, okay, I hadn't thought of that. This may be a non-problem then. >> Looking at the code, there's also an override to remove a dependency on >> request.locale. The templates are simpler too than the ones that ship >> with formlib. > > Hmm... yeah, I overlooked the request.locale fix. Perhaps the proper > solution would be to make five set locale up on the request? > > It makes plenty of sense for Five.formlib to have its own templates, > thats the purpose of using named templates. Other than the fact that > Five.formlib's pageform.pt doesn't use @@standard_macros which I think > it should. Right, I realize named templates could be used for this. Regards, Martijn From faassen at infrae.com Mon May 29 19:04:12 2006 From: faassen at infrae.com (Martijn Faassen) Date: Mon, 29 May 2006 19:04:12 +0200 Subject: [z3-five] five and formlib In-Reply-To: <4479B5A4.8070203@weitershausen.de> References: <1148643226.13916.13.camel@localhost> <44773CE9.4050402@infrae.com> <1148666311.13916.18.camel@localhost> <44776428.1020109@weitershausen.de> <1148764862.20291.25.camel@localhost> <4479B5A4.8070203@weitershausen.de> Message-ID: <447B298C.7060607@infrae.com> Philipp von Weitershausen wrote: > Rocky Burt wrote: [snip] >> >> In a nutshell it: >> 1) monkey patches ZPublisher.HTTPRequest to be FiveHTTPRequest >> 2) FiveHTTPRequest instantiates a z3 request object inside of its >> constructor > > This is weird... You're using the Z3 request just to get at the locale > object. Obviously, there is a much simpler way :). > I have a bit of code in Silva (1.5 and up) that hacks the locale into the request. This may be useful as a reference: # request doesn't have locale in Zope 2; this code should # ideally move somewhere into Five from zope.i18n.locales import locales, LoadLocaleError langs = IUserPreferredLanguages(request).getPreferredLanguages() for httplang in langs: parts = (httplang.split('-') + [None, None])[:3] try: request.locale = locales.getLocale(*parts) return except LoadLocaleError: # Just try the next combination pass else: # No combination gave us an existing locale, so use the default, # which is guaranteed to exist request.locale = locales.getLocale(None, None, None) Not ideal either of course; I believe I lifted the code out of various bits of Zope 3 as I wanted to keep this minimal. I guess that's why Rocky does drag in more - it's simpler. :) Regards, Martijn From rocky at serverzen.com Mon May 29 19:31:13 2006 From: rocky at serverzen.com (Rocky Burt) Date: Mon, 29 May 2006 15:01:13 -0230 Subject: [z3-five] five and formlib: part 2 Message-ID: <1148923873.9990.7.camel@localhost> Hi all, Ok, after various discussions on this mailing list and on IRC here is where I ended up with five and formlib. 1) Updated default pageform.pt to use @@standard_macros (that's the only change made to that zpt) 2) left the locale stuff all alone After much discussion here on how to get locale into a z2 request it was determined that the standard z2 request is designed in such a way to make this require some very ugly hacks. Perhaps if someone can come up with a cleaner way we can resume these discussions... but until we do, the Five.formlib.formbase classes will have to continue to exist. Ugh. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060529/a14a9205/attachment-0001.pgp From rocky at serverzen.com Mon May 29 20:52:56 2006 From: rocky at serverzen.com (Rocky Burt) Date: Mon, 29 May 2006 16:22:56 -0230 Subject: [z3-five] etc/site.zcml in zope 2.10's skel? Message-ID: <1148928776.9990.17.camel@localhost> Hi all, Ever since I've been developing z3-based projects on zope 2.8+ I've been copying Five's skel/package-includes and skel/site.zcml to my $INSTANCE_HOME/etc so I can use zcml slugs. Now that zope2 is gaining more and more zope3 support I think its time we added these items to zope 2.10's instance skel directory so each new zope 2.10 instance that is created has those items. Some reasons for doing this are: - Removes one more step for getting going with zope3 development on zope2 - Zope 3 developers wanting to port their apps to CMF/Plone don't have to figure out why their zcml slugs aren't working when they just copy them into etc/package-includes (since the instance has no site.zcml) - more consistent with zope3 instances What do you all think? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060529/e8fb8a8d/attachment.pgp From philipp at weitershausen.de Mon May 29 21:02:12 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 29 May 2006 21:02:12 +0200 Subject: [z3-five] etc/site.zcml in zope 2.10's skel? In-Reply-To: <1148928776.9990.17.camel@localhost> References: <1148928776.9990.17.camel@localhost> Message-ID: <447B4534.10100@weitershausen.de> Rocky Burt wrote: > Hi all, > > Ever since I've been developing z3-based projects on zope 2.8+ I've been > copying Five's skel/package-includes and skel/site.zcml to my > $INSTANCE_HOME/etc so I can use zcml slugs. Now that zope2 is gaining > more and more zope3 support I think its time we added these items to > zope 2.10's instance skel directory so each new zope 2.10 instance that > is created has those items. > > Some reasons for doing this are: > - Removes one more step for getting going with zope3 development on > zope2 > - Zope 3 developers wanting to port their apps to CMF/Plone don't have > to figure out why their zcml slugs aren't working when they just copy > them into etc/package-includes (since the instance has no site.zcml) > - more consistent with zope3 instances > > > What do you all think? +1 From whit at burningman.com Mon May 29 21:02:02 2006 From: whit at burningman.com (whit) Date: Mon, 29 May 2006 14:02:02 -0500 Subject: [z3-five] etc/site.zcml in zope 2.10's skel? In-Reply-To: <1148928776.9990.17.camel@localhost> References: <1148928776.9990.17.camel@localhost> Message-ID: Rocky Burt wrote: > Hi all, > > Ever since I've been developing z3-based projects on zope 2.8+ I've been > copying Five's skel/package-includes and skel/site.zcml to my > $INSTANCE_HOME/etc so I can use zcml slugs. Now that zope2 is gaining > more and more zope3 support I think its time we added these items to > zope 2.10's instance skel directory so each new zope 2.10 instance that > is created has those items. > > Some reasons for doing this are: > - Removes one more step for getting going with zope3 development on > zope2 > - Zope 3 developers wanting to port their apps to CMF/Plone don't have > to figure out why their zcml slugs aren't working when they just copy > them into etc/package-includes (since the instance has no site.zcml) > - more consistent with zope3 instances > > > What do you all think? > +1 (just killed a half hour wondering why 2.10 didn't find my slugs) -w From philipp at weitershausen.de Tue May 30 00:17:28 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue, 30 May 2006 00:17:28 +0200 Subject: [z3-five] Five release fest: Five 1.2.5, 1.3.6, 1.4 and 1.5c released! Message-ID: <447B72F8.8080808@weitershausen.de> The Five team is happy to announce the release of two Five bugfix releases, 1.2.5 and 1.3.6, a Five 1.4 final release and another Five 1.5c beta release today. What is Five ------------ Five is a Zope 2 product that allows you to integrate Zope 3 technologies into Zope 2, today. Among others, it allows you to use Zope 3 interfaces, ZCML-based configuration, adapters, browser pages (including skins, layers, and resources), automated add and edit forms based on schemas, object events, as well as Zope 3-style i18n message catalogs. We've tried to keep the Five experience as close to Zope 3 as possible, so this means that what you learn while using Five should also be applicable to Zope 3, and viceversa. More information about Five can be found on our website, http://codespeak.net/z3/five/. About Five 1.4 and 1.5 ---------------------- Five 1.4 and 1.5 are feature releases. They are basically equivalent except that Five 1.4 works with Zope 2.9/3.2 (only) and 1.5 works with Zope 2.10/3.3 (only). Five 1.5 will be included in Zope 2.10. Most important features are: * Added viewlet and content provider support. A big thanks to Alec Mitchell and his helpers at the Archipelago sprint for making this possible. * Add zope.formlib support. Please see ``doc/formlib.txt`` for more information. A big thanks to Jan-Wijbrand Kolman for this. * Port zope.testbrowser to Zope 2. You can now use Products.Five.testbrowser.Browser in functional tests. Much thanks to Brian Sutherland. * Add python-packages-as-zope-products support which basically allows for using any python package as a zope product without it having to live in Products/. Much thanks to Rocky Burt for this. Zope 2.10 and Five 1.5 are also a big milestone in the convergence of Zope 2 and Zope 3, for it is no longer necessary to mark classes with five:traversable and five:defaultViewable to enable Zope 3 view lookup functionality. A big thanks goes to Lennart Regebro and Michael Kerrin for making this possible! Changes in Five 1.2.5, 1.3.6, 1.4 (vs. 1.4c), 1.5c (vs. 1.5b) ------------------------------------------------------------- * Fixed an issue where based views that didn't have template or attribute defined weren't getting BrowserView mixed in. * Fixed an issue where new-style classes could not be used for view components with . * Five.testbrowser does not swallow cookies anymore, based on patch by Daniel Nouri. * Five.testbrowser capitalizes headers in the same way as the Zope2 HTTPResponse. i.e. content-length -> Content-Length. About the Zope 3 Base --------------------- Five is part of the *Zope 3 Base* project, which aims to offer an approachable area for developers of Zope 3 related software. More about the Zope 3 base and its projects can be found on the project website, http://codespeak.net/z3/. From Cliff.Ford at ed.ac.uk Tue May 30 20:56:39 2006 From: Cliff.Ford at ed.ac.uk (Cliff Ford) Date: Tue, 30 May 2006 19:56:39 +0100 Subject: [z3-five] Question about bindings Message-ID: <447C9567.20703@ed.ac.uk> I have been experimenting with additional Views of the ZopePageTemplate class and have noticed that it is only possible to produce one default view unless the __init__ function is copied to a subclass and the self.ZBindings_edit(self._default_bindings) line removed, for which _default_bindings = {'name_subpath': 'traverse_subpath'}, and I have noticed that traverse_subpath appears in the request object. I have no idea what the implications of changing the bindings might be, or whether there is a standard way of accessing a view other than the default view in this case. Can anyone explain or point me to some documentation? At the moment I am experimenting with the PageTemplate class instead. Cliff From chris at simplistix.co.uk Thu Jun 1 09:33:04 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 01 Jun 2006 08:33:04 +0100 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... Message-ID: <447E9830.8010001@simplistix.co.uk> Hi All, I had some i18n questions: http://mail.zope.org/pipermail/zope3-users/2006-May/003529.html Rocky Burt was good enough to point me at Philipp's excellent article: http://worldcookery.com/files/fivei18n/ Which has left me with some different questions: I need to write a language extractor thats returns the language specified in an attribute of the currently logged in user or defaults to the normal browser extraction. Has anyone done this before? If not, any pointers? I used the following to translate some code inside python scripts: from Products.PageTemplates.GlobalTranslationService import \ getGlobalTranslationService ts = getGlobalTranslationService() ts.translate(domain, msgid, context=self, target_language=target_language, default=default) What's the equivalent in Z3 land or should I be looking to turn all calls to the above into MessageID's? If I do, when and how do they get translated? I've made calls to the following too: name = ts.getLanguageName('en',self) #'en' is just an example current = ts.negotiate_language(self,domain) or default languages = [{'code':code, 'name':ts.getLanguageName(code, self), 'selected':current==code} for code in ts.getLanguages(self,domain)] What are the new-world equivalents of these? Finally, Philipp's article suggests that people may want to write message catalog implementations that do the automatic compilation to .mo and/or capture and report untranslated message ids. Has anyone done this? If not, I might well be up for it :-) Any help is good help! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From philipp at weitershausen.de Thu Jun 1 10:02:01 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu, 01 Jun 2006 10:02:01 +0200 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447E9830.8010001@simplistix.co.uk> References: <447E9830.8010001@simplistix.co.uk> Message-ID: <447E9EF9.6050900@weitershausen.de> Chris Withers wrote: > I need to write a language extractor thats returns the language > specified in an attribute of the currently logged in user or defaults to > the normal browser extraction. Has anyone done this before? If not, any > pointers? You would inherit from the default implementation in zope.publisher.browser.BrowserLanguages and override getPreferredLanguages. Inside I presume you would get the current user in the Zope 2 manner, getSecurityManager().getUser(), and do your checks. If that won't lead to anything, you can simply return super(...).getPreferredLanguages() to default to browser languages. > I used the following to translate some code inside python scripts: > > from Products.PageTemplates.GlobalTranslationService import \ > getGlobalTranslationService > ts = getGlobalTranslationService() > ts.translate(domain, > msgid, > context=self, > target_language=target_language, > default=default) > > What's the equivalent in Z3 land or should I be looking to turn all > calls to the above into MessageID's? If I do, when and how do they get > translated? 1) We usually don't do manual translation in Python 2) Instead we mark all user strings ("messages") as i18n messages (using zope.i18nmessageid.MessageFactory). That also helps the automatic extraction utility to find them. 3) Since most messages end up being inserted into PageTemplates anyway, they will be translated there. The idea is that ZPT already detected when something is an i18n message and translates it automatically (all the i18n info such as domain, mapping, etc. is intrinsic to the message object). I think that should even work in Zope 2.9. 4) In case you *do* need manual translation in Python (sometimes it happens), you can call zope.i18n.translate(msgid, context=REQUEST) (notice the context is the request here). That will of course only work with i18n messages from domains that are in Zope 3 style translation domain objects. If you want to translate messages from PTS or Localizer in your Python code, you should indeed use your above way of translating. In that case I recommend you would still mark the messages as i18n messages, just to be future proof. > I've made calls to the following too: > > name = ts.getLanguageName('en',self) #'en' is just an example > > current = ts.negotiate_language(self,domain) or default > > languages = [{'code':code, > 'name':ts.getLanguageName(code, self), > 'selected':current==code} for code in > ts.getLanguages(self,domain)] > > What are the new-world equivalents of these? Why would you need this? The translation machinery negotiates for you. All you have to worry about is the *extraction* of preferred languages from the request. You provide that IUserPReferredLanguages adapter and the machinery will do the Right Thing. (PTS's nomenclature is a bit confusing because it calls language negotation what actually is just an extract from the request). > Finally, Philipp's article suggests that people may want to write > message catalog implementations that do the automatic compilation to .mo > and/or capture and report untranslated message ids. Has anyone done > this? If not, I might well be up for it :-) Hanno Schlichting will be working in similar areas, I've heard. Perhaps you want to make friends with him :). Philipp From chris at simplistix.co.uk Fri Jun 2 09:48:33 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 02 Jun 2006 08:48:33 +0100 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447E9EF9.6050900@weitershausen.de> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> Message-ID: <447FED51.7090405@simplistix.co.uk> Philipp von Weitershausen wrote: > You would inherit from the default implementation in > zope.publisher.browser.BrowserLanguages and override > getPreferredLanguages. Inside I presume you would get the current user > in the Zope 2 manner, getSecurityManager().getUser(), and do your > checks. If that won't lead to anything, you can simply return > super(...).getPreferredLanguages() to default to browser languages. Cool, thanks. Once I've developed this component, how do I plug it in zcml-wise? >> from Products.PageTemplates.GlobalTranslationService import \ >> getGlobalTranslationService >> ts = getGlobalTranslationService() >> ts.translate(domain, >> msgid, >> context=self, >> target_language=target_language, >> default=default) >> >> What's the equivalent in Z3 land or should I be looking to turn all >> calls to the above into MessageID's? If I do, when and how do they get >> translated? > > 1) We usually don't do manual translation in Python What about sending notification mails and the like? > 2) Instead we mark all user strings ("messages") as i18n messages (using > zope.i18nmessageid.MessageFactory). That also helps the automatic > extraction utility to find them. Okay, but what translates these and when? > 4) In case you *do* need manual translation in Python (sometimes it > happens), you can call zope.i18n.translate(msgid, context=REQUEST) > (notice the context is the request here). Is msgid a string or a MessageID object there? >> I've made calls to the following too: >> >> name = ts.getLanguageName('en',self) #'en' is just an example >> >> current = ts.negotiate_language(self,domain) or default >> >> languages = [{'code':code, >> 'name':ts.getLanguageName(code, self), >> 'selected':current==code} for code in >> ts.getLanguages(self,domain)] >> >> What are the new-world equivalents of these? > > Why would you need this? For UI. Showing language names in the UI and showing a list of available languages to let the user pick their own. How would would build these in Zope 3? (and, more importantly, in 2.9 with Five?) >> Finally, Philipp's article suggests that people may want to write >> message catalog implementations that do the automatic compilation to .mo >> and/or capture and report untranslated message ids. Has anyone done >> this? If not, I might well be up for it :-) > > Hanno Schlichting will be working in similar areas, I've heard. Perhaps > you want to make friends with him :). Where can I find him? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From r.ritz at biologie.hu-berlin.de Fri Jun 2 10:11:25 2006 From: r.ritz at biologie.hu-berlin.de (Raphael Ritz) Date: Fri, 02 Jun 2006 10:11:25 +0200 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447FED51.7090405@simplistix.co.uk> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> Message-ID: <447FF2AD.8020706@biologie.hu-berlin.de> Chris Withers wrote: > Philipp von Weitershausen wrote: [..] >> >> Hanno Schlichting will be working in similar areas, I've heard. Perhaps >> you want to make friends with him :). > > > Where can I find him? Usually in Hamburg, Germany ;-) or head over to plone.devel Raphael > > cheers, > > Chris > From chris at simplistix.co.uk Fri Jun 2 10:24:44 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 02 Jun 2006 09:24:44 +0100 Subject: [z3-five] [Zope3-dev] Re: Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447FF2AD.8020706@biologie.hu-berlin.de> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> <447FF2AD.8020706@biologie.hu-berlin.de> Message-ID: <447FF5CC.9070502@simplistix.co.uk> Raphael Ritz wrote: >> Where can I find him? > > Usually in Hamburg, Germany ;-) I meant more by way of email or irc ;-) > or head over to plone.devel There's more chance of hell freezing over... Is he not on this or any of the other zope3-related lists? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From faassen at infrae.com Fri Jun 2 12:28:03 2006 From: faassen at infrae.com (Martijn Faassen) Date: Fri, 02 Jun 2006 12:28:03 +0200 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447E9830.8010001@simplistix.co.uk> References: <447E9830.8010001@simplistix.co.uk> Message-ID: <448012B3.9090705@infrae.com> Chris Withers wrote: > Hi All, > > I had some i18n questions: > http://mail.zope.org/pipermail/zope3-users/2006-May/003529.html > > Rocky Burt was good enough to point me at Philipp's excellent article: > http://worldcookery.com/files/fivei18n/ Some Silva-specific code (that I forget the details of right now) that I wrote is here: https://infrae.com/viewvc/Silva/trunk/adapters/languageprovider.py it's a hack but can display the list of languages that are available. Look in surrounding files for ZCML and such. I couldn't find the proper Zope 3 API to get the list of available languages. If there's something better I'd like to know. :) Regards, Martijn From plone at hannosch.info Fri Jun 2 13:53:22 2006 From: plone at hannosch.info (Hanno Schlichting) Date: Fri, 02 Jun 2006 13:53:22 +0200 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447FF5CC.9070502@simplistix.co.uk> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> <447FF2AD.8020706@biologie.hu-berlin.de> <447FF5CC.9070502@simplistix.co.uk> Message-ID: <448026B2.1040502@hannosch.info> Chris Withers wrote: > Is he not on this or any of the other zope3-related lists? Hi Chris, of course I'm reading this list, but sometimes I'm quite overworked and don't answer on the same day ;) >From reading your questions and the code Martijn posted I get the feeling that we all have quite some use-cases we try to solve in common which might indicate that these should be solved on the framework level. My idea for my Google Summer Of Code project (read: I'm currently getting paid by Google to do this stuff) so far has been to re-implement all the features of PlacelessTranslationService and PloneLanguageTool based on Zope3 and put some of them directly into Zope3 core and provide the rest and some more in a pure Zope3-style plone.i18n package. Amongst the features I was planning to implement are: - configurable language negotiation based on a set of registered extractors - extractors: browser language, cookie and URL segment (maybe member property but this is probably impossible in pure Zope3 right now) - possibility to restrict allowed languages, so one can force sites into English only mode or allow only a subset of available languages. For the Zope3 core I so far had in mind to implement: - Automatic generation of Gettext mo files from all registered po files on server start or explicit refresh. - if time permits implement a "tracker mode" (this is the PTS term, Localizer has the same feature) which if turned on, collects and stores all yet untranslated messages. While I still think the last two should make it into Zope3, there is one other major drawback right now, which I would like to solve. This is the half-hearted implementation of the INegotiator, as it is even mentioned in the interface description. Right now there are two interfaces IUserPreferredLanguages and ILanguageAvailability of whom only the first one is used by the Negotiator, whose responsibility it should be to negotiate between the preferred and available languages. Right now the available languages are hard-coded as all languages which exist for a TranslationDomain, which let to the hacky work-around code Martijn has written ;) As I guess not all of you already spent some hours looking through the Zope3 code I'll stop here for some meta comments :) My current roadmap is to implement all of the above mentioned in the next two to three months so it will be available as part of Zope 3.4 / Zope 2.11. Personally I'm not looking for a solution for Zope 2.9 or 2.10 as PTS and PloneLanguageTool solve all these use-cases right now, but are hard to extend, impossible to re-use and you know Zope2 ;) If people think these are good ideas and want to help, this would be much appreciated, for instance the mo-file compilation could be done as an add-on first, so it is also available for Zope 2.9 and latter be rolled into the core. Comments and cheerleading are also welcome ;) Hanno P.S. Can somebody point me to the Zope Foundation Contributer Agreement or do I still have to sign the old one? From qual at tiscali.de Fri Jun 2 19:06:45 2006 From: qual at tiscali.de (Uwe Hoffmann) Date: Fri, 02 Jun 2006 19:06:45 +0200 Subject: [z3-five] i18n in formlib Message-ID: Hi, i hope this is also a 'developing with Five'-list. i'm building an Application with Five and have a problem with the formlib i18n support. I have a Zope 2.9.3 , Five 1.4 , python2.4.3 environment. *Nothing* else installed. If i view a form i get the following results: 1) strings in the zope.formlib domain are *not* translated (e.g. 'There were errors' using the Five.i18n machinery, or 'Add' using the zope.i18n machinery (queryUtility in _translate always returns None). There are zope.formlib.po and -mo files in the formlib/locales/lang/LC_MESSAGES directory but i always see DummyTranslationServices) 2) strings in the zope domain are translated. (e.g. 'Required input is missing.' on validating the form) 3) strings from my own product domain are translated (e.g. attribute descriptions. interrestingly i can see a second attempt to translate the already translated descriptions but now via zope.formlib) here is my file implementing the form (i hope it doesn't get mangled) from zope.formlib import form from Products.Five.formlib.formbase import AddForm, EditForm, Form import interfaces import SimpleTest class AddASimpleTestForm(AddForm): """AddForm for creating and adding IReservationSimpleTest objects """ prefix = 'AddAForm' form_fields = [w for w in form.Fields(interfaces.IASimpleTest ).omit( "status", ) ] def createAndAdd(self, data): id = data.get('id') recipient = data.get('recipient') ctnt = SimpleTest.ASimpleTest( id, data.get('description'), status="passive", number=data.get('number'), ) self.context._setObject(id, ctnt) Any hints ? regards Uwe From rnd at onego.ru Mon Jun 5 12:36:57 2006 From: rnd at onego.ru (Roman Susi) Date: Mon, 05 Jun 2006 13:36:57 +0300 Subject: [z3-five] Right way to aggregate menus? Message-ID: <44840949.7020004@onego.ru> Hi! We have a collection of components each of which has 2 or more content objects classes. Almost all of them need their own menu when seen thru the "overall" component. Right now, menus are called by using (as a convention) metatype of the content object. For example, if the object meta_type is "Our Project Foo Tool", then menu is "our_project_foo_tool_menu". And when "our project main site" template wants to show menu for a certain object, then it easily finds it thru metatype. However, this is not very nice, because "Main site" stores all possible class names (or metatypes) for which to show menus. I'd liked to drop "Our Project New Tool" into "Our Project main Site" without any changes to the later. That is, given the content object and a request it should know what is the menu id. The easiest way is to implement "IOurProjectMenu" interface and add a method like .giveMenuId(request) to every Tool which needs menu... But it means content object view specific information, which is not good. What is the correct way to do such a thing with Zope-2.9.2? Thanks! Regards, Roman Suzi From rnd at onego.ru Mon Jun 5 13:01:51 2006 From: rnd at onego.ru (Roman Susi) Date: Mon, 05 Jun 2006 14:01:51 +0300 Subject: [z3-five] New classes/components on the fly? Message-ID: <44840F1F.1060808@onego.ru> Hi! Is it possible to create components on the fly? What I mean is that the user specifies schema fields, then selects methods (or combination of interfaces), menu items, and then we have something which could be integrated into existing system on the fly (including things which are usually done via ZCML). Because many of the components are quite similar and differ only specific field names and descriptions, that its quite dull to make separate components, classes, ZCMLs... instead of generic thing which can introduce its own protocols, views and schemas for content objects. For example, there is nothing inherently different between Bookmarks and Recipe Book. Both are Container-Containee, both have metadata, both have similar action (browse/add/modify/remove). I'd liked to know how to add those components on the fly (and I mean add classes, not instances). Right now it is not even possible without restarting Zope 2.9.2... In other words, is it possible to have a component-variable instead of making a lot of components-constants? Thanks! Regards, Roman Suzi From fg at nuxeo.com Mon Jun 5 13:50:11 2006 From: fg at nuxeo.com (Florent Guillaume) Date: Mon, 05 Jun 2006 13:50:11 +0200 Subject: [z3-five] default view Message-ID: <44841A73.7080309@nuxeo.com> Probably the Five list is more appropriate: In current Zope 2.10, when you have: and a URL like: http://.../foodoc/thepage it seems that the publisher will still use attribute lookup (and therefore acquisition) before the view if you have a URL like This is unfortunate because in my case I want to use a page name that is present as an attribute on all the parents ("view", this is for CMF), and there seems to be no way of having the Five views take precedence over attributes and acquisition. What's the reason for having decided to do it this way? Can this be changed? A second problem is that even if I specify: and the URL: http://.../foodoc/ then "thepage" is still looked up as above, attribute lookup first. I'm pretty that in this cas we only want view lookup. Opinions? Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com From qual at tiscali.de Mon Jun 5 15:11:04 2006 From: qual at tiscali.de (Uwe Hoffmann) Date: Mon, 05 Jun 2006 15:11:04 +0200 Subject: [z3-five] i18n in formlib In-Reply-To: References: Message-ID: Uwe Hoffmann schrieb: > i'm building an Application with Five and have a problem with > the formlib i18n support. > > 1) strings in the zope.formlib domain are *not* translated (e.g. > 'There were errors' using the Five.i18n machinery, > or 'Add' using the zope.i18n machinery (queryUtility in _translate > always returns None). There are zope.formlib.po and -mo files in the > formlib/locales/lang/LC_MESSAGES directory but i always see > DummyTranslationServices) Inserting the following line in Five/formlib/configure.zcml solved my actual problem, but i'm not sure if this is the correct fix. Regards, Uwe From chris at simplistix.co.uk Mon Jun 5 15:52:40 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 05 Jun 2006 14:52:40 +0100 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <448026B2.1040502@hannosch.info> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> <447FF2AD.8020706@biologie.hu-berlin.de> <447FF5CC.9070502@simplistix.co.uk> <448026B2.1040502@hannosch.info> Message-ID: <44843728.8020506@simplistix.co.uk> Hanno Schlichting wrote: > From reading your questions and the code Martijn posted I get the > feeling that we all have quite some use-cases we try to solve in common > which might indicate that these should be solved on the framework level. It does feel like there are some core requirements that aren't currently met by the current framework. I think extending the i18n API so that it can at least list the available languages and the currently negotiated language would be necessary. I have the feeling that other requirements, such as recoding missing messages that are requested and negotiating based on user attributes should be possible just by writing some new components to existing interfaces and wiring them in. > getting paid by Google to do this stuff) so far has been to re-implement > all the features of PlacelessTranslationService and PloneLanguageTool > based on Zope3 and put some of them directly into Zope3 core and provide > the rest and some more in a pure Zope3-style plone.i18n package. Yes, well I'm sure you know how much I care about Plone ;-) > - Automatic generation of Gettext mo files from all registered po files > on server start or explicit refresh. Yup, although surely that's just another message catalog implementation? > - if time permits implement a "tracker mode" (this is the PTS term, > Localizer has the same feature) which if turned on, collects and stores > all yet untranslated messages. Yeah, that should still be the .missing stuff I added to PTS a few years ago. > This is the half-hearted implementation of the INegotiator, as it is > even mentioned in the interface description. Right now there are two > interfaces IUserPreferredLanguages and ILanguageAvailability of whom > only the first one is used by the Negotiator, whose responsibility it > should be to negotiate between the preferred and available languages. That's a little disappointing :-S > Personally I'm not looking for a solution for Zope 2.9 or 2.10 as PTS > and PloneLanguageTool solve all these use-cases right now, but are hard > to extend, impossible to re-use and you know Zope2 ;) Well, these are my key requirements as I try to get as far from Plone as possible... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From regebro at gmail.com Mon Jun 5 16:53:44 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 5 Jun 2006 16:53:44 +0200 Subject: [z3-five] default view In-Reply-To: <44841A73.7080309@nuxeo.com> References: <44841A73.7080309@nuxeo.com> Message-ID: <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> On 6/5/06, Florent Guillaume wrote: > Probably the Five list is more appropriate: > it seems that the publisher will still use attribute lookup (and > therefore acquisition) before the view I think this was desired from the Plone community, and I think it's how Zope3 works (although I haven't tried it). If it isn't how zope3 works, we should change it. > name="thepage" > for=".IFoo" > /> > > and the URL: > http://.../foodoc/ > > then "thepage" is still looked up as above, attribute lookup first. > I'm pretty that in this cas we only want view lookup. Here again is the question of how Zope3 works. Also, if we change this, we can't override views with skins, which I personally thing we should not be able to, but I know many others do no agree. Of course, in all these cases using /@@view should work, but for CMF it's a problem, it's mostly assumed that /view is used as a default view. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From regebro at gmail.com Mon Jun 5 18:13:31 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 5 Jun 2006 18:13:31 +0200 Subject: [z3-five] New classes/components on the fly? In-Reply-To: <44840F1F.1060808@onego.ru> References: <44840F1F.1060808@onego.ru> Message-ID: <319e029f0606050913n5cbb6f84x463d0e52f4fdf714@mail.gmail.com> On 6/5/06, Roman Susi wrote: > In other words, is it possible to have a component-variable instead of > making a lot of components-constants? There is no functionality that does this in either Zope3 or Five, no. You would have to create that yourself, and it's a bit of work, I would think, although certainly something desirable. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From emmanuel.masker at gednius.com Mon Jun 5 20:42:30 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Mon, 05 Jun 2006 20:42:30 +0200 Subject: [z3-five] access to page through page template Message-ID: <1149532950.8453.12.camel@localhost.localdomain> I have declared a page with "page" directive. This latter can be accessed through @@xxxxx or /xxxxx as expected. Now,i try to access to this page in page template (action="xxxx" of submit button).But it does not work. Can someone help me? From philipp at weitershausen.de Mon Jun 5 20:56:25 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 05 Jun 2006 20:56:25 +0200 Subject: [z3-five] i18n in formlib In-Reply-To: References: Message-ID: <44847E59.9070609@weitershausen.de> Uwe Hoffmann wrote: > Uwe Hoffmann schrieb: > >> i'm building an Application with Five and have a problem with >> the formlib i18n support. > >> 1) strings in the zope.formlib domain are *not* translated (e.g. >> 'There were errors' using the Five.i18n machinery, >> or 'Add' using the zope.i18n machinery (queryUtility in _translate >> always returns None). There are zope.formlib.po and -mo files in the >> formlib/locales/lang/LC_MESSAGES directory but i always see >> DummyTranslationServices) > > > Inserting the following line in Five/formlib/configure.zcml solved my > actual problem, but i'm not sure if this is the correct fix. > > This is the correct fix (although you need to spell the package with a dotted name: zope.formlib). Five 1.4 should probably include this line already. Note that in Zope 2.10/3.3, formlib messages are part of the 'zope' domain. Philipp From philipp at weitershausen.de Mon Jun 5 20:57:50 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 05 Jun 2006 20:57:50 +0200 Subject: [z3-five] access to page through page template In-Reply-To: <1149532950.8453.12.camel@localhost.localdomain> References: <1149532950.8453.12.camel@localhost.localdomain> Message-ID: <44847EAE.7090404@weitershausen.de> Emmanuel Masker wrote: > I have declared a page with "page" directive. This latter can be > accessed through @@xxxxx or /xxxxx as expected. > > Now,i try to access to this page in page template (action="xxxx" > of > submit button).But it does not work. > > Can someone help me? We can help you once you provide more information on what your specific problem is. From philipp at weitershausen.de Mon Jun 5 21:02:42 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 05 Jun 2006 21:02:42 +0200 Subject: [z3-five] default view In-Reply-To: <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> Message-ID: <44847FD2.9020207@weitershausen.de> Lennart Regebro wrote: > On 6/5/06, Florent Guillaume wrote: >> Probably the Five list is more appropriate: > >> it seems that the publisher will still use attribute lookup (and >> therefore acquisition) before the view > > I think this was desired from the Plone community, and I think it's > how Zope3 works (although I haven't tried it). If it isn't how zope3 > works, we should change it. It's nothing that the Plone community desired. It's simply what Zope 3 does. Imagine you have a container with an object called 'index.html'. Then thiscontainer/index.html will always resolve to the object contained in this container. If views would take precedence, they would *always* shadow attributes (which is how contained objects work in Zope 2). There's a second reason why attribute-first-views-later is the more sensible thing to do in Zope 2: If some application registers a view (e.g. for * or for a very common interface) under a name that happens to be a publishable interfaces in another product, this view might very well shadow the original app and break this app. We can't risk that. >> > name="thepage" >> for=".IFoo" >> /> >> >> and the URL: >> http://.../foodoc/ >> >> then "thepage" is still looked up as above, attribute lookup first. >> I'm pretty that in this cas we only want view lookup. > > Here again is the question of how Zope3 works. Also, if we change > this, we can't override views with skins, which I personally thing we > should not be able to, but I know many others do no agree. Then again, others originally wanted to override skins with views... ;). > Of course, in all these cases using /@@view should work, but for CMF > it's a problem, it's mostly assumed that /view is used as a default > view. I think the CMF solved this with some sorts of action profiles or whatever... Ask Yuppie, I think he dealt with this issue in the CMF. Philipp From emmanuel.masker at gednius.com Mon Jun 5 21:04:41 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Mon, 05 Jun 2006 21:04:41 +0200 Subject: [z3-five] access to page through page template In-Reply-To: <44847EAE.7090404@weitershausen.de> References: <1149532950.8453.12.camel@localhost.localdomain> <44847EAE.7090404@weitershausen.de> Message-ID: <1149534281.8453.22.camel@localhost.localdomain> Ok. I have declared "store.xml" page like that: I have declared anothers page for interface IProduction, which is the default view like that: In fact, .browser.switchpage.repartitionpage is a function returns a view. Here is the function: class SwitchPage(BrowserView): def repartitionPage(self): obj = self.context if obj.meta_type == "Production" : if obj.creation : view = getViewProviding(self.context, IProductionRead, self.context.REQUEST) else: view = getViewProviding(self.context, IProductionWrite, self.context.REQUEST) obj.creation = True if obj.meta_type == "Synthese" : if obj.creation : view = getViewProviding(self.context, ISyntheseRead, self.context.REQUEST) else: view = getViewProviding(self.context, ISyntheseWrite, self.context.REQUEST) obj.creation = True if obj.meta_type == "Repartition" : if obj.creation : view = getViewProviding(self.context, IRepartitionRead, self.context.REQUEST) #view = queryMultiAdapter((self, self.context.REQUEST), IRepartitionRead, '', self.context,) else: obj.creation = True view = getViewProviding(self.context, IRepartitionWrite, self.context.REQUEST) #view = queryMultiAdapter((self, self.context.REQUEST), IRepartitionWrite, '', self.context, ) #view = view.data view.request.debug = False view.request.RESPONSE.setHeader('Content-Type', 'text/xml') return view.data Views for IProduction are declared like that: factory productionRead and productionWrite return xhtml (through generateXquery). Here is this function: class productionRead(BrowserView): implements(IProductionRead) def __init__(self, context=None, request=None): BrowserView.__init__(self, context, request) obj = context while not IPharmaFolder.providedBy(obj): obj = obj.aq_acquire('aq_parent') id_document = obj.id self.data = generateXquery(id_document, "production.xquery", "test.dbxml", "production") class productionWrite(BrowserView): implements(IProductionWrite) def __init__(self, context=None, request=None): BrowserView.__init__(self, context, request) obj = context while not IPharmaFolder.providedBy(obj): obj = obj.aq_acquire('aq_parent') id_document = obj.id self.data = generateXquery(id_document, "production.xquery", "test.dbxml", "production") Do you enough information? Regards. Le lundi 05 juin 2006 ? 20:57 +0200, Philipp von Weitershausen a ?crit : > Emmanuel Masker wrote: > > I have declared a page with "page" directive. This latter can be > > accessed through @@xxxxx or /xxxxx as expected. > > > > Now,i try to access to this page in page template (action="xxxx" > > of > > submit button).But it does not work. > > > > Can someone help me? > > We can help you once you provide more information on what your specific > problem is. > From fg at nuxeo.com Mon Jun 5 21:11:37 2006 From: fg at nuxeo.com (Florent Guillaume) Date: Mon, 5 Jun 2006 21:11:37 +0200 Subject: [z3-five] default view In-Reply-To: <44847FD2.9020207@weitershausen.de> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> Message-ID: <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> On 5 Jun 2006, at 21:02, Philipp von Weitershausen wrote: > Lennart Regebro wrote: >> On 6/5/06, Florent Guillaume wrote: >>> Probably the Five list is more appropriate: >>> it seems that the publisher will still use attribute lookup (and >>> therefore acquisition) before the view >> I think this was desired from the Plone community, and I think it's >> how Zope3 works (although I haven't tried it). If it isn't how zope3 >> works, we should change it. > > It's nothing that the Plone community desired. It's simply what > Zope 3 does. Imagine you have a container with an object called > 'index.html'. Then thiscontainer/index.html will always resolve to > the object contained in this container. If views would take > precedence, they would *always* shadow attributes (which is how > contained objects work in Zope 2). Yes but in Zope 2, Five views are shadowed by *acquired* attributes too, which IMO sucks. > There's a second reason why attribute-first-views-later is the more > sensible thing to do in Zope 2: If some application registers a > view (e.g. for * or for a very common interface) under a name that > happens to be a publishable interfaces in another product, this > view might very well shadow the original app and break this app. We > can't risk that. > >>> >> name="thepage" >>> for=".IFoo" >>> /> >>> >>> and the URL: >>> http://.../foodoc/ >>> >>> then "thepage" is still looked up as above, attribute lookup first. >>> I'm pretty that in this cas we only want view lookup. >> Here again is the question of how Zope3 works. Also, if we change >> this, we can't override views with skins, which I personally thing we >> should not be able to, but I know many others do no agree. > > Then again, others originally wanted to override skins with > views... ;). > >> Of course, in all these cases using /@@view should work, but for CMF >> it's a problem, it's mostly assumed that /view is used as a default >> view. > > I think the CMF solved this with some sorts of action profiles or > whatever... Ask Yuppie, I think he dealt with this issue in the CMF. Action alias at the moment use __bobo_traverse__, which is checked before attributes. If we wanted to reimplement action aliases ? la Zope 3, we would use views and these would be checked *after* acquired attributes too, so it wouldn't work. So here's a proposal: how about having the following order: - __bobo_traverse__ - unacquired attribute - zope 3 views - acquired attributes Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com From qual at tiscali.de Mon Jun 5 23:11:22 2006 From: qual at tiscali.de (Uwe Hoffmann) Date: Mon, 05 Jun 2006 23:11:22 +0200 Subject: [z3-five] i18n in formlib In-Reply-To: <44847E59.9070609@weitershausen.de> References: <44847E59.9070609@weitershausen.de> Message-ID: Philipp von Weitershausen schrieb: > Uwe Hoffmann wrote: >> > > > This is the correct fix (although you need to spell the package with a > dotted name: zope.formlib). out of curiosity: Will "/"-support ever be removed in ZCML ? Regards, Uwe From apm13 at columbia.edu Mon Jun 5 23:32:50 2006 From: apm13 at columbia.edu (Alec Mitchell) Date: Mon, 5 Jun 2006 14:32:50 -0700 Subject: [z3-five] default view In-Reply-To: <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> Message-ID: <365118370606051432n2cf87e9bo51851751a044bbf4@mail.gmail.com> On 6/5/06, Florent Guillaume wrote: > On 5 Jun 2006, at 21:02, Philipp von Weitershausen wrote: > > Lennart Regebro wrote: > >> On 6/5/06, Florent Guillaume wrote: > >>> Probably the Five list is more appropriate: > >>> it seems that the publisher will still use attribute lookup (and > >>> therefore acquisition) before the view > >> I think this was desired from the Plone community, and I think it's > >> how Zope3 works (although I haven't tried it). If it isn't how zope3 > >> works, we should change it. > > > > It's nothing that the Plone community desired. It's simply what > > Zope 3 does. Imagine you have a container with an object called > > 'index.html'. Then thiscontainer/index.html will always resolve to > > the object contained in this container. If views would take > > precedence, they would *always* shadow attributes (which is how > > contained objects work in Zope 2). > > Yes but in Zope 2, Five views are shadowed by *acquired* attributes > too, which IMO sucks. > > > There's a second reason why attribute-first-views-later is the more > > sensible thing to do in Zope 2: If some application registers a > > view (e.g. for * or for a very common interface) under a name that > > happens to be a publishable interfaces in another product, this > > view might very well shadow the original app and break this app. We > > can't risk that. > > > >>> >>> name="thepage" > >>> for=".IFoo" > >>> /> > >>> > >>> and the URL: > >>> http://.../foodoc/ > >>> > >>> then "thepage" is still looked up as above, attribute lookup first. > >>> I'm pretty that in this cas we only want view lookup. > >> Here again is the question of how Zope3 works. Also, if we change > >> this, we can't override views with skins, which I personally thing we > >> should not be able to, but I know many others do no agree. > > > > Then again, others originally wanted to override skins with > > views... ;). > > > >> Of course, in all these cases using /@@view should work, but for CMF > >> it's a problem, it's mostly assumed that /view is used as a default > >> view. > > > > I think the CMF solved this with some sorts of action profiles or > > whatever... Ask Yuppie, I think he dealt with this issue in the CMF. > > Action alias at the moment use __bobo_traverse__, which is checked > before attributes. If we wanted to reimplement action aliases ? la > Zope 3, we would use views and these would be checked *after* > acquired attributes too, so it wouldn't work. > > So here's a proposal: how about having the following order: > - __bobo_traverse__ > - unacquired attribute > - zope 3 views > - acquired attributes +1 this sounds like a very reasonable compromise to me, allowing views to have a little bit more power to override scripts and templates, while preserving Zope 3 behavior. Alec From rocky at serverzen.com Mon Jun 5 23:50:46 2006 From: rocky at serverzen.com (Rocky Burt) Date: Mon, 05 Jun 2006 19:20:46 -0230 Subject: [z3-five] default view In-Reply-To: <365118370606051432n2cf87e9bo51851751a044bbf4@mail.gmail.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> <365118370606051432n2cf87e9bo51851751a044bbf4@mail.gmail.com> Message-ID: <1149544228.6586.4.camel@localhost> On Mon, 2006-05-06 at 14:32 -0700, Alec Mitchell wrote: > On 6/5/06, Florent Guillaume wrote: > > On 5 Jun 2006, at 21:02, Philipp von Weitershausen wrote: > > > Lennart Regebro wrote: > > >> On 6/5/06, Florent Guillaume wrote: > > >>> Probably the Five list is more appropriate: > > >>> it seems that the publisher will still use attribute lookup (and > > >>> therefore acquisition) before the view > > >> I think this was desired from the Plone community, and I think it's > > >> how Zope3 works (although I haven't tried it). If it isn't how zope3 > > >> works, we should change it. > > > > > > It's nothing that the Plone community desired. It's simply what > > > Zope 3 does. Imagine you have a container with an object called > > > 'index.html'. Then thiscontainer/index.html will always resolve to > > > the object contained in this container. If views would take > > > precedence, they would *always* shadow attributes (which is how > > > contained objects work in Zope 2). > > > > Yes but in Zope 2, Five views are shadowed by *acquired* attributes > > too, which IMO sucks. > > > > > There's a second reason why attribute-first-views-later is the more > > > sensible thing to do in Zope 2: If some application registers a > > > view (e.g. for * or for a very common interface) under a name that > > > happens to be a publishable interfaces in another product, this > > > view might very well shadow the original app and break this app. We > > > can't risk that. > > > > > >>> > >>> name="thepage" > > >>> for=".IFoo" > > >>> /> > > >>> > > >>> and the URL: > > >>> http://.../foodoc/ > > >>> > > >>> then "thepage" is still looked up as above, attribute lookup first. > > >>> I'm pretty that in this cas we only want view lookup. > > >> Here again is the question of how Zope3 works. Also, if we change > > >> this, we can't override views with skins, which I personally thing we > > >> should not be able to, but I know many others do no agree. > > > > > > Then again, others originally wanted to override skins with > > > views... ;). > > > > > >> Of course, in all these cases using /@@view should work, but for CMF > > >> it's a problem, it's mostly assumed that /view is used as a default > > >> view. > > > > > > I think the CMF solved this with some sorts of action profiles or > > > whatever... Ask Yuppie, I think he dealt with this issue in the CMF. > > > > Action alias at the moment use __bobo_traverse__, which is checked > > before attributes. If we wanted to reimplement action aliases ? la > > Zope 3, we would use views and these would be checked *after* > > acquired attributes too, so it wouldn't work. > > > > So here's a proposal: how about having the following order: > > - __bobo_traverse__ > > - unacquired attribute > > - zope 3 views > > - acquired attributes > > +1 this sounds like a very reasonable compromise to me, allowing views > to have a little bit more power to override scripts and templates, > while preserving Zope 3 behavior. Well, without thinking of long-term repercussions of this I would say +1 to this as well. In my mind acquired *anything* should be handled *last* (if at all) when dealing with z3 tech in z2. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060605/eced5bb3/attachment.pgp From tseaver at palladion.com Tue Jun 6 00:09:37 2006 From: tseaver at palladion.com (Tres Seaver) Date: Mon, 05 Jun 2006 18:09:37 -0400 Subject: [z3-five] default view In-Reply-To: <1149544228.6586.4.camel@localhost> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> <365118370606051432n2cf87e9bo51851751a044bbf4@mail.gmail.com> <1149544228.6586.4.camel@localhost> Message-ID: <4484ABA1.7080102@palladion.com> Rocky Burt wrote: > On Mon, 2006-05-06 at 14:32 -0700, Alec Mitchell wrote: >> On 6/5/06, Florent Guillaume wrote: >>> On 5 Jun 2006, at 21:02, Philipp von Weitershausen wrote: >>>> Lennart Regebro wrote: >>>>> On 6/5/06, Florent Guillaume wrote: >>>>>> Probably the Five list is more appropriate: >>>>>> it seems that the publisher will still use attribute lookup (and >>>>>> therefore acquisition) before the view >>>>> I think this was desired from the Plone community, and I think it's >>>>> how Zope3 works (although I haven't tried it). If it isn't how zope3 >>>>> works, we should change it. >>>> It's nothing that the Plone community desired. It's simply what >>>> Zope 3 does. Imagine you have a container with an object called >>>> 'index.html'. Then thiscontainer/index.html will always resolve to >>>> the object contained in this container. If views would take >>>> precedence, they would *always* shadow attributes (which is how >>>> contained objects work in Zope 2). >>> Yes but in Zope 2, Five views are shadowed by *acquired* attributes >>> too, which IMO sucks. >>> >>>> There's a second reason why attribute-first-views-later is the more >>>> sensible thing to do in Zope 2: If some application registers a >>>> view (e.g. for * or for a very common interface) under a name that >>>> happens to be a publishable interfaces in another product, this >>>> view might very well shadow the original app and break this app. We >>>> can't risk that. >>>> >>>>>> >>>>> name="thepage" >>>>>> for=".IFoo" >>>>>> /> >>>>>> >>>>>> and the URL: >>>>>> http://.../foodoc/ >>>>>> >>>>>> then "thepage" is still looked up as above, attribute lookup first. >>>>>> I'm pretty that in this cas we only want view lookup. >>>>> Here again is the question of how Zope3 works. Also, if we change >>>>> this, we can't override views with skins, which I personally thing we >>>>> should not be able to, but I know many others do no agree. >>>> Then again, others originally wanted to override skins with >>>> views... ;). >>>> >>>>> Of course, in all these cases using /@@view should work, but for CMF >>>>> it's a problem, it's mostly assumed that /view is used as a default >>>>> view. >>>> I think the CMF solved this with some sorts of action profiles or >>>> whatever... Ask Yuppie, I think he dealt with this issue in the CMF. >>> Action alias at the moment use __bobo_traverse__, which is checked >>> before attributes. If we wanted to reimplement action aliases ? la >>> Zope 3, we would use views and these would be checked *after* >>> acquired attributes too, so it wouldn't work. >>> >>> So here's a proposal: how about having the following order: >>> - __bobo_traverse__ >>> - unacquired attribute >>> - zope 3 views >>> - acquired attributes >> +1 this sounds like a very reasonable compromise to me, allowing views >> to have a little bit more power to override scripts and templates, >> while preserving Zope 3 behavior. > > Well, without thinking of long-term repercussions of this I would say +1 > to this as well. In my mind acquired *anything* should be handled > *last* (if at all) when dealing with z3 tech in z2. This isn't "z3 tech" though; it is a synthesis of the two. I too would prefer to have views "hide" acquired namees, but we need to be careful. The current implementation was an attempt to "rationalize" Five's behavior to be more "Z3ish." What we see now is the result of weighting the "new" Z3 usage over the "old" patterns, without paying enough attention to BBB issues for Z2. Tres. -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com From optilude at gmx.net Tue Jun 6 01:23:59 2006 From: optilude at gmx.net (Martin Aspeli) Date: Tue, 06 Jun 2006 00:23:59 +0100 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> <447FF2AD.8020706@biologie.hu-berlin.de> <447FF5CC.9070502@simplistix.co.uk> <448026B2.1040502@hannosch.info> <44843728.8020506@simplistix.co.uk> Message-ID: On Mon, 05 Jun 2006 14:52:40 +0100, Chris Withers wrote: >> Personally I'm not looking for a solution for Zope 2.9 or 2.10 as PTS >> and PloneLanguageTool solve all these use-cases right now, but are hard >> to extend, impossible to re-use and you know Zope2 ;) > > Well, these are my key requirements as I try to get as far from Plone as > possible... I trust Hanno to get the organisation of products right: what should go into Zope, Five, CMF and Plone and how, and also to make things are reusable as possible outside of Plone. If you can't deal with a Zope 3 package that has a name starting with plone.*, well then I guess you (or your customers?) suffer. Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From regebro at gmail.com Tue Jun 6 09:14:09 2006 From: regebro at gmail.com (Lennart Regebro) Date: Tue, 6 Jun 2006 09:14:09 +0200 Subject: [z3-five] default view In-Reply-To: <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> Message-ID: <319e029f0606060014h19a29590qfceb66d86efbe294@mail.gmail.com> On 6/5/06, Florent Guillaume wrote: > So here's a proposal: how about having the following order: > - __bobo_traverse__ > - unacquired attribute > - zope 3 views > - acquired attributes Ah, right, good idea to split the attribute lookup between unacquired and acquired. It makes the traversal code more complex but it should work. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From rnd at onego.ru Tue Jun 6 09:50:55 2006 From: rnd at onego.ru (Roman Susi) Date: Tue, 06 Jun 2006 10:50:55 +0300 Subject: [z3-five] How to use EditView? Message-ID: <448533DF.9040906@onego.ru> hi! There is such a thing like EditView which is a subclass of BrowserView. My understanding of EditView is that it can both "show" forms and then store values from the form or indicate input errors. After some search efforts (are there proper docs, BTW?) I have found a variant with widgets. But I do not have any specific widgets, just some subset of schema (quite standard data types) of content object I want to be able to edit. Also, I have found two (three?) libs: Five.form, form and formlib which presumable can help to generate form automatically... They have different "interfaces". For example , field_names vs. fieldNames (if I remember correctly). So, is there any docs or good enough (not to be deprecated, Zope3 compatible or near) Zope2.9 example which can clearly show me what is the correct way to modify (some) fields of the content object if those fields are standard (do not require special widgets)? I do not want to create 3 classes for that (helper class, special schema class and EditView class), I want to reuse whatever is in the schema of content object. I vaguely understand that there are two things to that: - just handling form input (form is written "manually" in .pt) - write form automatically Both ways are Ok with me as long as they work and can be customized (like marking required fields the way I want) The simplest way (kinda CGI tradition) is just to have two things: edit_obj.html and .editObj() in the view class... But it is not nice to indicate input errors to the user. Regards, Roman Suzi From philipp at weitershausen.de Tue Jun 6 13:53:07 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue, 06 Jun 2006 13:53:07 +0200 Subject: [z3-five] Zope 2.9 and Zope 3 i18n, more questions... In-Reply-To: <447FED51.7090405@simplistix.co.uk> References: <447E9830.8010001@simplistix.co.uk> <447E9EF9.6050900@weitershausen.de> <447FED51.7090405@simplistix.co.uk> Message-ID: <44856CA3.4030904@weitershausen.de> Chris Withers wrote: > Philipp von Weitershausen wrote: >> You would inherit from the default implementation in >> zope.publisher.browser.BrowserLanguages and override >> getPreferredLanguages. Inside I presume you would get the current user >> in the Zope 2 manner, getSecurityManager().getUser(), and do your >> checks. If that won't lead to anything, you can simply return >> super(...).getPreferredLanguages() to default to browser languages. > > Cool, thanks. Once I've developed this component, how do I plug it in > zcml-wise? It's an adapter for IHTTPRequest (or IBrowserRequest), so you'd use . >>> from Products.PageTemplates.GlobalTranslationService import \ >>> getGlobalTranslationService >>> ts = getGlobalTranslationService() >>> ts.translate(domain, >>> msgid, >>> context=self, >>> target_language=target_language, >>> default=default) >>> >>> What's the equivalent in Z3 land or should I be looking to turn all >>> calls to the above into MessageID's? If I do, when and how do they get >>> translated? >> >> 1) We usually don't do manual translation in Python > > What about sending notification mails and the like? That's where we do use it. I said *usually*, didn't I? ;). >> 2) Instead we mark all user strings ("messages") as i18n messages (using >> zope.i18nmessageid.MessageFactory). That also helps the automatic >> extraction utility to find them. > > Okay, but what translates these and when? As I said, the ZPT engine does that automatically when it encounters a Message object. >> 4) In case you *do* need manual translation in Python (sometimes it >> happens), you can call zope.i18n.translate(msgid, context=REQUEST) >> (notice the context is the request here). > > Is msgid a string or a MessageID object there? msgid is a Message object (MessageID in Zope 2.8). >>> I've made calls to the following too: >>> >>> name = ts.getLanguageName('en',self) #'en' is just an example >>> >>> current = ts.negotiate_language(self,domain) or default >>> >>> languages = [{'code':code, >>> 'name':ts.getLanguageName(code, self), >>> 'selected':current==code} for code in >>> ts.getLanguages(self,domain)] >>> >>> What are the new-world equivalents of these? >> >> Why would you need this? > > For UI. Showing language names in the UI and showing a list of available > languages to let the user pick their own. How would would build these in > Zope 3? (and, more importantly, in 2.9 with Five?) See Hanno's replies... Philipp From tseaver at palladion.com Tue Jun 6 21:41:11 2006 From: tseaver at palladion.com (Tres Seaver) Date: Tue, 06 Jun 2006 15:41:11 -0400 Subject: [z3-five] default view In-Reply-To: <319e029f0606060014h19a29590qfceb66d86efbe294@mail.gmail.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606050753h6ed57b6fy55cc0301820a6af0@mail.gmail.com> <44847FD2.9020207@weitershausen.de> <44B5F02F-3147-4EEF-AECC-CCCA1FF5BCBC@nuxeo.com> <319e029f0606060014h19a29590qfceb66d86efbe294@mail.gmail.com> Message-ID: <4485DA57.5010000@palladion.com> Lennart Regebro wrote: > On 6/5/06, Florent Guillaume wrote: >> So here's a proposal: how about having the following order: >> - __bobo_traverse__ >> - unacquired attribute >> - zope 3 views >> - acquired attributes > > Ah, right, good idea to split the attribute lookup between unacquired > and acquired. It makes the traversal code more complex but it should > work. :-) Such a change should also be backported to the 2.9 branch, as the current situation is the source of BBB incompatibilities in 2.9.2+. Tres. -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com From emmanuel.masker at gednius.com Tue Jun 6 22:45:50 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Tue, 06 Jun 2006 22:45:50 +0200 Subject: [z3-five] differences between zope292+five136 and zope293+five1.4 Message-ID: <1149626751.8370.29.camel@localhost.localdomain> I made a product where i have declared a five page "store". Default view for this product is another five page "product.xml". In this latter, a submit button has as action "store" (i hope that i am enough clear). With zope292+five1.3.6, five page "store" is called as expected when i push on submit button. But with zope293+five1.4 (and the same product), submit button does not call five page "store". Do you know why? Is it a bug? Or a new behavior in five1.4 Emmanuel. From chris at simplistix.co.uk Wed Jun 7 19:56:38 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Wed, 07 Jun 2006 18:56:38 +0100 Subject: [z3-five] Silva, overrides.zcml and configure.zcml Message-ID: <44871356.4010501@simplistix.co.uk> Hi All, I've been using Silva as a base for learning Five. I see overrides.zcml and configure.zcml in the products directory, which raised two questions: How does overrides.zcml get dragged in? I see reference to five:loadProductsOverrides in Five/doc/features.txt but it's not used at all in the Silva product, and yet the Silva product does have an overrides.zcml. Now for configure.zcml, I'm guessing this gets dragged in from each installed product if it exists? What if I want to use a normal python package in lib/python rather than a product? How do I get the configure.zcml in a python package recognised? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From emmanuel.masker at gednius.com Wed Jun 7 22:38:41 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Wed, 07 Jun 2006 22:38:41 +0200 Subject: [z3-five] Five and Plone Message-ID: <1149712721.8388.32.camel@localhost.localdomain> I have written a product for plone using Five technology (with firefox). For this product, there is a default view defined with Five. In this default view, there are some actions that pointes to others pages defined with five as well (for instance,
). When i select my product to view it from content space, everything is fine and work correctly. Good. But, when the same instance of this product is selected from portlet navigation, this latter is correctly displayed but submit button does not work. It seems that pages defined with five are unknown. Can someone explain that? From regebro at gmail.com Wed Jun 7 23:31:08 2006 From: regebro at gmail.com (Lennart Regebro) Date: Wed, 7 Jun 2006 23:31:08 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <1149712721.8388.32.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> Message-ID: <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> On 6/7/06, Emmanuel Masker wrote: > When i select my product to view it from content space, everything is > fine and work correctly. Good. What does "select my product" mean? You mean the object? > But, when the same instance of this product is selected from portlet > navigation, this latter is correctly displayed but submit button does > not work. It seems that pages defined with five are unknown. > > Can someone explain that? Could you be more specific to what the difference between the two cases are? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From optilude at gmx.net Wed Jun 7 23:37:41 2006 From: optilude at gmx.net (Martin Aspeli) Date: Wed, 07 Jun 2006 22:37:41 +0100 Subject: [z3-five] Five and Plone References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> Message-ID: On Wed, 07 Jun 2006 22:31:08 +0100, Lennart Regebro wrote: > On 6/7/06, Emmanuel Masker wrote: >> When i select my product to view it from content space, everything is >> fine and work correctly. Good. > > What does "select my product" mean? You mean the object? > >> But, when the same instance of this product is selected from portlet >> navigation, this latter is correctly displayed but submit button does >> not work. It seems that pages defined with five are unknown. >> >> Can someone explain that? > > Could you be more specific to what the difference between the two cases > are? I think his questions are quite plone-specific... Emmanuel, it'd be better if you asked on plone-users. Martin -- "You can just adapt yourself out of it..." // Archipelago sprint 26/04/2006 From emmanuel.masker at gednius.com Wed Jun 7 23:47:07 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Wed, 07 Jun 2006 23:47:07 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> Message-ID: <1149716827.8376.1.camel@localhost.localdomain> select the product : click on the instance to view it (or edit). In first case, i select it from content space. In last case,i select it from navigation portlet. Le mercredi 07 juin 2006 ? 23:31 +0200, Lennart Regebro a ?crit : > On 6/7/06, Emmanuel Masker wrote: > > When i select my product to view it from content space, everything is > > fine and work correctly. Good. > > What does "select my product" mean? You mean the object? > > > But, when the same instance of this product is selected from portlet > > navigation, this latter is correctly displayed but submit button does > > not work. It seems that pages defined with five are unknown. > > > > Can someone explain that? > > Could you be more specific to what the difference between the two cases are? > From philipp at weitershausen.de Thu Jun 8 00:04:38 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu, 08 Jun 2006 00:04:38 +0200 Subject: [z3-five] Silva, overrides.zcml and configure.zcml In-Reply-To: <44871356.4010501@simplistix.co.uk> References: <44871356.4010501@simplistix.co.uk> Message-ID: <44874D76.6050509@weitershausen.de> Chris Withers wrote: > Hi All, > > I've been using Silva as a base for learning Five. > I see overrides.zcml and configure.zcml in the products directory, which > raised two questions: > > How does overrides.zcml get dragged in? I see reference to > five:loadProductsOverrides in Five/doc/features.txt but it's not used at > all in the Silva product, and yet the Silva product does have an > overrides.zcml. > > Now for configure.zcml, I'm guessing this gets dragged in from each > installed product if it exists? Right. Same as overrides.zcml. Basically, Five loads site.zcml upon Zope startup. This loads: - meta.zcml from all products - configure.zcml from all products - overrides.zcml from all products (with the overrides include handler) > What if I want to use a normal python > package in lib/python rather than a product? How do I get the > configure.zcml in a python package recognised? Like you would in Zope 3: by *explicitly* including it a) in one of your product's configure.zcml (this product would typically rely on the python package anyway) b) in your etc/site.zcml (in case your instance has one, the skeleton on is in Five/skel) c) in a -configure.zcml snippet which would be placed in your instance's etc/package-includes (in case your instance has that, same as etc/site.zcml). In all three cases, the include statement would be Magical things only happen for products, as a sort of legacy thing. For everything else, don't expect magical things to happen. Philipp From philipp at weitershausen.de Thu Jun 8 00:08:05 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu, 08 Jun 2006 00:08:05 +0200 Subject: [z3-five] access to page through page template In-Reply-To: <1149534281.8453.22.camel@localhost.localdomain> References: <1149532950.8453.12.camel@localhost.localdomain> <44847EAE.7090404@weitershausen.de> <1149534281.8453.22.camel@localhost.localdomain> Message-ID: <44874E45.3080503@weitershausen.de> Emmanuel Masker wrote: ... > > Do you enough information? I'm not going to dig through your code, sorry. With "information" I meant useful debugging information. You'll have to do a minimum of debugging yourself. As a minimum we need a traceback and a good error description. Your original email just stated "But it does not work." That's just not enough. Philipp From rocky at serverzen.com Thu Jun 8 02:23:22 2006 From: rocky at serverzen.com (Rocky Burt) Date: Wed, 07 Jun 2006 21:53:22 -0230 Subject: [z3-five] Silva, overrides.zcml and configure.zcml In-Reply-To: <44874D76.6050509@weitershausen.de> References: <44871356.4010501@simplistix.co.uk> <44874D76.6050509@weitershausen.de> Message-ID: <1149726185.19463.48.camel@localhost> On Thu, 2006-08-06 at 00:04 +0200, Philipp von Weitershausen wrote: > Chris Withers wrote: > > What if I want to use a normal python > > package in lib/python rather than a product? How do I get the > > configure.zcml in a python package recognised? > > Like you would in Zope 3: by *explicitly* including it > > a) in one of your product's configure.zcml (this product would typically > rely on the python package anyway) > > b) in your etc/site.zcml (in case your instance has one, the skeleton on > is in Five/skel) > > c) in a -configure.zcml snippet which would be placed in > your instance's etc/package-includes (in case your instance has that, > same as etc/site.zcml). > > In all three cases, the include statement would be > Please keep in mind that Zope < 2.10 doesn't respect certain products defined to be first-class Zope 2 products in the traditional sense. Basically Zope 2's App factory mechanism doesn't look at products that live outside of the Products/ directory and Zope 2's External Method mechanism doesn't look outside of Products/* for product info either. With Zope 2.10 this has been fixed. In the meantime (if you're stuck on Zope 2.8 or 2.9) you can use the pythonproducts_ product. Also, CMF 1.5/1.6 has issues loading FTI info from products not defined in Products/*. You can use the pythonproducts_ to remedy that as well. _pythonproducts: http://dev.serverzen.com/site/projects/pythonproducts/ - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060607/9254da2a/attachment.pgp From emmanuel.masker at gednius.com Thu Jun 8 07:42:08 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Thu, 08 Jun 2006 07:42:08 +0200 Subject: [z3-five] access to page through page template In-Reply-To: <44874E45.3080503@weitershausen.de> References: <1149532950.8453.12.camel@localhost.localdomain> <44847EAE.7090404@weitershausen.de> <1149534281.8453.22.camel@localhost.localdomain> <44874E45.3080503@weitershausen.de> Message-ID: <1149745328.8373.1.camel@localhost.localdomain> Thank, Anyway, i found the root of the problem. When i select the product to display it from content space, everything is ok. But,for unknown reason,when i select it from navigation portlet, pages defined through view's five seem not work as expected. Emmanuel. Le jeudi 08 juin 2006 ? 00:08 +0200, Philipp von Weitershausen a ?crit : > Emmanuel Masker wrote: > ... > > > > Do you enough information? > > I'm not going to dig through your code, sorry. With "information" I > meant useful debugging information. You'll have to do a minimum of > debugging yourself. As a minimum we need a traceback and a good error > description. Your original email just stated "But it does not work." > That's just not enough. > > Philipp From lewicki at provider.pl Thu Jun 8 10:50:19 2006 From: lewicki at provider.pl (Pawel Lewicki) Date: Thu, 08 Jun 2006 10:50:19 +0200 Subject: [z3-five] access to page through page template In-Reply-To: <1149745328.8373.1.camel@localhost.localdomain> References: <1149532950.8453.12.camel@localhost.localdomain> <44847EAE.7090404@weitershausen.de> <1149534281.8453.22.camel@localhost.localdomain> <44874E45.3080503@weitershausen.de> <1149745328.8373.1.camel@localhost.localdomain> Message-ID: <4487E4CB.4000205@provider.pl> Emmanuel Masker wrote: > Thank, > > Anyway, i found the root of the problem. > When i select the product to display it from content space, everything > is ok. But,for unknown reason,when i select it from navigation portlet, > pages defined through view's five seem not work as expected. Compare URLs. Pawel From tseaver at palladion.com Thu Jun 8 14:27:21 2006 From: tseaver at palladion.com (Tres Seaver) Date: Thu, 08 Jun 2006 08:27:21 -0400 Subject: [z3-five] Five and Plone In-Reply-To: <1149716827.8376.1.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> Message-ID: <448817A9.5060308@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Emmanuel Masker wrote: > select the product : click on the instance to view it (or edit). > In first case, i select it from content space. In last case,i select it > from navigation portlet. Are the two URLs different? It shouldn't otherwise matter how you found the object, as HTTP is stateless (modulo sessions / cookies). Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEiBep+gerLs4ltQ4RAiPVAKCNvA9DEnse9+qAzskiBMgePhjNBwCdEJzY xT67T9/E47gLlzr5Vz9iY9o= =gdP6 -----END PGP SIGNATURE----- From emmanuel.masker at gednius.com Thu Jun 8 18:49:26 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Thu, 08 Jun 2006 18:49:26 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <448817A9.5060308@palladion.com> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> Message-ID: <1149785366.8373.7.camel@localhost.localdomain> URLs are almost the same :).The only difference is '/' at the end of the good URL. I do not know why five view can be accessed if url is finished by '/'. Anyway, to solve that we have to change portlet_navtree_macro by following code Le jeudi 08 juin 2006 ? 08:27 -0400, Tres Seaver a ?crit : > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Emmanuel Masker wrote: > > select the product : click on the instance to view it (or edit). > > In first case, i select it from content space. In last case,i select it > > from navigation portlet. > > Are the two URLs different? It shouldn't otherwise matter how you found > the object, as HTTP is stateless (modulo sessions / cookies). > > > Tres. > - -- > =================================================================== > Tres Seaver +1 202-558-7113 tseaver at palladion.com > Palladion Software "Excellence by Design" http://palladion.com > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEiBep+gerLs4ltQ4RAiPVAKCNvA9DEnse9+qAzskiBMgePhjNBwCdEJzY > xT67T9/E47gLlzr5Vz9iY9o= > =gdP6 > -----END PGP SIGNATURE----- From regebro at gmail.com Thu Jun 8 20:09:49 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 8 Jun 2006 20:09:49 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <1149785366.8373.7.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> <1149785366.8373.7.camel@localhost.localdomain> Message-ID: <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> On 6/8/06, Emmanuel Masker wrote: > I do not know why five view can be accessed if url is finished by '/'. A wild guess: Because when you submit the form, your browser tries to go not to /foo/bar/object/method, but to /foo/bar/method? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From emmanuel.masker at gednius.com Thu Jun 8 22:18:43 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Thu, 08 Jun 2006 22:18:43 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> <1149785366.8373.7.camel@localhost.localdomain> <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> Message-ID: <1149797923.8373.31.camel@localhost.localdomain> No. In both cases, client tries to go to to same page. Le jeudi 08 juin 2006 ? 20:09 +0200, Lennart Regebro a ?crit : > On 6/8/06, Emmanuel Masker wrote: > > I do not know why five view can be accessed if url is finished by '/'. > > A wild guess: Because when you submit the form, your browser tries to > go not to /foo/bar/object/method, but to /foo/bar/method? > From regebro at gmail.com Thu Jun 8 22:54:16 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 8 Jun 2006 22:54:16 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <1149797923.8373.31.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> <1149785366.8373.7.camel@localhost.localdomain> <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> <1149797923.8373.31.camel@localhost.localdomain> Message-ID: <319e029f0606081354i2abf2eb6h7c2d996e07247644@mail.gmail.com> On 6/8/06, Emmanuel Masker wrote: > In both cases, client tries to go to to same page. So, in fact, in both cases, the client tries to post a form to a url. The url is the same in both cases. The form is the same in both cases. In one case you claim the url (which is defined with a zcml statement) exists. In the other not. I'm of the opinion that this is impossible. There is something you aren't telling us. And one of those things are the error message, which you still haven't posted. ;-) In any case, it's probably so that the code in the views __init__ is broken in some way. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From emmanuel.masker at gednius.com Thu Jun 8 23:21:12 2006 From: emmanuel.masker at gednius.com (Emmanuel Masker) Date: Thu, 08 Jun 2006 23:21:12 +0200 Subject: [z3-five] Five and Plone In-Reply-To: <319e029f0606081354i2abf2eb6h7c2d996e07247644@mail.gmail.com> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> <1149785366.8373.7.camel@localhost.localdomain> <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> <1149797923.8373.31.camel@localhost.localdomain> <319e029f0606081354i2abf2eb6h7c2d996e07247644@mail.gmail.com> Message-ID: <1149801672.8373.42.camel@localhost.localdomain> I said that url to access to first page are not the same (page where the submit is defined). As you can see by yourself in Plone, url in main template is ended by '/'. url in navigation portel is not ended by '/'. There is the only difference. And it is here that the problem is. There is not error message. In fact, i am using Xform to display some forms (it's rather fine). When instance is not correclty defined, submit is not work. That's all. In my case, instance is defined in five view. Thus, if this five view is not present,my forms does not work as expected. I have modified navigation portel to add '/' at end of each URL. And now everything is fine. Le jeudi 08 juin 2006 ? 22:54 +0200, Lennart Regebro a ?crit : > On 6/8/06, Emmanuel Masker wrote: > > In both cases, client tries to go to to same page. > > So, in fact, in both cases, the client tries to post a form to a url. > The url is the same in both cases. > The form is the same in both cases. > In one case you claim the url (which is defined with a zcml statement) > exists. In the other not. > > I'm of the opinion that this is impossible. There is something you > aren't telling us. And one of those things are the error message, > which you still haven't posted. ;-) > > In any case, it's probably so that the code in the views __init__ is > broken in some way. > From tseaver at palladion.com Thu Jun 8 23:31:13 2006 From: tseaver at palladion.com (Tres Seaver) Date: Thu, 08 Jun 2006 17:31:13 -0400 Subject: [z3-five] Five and Plone In-Reply-To: <1149801672.8373.42.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> <319e029f0606071431n5b0fd90bq189b8c6335c5222@mail.gmail.com> <1149716827.8376.1.camel@localhost.localdomain> <448817A9.5060308@palladion.com> <1149785366.8373.7.camel@localhost.localdomain> <319e029f0606081109w64cd2bd6q240d8a9038a90fd1@mail.gmail.com> <1149797923.8373.31.camel@localhost.localdomain> <319e029f0606081354i2abf2eb6h7c2d996e07247644@mail.gmail.com> <1149801672.8373.42.camel@localhost.localdomain> Message-ID: <44889721.5080305@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Emmanuel Masker wrote: > I said that url to access to first page are not the same (page where the > submit is defined). > As you can see by yourself in Plone, url in main template is ended by > '/'. url in navigation portel is not ended by '/'. There is the only > difference. And it is here that the problem is. > > There is not error message. In fact, i am using Xform to display some > forms (it's rather fine). When instance is not correclty defined, submit > is not work. That's all. > In my case, instance is defined in five view. Thus, if this five view is > not present,my forms does not work as expected. > > I have modified navigation portel to add '/' at end of each URL. And now > everything is fine. You could also be sure to make the 'action' of your forms an absolute URL; otherwise, the browser interprets it differently depending on the presence of the trailing slash. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEiJch+gerLs4ltQ4RAmRmAKCt0hcvxoh9baVX2bUjt+d5M7XtJACgg488 auoSMDSXYJZnhYQ7R3KLhfQ= =EDDe -----END PGP SIGNATURE----- From rnd at onego.ru Sat Jun 17 18:06:52 2006 From: rnd at onego.ru (Roman Susi) Date: Sat, 17 Jun 2006 19:06:52 +0300 Subject: [z3-five] Setup database connection in Five? Message-ID: <4494289C.6080709@onego.ru> Hi! Yet another frustrating experience with Zope 2.9 and Five... I cant find anywhere how do I setup database connection Zope3-way? I do not want any sqlos, I just want to be able to perform sql queries (I do not need sqlobject and sqlos) http://codespeak.net/z3/sqlos/ has some zcml blurb but it doesnt work, telling me directive unknown... Adding SQL database connection Zope2 way thru ZMI works and SELECTs are performed ok. But how to do it thru ZCML? I need to know: - what to put into zcml - what interface or whatever to use in the product code Thanks! Regards, Roman From pw_lists at slinkp.com Sat Jun 17 19:15:57 2006 From: pw_lists at slinkp.com (Paul Winkler) Date: Sat, 17 Jun 2006 13:15:57 -0400 Subject: [z3-five] Setup database connection in Five? In-Reply-To: <4494289C.6080709@onego.ru> References: <4494289C.6080709@onego.ru> Message-ID: <20060617171557.GB9696@slinkp.com> On Sat, Jun 17, 2006 at 07:06:52PM +0300, Roman Susi wrote: > Hi! > > Yet another frustrating experience with Zope 2.9 and Five... > I cant find anywhere how do I setup database connection Zope3-way? > > I do not want any sqlos, I just want to be able to perform sql queries > (I do not need sqlobject and sqlos) > > http://codespeak.net/z3/sqlos/ > > has some zcml blurb but it doesnt work, telling me directive unknown... > > Adding SQL database connection Zope2 way thru ZMI works and SELECTs are > performed ok. But how to do it thru ZCML? > > I need to know: > > - what to put into zcml > - what interface or whatever to use in the product code AFAIK, no such feature exists. You still need to create a connection through the ZMI. -- Paul Winkler http://www.slinkp.com From regebro at gmail.com Mon Jun 19 17:07:27 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 19 Jun 2006 17:07:27 +0200 Subject: [z3-five] default view In-Reply-To: <44841A73.7080309@nuxeo.com> References: <44841A73.7080309@nuxeo.com> Message-ID: <319e029f0606190807q124473f1l62d31a7776a0ba33@mail.gmail.com> OK, fixes checked in on Zope2 trunk. Five trunk also changed, it now includes more tests. I'll check this into Zope2 2.10 branch after I get an answer from Alec Mitchell about the fix he did on Zope trunk (I think it should be merged to 2.10 branch as well). Also, I'm going to work during next weekend to fix BBB and/or methods of moving over from the old Five sitemanager to the new Z3 site manager code. I hope to get that into 2.10 before the release (even though only me and one more person uses it). From regebro at gmail.com Wed Jun 21 13:27:39 2006 From: regebro at gmail.com (Lennart Regebro) Date: Wed, 21 Jun 2006 13:27:39 +0200 Subject: [z3-five] default view In-Reply-To: <319e029f0606190807q124473f1l62d31a7776a0ba33@mail.gmail.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606190807q124473f1l62d31a7776a0ba33@mail.gmail.com> Message-ID: <319e029f0606210427i6e4780d4vc5d3f134d0c96de2@mail.gmail.com> On 6/19/06, Lennart Regebro wrote: > I'll check this into Zope2 2.10 branch after I get an answer from Alec > Mitchell about the fix he did on Zope trunk (I think it should be > merged to 2.10 branch as well). Done! -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From philipp at weitershausen.de Wed Jun 21 15:25:09 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed, 21 Jun 2006 15:25:09 +0200 Subject: [z3-five] default view In-Reply-To: <319e029f0606190807q124473f1l62d31a7776a0ba33@mail.gmail.com> References: <44841A73.7080309@nuxeo.com> <319e029f0606190807q124473f1l62d31a7776a0ba33@mail.gmail.com> Message-ID: <449948B5.4010502@weitershausen.de> Lennart Regebro wrote: > OK, fixes checked in on Zope2 trunk. > Five trunk also changed, it now includes more tests. Yay! On how many knees do you need me to do this for Five 1.2/1.3/1.4 as well? :) > I'll check this into Zope2 2.10 branch after I get an answer from Alec > Mitchell about the fix he did on Zope trunk (I think it should be > merged to 2.10 branch as well). > > Also, I'm going to work during next weekend to fix BBB and/or methods > of moving over from the old Five sitemanager to the new Z3 site > manager code. I hope to get that into 2.10 before the release (even > though only me and one more person uses it). Great, thanks. Philipp From k.suess at gmx.net Wed Jun 21 21:45:46 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Wed, 21 Jun 2006 21:45:46 +0200 Subject: [z3-five] view not found Message-ID: <4499A1EA.70509@gmx.net> Hi, just tried to adapt five view technique for a product. Unfortunatly my first view is not found by now. I've read code from CMFPlone and the tutorial from Philipp von Weitershausen. What I did until now: MyProduct |-browser |-__init.py |-annonces.py |-configure.zcml |-interfaces.py |-skins |-MyProduct |-annonces_listing.pt /browser/configure.zcml: ... calling http://localhost:9081/.../annonces_view produces a 404 error. What did I miss? Thanks a lot for any help, Katja From k.suess at gmx.net Wed Jun 21 21:47:36 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Wed, 21 Jun 2006 21:47:36 +0200 Subject: [z3-five] view not found+ In-Reply-To: <4499A1EA.70509@gmx.net> References: <4499A1EA.70509@gmx.net> Message-ID: <4499A258.70604@gmx.net> Is there a way to debug the processing of what is declared in configure.zcml? From tseaver at palladion.com Wed Jun 21 23:25:43 2006 From: tseaver at palladion.com (Tres Seaver) Date: Wed, 21 Jun 2006 17:25:43 -0400 Subject: [z3-five] view not found In-Reply-To: <4499A1EA.70509@gmx.net> References: <4499A1EA.70509@gmx.net> Message-ID: <4499B957.5080704@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Katja S?ss wrote: > Hi, > just tried to adapt five view technique for a product. > Unfortunatly my first view is not found by now. > > I've read code from CMFPlone and the tutorial from Philipp von Weitershausen. > > What I did until now: > > MyProduct > |-browser > |-__init.py > |-annonces.py > |-configure.zcml > |-interfaces.py > |-skins > |-MyProduct > |-annonces_listing.pt > > /browser/configure.zcml: > ... > for="*" > name="annonces_view" > template="annonces_listing.pt" > class=".annonces.AnnoncesView" > allowed_interface=".interfaces.IAnnoncesView" > permission="zope.Public" > /> > > > calling http://localhost:9081/.../annonces_view > produces a 404 error. > > What did I miss? > Thanks a lot for any help, You need to mark your class as being 'five:traversable'. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEmblX+gerLs4ltQ4RAusUAJ9OAaUX6KPUTQfwaLuaBd/s08gcSQCfWIeU QNUTZDhte4tc2tdfeN88LpY= =L+u3 -----END PGP SIGNATURE----- From rocky at serverzen.com Wed Jun 21 23:33:32 2006 From: rocky at serverzen.com (Rocky Burt) Date: Wed, 21 Jun 2006 19:03:32 -0230 Subject: [z3-five] view not found+ In-Reply-To: <4499A258.70604@gmx.net> References: <4499A1EA.70509@gmx.net> <4499A258.70604@gmx.net> Message-ID: <1150925601.6983.122.camel@localhost> On Wed, 2006-21-06 at 21:47 +0200, Katja S?ss wrote: > Is there a way to debug the processing of what is declared in configure.zcml? I've personally found that the best way of debugging such ZCML related issues is by writing unit tests to make sure the minimal test is working and then work towards integration and functional tests where my ZCML possibly stops working. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060621/7a41f12a/attachment.pgp From k.suess at gmx.net Thu Jun 22 07:50:03 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Thu, 22 Jun 2006 07:50:03 +0200 Subject: [z3-five] view not found Message-ID: <449A2F8B.5000305@gmx.net> >>What I did until now: >> >>MyProduct >>|-browser >> |-__init.py >> |-annonces.py >> |-configure.zcml >> |-interfaces.py >>|-skins >> |-MyProduct >> |-annonces_listing.pt >> >>/browser/configure.zcml: >>... >> > for="*" >> name="annonces_view" >> template="annonces_listing.pt" >> class=".annonces.AnnoncesView" >> allowed_interface=".interfaces.IAnnoncesView" >> permission="zope.Public" >> /> >> >> >>calling http://localhost:9081/.../annonces_view >>produces a 404 error. >> >>What did I miss? >>Thanks a lot for any help, > > > You need to mark your class as being 'five:traversable'. > > Tres. The view has to show search results. There is no class to mark as traversable. ? Katja From lists at andreas-jung.com Thu Jun 22 08:09:55 2006 From: lists at andreas-jung.com (Andreas Jung) Date: Thu, 22 Jun 2006 08:09:55 +0200 Subject: [z3-five] view not found In-Reply-To: <449A2F8B.5000305@gmx.net> References: <449A2F8B.5000305@gmx.net> Message-ID: From: z3-five-owner at codespeak.net To: lists at zopyx.com Subject: Re: [z3-five] view not found Date-Sent: 22. Juni 2006 08:07:43 --On 22. Juni 2006 07:50:03 +0200 Katja S?ss wrote: > > The view has to show search results. There is no class to mark as > traversable. ? > Katja > The *content-type* class for which the view is used for has be five:traversable, not the view itself. -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/20060622/df07e985/attachment.pgp From k.suess at gmx.net Thu Jun 22 08:30:00 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Thu, 22 Jun 2006 08:30:00 +0200 Subject: [z3-five] view not found In-Reply-To: <86878943AA59B2F88D09DE55@[192.168.0.28]> References: <449A2F8B.5000305@gmx.net> <86878943AA59B2F88D09DE55@[192.168.0.28]> Message-ID: <449A38E8.4020004@gmx.net> Andreas Jung schrieb: > > --On 22. Juni 2006 07:50:03 +0200 Katja S?ss wrote: > >> The view has to show search results. There is no class to mark as >> traversable. ? >> Katja >> > The *content-type* class for which the view is used for has be > five:traversable, not the view itself. > > -aj How to explain? Like the page template 'portlet_news' serving the news portlet I tried to put the (simple) logic in a view class. annonces_listing.pt: .. annonces/annonces.py: ... class AnnoncesView(utils.BrowserView): implements(IAnnoncesView) def published_annonces(self, region, ressort): context = utils.context(self) portal_catalog = getToolByName(context, 'portal_catalog') .... Maybe five views are not thought for this case? And it's better to use a utility class with a collection of helper methods? Katja From regebro at gmail.com Thu Jun 22 08:45:35 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 22 Jun 2006 08:45:35 +0200 Subject: [z3-five] view not found In-Reply-To: <449A38E8.4020004@gmx.net> References: <449A2F8B.5000305@gmx.net> <86878943AA59B2F88D09DE55@192.168.0.28> <449A38E8.4020004@gmx.net> Message-ID: <319e029f0606212345i7374479er14c23b5f80f3754c@mail.gmail.com> On 6/22/06, Katja S?ss wrote: > Andreas Jung schrieb: > > The *content-type* class for which the view is used for has be > > five:traversable, not the view itself. > > Maybe five views are not thought for this case? It could very well be, but if you want to use a five view fo any object, than all objects need to be five-traversable. This is, btw, the case in Zope 2.10. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ From philipp at weitershausen.de Thu Jun 22 09:08:40 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu, 22 Jun 2006 09:08:40 +0200 Subject: [z3-five] view not found In-Reply-To: <449A2F8B.5000305@gmx.net> References: <449A2F8B.5000305@gmx.net> Message-ID: <449A41F8.5070905@weitershausen.de> Katja S?ss wrote: >> You need to mark your class as being 'five:traversable'. > > The view has to show search results. There is no class to mark as traversable. But the view will be displayed somewhere, probably at the site root or so. You said you're calling it with http://localhost:9081/.../annonces_view. Then whatever object http://localhost:9081/.../ ends up being, it must be five:traversable. Otherwise the view can't be found. This doesn't have anythign to do with Five views not being designed for this or not (they can surely be used for this). As Lennart said, five:traversable is obsolete in Zope 2.10. But with lower versions you need it. Philipp From k.suess at gmx.net Thu Jun 22 10:26:51 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Thu, 22 Jun 2006 10:26:51 +0200 Subject: [z3-five] view not found In-Reply-To: <358B2A1F05BFAEAEC415389E@[192.168.0.28]> References: <449A2F8B.5000305@gmx.net> <86878943AA59B2F88D09DE55@[192.168.0.28]> <449A38E8.4020004@gmx.net> <358B2A1F05BFAEAEC415389E@[192.168.0.28]> Message-ID: <449A544B.9000505@gmx.net> Andreas Jung schrieb: > --On 22. Juni 2006 08:30:00 +0200 Katja S?ss wrote: > >> >> How to explain? Like the page template 'portlet_news' serving the news >> portlet I tried to put the (simple) logic in a view class. >> >> annonces_listing.pt: >> .. >> > tal:define="view context/@@annonces_view; >> annonces python:view.published_annonces> .... >> >> Maybe five views are not thought for this case? And it's better to use a >> utility class with a collection of helper methods? >> > > Please read carefully. I wrote that the content-type class *itself* must > be five:traversable. If your in your example 'context' is an instance of > class Foo.Bar.News then Foo.Bar.News must be configured as > five:traversable through ZCML but *not* the view. > > -aj > neither nor in MyProduct/configure.zcml helps. If I call http://localhost:9081/playground/testsite/annonces_listing?region=bsl I receive an attribute error: File "/usr/local/zope_2.9.2/lib/python/Products/PageTemplates/Expressions.py", line 286, in restrictedTraverse o=t(REQUEST, name) File "/usr/local/zope_2.9.2/lib/python/Products/Five/traversable.py", line 107, in __bobo_traverse__ raise AttributeError(name) AttributeError: @@annonces_view Katja From k.suess at gmx.net Thu Jun 22 11:25:15 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Thu, 22 Jun 2006 11:25:15 +0200 Subject: [z3-five] view not found In-Reply-To: <449A544B.9000505@gmx.net> References: <449A2F8B.5000305@gmx.net> <86878943AA59B2F88D09DE55@[192.168.0.28]> <449A38E8.4020004@gmx.net> <358B2A1F05BFAEAEC415389E@[192.168.0.28]> <449A544B.9000505@gmx.net> Message-ID: <449A61FB.9000207@gmx.net> hey, and in MyProduct/configure.zcml and Zope understands what I want to see! :-) Thanks to all of you, Katja From ra at burningman.com Thu Jun 22 21:48:42 2006 From: ra at burningman.com (Rob Miller) Date: Thu, 22 Jun 2006 12:48:42 -0700 Subject: [z3-five] overriding field constraint error messages Message-ID: i'm doing my first z3 schema based work and am having a problem with generating helpful error messages for my users. currently, when you put a constraint on a field and the constraint is not met, a "ConstraintNotSatisfied" error is added to the error container that is returned to the add or edit view (raised as a "WidgetsError", AFAICT). the ConstraintNotSatisfied error has a __doc__ value of (simply enough) "Constraint not satisfied". problem is, this isn't very useful; different fields have different constraints, i'd like to have the message be more specific to the nature of the problem. is there a way to still use the constraint mechanism, but to override the error message on a field-by-field basis so that users can know what they need to fix to satisfy the constraint? -r From ra at burningman.com Thu Jun 22 22:15:30 2006 From: ra at burningman.com (Rob Miller) Date: Thu, 22 Jun 2006 13:15:30 -0700 Subject: [z3-five] overriding field constraint error messages In-Reply-To: References: Message-ID: Rob Miller wrote: > i'm doing my first z3 schema based work and am having a problem with > generating helpful error messages for my users. currently, when you put a > constraint on a field and the constraint is not met, a > "ConstraintNotSatisfied" error is added to the error container that is > returned to the add or edit view (raised as a "WidgetsError", AFAICT). > the ConstraintNotSatisfied error has a __doc__ value of (simply enough) > "Constraint not satisfied". > > problem is, this isn't very useful; different fields have different > constraints, i'd like to have the message be more specific to the nature of > the problem. is there a way to still use the constraint mechanism, but to > override the error message on a field-by-field basis so that users can know > what they need to fix to satisfy the constraint? philipp answered my question in IRC, posting the solution here for the archives. instead of having the constraint callable return False, it is easy enough to define a custom exception, with a custom __doc__ value, inheriting from ValidationError and then raise this exception from the constraint. -r p.s.: worth noting that the __doc__ value should, of course, use Z3's MessageFactory to be easily translatable. From r.ritz at biologie.hu-berlin.de Fri Jun 23 12:30:47 2006 From: r.ritz at biologie.hu-berlin.de (Raphael Ritz) Date: Fri, 23 Jun 2006 12:30:47 +0200 Subject: [z3-five] overriding field constraint error messages In-Reply-To: References: Message-ID: Rob Miller schrieb: [..] > philipp answered my question in IRC, posting the solution here for the > archives. instead of having the constraint callable return False, it is easy > enough to define a custom exception, with a custom __doc__ value, inheriting > from ValidationError and then raise this exception from the constraint. > > -r > > p.s.: worth noting that the __doc__ value should, of course, use Z3's > MessageFactory to be easily translatable. > Thanks for posting this here Rob! Now I have a follow-up question (probably because I know still way to little about Z3 and Five): Is this also the recommended way to do this in Zope 3 or is there a more direct way to do it in the schema declaration that's simply not available through Five? If not I can see us preaching to the so-far-AT future-Z3 wannabe devs: "Well, that's easy enough - just subclass this and that - change the doc-string - but don't forget to do it such and such - and raise this instead" getting in turn: "Why can't I just declare the error message in the schema/validator declaration?" Raphael From philipp at weitershausen.de Sat Jun 24 12:34:50 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 24 Jun 2006 12:34:50 +0200 Subject: [z3-five] overriding field constraint error messages In-Reply-To: References: Message-ID: <449D154A.7070906@weitershausen.de> Raphael Ritz wrote: > Now I have a follow-up question (probably because I know still > way to little about Z3 and Five): Is this also the recommended > way to do this in Zope 3 or is there a more direct way to do > it in the schema declaration that's simply not available through > Five? No, this is the way to do this in Zope 3 as well. > If not I can see us preaching to the so-far-AT future-Z3 wannabe > devs: "Well, that's easy enough - just subclass this and that - > change the doc-string - but don't forget to do it such and such - > and raise this instead" getting in turn: "Why can't I just declare > the error message in the schema/validator declaration?" Because you can't :). I think there's a good rationale behind using exceptions to indicate that validation has failed. For example, compare this constraint example without a custom exception (hence it will use the standard "Constraint not satisfied message"): import re from zope.schema import TextLine regex = r"[a-zA-Z0-9._%-]+@([a-zA-Z0-9-]+\.)*[a-zA-Z]{2,4}" check_email = re.compile(regex).match email = TextLine( title=u"Email", description=u"An email address", constraint=check_email ) with an example that *does* use a custom exception: import re from zope.schema import ValidationError, TextLine class NotAnEmailAddress(ValidationError): """Not a valid email address""" expr = re.compile(r"[a-zA-Z0-9._%-]+@([a-zA-Z0-9-]+\.)*[a-zA-Z]{2,4}") def check_email(value): if not expr.match(value): raise NotAnEmailAddress(value) return True email = TextLine( title=u"Email", description=u"An email address", constraint=check_email ) I think the additional amount of code isn't that much, but it's quite explicit, both from a user point of view (explicit error message) and from a developer point of view (explicit exception). Of course, you should always feel free to suggest alternative spellings to the Zope 3 dev list if you think that this should be simplified significantly. :) By the way, thanks to Rob for pointing out this issue, will be properly documented in the book now. Philipp From suresh_vv at yahoo.com Tue Jun 27 17:03:35 2006 From: suresh_vv at yahoo.com (suresh) Date: Tue, 27 Jun 2006 20:33:35 +0530 Subject: [z3-five] Five and Plone In-Reply-To: <1149712721.8388.32.camel@localhost.localdomain> References: <1149712721.8388.32.camel@localhost.localdomain> Message-ID: Emmanuel Masker wrote: > I have written a product for plone using Five technology (with firefox). > For this product, there is a default view defined with Five. In this > default view, there are some actions that pointes to others pages > defined with five as well (for instance, action="my_five_page">). > When i select my product to view it from content space, everything is > fine and work correctly. Good. > But, when the same instance of this product is selected from portlet > navigation, this latter is correctly displayed but submit button does > not work. It seems that pages defined with five are unknown. > > Can someone explain that? > Did you finally find the real problem? I do not like your fix of patching the navigation portlet. Were you using relative URLs as Tres suspected? Could this be because you need to make your object five:traversable? -- Thank you and Cheers, Suresh V. CTO, ParTecs, Bangalore http://www.partecs.com Plone-Zope-Python Consulting From tim at sitefusion.co.uk Tue Jun 27 19:29:08 2006 From: tim at sitefusion.co.uk (Tim Hicks) Date: Tue, 27 Jun 2006 18:29:08 +0100 Subject: [z3-five] Browser view protected by different permissions Message-ID: <44A16AE4.8020001@sitefusion.co.uk> Hi All, (I apologise if this is an obvious question. Please feel free to scold me and tell me to RTFM... as long at you tell me which manual ;-).) I have BrowserView that I'm using in my Plone product. Say, So my .browser.receiver.TrackbackInManagerView class (which subclasses BrowserView) implements both ITrackbackInManagerView and IReadTrackbackInManager. As I understand it, this means that any method on TrackbackInManagerView that appears in either of these two interfaces is thus protected by the "zope2.View" permission. Is that right? Now, my real question is this: How can I protect methods defined in ITrackbackInManagerView with one permission, and those defined in IReadTrackackInManager with another? Or am I going about this the wrong way? Thanks, Tim From ra at burningman.com Tue Jun 27 21:43:03 2006 From: ra at burningman.com (Rob Miller) Date: Tue, 27 Jun 2006 12:43:03 -0700 Subject: [z3-five] Browser view protected by different permissions In-Reply-To: <44A16AE4.8020001@sitefusion.co.uk> References: <44A16AE4.8020001@sitefusion.co.uk> Message-ID: <44A18A47.3070300@burningman.com> Tim Hicks wrote: > Hi All, > > (I apologise if this is an obvious question. Please feel free to scold > me and tell me to RTFM... as long at you tell me which manual ;-).) > I have BrowserView that I'm using in my Plone product. Say, > > for="*" > name="TrackbackInManagerView" > class=".browser.receiver.TrackbackInManagerView" > permission="zope2.View" > allowed_interface=".interfaces.ITrackbackInManagerView > .interfaces.IReadTrackbackInManager" > /> > > So my .browser.receiver.TrackbackInManagerView class (which subclasses > BrowserView) implements both ITrackbackInManagerView and > IReadTrackbackInManager. As I understand it, this means that any method > on TrackbackInManagerView that appears in either of these two interfaces > is thus protected by the "zope2.View" permission. Is that right? i think yes. and since you didn't specify either a "template" or an "attribute" attribute on your tag, your class's __call__ method will be invoked when you traverse to the view. > Now, my real question is this: How can I protect methods defined in > ITrackbackInManagerView with one permission, and those defined in > IReadTrackackInManager with another? i don't think you can, with a single tag. i don't think it's a problem, however, to have two browser:page tags that refer to the same view class. you'd have to give them different names, of course. personally, i only use "allowed_interfaces" (or "allowed_attributes") when i have a page template associated w/ the page and the template needs access to the interfaces or attributes of the view class. if i want to expose attributes from a view class for direct publishing, i'll use a separate tag (with an "attribute" attribute) for each one i want to expose. hope this helps, -r From emmanuel.masker at gednius.com Tue Jun 27 22:06:16 2006 From: emmanuel.masker at gednius.com (emmanuel masker) Date: Tue, 27 Jun 2006 22:06:16 +0200 Subject: [z3-five] Five and Plone In-Reply-To: References: <1149712721.8388.32.camel@localhost.localdomain> Message-ID: <44A18FB8.5010000@gednius.com> suresh a ?crit : > Emmanuel Masker wrote: > >> I have written a product for plone using Five technology (with firefox). >> For this product, there is a default view defined with Five. In this >> default view, there are some actions that pointes to others pages >> defined with five as well (for instance, > action="my_five_page">). >> When i select my product to view it from content space, everything is >> fine and work correctly. Good. >> But, when the same instance of this product is selected from portlet >> navigation, this latter is correctly displayed but submit button does >> not work. It seems that pages defined with five are unknown. >> >> Can someone explain that? >> >> > > Did you finally find the real problem? > > I do not like your fix of patching the navigation portlet. > > Were you using relative URLs as Tres suspected? > > Could this be because you need to make your object five:traversable? > > > I think that the real problem comes from Xform that is under developpement. From y.2006_ at wcm-solutions.de Thu Jun 29 14:32:49 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Thu, 29 Jun 2006 14:32:49 +0200 Subject: [z3-five] using Zope 3 form widgets for Zope 2 content Message-ID: <44A3C871.8070508@wcm-solutions.de> Hi! I tried to use Zope 3 form widgets for Zope 2 content and stumbled about some issues. Now I wonder if someone else tried the same and has already workarounds for those issues: 1.) zope.schema.Datetime seems not to be suitable for Zope 2 DateTime fields. The datetime widgets expect generic Python datetime objects. Has anybody tried to write an adapter that provides a datetime and converts it back to DateTime? Or created a field/widget for Zope 2 DateTime objects? Or is there a better solution? 2.) OrderedMultiSelectWidget uses a ViewPageTemplateFile that causes trouble in Zope 2. I don't need that right now, but my existing content often uses List or Tuple fields in places where I just need a Set and a widget without ordering support. Using a Set field in my adapter and mapping it to the List field of my content works, but is there a better solution? 3.) The error messages are not translated. I have not tracked that down so far, but maybe someone else knows what's going wrong here? 4.) I just started experimenting with this. Are there more known issues? TIA Yuppie From fg at nuxeo.com Thu Jun 29 19:21:03 2006 From: fg at nuxeo.com (Florent Guillaume) Date: Thu, 29 Jun 2006 19:21:03 +0200 Subject: [z3-five] CMF tests failing in zope 2.10 Message-ID: <44A40BFF.9040108@nuxeo.com> Some CMF 1.6 and 2.0 (and I guess trunk) tests are failing in Zope 2.10 due to missing adapters somewhere. Example, when it tries to evaluate the path 'info/id' (where info is a dict): Error in test test_generateWorkflowXML_multiple (Products.DCWorkflow.tests.test_exportimport.WorkflowDefinitionConfiguratorTests) Traceback (most recent call last): ... File "/Users/fg/zope/zope2-zope/lib/python/Products/PageTemplates/Expressions.py", line 121, in _eval ob = self._subexprs[-1](econtext) File "/Users/fg/zope/zope2-zope/lib/python/zope/tales/expressions.py", line 124, in _eval ob = self._traverser(ob, element, econtext) File "/Users/fg/zope/zope2-zope/lib/python/Products/PageTemplates/Expressions.py", line 73, in boboAwareZopeTraverse request=request) File "/Users/fg/zope/zope2-zope/lib/python/zope/traversing/adapters.py", line 161, in traversePathElement raise TraversalError('No traversable adapter found', obj) TraversalError: ('No traversable adapter found', {'state_variable': 'state', 'state_info': [...], ...}) Does anyone have an idea which adapters are missing, and where to add them in the tests? Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com From philipp at weitershausen.de Fri Jun 30 10:14:38 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri, 30 Jun 2006 10:14:38 +0200 Subject: [z3-five] using Zope 3 form widgets for Zope 2 content In-Reply-To: <44A3C871.8070508@wcm-solutions.de> References: <44A3C871.8070508@wcm-solutions.de> Message-ID: <44A4DD6E.1090006@weitershausen.de> yuppie wrote: > I tried to use Zope 3 form widgets for Zope 2 content and stumbled about > some issues. Now I wonder if someone else tried the same and has already > workarounds for those issues: > > > 1.) zope.schema.Datetime seems not to be suitable for Zope 2 DateTime > fields. The datetime widgets expect generic Python datetime objects. Yup. > Has anybody tried to write an adapter that provides a datetime and > converts it back to DateTime? Or created a field/widget for Zope 2 > DateTime objects? Or is there a better solution? Why not just use Python datetime objects? They can do more than their older Zope 2 brother :). > 2.) OrderedMultiSelectWidget uses a ViewPageTemplateFile that causes > trouble in Zope 2. > > I don't need that right now, but my existing content often uses List or > Tuple fields in places where I just need a Set and a widget without > ordering support. Using a Set field in my adapter and mapping it to the > List field of my content works, but is there a better solution? What's the trouble it causes? > 3.) The error messages are not translated. I have not tracked that down > so far, but maybe someone else knows what's going wrong here? I thought we had tests for this :). I'm pretty sure translation works, at least in the tests. Back when I tested it worked as well. If you're using zope.formlib, perhaps it's due to the zope.formlib vs. zope i18n domain confusion. Philipp From y.2006_ at wcm-solutions.de Fri Jun 30 15:22:23 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Fri, 30 Jun 2006 15:22:23 +0200 Subject: [z3-five] using Zope 3 form widgets for Zope 2 content In-Reply-To: <44A4DD6E.1090006@weitershausen.de> References: <44A3C871.8070508@wcm-solutions.de> <44A4DD6E.1090006@weitershausen.de> Message-ID: <44A5258F.1030907@wcm-solutions.de> Hi Philipp! Philipp von Weitershausen wrote: > yuppie wrote: >> I tried to use Zope 3 form widgets for Zope 2 content and stumbled about >> some issues. Now I wonder if someone else tried the same and has already >> workarounds for those issues: >> >> >> 1.) zope.schema.Datetime seems not to be suitable for Zope 2 DateTime >> fields. The datetime widgets expect generic Python datetime objects. > > Yup. > >> Has anybody tried to write an adapter that provides a datetime and >> converts it back to DateTime? Or created a field/widget for Zope 2 >> DateTime objects? Or is there a better solution? > > Why not just use Python datetime objects? They can do more than their > older Zope 2 brother :). Because I want to use the datetime objects within an existing Zope 2 / CMF application that expects Zope 2 DateTime objects. For now I just want to use formlib for forms, not rewrite everything. I don't know if it is a good idea to provide a field and widget for Zope 2 DateTime objects, but I'm sure utility functions for converting DateTime to datetime and back would be quite useful. I found this one: http://mail.zope.org/pipermail/zope/2005-September/161378.html But I'd prefer to have tested functions in Zope core. >> 2.) OrderedMultiSelectWidget uses a ViewPageTemplateFile that causes >> trouble in Zope 2. > > What's the trouble it causes? Please forget this one for now, I was just wondering if someone else stumbled over OrderedMultiSelectWidget issues. I have no time to make a useful bug report for this issue, the only thing I remember is a traceback with the known request.debug issue. >> 3.) The error messages are not translated. I have not tracked that down >> so far, but maybe someone else knows what's going wrong here? > > I thought we had tests for this :). I'm pretty sure translation works, > at least in the tests. Back when I tested it worked as well. If you're > using zope.formlib, perhaps it's due to the zope.formlib vs. zope i18n > domain confusion. Oops! Pilot error :( The untranslated error messages belong to the zope domain. All other domains I use (including zope.formlib) have only 'de' .mo files, so I didn't recognize that the browser I used for testing was set to 'en'. Thanks! Yuppie From rocky at serverzen.com Fri Jun 30 16:41:59 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 30 Jun 2006 12:11:59 -0230 Subject: [z3-five] using Zope 3 form widgets for Zope 2 content In-Reply-To: <44A5258F.1030907@wcm-solutions.de> References: <44A3C871.8070508@wcm-solutions.de> <44A4DD6E.1090006@weitershausen.de> <44A5258F.1030907@wcm-solutions.de> Message-ID: <1151678503.26884.76.camel@localhost> On Fri, 2006-30-06 at 15:22 +0200, yuppie wrote: > Philipp von Weitershausen wrote: > > yuppie wrote: > >> Has anybody tried to write an adapter that provides a datetime and > >> converts it back to DateTime? Or created a field/widget for Zope 2 > >> DateTime objects? Or is there a better solution? > > > > Why not just use Python datetime objects? They can do more than their > > older Zope 2 brother :). > > Because I want to use the datetime objects within an existing Zope 2 / > CMF application that expects Zope 2 DateTime objects. For now I just > want to use formlib for forms, not rewrite everything. > > I don't know if it is a good idea to provide a field and widget for Zope > 2 DateTime objects, but I'm sure utility functions for converting > DateTime to datetime and back would be quite useful. Perhaps while we are waiting for Zope 2 to figure out what its relationship to python datetime objects is going to be we could simply add a method to Zope's current DateTime such as "as_datetime()" or something similar that returns a datetime object. And also to allow the DateTime constructor to take a regular datetime object. I fear DateTime will be with us for a while, so it'd be nice if we could at least make its existence a little easier with the rest of Python :) Too bad this is probably too late for the Zope 2.10 release :( - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20060630/f02e61de/attachment.pgp From jhauser at zscout.de Fri Jun 30 19:01:51 2006 From: jhauser at zscout.de (Janko Hauser) Date: Fri, 30 Jun 2006 19:01:51 +0200 Subject: [z3-five] using Zope 3 form widgets for Zope 2 content In-Reply-To: <1151678503.26884.76.camel@localhost> References: <44A3C871.8070508@wcm-solutions.de> <44A4DD6E.1090006@weitershausen.de> <44A5258F.1030907@wcm-solutions.de> <1151678503.26884.76.camel@localhost> Message-ID: <0CFF23A5-1ED5-4E40-AC75-5ECDA4510AF6@zscout.de> Am 30.06.2006 um 16:41 schrieb Rocky Burt: > Perhaps while we are waiting for Zope 2 to figure out what its > relationship to python datetime objects is going to be we could simply > add a method to Zope's current DateTime such as "as_datetime()" or > something similar that returns a datetime object. And also to > allow the > DateTime constructor to take a regular datetime object. Actually the DateIndex has such a convert method. The DateRangeIndex is missing this method. I used as a shorttime solution a monkeypatch, which replaced the _convertDateTime method with the _convert method from DateIndex. I use only datetime instances and not DateTime, so I can not say for sure, if the mixed case is working. __Janko Hauser -- Janko Hauser email: jhauser at zscout.de mobile: +49 1721 641552 -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 155 bytes Desc: Signierter Teil der Nachricht Url : http://codespeak.net/pipermail/z3-five/attachments/20060630/dbfdc277/attachment.pgp