Re: [Zope3-Users] addview name not form
Am Samstag, 17. September 2005 15:10 schrieb Florian Lindner: Hello, I've a wierd error. I've a configure.zcml with: addform schema=CS.Link.interfaces.ILink name=AddCSLink.html content_factory=CS.Link.link.Link permission=CS.Add layer=centershock / addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / But this gives a configuration error upon startup: File /home/florian/Zope3/src/zope/app/publisher/browser/menumeta.py, line 214, in _checkViewFor raise ConfigurationError( zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found in: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.zcml , line 20.4-27.6 addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / I really don't understand why the view is not found... I still have this problem. Is it just to easy so that noone answers me or does really nobody knows some help? I'm really stuck with that. If somebody knows something, _please_ answer! Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florian Lindner wrote: Am Samstag, 17. September 2005 15:10 schrieb Florian Lindner: Hello, I've a wierd error. I've a configure.zcml with: addform schema=CS.Link.interfaces.ILink name=AddCSLink.html content_factory=CS.Link.link.Link permission=CS.Add layer=centershock / addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / But this gives a configuration error upon startup: File /home/florian/Zope3/src/zope/app/publisher/browser/menumeta.py, line 214, in _checkViewFor raise ConfigurationError( zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found in: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.zcml , line 20.4-27.6 addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / I really don't understand why the view is not found... I still have this problem. Is it just to easy so that noone answers me or does really nobody knows some help? I'm really stuck with that. If somebody knows something, _please_ answer! Hi Florian, It means the view name AddCSLink.html is not registred for the CS.ContentFolder.interfaces.IContentFolder *and* the default layer. It used to work before the #307 collector issue fix. See : http://svn.zope.org/Zope3/trunk/src/zope/app/publisher/browser/menumeta.py?rev=37584view=auto _checkViewFor() and addMenuItem() Maybe a more verbose error is needed saying on which interfaces the multi-adaper lookup failed ? J. - -- Julien Anguenot | Nuxeo RD (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFDOUpwGhoG8MxZ/pIRAizgAJ0V43VrwW9YeOPmv86qDnWJXo7MYACfcs/M alFnLoEHnzfT+ubJM/UQ0kE= =HV5y -END PGP SIGNATURE- ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
Am Dienstag, 27. September 2005 15:34 schrieb Julien Anguenot: Florian Lindner wrote: Am Samstag, 17. September 2005 15:10 schrieb Florian Lindner: Hello, I've a wierd error. I've a configure.zcml with: addform schema=CS.Link.interfaces.ILink name=AddCSLink.html content_factory=CS.Link.link.Link permission=CS.Add layer=centershock / addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / But this gives a configuration error upon startup: File /home/florian/Zope3/src/zope/app/publisher/browser/menumeta.py, line 214, in _checkViewFor raise ConfigurationError( zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found in: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.zcm l , line 20.4-27.6 addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / I really don't understand why the view is not found... I still have this problem. Is it just to easy so that noone answers me or does really nobody knows some help? I'm really stuck with that. If somebody knows something, _please_ answer! Hi Florian, It means the view name AddCSLink.html is not registred for the CS.ContentFolder.interfaces.IContentFolder *and* the default layer. It used to work before the #307 collector issue fix. See : http://svn.zope.org/Zope3/trunk/src/zope/app/publisher/browser/menumeta.py? rev=37584view=auto _checkViewFor() The arguments in _checkViewFor are: for_ = InterfaceClass CS.ContentFolder.interfaces.IContentFolder layer = InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer view_name = AddCSLink.html and addMenuItem() What information you want from addMenuItem? Maybe a more verbose error is needed saying on which interfaces the multi-adaper lookup failed ? It works when I take the for attribute out of the addMenuItem directive. However I want to have this addform displayed in the menu when I have a view on IContentFolder. Without the for attribute it is not shown. The addform works perfectly from contentfolderobject/+/AddCSLink.html. I just want to have a addMenuItem in the CSaddMenu that is shown on all views on IContentFolder. All that should be placed in the centersock layer. I hope I could express what I mean... ;-) Thanks for your help! Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florian Lindner wrote: Am Dienstag, 27. September 2005 15:34 schrieb Julien Anguenot: Florian Lindner wrote: Am Samstag, 17. September 2005 15:10 schrieb Florian Lindner: Hello, I've a wierd error. I've a configure.zcml with: addform schema=CS.Link.interfaces.ILink name=AddCSLink.html content_factory=CS.Link.link.Link permission=CS.Add layer=centershock / addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / But this gives a configuration error upon startup: File /home/florian/Zope3/src/zope/app/publisher/browser/menumeta.py, line 214, in _checkViewFor raise ConfigurationError( zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found in: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.zcm l , line 20.4-27.6 addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / I really don't understand why the view is not found... I still have this problem. Is it just to easy so that noone answers me or does really nobody knows some help? I'm really stuck with that. If somebody knows something, _please_ answer! Hi Florian, It means the view name AddCSLink.html is not registred for the CS.ContentFolder.interfaces.IContentFolder *and* the default layer. It used to work before the #307 collector issue fix. See : http://svn.zope.org/Zope3/trunk/src/zope/app/publisher/browser/menumeta.py? rev=37584view=auto _checkViewFor() The arguments in _checkViewFor are: for_ = InterfaceClass CS.ContentFolder.interfaces.IContentFolder layer = InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer view_name = AddCSLink.html and addMenuItem() What information you want from addMenuItem? Maybe a more verbose error is needed saying on which interfaces the multi-adaper lookup failed ? It works when I take the for attribute out of the addMenuItem directive. However I want to have this addform displayed in the menu when I have a view on IContentFolder. Without the for attribute it is not shown. The addform works perfectly from contentfolderobject/+/AddCSLink.html. I just want to have a addMenuItem in the CSaddMenu that is shown on all views on IContentFolder. All that should be placed in the centersock layer. I hope I could express what I mean... ;-) Try to add a layer=centershock within your addMenuItem directive such as : addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu layer=centershock / J. - -- Julien Anguenot | Nuxeo RD (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFDOWHHGhoG8MxZ/pIRAmrdAJ9tmYaCMLK2BuDWvNzX/eqaVaUkQwCeKajC gAkw8Y/FcEcmtSByPHXBAOU= =GNIs -END PGP SIGNATURE- ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] images in a content object
On Jun 3, 2005, at 3:28 PM, Stephan Richter wrote: On Saturday 14 May 2005 14:21, [EMAIL PROTECTED] wrote: A direction to a working example would be very much appreciated. Playing with Z3 is nice, but it is much harder than Z2 when it comes to getting where I want. But, I'm not giving up! I think the books are as much direction as we can give you without having a traceback of what's going wrong. I would also like to see the interfaces. Hey everyone, I'm having similar trouble with a content object that contains an image. Thee pertinent part of my schema is this: image_file = Bytes( title=uImage, description=uUpload an associated image here, required=False) My problem is that I haven't figured out how to point to this image, as it is part of the content object itself. Ideally, I would like to be able to refer to it in a ZPT via a URL. Something on the order of img tal:attributes=src string:${context/@@absolute_url}/image_file / Any ideas or code to which I could be pointed? Thanks! Duncan ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] images in a content object
Duncan McGreggor wrote: My problem is that I haven't figured out how to point to this image, as it is part of the content object itself. Ideally, I would like to be able to refer to it in a ZPT via a URL. Something on the order of img tal:attributes=src string:${context/@@absolute_url}/image_file / Any ideas or code to which I could be pointed? You could make the content object traversable, so you could do http://path_to_object/image_file. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] images in a content object
On Sep 27, 2005, at 11:54 AM, Benji York wrote: Duncan McGreggor wrote: My problem is that I haven't figured out how to point to this image, as it is part of the content object itself. Ideally, I would like to be able to refer to it in a ZPT via a URL. Something on the order of img tal:attributes=src string:${context/@@absolute_url}/image_file / Any ideas or code to which I could be pointed? You could make the content object traversable, so you could do http://path_to_object/image_file. Man, that sounds perfect... But! *sheepish grin* I've never done that before... is there someplace you could point me (and future readers of the list archives) where I could read about doing that (chapter of a book?) or some code in svn that shoes an example in a zcml file (I'm assuming this would be done in zcml?). Thanks, man! d ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] images in a content object
Duncan McGreggor wrote: On Sep 27, 2005, at 11:54 AM, Benji York wrote: Duncan McGreggor wrote: My problem is that I haven't figured out how to point to this image, as it is part of the content object itself. Ideally, I would like to be able to refer to it in a ZPT via a URL. Something on the order of img tal:attributes=src string:${context/@@absolute_url}/image_file / Any ideas or code to which I could be pointed? You could make the content object traversable, so you could do http://path_to_object/image_file. Man, that sounds perfect... But! *sheepish grin* I've never done that before... is there someplace you could point me (and future readers of the list archives) where I could read about doing that (chapter of a book?) or some code in svn that shoes an example in a zcml file (I'm assuming this would be done in zcml?). Thanks, man! d I've done something similar for caching images in a RAM Cache and accessing them through a url. I simply added a page / BrowserView. see: http://svn.nuxeo.org/trac/pub/file/z3lab/cpsskins/branches/jmo-perspectives/browser/caching.py If you remove the RAM cache part, your code could look like this (not tested ): __init__.py: from zope.app.file.browser.image import ImageData from zope.app.file.image import Image from zope.app.publisher.browser import BrowserView class ImageView(BrowserView): A view for accessing images. def show(self) viewer = ImageData() viewer.context = Image(context.data) viewer.request = self.request return viewer() configure.zcml : pages for=zope.app.file.interfaces.IImage class=.ImageView permission=zope.Public page name=show attribute=show / /pages then access your image with http://path_to_object/image_file/show /JM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
Am Dienstag, 27. September 2005 17:14 schrieb Julien Anguenot: Florian Lindner wrote: Am Dienstag, 27. September 2005 15:34 schrieb Julien Anguenot: Florian Lindner wrote: Am Samstag, 17. September 2005 15:10 schrieb Florian Lindner: Hello, I've a wierd error. I've a configure.zcml with: [...] But this gives a configuration error upon startup: File /home/florian/Zope3/src/zope/app/publisher/browser/menumeta.py, line 214, in _checkViewFor raise ConfigurationError( zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found in: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.z cm l , line 20.4-27.6 addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu / I really don't understand why the view is not found... I still have this problem. Is it just to easy so that noone answers me or does really nobody knows some help? I'm really stuck with that. If somebody knows something, _please_ answer! Hi Florian, It means the view name AddCSLink.html is not registred for the CS.ContentFolder.interfaces.IContentFolder *and* the default layer. It used to work before the #307 collector issue fix. See : http://svn.zope.org/Zope3/trunk/src/zope/app/publisher/browser/menumeta.p y? rev=37584view=auto _checkViewFor() The arguments in _checkViewFor are: for_ = InterfaceClass CS.ContentFolder.interfaces.IContentFolder layer = InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer view_name = AddCSLink.html and addMenuItem() What information you want from addMenuItem? Maybe a more verbose error is needed saying on which interfaces the multi-adaper lookup failed ? It works when I take the for attribute out of the addMenuItem directive. However I want to have this addform displayed in the menu when I have a view on IContentFolder. Without the for attribute it is not shown. The addform works perfectly from contentfolderobject/+/AddCSLink.html. I just want to have a addMenuItem in the CSaddMenu that is shown on all views on IContentFolder. All that should be placed in the centersock layer. I hope I could express what I mean... ;-) Try to add a layer=centershock within your addMenuItem directive such as : addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add for=CS.ContentFolder.interfaces.IContentFolder menu=CSaddMenu layer=centershock / ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/CS/Link/browser/skin/configure.zcml, line 20.4-28.7 ConfigurationError: ('Unrecognized parameters:', 'layer') It is also not listed in apidoc. The method to create the menu item directly in the addform directive works but is somehow buggy. See the tread: Object Name field on addforms started from me at 11.09.2005 15:04. Any other ideas? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Problems with a catalog
1. How do I add a catalog to a site ? 2. Catalog error 1/- I get thus far.. From the /++etc++site/@@SiteManagement form I can successfully add a Catalog object. However, when I try to add an index, it fails ... File ... /zope/app/catalog/catalog.py, line 130, in indexAdded File ... /zope/app/catalog/catalog.py, line 68, in updateIndex File ... /zope/component/__init__.py, line 257, in getUtility ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') Then if I try to add an IntId Tool, it fails ... File ... app/catalog/catalog.py, line 144, in reindexDocSubscriber File ... component/__init__.py, line 257, in getUtility ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') Actually, attempting to add any other object no longer works with the same error. So the catalog depends on a/the intid utilitly. When I add a uid utility first, then a catalog, adding and index still fails (as above). 2/ However, if I add the IntId utility to /++etc++/default (rather than /++etc++/tools), I can add a catalog, then successfully create index(es). However when I try to search the catalog it fails.. cat = zapi.getUtility(ICatalog, context=root) print cat.searchResults() None print cat.searchResults(title_index='') Traceback (most recent call last): File stdin, line 1, in ? File ... /zope/app/catalog/catalog.py, line 107, in searchResults File /usr/lib/python2.4/site-packages/PIL/__init__.py, line 257, in getUtility zope.component.interfaces.ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') (Don't know why PIL is appearing in the traceback.) I can make it work if I change (catalog.py:107) from: uidutil = zapi.getUtility(IIntIds) to: uidutil = zapi.getUtility(IIntIds, context=self) cat = zapi.getUtility(ICatalog, context=root) cat.searchResults(title_index='') zope.app.catalog.catalog.ResultSet instance at 0x41ac168c I don't know why the context needs to be explicitly set. Is it something to do with how the IntIds/Calatogs should be added to the site? ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Adding indexes to a Catalog tool subclass
I can add a tool which is a simple subclass of Catalog. However if I try to add some index(es) in the constructor it fails with a NotYet error (see below). Is there a simple way to achieve this? from zope.app.catalog.interfaces import ICatalog from zope.app.catalog.catalog import Catalog from zope.app.catalog.text import TextIndex class IFoodCatalog(ICatalog): pass class FoodCatalog(Catalog): implements(IFoodCatalog) def __init__(self): super(FoodCatalog, self).__init__() #this fails #self['title'] = TextIndex('title', IFood) File .. /zope/app/intid/__init__.py, line 161, in addIntIdSubscriber File .. /zope/interface/interface.py, line 697, in __call__ File .. /zope/interface/interface.py, line 765, in __adapt__ File .. /zope/app/component/hooks.py, line 96, in adapter_hook File .. /zope/interface/adapter.py, line 419, in adapter_hook File .. /app/security/adapter.py, line 88, in __call__ File .. /zope/app/keyreference/persistent.py, line 41, in __init__ NotYet: zope.app.catalog.text.TextIndex object at 0x4264c36c ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users