Re: [Zope3-Users] Autocreated content objects
On Wed, 2006-09-27 at 11:13 +1000, John Maddison wrote: Ah, I think I may have misdescribed what I was trying to do - I'm not trying to replace the root object, I'm trying to automatically create some other objects to put inside it (without having to use the ZMI). Hi John, Maybe we are back at my answer? There is zc.buildout for full installation set up and z3c.configurator, neither of which I've gained experience with - yet. They are still a rung or two up my learning curve. (Mixing metaphors). For my simple attempts I use a straight forward python method:: class AddSampleGallery(BrowserView): Install script for a sample gallery def install(self): root = self.context root['myapp'] = MyApp() And slot it in a menu with zcml:: browser:page for=zope.app.folder.interfaces.IFolder name=addSampleGallery.html permission=zope.ManageSite class=.install.AddSampleGallery attribute=install / browser:menuItem menu=zmi_actions title=Add sample gallery for=zope.app.folder.interfaces.IFolder action=addSampleGallery.html permission=zope.ManageSite / The install method obviously does a lot more including sample content, principals etc. And then there is a subscriber to the application's IObjectAddedEvent which does set up only possible after the content is located. Regards, Darryl ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Reportlab threadsafe solution?
Chris McDonough wrote: Why not just use a mutex (a recursive lock makes things easier too)? Yeah, Big Fat Lock has been my solution with Reportlab, worked well under high load for several years. I don't use RLocks myself, paranoia says they're not big or fat enough ;-) Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Autocreated content objects
On 9/27/06, Darryl Cousins [EMAIL PROTECTED] wrote: browser:menuItem menu=zmi_actions title=Add sample gallery for=zope.app.folder.interfaces.IFolder action=addSampleGallery.html permission=zope.ManageSite / The install method obviously does a lot more including sample content, principals etc. And then there is a subscriber to the application's IObjectAddedEvent which does set up only possible after the content is located. Ah. You're still using an explicit gesture in the user interface to add this content, then? Ok. I certainly hadn't understood that you wanted this to require a UI gesture. That doesn't require nearly as much spelunking around how Z3 starts up. :-) -Fred -- Fred L. Drake, Jr.fdrake at gmail.com Every sin is the result of a collaboration. --Lucius Annaeus Seneca ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zope 3.3.0 released!
On behalf of the Zope 3 development team I'm proud to announce the final Zope 3.3.0 release. There were no changes since the 3.3.0 release candidate. Zope 3 is the next major Zope release and has been written from scratch based on the latest software design patterns and the experiences of Zope 2. Cleanup of the Zope 3 packages has continued to ensure a flexible and scalable platform. We continued the work on making the transition from Zope 2 to Zope 3 by making Zope 2.10 use even more of the Zope 3 packages. But the transition is far from complete yet. **You can't run Zope 2 applications in Zope 3.** Downloads - http://www.zope.org/Products/Zope3 Installation instructions for both Windows and Un*x/Linux are now available in the top level README.txt file of the distribution. The binary installer is recommended for Windows. Zope 3.3 requires Python 2.4.1 to run, Python 2.4.3 is recommended. It does **NOT** work with Python 2.5 yet. You must also have zlib installed on your system. Most Important Changes Since Zope 3.2 - - Provided a new component registry API that allows multiple component registries to be combined more flexibly than before. See 'zope.component.interfaces.IComponentRegistry' for more information. - Greatly simplified local-component registration. See 'zope.component.interfaces.IComponentRegistry' for more information. - Moved many packages out of zope.app to make them easier to use outside of Zope. - Change the session credentials plugin to make it configurable in which fields it looks for the credentials. - Added a new API for collating text. You can now adapt a locale to 'zope.i18n.interfaces.ILocales.ICollator'. You can then use that to sort strings, such as menu entries, in a locale-specific fashion. - A new 'zope.annotation.factory' helper function that makes it easier to create annotations. Also added a README in 'zope.annotation' which explains how to use it. - Added a more complete set of widgets for fields that use iterable sources. These widgets now mirror the set provided by vocabulary-based fields. - Added a cleaner and more robust API to testbrowser for setting file-upload data. - Deprecated several ZCML directives: * factory * vocabulary * content (as an alias to the class directive) * modulealias * renderer:renderer - The 'browser:layer' directive and the 'ILayer' interface has been deprecated. Registering layers has become obsolete, layers should be created as interfaces extending 'IBrowserRequest'. - The 'browser:skin' directive has been deprecated. Skins should be created as interfaces extending 'IBrowserRequest' and can be registered using a simple 'utility' directive. - The 'ISkin' interface has been renamed to 'IBrowserSkinType'. For a complete list of changes see the 'CHANGES.txt' file. Resources - - Zope 3 Development Web Site: http://dev.zope.org/Zope3 - Zope 3 Dev Mailing List: http://mail.zope.org/mailman/listinfo/zope3-dev - Zope 3 Users Mailing List: http://mail.zope.org/mailman/listinfo/zope3-users - IRC Channel: #zope3-dev at irc.freenode.net Acknowledgments --- Thanks goes to everyone who contributed. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] testbrowser passes but view fails
I have a situation where the functional test passes but when the page is actually viewed a ComponentLookupError is raised. This test passes using zope.testbrowser browser.open('http://localhost/@@z3d.demo3.index.html') 'ViewletDemo3' in browser.contents True A quick sanity check browser.open('http://localhost/@@z3d.demo3.index.html') 'does not exist' in browser.contents False When the actual page http://localhost/@@z3d.demo3.index.html is viewed, a ComponentLookupError is raised File C:\Python24\Lib\site-packages\zope\contentprovider\tales.py, line 71, i n __call__ provider.update() File c:\z3_inst\lib\python\zope3demos\viewletdemos\demo3\demo.py, line 26, i n update zope.viewlet.interfaces.IViewlet, name='MISSING'') File C:\Python24\Lib\site-packages\zope\component\_api.py, line 103, in getM ultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((persistent broken test_fps.interfaces.DummyContent inst ance '\x00\x00\x00\x00\x00\x00\x00\x1f', zope.publisher.browser.BrowserRequest instance URL=http://localhost:8080/@@z3d.demo3.index.html, .browser.viewmeta.MasterpageView object at 0x033FA4B0, zope.viewlet.manager.V iewletManager providing IDemoViewletManager object at 0x033FABB0), InterfaceC lass zope.viewlet.interfaces.IViewlet, 'MISSING') MISSING does not exist. class DemoViewletManager(ViewletManagerBase): IDemoViewletManager marker interface zope.interface.implements(IDemoViewletManager) def update(self): rows=[] # list all in this directory for name, object in self.context.items(): # adapt each folder item to IViewlet rows.append( zope.component.getMultiAdapter( (object, self.request, self.__parent__, self), zope.viewlet.interfaces.IViewlet, name='MISSING') ) [entry.update() for entry in rows] self.viewlets = rows When MISSING is replaced with the correct name the functional tests pass and the view renders properly. I'm using Zope 3.3.0b2 on python 2.4.3 Am I missing something or is this a possible bug? Thanks. Kevin Smith ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] testbrowser passes but view fails
[EMAIL PROTECTED] wrote: I have a situation where the functional test passes but when the page is actually viewed a ComponentLookupError is raised. One common cause for these types of errors is differences in configuration between the testing and production environment. Try running zope with the testing config and see if you get the same results when accessing the page with a real browser. You can do that by specify which ZCML to use with the -X site-definition=foo.zcml switch, where foo.zcml is either the top-level ftesting.zcml or the ZCML for your test layer. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zope 3.3.0 - Adding Utilities to Content Space
Philipp von Weitershausen wrote: On behalf of the Zope 3 development team I'm proud to announce the final Zope 3.3.0 release. There were no changes since the 3.3.0 release candidate. I've noticed the following changes in the zope 3.3 ZMI Zope 3.3 - Can add utilities anywhere, e.g. to Folders (content space). Zope 3.2 - Can only add utilities to a Site Mgmt Folder Zope 3.3 - All Objects have a ZMI Registration Tab Zope 3.2 - Only ILocalUtility? objects have a reg. tab Is this intentional? I seem to recall an objective of zope3 was to remove 'tools' from content space? Thanks -Tom ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users