Re: [Zope3-Users] Re: Using metadata for description
Am Mittwoch, 4. Mai 2005 08:40 schrieb Philipp von Weitershausen: Florian Lindner wrote: Hello, I want to allow the user to give items a short description, like for a link: Name: Zope URL: http://zope.org Description: Homepage of Zope, a web application server Is it wise to use the metadata description field for that purpose or should I just add a TextLine attribute to the interface. If this description has little or nothing to do with the actual item, but is only there for categorizing it or similar, I'd use the DublinCore 'description' field. Mmmhh, not easy to tell... ;-) How would you solve the case above? The user just uses it to describe it, The application itself makes no use of it. Florian If it's good to use metadata: How can I directly use metadata from ZPTs? Through the 'zope' TALES namespace, e.g. obj/zope:description. Not all DublinCore metadata is available through that, though. See zope.tales.interfaces.ITALESFunctionNamespace for a list of available names. Philipp ___ 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
[Zope3-Users] Using metadata and __name__ in addform
Hello, how can I automatically create a addform that allows the user to enter the metadate zope:description and the __name__. Using addform-fields has not worked. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Question/Problem with UserPreferences
Hello, I try to use the User Preference API. I've defined a Interface: class IUserSettings(Interface): email = TextLine( title = uE-mail Address) and registered it in my configure.zcml: preferenceGroup id=UserSettings title=Basic User Settings schema=.interfaces.IUserSettings / First question: What happens if two configure.zcml files register a preference group with the same name? When I go to http://localhost:8080/++preferences++ I see a page which - amoung others - displays my preferencce group. http://localhost:8080/++preferences++/UserSettings displays only my group. I try to use the value of email in a ZPT: E-Mail: span tal:replace=++preferences++/UserSettings/email / or E-Mail: span tal:replace=++preferences++UserSettings/email / both give this traceback: PTRuntimeError: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid variable name email in expression \'++preferences++UserSettings/email\', at line 6, column 15'] What is wrong there? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Question/Problem with UserPreferences
Am Freitag, 10. Juni 2005 14:06 schrieb Stephan Richter: On Thursday 09 June 2005 12:44, Florian Lindner wrote: I try to use the value of email in a ZPT: E-Mail: span tal:replace=++preferences++/UserSettings/email / or E-Mail: span tal:replace=++preferences++UserSettings/email / both give this traceback: PTRuntimeError: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid variable name email in expression \'++preferences++UserSettings/email\', at line 6, column 15'] What is wrong there? This is not a preferences error, but a pagetemplate one. I have no clue what could have gone wrong here. Can you try a different name? Maybe something like `email1`? I suspect a clash of variable names. I've tried email1 and emailX as variable names. Both produce exactly the same error. I got no idea what is wrong there... Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Output the template of a view class
Hello, sine I suspect my last email to have drowned on the list, I try to ask again. How can I ouput the template from the associated view class? class view: def __call__(self): return template How to do that? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Syncing two attributes
Hello, I've one attribute A which is exposed via the Interface. Another internal attribute B should be in sync with it. So everytime A changes I want a function to be called. I think (solving another error stands before testing it) with __setattr__: def __setattr__(self, name, value): if name == expirationTime: self.expTimeDelta = datetime.timedelta(minutes = value) self.__dict__[name] = value But I really don't like that way? Is there elegant, more zope-like solution? Or is this the way to do it? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Inline code in ZPT
Am Mittwoch, 6. Juli 2005 21:47 schrieb Nicolas Legault: Two questions: 1: Is it possible to have Inline code in a page template that is created on the host file system, not throught the ZMI ? I got an error that inline code is not activated, where do I activate it ? 2: Is it a bug or this code is now not supported in Zope 3.1 ZPT ? 01 htmlbody 02 script type=text/server-python 03 global x 04 x = Hello World! 05 /script 06 b tal:content=x / 07 /body/html this code is from http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3GUI I don't know if it is still possible. If it's not supported anymore, is there a way to return values from the python script and use them in the zpt ? You can always define a view class and use the return value of a function: browser:page template=the_file_above.zpt class=pyfile.viewclass [...] / In your file pyfile: class viewclass: def foo(self): return bar and now you can use a TAL expression like that: span tal:replace=view/foo / is being replaced with: bar Hope that helps, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: [Zope3-dev] (no subject)
Am Samstag, 9. Juli 2005 02:20 schrieb aaron wang: hi all, I am a newcomer to python zope, I read some materials, and want to know wheather I could start on zope3 without experience on zope2. I want start on my learning by constructing a small website, but I don't have right book/tutorial for reference. Thanks your reply in advance Hi Aaron, there are currently two books around. Stephans Zope3 book is more a reference guide. It is available both online and printed. The online version can be found at http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book. But at the moment the printed version is much more recent that the online version. Philipps book is more aimed toward beginners and available only printed. The homepage is http://worldcookery.com/. A good starting point for all kinds of Zope3 documentation is http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Documentation. BTW: This is the list for people developing Zope3, not for people developing _with_ Zope3. ;-) zope3-users@zope.org would be more appropriate for your question. (http://www.zope.org/Resources/MailingLists). I'm alos posting a follow up there. Hope that helps, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Problems with PartialAnnotationsAdapter
Hello, without change of my codebase my objects which use the partial annotations adapter are not working anymore. I use it like that: contentitem.py: from zope.app.dublincore import annotatableadapter factory = annotatableadapter.partialAnnotatableAdapterFactory([title, description]) configure.zcml: adapter for=.interfaces.IContentItem provides=zope.app.dublincore.interfaces.IZopeDublinCore factory=.contentitem.factory trusted=True permission=zope.Public / As soon as I try to get DC metadata (for example in a content view of the container) I get this traceback: File /home/florian/Zope3/src/zope/app/container/browser/contents.py, line 96, in listContentInfo return self._normalListContentsInfo() File /home/florian/Zope3/src/zope/app/container/browser/contents.py, line 122, in _normalListContentsInfo info = map(self._extractContentInfo, self.context.items()) File /home/florian/Zope3/src/zope/app/container/browser/contents.py, line 169, in _extractContentInfo info['retitleable'] = canWrite(dc, 'title') File /home/florian/Zope3/src/zope/security/checker.py, line 96, in canWrite checker.check_setattr(obj, name) ForbiddenAttribute: ('title', zope.app.dublincore.annotatableadapter.ZDCPartialAnnotatableAdapter object at 0xb2ecdacc) I'm logged in a zope.Manager, the adapter is trusted and has public access. What is wrong with my permissions? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Using attributes in a nameChooser
Hello, in a Containers chooseName function I want to use a attribute of the created object: def chooseName(self, name, object): return object.name File /home/florian/Desktop/zope/lib/python/CS/ContentFolder/contentfolder.py, line 15, in chooseName return object.name AttributeError: 'Link' object has no attribute 'name' Even though apidoc says there is a attribute name. Or is it impossible to access the attributes at this time of the creation process? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Using attributes in a nameChooser
Am Freitag, 5. August 2005 15:49 schrieb Ruslan Spivak: В Птн, 05/08/2005 в 12:25 +0200, Florian Lindner пишет: Hello, in a Containers chooseName function I want to use a attribute of the created object: def chooseName(self, name, object): return object.name File /home/florian/Desktop/zope/lib/python/CS/ContentFolder/contentfolder.py , line 15, in chooseName return object.name AttributeError: 'Link' object has no attribute 'name' You should define atributes from schema you want to access with set_before_add in your addform directive. This works perfect. Can this set_before_add behevoir be somehow defined global for the object or even better be imposed by the container? So that it does not need to be declared by every addform. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Using attributes in a nameChooser
Am Freitag, 5. August 2005 21:21 schrieb Ruslan Spivak: Florian Lindner [EMAIL PROTECTED] writes: [...] Can this set_before_add behevoir be somehow defined global for the object or even better be imposed by the container? So that it does not need to be declared by every addform. Not sure. Ok. Let me explain why I want to do that. I still have the problem that I want to enable to user to enter the __name__ of the object on creation (in the addform). Now it's working more or less. In the chooseName function I read out name attribute and return this name. One problem of this method is that I can not really return an validation error of the name field if the name is already taken. AFAIK I can't develop a custom schema field that validates it before, because fields do not have access to their objects. What do you think is the best solution of the problem above? Simply that the user could choose a name of the object. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Still problems with partialAnnotationsAdapter
Hello, I'm still having problems with the partialAnnotationsAdapter. Refer to my posting: Subject: [Zope3-Users] Problems with PartialAnnotationsAdapter From: Florian Lindner [EMAIL PROTECTED] To: zope3-users@zope.org Date: 25.07.2005 15:14 or http://www.zope.org/Collectors/Zope3-dev/438 I've created a minimalistic (2,7 KB unzipped size) content type that demonstrates the problem. It is uploaded at http://xgm.de/partial.tar.gz. I would really appreciate it, if someone might have a look at it. I've tested with the newest SVN version (from 2 hours ago) and I've also created a new plain instance for it. The described error still persists. Another thing that puzzles me, is that altough I've defined a schema field description the addform is empty. As soon as I've entered a object id and clicked Add the error comes up. I've the item was added to the root folder I'm unable to get into the ZMI without deleting the files in instance/var. (which is not a problem for me) Thanks! Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Calling createAndAdd with different object id
Am Sonntag, 11. September 2005 03:52 schrieb Alen Stanisic: I don't think you would do it in AddView. You need to implement an adapter for your container providing zope.app.container.interfaces.INameChooser where chooseName() method will return name for you objects. A INameChooser adapter would really be perfect for me. But I need access to the form data of the add form. And AFAIK I don't have this using the NameChooser. You now a way to get the form data in the NameChooser? Thanks, Florian Alen On Sat, 2005-09-10 at 17:05 +0200, Florian Lindner wrote: Hello, I want to override the createAndAdd method mothed in a view class. Since I don't want to do all the work I want to derive my class from the AddView class from /home/florian/Zope3/src/zope/app/form/browser/add.py. The only thing I do in my class is to change the name (object id) of the object to be created. In the arguments of the createAndAdd method I have not found any information about the id. How can I alter the name? Thanks, Florian ___ 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] Object Name field on addforms
Am Sonntag, 11. September 2005 15:04 schrieb Florian Lindner: Hello the auto generated add forms sometimes dispaly a field for the Object Name. add.pt in src/zope/app/form/browser span tal:condition=context/nameAllowed|nothing tal:omit-tag= nbsp;nbsp;b i18n:translate=Object Name/bnbsp;nbsp; input type='text' name='add_input_name' tal:attributes=value context/contentName / This is depended if the container implements IContainerNamesContainer: correct: adding.py in zope/app/container/browser def nameAllowed(self): Return whether names can be input by the user. return not IContainerNamesContainer.providedBy(self.context) I have a Container (implementing IContainer, Interface (via Interface inheritance) and via ZCML IAttributeAnnotatable and IContentContainer. On the auto-generated addform in my layer the Object Name is not shown. Why? Thanks, Florian ___ 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] Object Name field on addforms
Am Sonntag, 11. September 2005 20:22 schrieb Stephan Richter: On Sunday 11 September 2005 09:04, Florian Lindner wrote: I have a Container (implementing IContainer, Interface (via Interface inheritance) and via ZCML IAttributeAnnotatable and IContentContainer. On the auto-generated addform in my layer the Object Name is not shown. Why? Because your container does not implement IContainerNamesContainer. If I make my container implementing IContainerNamesContainer the form field in never displayed (doesn't matter if I use the folder/+/addview or folder/addview URL). I understand the code that the form field in only shown when the container does NOT implement IContainerNamesContainer. Is that not right? def nameAllowed(self): return not IContainerNamesContainer.providedBy(self.context) span tal:condition=context/nameAllowed|nothing tal:omit-tag= Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Object Name field on addforms
Am Sonntag, 11. September 2005 20:25 schrieb Stephan Richter: On Sunday 11 September 2005 10:07, Florian Lindner wrote: The field is displayed when the addform is called with folder/+/AddCSLink.html. In this case AddCSLink.html is a view for IAdding. When folder/AddCSLink.html is is not displayed. Here AddCSLink.html is a view of IContainer. What is the difference between these two? I am surprised both would work. Only the first one should. Both forms are displayed. But when I tried to actually add the object the latter way (which is not supposed to work) generates a system error: File /home/florian/Zope3/src/zope/app/form/browser/add.py, line 134, in add return self.context.add(content) ForbiddenAttribute: ('add', CS.ContentFolder.contentfolder.ContentFolder object at 0xb3041fac) The first one works. Unfortunatly when you use the addform directive to register a menu item the action is folder/AddCSLink.html. Can this be changed? Don't use the menu/title attributes of form:addform. Use the browser:addMenuItem directive instead. Ok. But why does the addform directive registers a menu item with a action which is not even supposed to work? Isn't that considered a bug? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Object Name field on addforms
Am Montag, 12. September 2005 15:07 schrieb Stephan Richter: On Monday 12 September 2005 09:02, Florian Lindner wrote: Because your container does not implement IContainerNamesContainer. If I make my container implementing IContainerNamesContainer the form field in never displayed (doesn't matter if I use the folder/+/addview or folder/addview URL). I understand the code that the form field in only shown when the container does NOT implement IContainerNamesContainer. Is that not right? Oops, my bad; you are right. BTW, are you using the default template? Not really, but only a slight modification: metal:block define-macro=page !DOCTYPE stuff html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head title metal:define-slot=titleTesttitle/title link rel=icon type=image/png tal:attributes=href context/++resource++favicon.png / link rel=stylesheet type=text/css tal:attributes=href context/++resource++styles.css / meta http-equiv=Content-Type content=text/html;charset=utf-8 / /head body div id=navigation navigation stuff /div div id=content h2template.pt/h2 metal:block define-slot=body This is the content. /metal:block /div /body /html /metal:block Since the add.pt uses the body slot it should not affect the result, should it? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Fields are not inherited
Hello, I have a interface: class IContentItem(Interface): The ContentItem object works as a base class for all other content objects. def __setitem__(name, object): Add a IContentItem object. title = TextLine( title = uName, description = uName that will be part of the URL, required = True) description = TextLine ( title = uDescription, description = uDescription of the object., required = False) This interface should not represent a content item, it should just work as a common base for all other content objects. It does not have a class which implements it. I've registered it with: interface interface=.interfaces.IContentItem / I've also tried adding type=zope.app.content.interfaces.IContentType. When I look at the apidoc of this Interface no attributes/fields are shown. Another interface is derived from that one: class ILink(IContentItem): This interface stores information about a URL. def __setitem__(name, object): Adds a ILink object. URL = URI ( title = uURL, description = uThe URL., required = True) In the apidoc of this interface only the URL field is shown. None of the inherited fields. This content object is registered as usual: configure xmlns=http://namespaces.zope.org/zope; interface interface=.interfaces.ILink type=zope.app.content.interfaces.IContentType / content class=.link.Link implements interface=zope.app.annotation.interfaces.IAttributeAnnotatable / factory / require permission=zope.Public interface=.interfaces.ILink / require permission=zope.Public set_schema=.interfaces.ILink / /content /configure Why are the fields of ContentItem not inherited? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Fields are not inherited
Am Montag, 12. September 2005 19:47 schrieb Stephan Richter: On Monday 12 September 2005 13:30, Florian Lindner wrote: class IContentItem(Interface): The ContentItem object works as a base class for all other content objects. def __setitem__(name, object): Add a IContentItem object. title = TextLine( title = uName, description = uName that will be part of the URL, required = True) description = TextLine ( title = uDescription, description = uDescription of the object., required = False) You got the indentation wrong. Oh no... Sorry, for this stupid mistake and thanks for telling me... :-/ Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Object Name field on addforms
Am Montag, 12. September 2005 15:09 schrieb Stephan Richter: On Monday 12 September 2005 09:05, Florian Lindner wrote: Don't use the menu/title attributes of form:addform. Use the browser:addMenuItem directive instead. Ok. But why does the addform directive registers a menu item with a action which is not even supposed to work? Isn't that considered a bug? Yes, it should. :-\ I've a wierd error now. I've changed my configure.zcml accordingly: 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... 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
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
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
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
Re: [Zope3-Users] addview name not form
Hi, no one any more ideas? *desperated* I can't really believ that this error has not occured to anyone else, since IMO it is very a standard situation... Would it help if I create a small package which demonstrates the error? Thx, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] addview name not form
Am Donnerstag, 29. September 2005 20:25 schrieb Julien Anguenot: First have a look at this : http://www.zope.org/Collectors/Zope3-dev/391 The addMenuItem directive should look this way in order to work : addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=zope.Public menu=CSaddMenu / without 'for=CS.ContentFolder.interfaces.IContentFolder' (check the collector entry) But then the menu entry does not show up in views on IContentFolder. And I need it showing up there. The addMenuItem doesn't support the layer attribute. I'm going to add this to the addMenuItem directive interface. When do you think you will be done? Thx, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Object Name field on addforms
Am Sonntag, 11. September 2005 20:25 schrieb Stephan Richter: On Sunday 11 September 2005 10:07, Florian Lindner wrote: The field is displayed when the addform is called with folder/+/AddCSLink.html. In this case AddCSLink.html is a view for IAdding. When folder/AddCSLink.html is is not displayed. Here AddCSLink.html is a view of IContainer. What is the difference between these two? I am surprised both would work. Only the first one should. Unfortunatly when you use the addform directive to register a menu item the action is folder/AddCSLink.html. Can this be changed? Don't use the menu/title attributes of form:addform. Use the browser:addMenuItem directive instead. I've managed to register it now with a serperate addMenuItem directive. But the URL of the menu item is still folder/AddCSLink.html and not folder/+/AddCSLink.html and it's still the same error like I was registering it within the addform directive. 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
Am Montag, 3. Oktober 2005 14:01 schrieb Florian Lindner: Am Freitag, 30. September 2005 20:17 schrieb Julien Anguenot: Florian Lindner wrote: Am Donnerstag, 29. September 2005 20:25 schrieb Julien Anguenot: First have a look at this : http://www.zope.org/Collectors/Zope3-dev/391 Sorry, didn't read that thoroughly. What do you suggest at the moment do get the desired behavior? Your ContentFolder should implement IAdding and then your example should work I guess. I've modified my content class directive for the addfolder: interface interface=.interfaces.IContentFolder type=zope.app.content.interfaces.IContentType / content class=.contentfolder.ContentFolder implements interface=zope.app.annotation.interfaces.IAttributeAnnotatable / implements interface=zope.app.container.interfaces.IContentContainer / implements interface=zope.app.container.interfaces.IAdding / factory description=CS ContentFolder / require permission=CS.View interface=.interfaces.IContentFolder / require permission=CS.Edit set_schema=.interfaces.IContentFolder / /content And my addMenuItem: addMenuItem title=Link class=CS.Link.link.Link view=AddCSLink.html permission=CS.Add menu=CSaddMenu layer=centershock for=CS.ContentFolder.interfaces.IContentFolder / it's still: zope.configuration.exceptions.ConfigurationError: view name AddCSLink.html not found Does it work with your code? (the code I uploaded) Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] PAU and Session Credentials
Hello, I've created and registered a PluggableAuthentication in my site. I've added two plugins: PrincipalFolder and SessionCredentialsPlugin and registered both. I've configured the PAU to use these plugins. In the principal folder I've created a Principal. I've also created a loginForm.html that looks like that: form method=post enctype=multipart/form-data tal:attributes=action request/camefrom input class=textType id=login name=login size=20 type=text / input class=textType id=password name=password size=20 type=password / input type=submit name=SUBMIT / /form If I try to call a page which reguired a specific permission the loginForm comes up. But when I enter the login and password of the Principal in the Principal Folder or a the manager principal defined on creation of the instance I just get redirected to the login page again. This now was the behavior before a played around with the PAU a bit now it has changed to a system error: TraversalError: (Principal(u'pre1'), 'getLogin') The error log information of the user: User: unauthenticated, pre1, CS.User, pre is the prefix of my principal folder (BTW: what is the sense of this prefix), 1 is the object id of my test principal, CS.User the role of the principal. I've been stepping in the session credentials plugin code and I see that the login and password date is extracted correctly. Somehow I'm still confused how everything is supposed to work... Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] PAU and Session Credentials
Am Freitag, 25. November 2005 00:06 schrieb Christian Lück: Hi Florian, Florian Lindner wrote: If I try to call a page which reguired a specific permission the loginForm comes up. But when I enter the login and password of the Principal in the Principal Folder or a the manager principal defined on creation of the instance I just get redirected to the login page again. I guess that you still have to grant permissions or a role to the principal. If you want to grant it globally you should login as admin and get to the rootfolder ([top]). There is a Grant item the ZMI menu. On the @@grant.html view you have to choose the right source path, probably /++etc++site/default/YourPluggableAuthentication/YourPrincipalFolder Yust press buttons, ZMI does the rest... :-) I've done that: Selected Nothing PrincipalFolder Source path /cs/++etc++site/default/PluggableAuthentication/PrincipalFolder behavior before a played around with the PAU a bit now it has changed to a system error: TraversalError: (Principal(u'pre1'), 'getLogin') Maybe it's the same error I once reported on the dev list: http://mail.zope.org/pipermail/zope3-dev/2005-October/016163.html I've not yet filed a report -- sorry to much to do at work last month. I don't know if it is the same... I'm still stuck with this SystemError... Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] unauthenticated principal
Hello, my error log has a entry to a unauthenticated principal: unauthenticated, pre1, CS.User, beschreibung but why is there a username (pre1) being print? What does the unauthenticated means in that context? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Stephan Philipp: New versions of your books?
Hello, I think both your books are, due to the fast pace of Zope3 development outdated in large sections. Are there any plans for new version of these books? Or any new Zope3 books upcoming? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Get classes implementing Interface
Hello, how can I get all classes that implement a specific interface? What interface do I need to search for, when I want all objects that can be added and work as container? IContainer seem to be implemented by a lot more objects... Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Get classes implementing Interface
Am Mittwoch, 28. Dezember 2005 14:48 schrieb Jim Fulton: Florian Lindner wrote: Hello, how can I get all classes that implement a specific interface? What interface do I need to search for, when I want all objects that can be added and work as container? IContainer seem to be implemented by a lot more objects... There isn't an api for that. And there is no workaround that comes? How would you do that? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Am Freitag, 30. Dezember 2005 10:20 schrieb Philipp von Weitershausen: Florian Lindner wrote: Am Mittwoch, 28. Dezember 2005 14:48 schrieb Jim Fulton: Florian Lindner wrote: Hello, how can I get all classes that implement a specific interface? What interface do I need to search for, when I want all objects that can be added and work as container? IContainer seem to be implemented by a lot more objects... There isn't an api for that. And there is no workaround that comes? How would you do that? What's your use case? Hi, my first use case is that I want to enhance the HomefolderManager to make it possible to select something else than a Folder to be created automatically. Right now I have forked a version of the HomefolderManager and just changed in the code. But I would like to have a more generic solution and I'll also commit it back to the trunk. For that I want all classes implementing IContainer (and IContentType ?) and let the user select on in the configuration dialog of the HomefolderManager. More use caess probably show up in my project later, but nothing fixed at this time. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton: Philipp von Weitershausen wrote: Florian Lindner wrote: my first use case is that I want to enhance the HomefolderManager to make it possible to select something else than a Folder to be created automatically. Right now I have forked a version of the HomefolderManager and just changed in the code. But I would like to have a more generic solution and I'll also commit it back to the trunk. For that I want all classes implementing IContainer (and IContentType ?) and let the user select on in the configuration dialog of the HomefolderManager. More use caess probably show up in my project later, but nothing fixed at this time. So what you want is to create objects. Classes are just an implementation detail to creating objects :). Factories create objects, whether they're from a class is immaterial. So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. But the HomeFolderManager is not a container itself it's just a utility that creates container upon requests. And I want to make choosable which container to create. Or do I misunderstand you? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell: On 12/30/05, Florian Lindner [EMAIL PROTECTED] wrote: Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton: Philipp von Weitershausen wrote: So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. But the HomeFolderManager is not a container itself it's just a utility that creates container upon requests. And I want to make choosable which container to create. Or do I misunderstand you? Well first (and I apologize if this has been mentioned before), 'containers' are a more abstract notion while 'folders' are more concrete. A message or document that allows comments might be a container, but it's not something that you'd see in the ZMI or any content management type interface as a folder. You'd see it as an article. Something that's Folderish (to drag up an old term) will probably have a folder icon, will probably (but not necessarily) will have sub-folders, will have a view to manage its contents, and so on. [...] Basically the HomeFolderManager (HFM) only creates an 1:1 relation between a principal and an object. It can also auto-create these objects if the relation is being read for the first time. In this case the object to be created is hardcoded to be a zope.app.folder.Folder. The HFM does not care what is being done with the objects it just returns them. In my project I've another folderish object that I want to have created, therefore I forked the HFM and modified the code to create the object I want. Of course, the common use case would be to create a folderish object, but any other kind of objects would make sense to. A principal could have a home page (just one site) which is not folderish neither a IContainer which could the HFM return. Or a project which can contain comments, which is not folderis either but is an IContainer implemention. I think that the HFM should allow creation of ANY objects, regardless of being folderish or IContainer implemenations. Of course, the name HomeFOLDERManager would not make sense anymore in this case. What do you think? Florian I've included zope-dev in the recipients. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Does anyone got this mail? I've not received a copy from the mailinglists neither it shows up in the archives... Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell: On 12/30/05, Florian Lindner [EMAIL PROTECTED] wrote: Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton: Philipp von Weitershausen wrote: So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. But the HomeFolderManager is not a container itself it's just a utility that creates container upon requests. And I want to make choosable which container to create. Or do I misunderstand you? Well first (and I apologize if this has been mentioned before), 'containers' are a more abstract notion while 'folders' are more concrete. A message or document that allows comments might be a container, but it's not something that you'd see in the ZMI or any content management type interface as a folder. You'd see it as an article. Something that's Folderish (to drag up an old term) will probably have a folder icon, will probably (but not necessarily) will have sub-folders, will have a view to manage its contents, and so on. [...] Basically the HomeFolderManager (HFM) only creates an 1:1 relation between a principal and an object. It can also auto-create these objects if the relation is being read for the first time. In this case the object to be created is hardcoded to be a zope.app.folder.Folder. The HFM does not care what is being done with the objects it just returns them. In my project I've another folderish object that I want to have created, therefore I forked the HFM and modified the code to create the object I want. Of course, the common use case would be to create a folderish object, but any other kind of objects would make sense to. A principal could have a home page (just one site) which is not folderish neither a IContainer which could the HFM return. Or a project which can contain comments, which is not folderis either but is an IContainer implemention. I think that the HFM should allow creation of ANY objects, regardless of being folderish or IContainer implemenations. Of course, the name HomeFOLDERManager would not make sense anymore in this case. What do you think? Florian I've included zope-dev in the recipients. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-dev] Re: [Zope3-Users] Re: Get classes implementing Interface
Am Samstag, 31. Dezember 2005 14:48 schrieb Florian Lindner: Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell: On 12/30/05, Florian Lindner [EMAIL PROTECTED] wrote: Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton: Philipp von Weitershausen wrote: So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. I'll also note that the use case is also directly addressed through containment constraints. You can say that a container should only contain objects of some given types and you will get just those types in the add list. But the HomeFolderManager is not a container itself it's just a utility that creates container upon requests. And I want to make choosable which container to create. Or do I misunderstand you? Well first (and I apologize if this has been mentioned before), 'containers' are a more abstract notion while 'folders' are more concrete. A message or document that allows comments might be a container, but it's not something that you'd see in the ZMI or any content management type interface as a folder. You'd see it as an article. Something that's Folderish (to drag up an old term) will probably have a folder icon, will probably (but not necessarily) will have sub-folders, will have a view to manage its contents, and so on. [...] Basically the HomeFolderManager (HFM) only creates an 1:1 relation between a principal and an object. It can also auto-create these objects if the relation is being read for the first time. In this case the object to be created is hardcoded to be a zope.app.folder.Folder. The HFM does not care what is being done with the objects it just returns them. In my project I've another folderish object that I want to have created, therefore I forked the HFM and modified the code to create the object I want. Of course, the common use case would be to create a folderish object, but any other kind of objects would make sense to. A principal could have a home page (just one site) which is not folderish neither a IContainer which could the HFM return. Or a project which can contain comments, which is not folderis either but is an IContainer implemention. I think that the HFM should allow creation of ANY objects, regardless of being folderish or IContainer implemenations. Of course, the name HomeFOLDERManager would not make sense anymore in this case. What do you think? Florian No thoughts / opinions of anyone? Can I make the changes to the HomeFolderManager (list box of all classes implementing IContainer to select which class to create) and commit? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Am Freitag, 30. Dezember 2005 13:30 schrieb Philipp von Weitershausen: Florian Lindner wrote: my first use case is that I want to enhance the HomefolderManager to make it possible to select something else than a Folder to be created automatically. Right now I have forked a version of the HomefolderManager and just changed in the code. But I would like to have a more generic solution and I'll also commit it back to the trunk. For that I want all classes implementing IContainer (and IContentType ?) and let the user select on in the configuration dialog of the HomefolderManager. More use caess probably show up in my project later, but nothing fixed at this time. So what you want is to create objects. Classes are just an implementation detail to creating objects :). Factories create objects, whether they're from a class is immaterial. So, what you want is not a list of classes but a list of factories that can create IContainers. This is possible by using zapi.getUtilitiesFor(IFactory) and then checking each factory's getInterfaces() method whether IContainer is a part of the returned result. I would probably base an implementation of all on the UtilityVocabulary. Hi, I do it this way now: utils = getUtilitiesFor(IFactory) self.objects = {} for i in utils: if IContainer in i[1].getInterfaces(): the UtilityVocabulary gives the same result as getUtilitiesFor. But that does not list all classes, for example there is no class of the normal Folder. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Convert from string to class
Hello, I've a string like zope.app.folder.Folder and I want to get the class zope.app.folder.Folder from this string. How can I do that? It's probably more a python problem that Zope... but I hope you excuse. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Still trying to figure out PAU
Am Freitag, 3. Februar 2006 17:11 schrieb Rupert Redington: Florian Lindner wrote: Am Freitag, 3. Februar 2006 04:07 schrieb Gary Poster: On Feb 2, 2006, at 4:41 PM, Florian Lindner wrote: Hello, I'm still desperately trying to figure out the PluggableAuthentication. Since no one has replied, I'll try my 30-second remediation technique again. ;-) That means I didn't really follow exactly what you are doing, and I'm just trying for low-hanging fruit to help you. :-) :-) : I perform the following steps: 1) Create an instance of my folderish, possible site (named A), content object. 2) I create a site in it. 3) I add a PAU in the default software space 4) I add a SessionCredentialsPlugin and a PrincipalFolder as plugins. 5) I create a internal principal with Title = zope.Manager (tried also other ones). name = abc 6) In the SessionCredentialsPlugin I leave to loginForm.html. I've a loginForm.html view in my A-object) 7) I register all components (SessionCreadentiasPlugin, PrincipalFolder and PAU) So that means that http://127.0.0.1:8080/++etc++site/default/test.pau/ @@configure.html (or similar) has one credentials plugin in the right column (Session Credentials (a utility)) and one authenticator plugin in the right column (PrincipalFolder (a utility) or something like that). Right? If not, make it so. :-) It was already like that, forgot to mention it. If that doesn't work, try making the right column of the Credentials Plugins field be No Challenge if Authenticated (a utility) first and then Session Credentials (a utility) second. That's probably what you want anyway. Changed it a bit. I'm not redirected to the loginForm.html but a Not authorized page. Anything else is the same. I wonder why I'm not authorized, because in the authenticateCredentials() function the internal.title returns: (Pdb) internal.title u'zope.Manager' Which should be authorized for anything. Hope you can hang the fruits a few centimeter lower... ,-) If this fruit is low enough for me I'll be very surprised, and you've probably done this already, but: Does the Principal you've added to your PAU authentication plugin have a grant on the site/folder you're trying to access? I've given the principal the title (which is AFAIK the same as role) zope.Manager, which IMO does not need further grants. Another way I've tried: I've created a principal with title CS.User. In my configure.zcml I have: role id=CS.User title=centershock.net user / grant permission=CS.View role=CS.User / The ressource I try to access has security declarations: page name=toHomeFolder for=* permission=CS.View [...] / Or do I need further grants or anything? Or do I misunderstand the title attribute of the principal. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Best way to add a Principal to PAU
Hello, I've managed to add a principal to a principal folder inside a PAU: pau = getUtility(IAuthentication) pfolder = pau.keys()[0] principal = InternalPrincipal(def, pwd123,a title, a description) pfolder[def] = principal but I doubt that the most elegant way. How can I achieve do it more or less agnostic form the principal source (or a least from the name and ordinal postion inside PAU)? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get classes implementing Interface
Am Montag, 6. Februar 2006 12:19 schrieb Stephan Richter: On Sunday 08 January 2006 10:01, Florian Lindner wrote: I do it this way now: utils = getUtilitiesFor(IFactory) self.objects = {} for i in utils: if IContainer in i[1].getInterfaces(): the UtilityVocabulary gives the same result as getUtilitiesFor. But that does not list all classes, for example there is no class of the normal Folder. This is bad and I think a bug. Could you report it as an issue or even investigate it further and make a suggestion? I'm not sure if I described it correctly. I've the following code: def __call__(self): from zope.app.zapi import * from zope.component.interfaces import IFactory from zope.app.container.interfaces import IContainer utils = getUtilitiesFor(IFactory) for i in utils: if zope.app.content.Folder == i[0]: import pdb; pdb.set_trace() at the breakpoint: (Pdb) i (u'zope.app.content.Folder', Factory for class 'zope.app.folder.folder.Folder') (Pdb) i[1].getInterfaces() implementedBy zope.app.folder.folder.Folder (Pdb) IContainer in i[1].getInterfaces() False Should the latter return True? If yes and therefore it is a bug I'll try to investigate if further and/or report an issue. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Trying to use browser:form - 404
Hello, I try to create a form build from a schema with browser:form: form name=registrationForm.html schema=.interfaces.registrationForm class=.views.registrationForm permission=zope.Public layer=centershock for=*/ interfaces.registrationForm looks like that: from zope.interface import Interface from zope.schema import TextLine, Password class registrationForm(Interface): login = TextLine(title=uUsername) views.registrationForm: class registrationForm(object): def __init__(self): import pdb; pdb.set_trace() def getData(self): import pdb; pdb.set_trace() def setData(self): import pdb; pdb.set_trace() but when I try to call the URL: http://horus:8080/++skin++centershock/registrationForm.html I just get 404. Why that? Anybody knows? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Freitag, 10. Februar 2006 11:37 schrieb Lennart Regebro: On 2/10/06, Florian Lindner [EMAIL PROTECTED] wrote: It does not implement registrationForm. But I thought that interfaces.registrationForm is only for providing the schema to build the form, because of the for=* it should displayable from all objects. Or not? Right, but when you try to display a page that uses a schema for an object that does not implement that schema, it tries to look up an adapter between the object and the schema. And if that fails, the page will not be displayed. I suspect that may be the reason. Try to not define the schema and see if the page shows up. I don't think that you're right... Anyway, I tried it: The schema is required, I can't leave it undefined. I've changed it to: schema=CS.centershock.interfaces.ICentershock And called ++skin++centershock/cs/registerForm.html. cs is an object that does implement ICentershock. I've also tried to set for on the same value as schema or omitting it. Everything gave the same result: 404. Any more ideas? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Donnerstag, 9. Februar 2006 22:45 schrieb Bernd Dorn: On 09.02.2006, at 19:27, Florian Lindner wrote: Hello, I try to create a form build from a schema with browser:form: form name=registrationForm.html schema=.interfaces.registrationForm class=.views.registrationForm permission=zope.Public layer=centershock for=*/ interfaces.registrationForm looks like that: from zope.interface import Interface from zope.schema import TextLine, Password class registrationForm(Interface): login = TextLine(title=uUsername) views.registrationForm: class registrationForm(object): def __init__(self): import pdb; pdb.set_trace() def getData(self): import pdb; pdb.set_trace() def setData(self): import pdb; pdb.set_trace() but when I try to call the URL: http://horus:8080/++skin++centershock/registrationForm.html I just get 404. maybe http://horus:8080/++skin++Centershock/registrationForm.html skin names are CamelCase per convention and layers lowercase Not in my convention ;-) The skin is applied correctly, the 404 error page is rendered with my skin. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Freitag, 10. Februar 2006 14:05 schrieb Garanin Michael: Do you register the 'centershock'skin? Write this part of zcml-code, please. Yes, there are a number of page directives that use the centershock skin and are working correctly. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Freitag, 10. Februar 2006 15:18 schrieb Garanin Michael: I simulate this for Buddy from buddydemo (see attached) == it is normal work for Buddy-object! I think you make mistakes: 1) __init__ for 'view' always get 3-parameters (self, context, request) I've removed __init__ from the view class, like you did. 2) getData must return dictionary. getData was never called (otherwise I would jumped into pdb). Anyway, I've changed it accordingly and still no success. Any more ideas? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] zope3-users rejects mail
Hello, some (not all) of my postings to zope3-users are being rejected: Final-Recipient: rfc822; zope3-users@zope.org Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; host mail.zope.org[63.240.213.173] said: 550 Error: Message content rejected (in reply to end of DATA command) Anybody knows whats wrong? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Freitag, 10. Februar 2006 20:10 schrieb Garanin Michael: I've played with zope.formlib before that. I didn't manage to generate a entire form, just the input ... statemenets were generated, without any html headers or anything like that. So I need to add them manually with python code or a template. Can you tell me how I can generate a form. Basically the same like the form directive we're talking about all the time. Thanks, Florian It's easy. Example: 1) class IMyForm(Interface): title = TextLine(...) 2) class MyAddForm(zope.formlib.AddForm): form_fields = IMyForm def create(self, data): # create you object from data-dictionary class MyEditForm(zope.formlib.EditForm): form_fields = IMyForm # yes it's all ! ;-) 3) in browser.zcml page name=AddMyObject.html for=zope.app.container.interfaces.IAdding class=.MyAddForm permission=zope.ManageContent / page name=edit.html for=.IMyObjectInterface class=.MyEditForm permission=zope.ManageContent / P.S. you can see usage zope.formlib in 'zsqlmap' (my product, see zope.org ;-) Thanks for your example. But I've the same error, a 404. in views.py: from zope.formlib.form import EditForm from interfaces import IRegistrationForm class registrationForm(EditForm): form_fields = IRegistrationForm in configure.zcml: page name=registrationForm.html class=.views.registrationForm permission=zope.Public layer=centershock for=CS.centershock.interfaces.ICentershock / And I try to call it with: /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object. It still gives a 404. Any guess what's wrong? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 00:29 schrieb Alen Stanisic: On Fri, 2006-02-10 at 22:18 +0100, Florian Lindner wrote: Thanks for your example. But I've the same error, a 404. in views.py: from zope.formlib.form import EditForm from interfaces import IRegistrationForm class registrationForm(EditForm): form_fields = IRegistrationForm in configure.zcml: page name=registrationForm.html class=.views.registrationForm permission=zope.Public layer=centershock for=CS.centershock.interfaces.ICentershock / And I try to call it with: /++skin++centershock/cs/registerForm.html whereas cs is a ICentershock object. It still gives a 404. Any guess what's wrong? What happens if you changed your view.py to: from zope.formlib.form import Form . . class registrationForm(Form): I get a system error: 2006-02-11T00:41:25 ERROR SiteError http://horus:8080/++skin++centershock/cs/registrationForm.html Traceback (most recent call last): File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in publish result = publication.callObject(request, object) File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in mapply return debug_call(object, args) File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in debug_call return object(*args) File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__ self.update() File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update self.setUpWidgets() File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File /home/florian/Zope3/src/zope/formlib/form.py, line 337, in setUpEditWidgets field = form_field.field AttributeError: 'str' object has no attribute 'field' 127.0.0.1 - - [11/Feb/2006:00:41:25 +0200] GET /++skin++centershock/cs/registrationForm.html HTTP/1.1 500 89 - Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko) I get it now with EditForm too (the backtrace above was produced with EditForm) I think I had a typo that caused the 404 in my last post, sorry!. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 00:58 schrieb Alen Stanisic: On Sat, 2006-02-11 at 00:44 +0100, Florian Lindner wrote: I get a system error: 2006-02-11T00:41:25 ERROR SiteError http://horus:8080/++skin++centershock/cs/registrationForm.html Traceback (most recent call last): File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in publish result = publication.callObject(request, object) File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in mapply return debug_call(object, args) File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in debug_call return object(*args) File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__ self.update() File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update self.setUpWidgets() File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File /home/florian/Zope3/src/zope/formlib/form.py, line 337, in setUpEditWidgets field = form_field.field AttributeError: 'str' object has no attribute 'field' 127.0.0.1 - - [11/Feb/2006:00:41:25 +0200] GET /++skin++centershock/cs/registrationForm.html HTTP/1.1 500 89 - Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko) I get it now with EditForm too (the backtrace above was produced with EditForm) I think I had a typo that caused the 404 in my last post, sorry!. Florian In your view.py is the syntax when you set form_fields valid, I haven't seen it before: form_fields = IRegistrationForm I usually do it by (from zope.formlib import form) form_fields = form.Fields(IRegistrationForm) I've changed it to: class registrationForm(form.EditForm): form_fields = form.Fields(IRegistrationForm) but that gives a system error: 2006-02-11T10:07:02 ERROR SiteError http://horus:8080/++skin++centershock/cs/registrationForm.html Traceback (most recent call last): File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in publish result = publication.callObject(request, object) File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in mapply return debug_call(object, args) File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in debug_call return object(*args) File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__ self.update() File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update self.setUpWidgets() File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File /home/florian/Zope3/src/zope/formlib/form.py, line 373, in setUpEditWidgets value = field.get(adapter) File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, in get return getattr(object, self.__name__) ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock object at 0xb757a46c) blablubb is a field of my interface. Any idea? Missing security declarations? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 10:18 schrieb Helmut Merz: Am Freitag, 10. Februar 2006 22:18 schrieb Florian Lindner: in configure.zcml: ... name=registrationForm.html And I try to call it with: /++skin++centershock/cs/registerForm.html Is this really your code (registrationForm.html vs. registerForm.html)? Then a 404 shouldn't be a surprise ;-) Yes, that was my fault. I've this registerForm.html in my history and tend to select it accidently. But it's still a error: 2006-02-11T10:04:48 ERROR SiteError http://horus:8080/++skin++centershock/cs/registrationForm.html Traceback (most recent call last): File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in publish result = publication.callObject(request, object) File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in mapply return debug_call(object, args) File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in debug_call return object(*args) File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__ self.update() File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update self.setUpWidgets() File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File /home/florian/Zope3/src/zope/formlib/form.py, line 337, in setUpEditWidgets field = form_field.field AttributeError: 'str' object has no attribute 'field' when using form_fields = IRegistrationForm. If I change it to form_fields = form.Fields(IRegistrationForm) like proposed in another mail I get another error: 2006-02-11T10:07:02 ERROR SiteError http://horus:8080/++skin++centershock/cs/registrationForm.html Traceback (most recent call last): File /home/florian/Zope3/src/zope/publisher/publish.py, line 138, in publish result = publication.callObject(request, object) File /home/florian/Zope3/src/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /home/florian/Zope3/src/zope/publisher/publish.py, line 113, in mapply return debug_call(object, args) File /home/florian/Zope3/src/zope/publisher/publish.py, line 119, in debug_call return object(*args) File /home/florian/Zope3/src/zope/formlib/form.py, line 738, in __call__ self.update() File /home/florian/Zope3/src/zope/formlib/form.py, line 707, in update self.setUpWidgets() File /home/florian/Zope3/src/zope/formlib/form.py, line 770, in setUpWidgets adapters=self.adapters, ignore_request=ignore_request File /home/florian/Zope3/src/zope/formlib/form.py, line 373, in setUpEditWidgets value = field.get(adapter) File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, in get return getattr(object, self.__name__) ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock object at 0xb757a46c) blablubb is a field of my interface. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 12:44 schrieb Helmut Merz: Am Samstag, 11. Februar 2006 11:21 schrieb Florian Lindner: Am Samstag, 11. Februar 2006 10:18 schrieb Helmut Merz: Is this really your code (registrationForm.html vs. registerForm.html)? Then a 404 shouldn't be a surprise ;-) Yes, that was my fault. I've this registerForm.html in my history and tend to select it accidently. Ah, sorry, I missed this info in your previous post... ... If I change it to form_fields = form.Fields(IRegistrationForm) like proposed in another mail That's the correct way to do it anyway (see zope/formlib/form.txt). I get another error: ... File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, in get return getattr(object, self.__name__) ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock object at 0xb757a46c) blablubb is a field of my interface. Of which interface? IRegistrationForm only or also ICentershock? (and no typos? ;-)) of IRegistrationForm and not of ICentershock If it's in ICentershock and you have something like content class=CS.centershock.centershock.Centershock ... require permission=zope.Public interface=.interfaces.ICentershock / require permission=zope.Public set_schema=.interfaces.ICentershock / /content in configure.zcml (and Centershock implements ICentershock, of course) then you really shouldn't get the ForbiddenAttribute error. I have that declaration for ICentershock. I've no declaration for IRegistrationForm. Note that I don't want to edit an ICentershock object, I don't want to edit any kind of object. I just want to create a form based on a schema. The schema has no use but to provide the fields information for the form. The processing of the data entered is done manually in python code. registrationForm.html is not a view on a Centershock object. It should be a form in which the user can enter data that is being processed by the view class and ultimately create an user in a PAU utility. The ICentershock objects should server as a kind of root object of my application, the object that provided all the pages that can't be assigned to an instance of an object (like contact information or the powered by Zope page). Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 11:59 schrieb Garanin Michael: File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, in get return getattr(object, self.__name__) ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock object at 0xb757a46c) That is problem? You object don't have '__name__' attribute. See 'buddydemo.Buddy' please. There are two variants: 1) in MyClass write ' __name__ = __parent__ = None' 2) or MyClass must implement ILocation What is MyClass in this context? The interface, the view class, or the class that contains it? Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 16:51 schrieb Helmut Merz: Am Samstag, 11. Februar 2006 14:11 schrieb Florian Lindner: blablubb is a field of my interface. Of which interface? IRegistrationForm only or also ICentershock? (and no typos? ;-)) of IRegistrationForm and not of ICentershock I see... Seems to be OK for what you're wanting to do. Note that I don't want to edit an ICentershock object, I don't want to edit any kind of object. I just want to create a form based on a schema. The schema has no use but to provide the fields information for the form. The processing of the data entered is done manually in python code. registrationForm.html is not a view on a Centershock object. It should be a form in which the user can enter data that is being processed by the view class and ultimately create an user in a PAU utility. The ICentershock objects should server as a kind of root object of my application, the object that provided all the pages that can't be assigned to an instance of an object (like contact information or the powered by Zope page). OK, but for EditForm you need an object the fields of the form can be bound to. If that's not a content object it could just be an adapter. Another and probably better way in this case would be not to derive from EditForm but from Form. I just have to solve a similar problem and got it working the following way (IPersonRegistration is the schema for the form, INode is the interface of something like your Centershock object): browser/configure.zcml: browser:page name=registration.html for=..interfaces.INode class=.registration.PersonRegistrationView permission=zope.Public / browser/registration.py: from zope.formlib.form import Form, FormFields, action from zope.formlib.i18n import _ class PersonRegistrationView(EditForm): form_fields = FormFields(IPersonRegistration) @action(_(Apply)) def handle_edit_action(self, action, data): print data # here we'll do the real stuff... As often with Zope 3: simple but not easy (to find out) ;-) I couldn't express it better... Thanks a lot, it works now! Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Trying to use browser:form - 404
Am Samstag, 11. Februar 2006 16:40 schrieb Garanin Michael: I still don't understand why it's necessary that the content object needs to implement or be adaptable to the schema from which the form is generated. Florian It's normal and it's right: content object MUST be adaptable to shema-interface. It's 'components world' ;-) No, you misunderstood me. The IRegistrationForm interface has nothing to do with the ICentershock interface. Look at the recend email from Helmut Merz [EMAIL PROTECTED] in this thread. He did exactly what I want and it works without an implements. Thanks a lot for your help! Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Users need to activate their accounts
Hello, how would you implement something like that? What comes into my mind is: 1) Let the registration script create a PendingPrincipal object and store them into a folder. The activation script create a real user in the PAU based on the PendingPrincipal und deletes the PendingPrincipal. Can I reuse a existing principal info object for that? I'm not sure about creating them in content space. 2) Create a utility that stores the principal information. The activation script reads that information and creates a principal in PAU (or let the utiltity create it) 3) Create (subclass) a PrincipalFolder and the InternetPrincipal object. Give the principal a activated flag and the Fodler a activatePrincipal(key) method. At the moment I'm not sure if I know how to do that, but I've not tried yet. ;-) At the moment I tend to 1) or 3). What do you think? How do you do it? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Lookup AddForms
Am Sonntag, 12. Februar 2006 21:54 schrieb Marc Rijken: Hi All, In an application I want to lookup for the addform registered for a schema. I have tried to lookup via the adapter. That failed, because the schema is not used as an interface for an adapter. I do not know where to look now. Can someone help me? The addForm is registerad as a view named +. Use getView to look it up. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope 3 Developer's LiveBook
Am Dienstag, 14. Februar 2006 19:41 schrieb Paul Dumais: Thanks, everyone for your comments. I'm not sure how commited I am to doing this, but I might as well take the rock soup approach. A rock soup is better than no soup, and everyone else can add their favorite ingredients to make it into something tasty. I'm sure that I'll also try to give some ingredients for the soup! I like the latex approch. There is a latex to html converter that the python website documentation uses (at least some of it). That means we could just do a latex to pdf and a latex to html conversion say once each month after doing an svn up. I also think that pure Latex would be the best choice. It's convertible into a lot different formats and can be edited just using a simple text editor. Should I get svn commit permission on the zope.org site and do this on a branch there? Since we need to start from scratch there is nothing to branch. ;-) I think Jim Fulton is responsible for giving checkin permission to the Zope repository. I presume the ZPL liscense would apply in this case. Would it be better to set up a repository somewhere else and use a different liscence (GPL, LGPL, ...)? I'm not too savy with the different liscenses out there. I'm happy as long as anyone is free to make derivative works without getting permission. On 2/14/06, Stephan Richter [EMAIL PROTECTED] wrote: On Tuesday 14 February 2006 12:15, Paul Dumais wrote: Do we start from scratch? I think you have to, because both current books have licenses that do not allow any other commercial use. Can we use any of the material from Stephan or Phillip's books? The Zope 3 Developer's Handbook by Stephan Richter doesn't seem to have any copywrite notice on it (on line pdf version at least). Can someone tell me what are the restrictions on it's use? That is not true. The online, PDF and paper version all have an appendix with the license of the book. See: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Boo k/CreativeCommonsAttributionNoDerivsNonCommercialLicense What form should it take? Should we make it a latex file and check-in changes via svn? Should it be a simple wiki? I would urge you to use latex or some other advanced format. ReST and other low-tech solutions will not provide you the flexibility you need to develop a printable book. What liscense if any should the document have? How do anonymous/ community users contribute and fix errors? If it is a community book, then make it the most open CC license you possibly can. http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] What attributes are made persistent
Hello, in a class derived from Persistent, which attributes are stored? All or only those thar are declared in the interface? def __init__(self): self.queue = {} self.queue seem is empty each time I restart Zope. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Lists dont accept default values
Am Mittwoch, 15. Februar 2006 14:40 schrieb Frank Burkhardt: Hi, I wrote a schema like this to have a list of objects on a content object: class IMyContent(Interface): mynumbers=List( title=_(uCool Numbers), required=True, value_type=Int( title=_(integer) ) default=[1,2,3,5,7] ) I think the default property expects one item of your list, so either 1, 2, 3, 5 or 7, not all of them. If you want to define the set of selectable values you maybe rather want to use a Choice field and specify the values property. Or set a Choice field as value for value_type. See Stephans book [1], chapther 8.3 Core Schema Fields [1] http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage/Zope3Book Regards, Florian myline=TextLine( title=_(A line of text), required=True, default=u'default test' ) I'm using an 'addform' to add self made objects to my site but unfortunately the list mynumbers is not initialized with those 5 default numbers. The default value of myline is displayed correctly on the add form. Does anyone know, how this can be fixed? ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] more efficient role - permission mapping in ZCML
Hello, I'v a number of permissions (A, B, C, D) which I want to map to a number of roles (x, y, z). x should have permission A, B, C, D y should have A, B, C z should have A Is there a faster way of doing that in ZCML than grant permission=A role=x / grant permission=B role=x / grant permission=C role=x / grant permission=D role=x / and so on? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Wierd import problem
Hello, I've a wierd problem which is supposed to be plain simple but I can't see it... Zope3 gives on startup: File /home/florian/Desktop/zope/lib/python/CS/user_management/views.py, line 2, in ? from interfaces import IRegistrationForm File /home/florian/Desktop/zope/lib/python/CS/user_management/interfaces.py, line 5, in ? from views import UserRegistrationField zope.configuration.xmlconfig.ZopeXMLConfigurationError: File /home/florian/Desktop/zope/etc/site.zcml, line 7.2-7.55 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/etc/package-includes/cs-configure.zcml, line 1.0-1.24 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/CS/configure.zcml, line 20.4-20.42 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/CS/user_management/configure.zcml, line 3.4-11.38 ImportError: cannot import name UserRegistrationField my views.py has: class UserRegistrationField(TextLine): implements(ITextLine) def _validate(self, value): super(UserRegistrationField, self)._validate(value) [...] and my interfaces.py: from views import UserRegistrationField both are in the same directory. If I remove the the import everything goes well. If I cutpaste the code from views.py to interfaces it works too. What am I doing wrong here? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Creating objects in software space when making site
Hello, my content object depends on a number of utilities to be present. It is usually also used as a site. During development it happens often that I delete and recreate it. Can I install a hook or something so I can make that these utilies are being created when my objects becomes a site? How do I create utitlies in software space? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] New way of using skins
Hello, I have: zope:interface interface=.interfaces.ICentershockSkin type=zope.publisher.interfaces.browser.IBrowserSkinType name=centershock / class ICentershockSkin(zope.app.rotterdam.Rotterdam): What do I have to give for the layer or type (what is the difference?) attributes of view / pages / ... directives? layer = centershock does not seem to work anymore (for what is name attribute of the interface directive?). layer=CS.skin.interfaces.ICentershockLayer seems to work but do I always have to give the lenghty python path?? Thanks, florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Deprecate conditionally
Hello, I want show a deprecation warning only if a argument of a function is set to False. def foo(arg1, arg2, arg3 = False): if not arg3: arg3 = deprecation.deprecated(arg3, arg3=False is deprecated.) But that does not show anything. How do it correctly? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ZPT traverser for finding site
Hello, is there a ZPT traverser for finding the nearest site in Zope3? a tal:attributes=href site/registrationForm/absoluteURLregister/a/li because registrationForm is registered in my object which forms the site. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Programatically add plugins to PAU
Am Mittwoch, 12. April 2006 08:50 schrieb Stephan Richter: On Wednesday 12 April 2006 02:39, Michael Howitz wrote: This is how we did it in a project: createAuthenticationUtils is called on handling the ObjectAddedEvent for the folder (which is programmatically made a site) which should contain the PAU. Interesting. We did, of course, something similar too in our current project. This either means that (a) PAU is too hard to set up and/or (b) that we need another helper layer. I would like to think the problem is (b), because I like the flexibility of PAU. The configuration package we wrote is step one, but it would be good to agree on a set of high-level helper functions too. I think it's fine the way it is beside one thing. # This is fine, it's added just like all the other utilites. pau = ensureUtility(cs, IPluggableAuthentication, '', PluggableAuthentication , asObject = True) # This is ok for adding, but I got no idea how to register it. A nice thing would be function like ensurePlugin that works analog to ensureUtility (adds und registers a plugin, does the NameChooser call if needed, ...) principal_folder = PrincipalFolder(prefix = cs) pau[PrincipalFolder] = principal_folder # This is pretty straightforward but I was not expecting to give a string, rather I thougt it expected a Interface or something like that. pau.credentialsPlugins = (u'Session Credentials',) The only thing I would change is to add a ensurePlugin function to either the pau object itself or also as part of zope.app.appsetup. (like all the other ensure* functions). Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Programatically add plugins to PAU
Am Mittwoch, 12. April 2006 08:39 schrieb Michael Howitz: Florian Lindner wrote: Hello, I've a PluggableAuthentication and want to add and register some plugins to it. Adding works fine: principal_folder = zope.app.authentication.principalfolder.PrincipalFolder(prefix = cs) pau[PrincipalFolder] = principal_folder and I think I can select it with: pau.credentialsPlugins = [principal_folder] but how to register it before? And how do I select credential plugins? This is how we did it in a project: createAuthenticationUtils is called on handling the ObjectAddedEvent for the folder (which is programmatically made a site) which should contain the PAU. reg = site.UtilityRegistration(name, interface, utility) Thanks for the code. One question: Of what type is site? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Generating loginForm with formlib
Hello, I want to generate a login form for the PAU session credentials plugin. The plugin expects a form that have a login and a password field. I've created a interface: class ILoginForm(Interface): For generating the login form. login = TextLine(title=uUsername, required=True) password = Password(title=uPassword, required=True) but formlib generates the two fields with name=form.login therefore the session credentials plugin is able to extract the credentials. How can I use formlib to generate a login form? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Static vocabulary
Hello, I want to define an vocabulary schema field with a fixed sets of values. How can I do that? How can I define it directly in ZCML? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] formlib: Some additional text
Hello, I've a normal formlib: class xy(Formlib): form_fields = IInterface page class .views.xy / (pseudo-code) Now I want to place some additional text above the form stuff. But I want to keep all this usefull JavaScript stuff that form lib inserts. How can I do that? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] formlib: Some additional text
Am Freitag, 5. Mai 2006 17:10 schrieb Fred Drake: On 5/5/06, Florian Lindner [EMAIL PROTECTED] wrote: Now I want to place some additional text above the form stuff. But I want to keep all this usefull JavaScript stuff that form lib inserts. Can you use the extra_info slot? I think that would work. (I've looked at its position in zope/formlib/pageform.pt). But how can I fill that slot? I've tried by adding a template to the configure.zcml: html metal:use-macro=context/@@standard_macros/page body metal:block fill-slot=body /metal:block /body /html @@standard_macros/page is my template in my skin. The skin is derived from the rotterdam skin. Where do I add the fill-slot? I've tried a various locations in the template above but nothing has a real effect. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Problem with Umlauts
Hello, I have an schema like that: class IAbbreviation(Interface): abbreviation = TextLine( title = uAbkürzung, required = True) meaning = TextLine( title = uBedeutung, required = True) description = TextLine( title = uErklärung, required = False) but in all Forms (ZMI or formlib generated) the German Umlauts are displayed like Abkürzung which should be Abkürzung. Anyone got an idea what's wrong? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with Umlauts
Am Montag, 8. Mai 2006 22:16 schrieb Egon Frerich: Hi Florian, do you have the first line # -*- coding: utf8 -*- in your python module? No. And is the source encoded in UTF-8? Yes. But with the line above added to the file it works now. Never heard of that line... Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How to make catalog working?
Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt: Hi, On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote: Hello, I've added some content objects of interface IFoo to my site. Then I added a catalog to my site (and also a IntID utility). I registered both. To the catalog I've added a FieldIndex and a TextIndex, set the interface to IFoo and the fieldname to a field that IFoo has. I registered both indexes. The IntID utility has to be registered *before* all the objects you want to find. No object created before you had a registered IntID will ever be found. Have a look at http://zope3.mpg.de/suchen (Das Prinzip) I've done that and it does not help. The IntID utility says that 3 objects are registered, but the catalog indexes are still zero count. Thanks. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How to make catalog working?
Am Dienstag, 16. Mai 2006 13:23 schrieb Jim Washington: Frank Burkhardt wrote: Hi, On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote: Hello, I've added some content objects of interface IFoo to my site. Then I added a catalog to my site (and also a IntID utility). I registered both. To the catalog I've added a FieldIndex and a TextIndex, set the interface to IFoo and the fieldname to a field that IFoo has. I registered both indexes. The IntID utility has to be registered *before* all the objects you want to find. No object created before you had a registered IntID will ever be found. Have a look at http://zope3.mpg.de/suchen (Das Prinzip) You can get the IntIDs utility to register objects after they are created. Something like the below will register and catalog a bunch of items: def catalog_items(self): intids = zapi.getUtility(IIntIds,[name]) catalog = zapi.getUtility(ICatalog,[name]) for item in some_function_that_returns_the_items(): catalog.index_doc(intids.register(item), item) The most important part is the intids.register(item) statement. The problem is not that objects have been created before the IntIDs utility. The IntID utility says that 3 objects are registered, but the catalog indexes are still zero count. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How to make catalog working?
Am Dienstag, 16. Mai 2006 21:51 schrieb Frank Burkhardt: Hi, On Tue, May 16, 2006 at 07:08:34PM +0200, Florian Lindner wrote: Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt: [snip] The IntID utility has to be registered *before* all the objects you want to find. No object created before you had a registered IntID will ever be found. Have a look at http://zope3.mpg.de/suchen (Das Prinzip) I've done that and it does not help. Are you sure, your object implements the interface, you're indexing? Use the introspector to find out. Direkt bereitgestellte Schnittstellen Keine Schnittstelle direkt bereitgestellt Bereitgestellte Schnittstellen xgm.interfaces.IAbbreviation --- zope.annotation.interfaces.IAttributeAnnotatable zope.app.container.interfaces.IContained I've marked the interface that I've configured the indexes on. Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How to make catalog working?
Am Dienstag, 16. Mai 2006 21:51 schrieb Frank Burkhardt: Hi, On Tue, May 16, 2006 at 07:08:34PM +0200, Florian Lindner wrote: Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt: [snip] The IntID utility has to be registered *before* all the objects you want to find. No object created before you had a registered IntID will ever be found. Have a look at http://zope3.mpg.de/suchen (Das Prinzip) I've done that and it does not help. Are you sure, your object implements the interface, you're indexing? Use the introspector to find out. I got the problem now. My object was not adaptable to IKeyReference. It's now by subclassing Persistent. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] How to use catalog.searchResults
Hello, I have a catalog: (Pdb) catalog zope.app.catalog.catalog.Catalog object at 0xb4a3f66c with one index: (Pdb) for i in catalog.keys(): print i AbbreviationIndex but I can't find a way to use the search results function: (Pdb) catalog.searchResults(AbbreviationIndex = ABC) *** TypeError: ('two-length tuple expected', 'ABC') (Pdb) catalog.searchResults([AbbreviationIndex ,ABC]) *** TypeError: searchResults() takes exactly 1 argument (2 given) (Pdb) res = catalog.searchResults() (Pdb) res == None True How to use it? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How to use catalog.searchResults
Am Sonntag, 21. Mai 2006 17:58 schrieb mats.nordgren: (Pdb) catalog.searchResults(AbbreviationIndex = ABC) *** TypeError: ('two-length tuple expected', 'ABC') (Pdb) catalog.searchResults([AbbreviationIndex ,ABC]) *** TypeError: searchResults() takes exactly 1 argument (2 given) (Pdb) res = catalog.searchResults() (Pdb) res == None True How to use it? Have you tried catalog.searchResults(idx=('AbbreviationIndex', 'ABC')) Do you mean idx as a placeholder for something or really idx? it gives: (Pdb) results = catalog.searchResults(idx=('AbbreviationIndex', 'ABC')) *** KeyError: 'idx' Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Again unicode problem (in configure.zcml)
Hello, Zope gives this message on startup: File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 165, in _validate raise WrongType(value, self._type) zope.configuration.xmlconfig.ZopeXMLConfigurationError: File /home/florian/Desktop/zope/etc/site.zcml, line 7.2-7.55 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/etc/package-includes/xgm-configure.zcml, line 1.0-1.25 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/xgm/configure.zcml, line 2.4-2.34 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/xgm/browser/configure.zcml, line 2.4-2.31 ZopeXMLConfigurationError: File /home/florian/Desktop/zope/lib/python/xgm/browser/skin/configure.zcml, line 3.4-7.6 ConfigurationError: ('Invalid value for', 'layer', ('', type 'unicode')) The directive Zope is complaining about: resourceDirectory directory=files name=files layer=xgm.interfaces.IXGMSkin / but when I remove this one, it complains about the next one. Weird thing is: the file is not even unicode: [EMAIL PROTECTED] ~/Desktop/zope/lib/python/xgm/browser/skin $ file configure.zcml configure.zcml: ASCII text, with CRLF line terminators Anyone know what's wrong? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Generating loginForm with formlib
Am Donnerstag, 1. Juni 2006 22:27 schrieb Stephan Richter: On Thursday 20 April 2006 09:38, Florian Lindner wrote: but formlib generates the two fields with name=form.login therefore the session credentials plugin is able to extract the credentials. How can I use formlib to generate a login form? I think we used a custom written form. ;-) But you need to find a way to turn off the widget prefix. It is probably a matter of overriding the setUpWidgets() method. As you know I've checked in a change to the the session credentials plugin. So this problem has vanished. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Utilities
Am Montag, 5. Juni 2006 08:14 schrieb David Johnson: What is the best to find the nearest utility without using a name? zapi.getUtility() seems to require a name (though the documentation implies otherwise). zapi.getAllRegisiteredUtilitiesFor() works but it seems to me if you have lots of utilities in other contexts, it would query those as well, and thereby be slow in a large application. getUtility does not require a name. Example: from zope.app.zapi import getUtility from zope.app.homefolder.interfaces import IHomeFolderManager hfm = getUtility(IHomeFolderManager) Regards, Florian I come across this problem frequently and haven't figured out the best way to deal with it. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Problem with 3.3 beta1
Hello, my code works with svn, but not with beta1: File /home/xgmde/Zope3//lib/python/zope/component/_api.py, line 207, in getUtility raise ComponentLookupError(interface, name) ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') The problem is clear but it should not appear. It occurs upon adding my object. This object performs some initializations: def onObjectAdded(event): if IXGM.providedBy(event.object): if not ISite.providedBy(event.object): # Make it a site xgm = event.object site_manager = LocalSiteManager(xgm) xgm.setSiteManager(site_manager) intid = ensureUtility(xgm, IIntIds, '', IntIds , asObject = True) cat = ensureUtility(xgm, ICatalog, '', Catalog, asObject = True) abbr_index = TextIndex(abbreviation, IAbbreviation) cat[AbbreviationIndex] = abbr_index When I trace into that I can see that the intid is really created and also at the correct place. Anyone knows whats wrong? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Using restructered text
Hello, how can I use (render to html) restructered text that is in a static file? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Create catalog index via script
Am Samstag, 17. Juni 2006 10:38 schrieb Achim Domma: Hi, I have a workspace object, which I initialize in the IObjectCreatedEvent. I try to add a catalog with an index like this: ensureUtility(workspace,zope.app.intid.interfaces.IIntIds,'',IntIds,asObjec t=True) catalog=ensureUtility(workspace,zope.app.catalog.interfaces.ICatalog,'',Cat alog,asObject=True) catalog[tmp]=CategoryIndex() workspace derives from Folder and is already a Site at this point. The last line causes the following error: ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') If I remove the line, it works fine. I can see the Catalog in my Workspace and can add the CategoryIndex without problem!? Seems like I'm missing something in the setup of the IIntIds utility, but I have no idea what it is. I assume that you have made workspace a site before? How does that code look like? Do you have this expression: hooks.setSite(workspace) Without that expression I used to have the same error. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Formlib and invariants
Am Mittwoch, 19. Juli 2006 03:25 schrieb Darryl Cousins: Hi All, I've had a bit of a struggle getting formlib error views to play nicely with invariants. That is the problem I have found to trouble me is in the zope.formlib.form.FormBase method error_views. When I use the schema: class IMemberRegisterForm(IMemberData, IMemberDetails): Schema for a member register form. new_password = Password( title=_(Choose a Password), required=True) verify_password = Password( title=_(Verify Password), required=True) @invariant def passwordsMatch(register): if register.new_password != register.verify_password: msg = _(Entered passwords do not match) error = ('verify_password', _(Passwords), msg) raise Invalid(error) [...] I am not sure if I've understood you correctly, but I've solved the same problem (raise error if passwords are not equal) this way: class PasswordsAreNotEqual(ValidationError): The passwords are not equal. interface.implements(IWidgetInputError) class IRegistrationForm(interface.Interface): For entering the data for registration. password = Password(title=uPassword, description=uYour password., required=True) password2 = Password(title=uVerify Password, required=True) @interface.invariant def arePasswordsEqual(obj): if obj.password != obj.password2: raise PasswordsAreNotEqual Hope this helps, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] nextURL not working as expected
Hello, I habe a view class derived from zope.formlib.form.AddForm: class AddLink(form.AddForm): form_fields = form.fields(ILink) def createAndAdd(self, data): self.link = Link() self.link.title = data['title'] self.link.description = data['description'] self.link.URL = data['URL'] self.context[data[title]] = self.link return self.link def nextURL(self): return absoluteURL(self.link, self.request) The view is registered for zope.app.container.interfaces.IAdding After I have added the object I except to be redirected to the URL returned in nextURL. Instead I am always redirected to the add form again. It seems that nextURL is not even called. Why? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zope3's TAL ZPT reference
Am Montag, 7. August 2006 14:57 schrieb Michele Amori: Hello all, actually I'm a zope newbie. I must develop web applications with zope 3.2, in the next future, so I'd like some help from this ML. I'm searching for a ZPT (or TAL) reference for Zope 3...where is it? Take a look here: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: default defaultView
Am Mittwoch, 9. August 2006 00:27 schrieb Philipp von Weitershausen: Florian Lindner wrote: Hello, is there a kind of default defaultView? So when a object is called and no defaultView is defined that a view like index.html is called? I thought yes, but a test has not proven that. If there is really no such default, why? I think a little bit more (optional) convention over configuration would be good for Zope... zope.app/browser.zcml says: browser:defaultView name=index.html / So, as you can see, we indeed have a default default view. It's index.html. That's what I thought too. But: I go to an object and get an 404 error. Now add this ZCML to configure.zcml: defaultView name=index.html for=CS.Link.interfaces.ILink layer=CS.skin.interfaces.ICentershockSkin / and the same URL work. You see that there is already a view named index.html page name=index.html for=CS.Link.interfaces.ILink template=link.pt permission=zope.View layer=CS.skin.interfaces.ICentershockSkin / But why is it not used as the default view? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] How does the static-apidoc script works?
Hello, how does that script works? Executing gives an error: [EMAIL PROTECTED] ~/Zope3 $ python utilities/static-apidoc /home/florian/z3-doc/ Traceback (most recent call last): File utilities/static-apidoc, line 37, in ? main() File /home/florian/Zope3/src/zope/app/apidoc/static.py, line 504, in main maker.start() File /home/florian/Zope3/src/zope/app/apidoc/static.py, line 200, in start self.browser._links_factory.urltags = urltags File /home/florian/Zope3/src/mechanize/_mechanize.py, line 505, in __getattr__ raise AttributeError( AttributeError: class 'zope.app.apidoc.static.PublisherBrowser' instance has no attribute _links_factory (perhaps you forgot to .select_form()?) and the z3-doc directoy is empty. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Blog package
Hello, is there a blog package for Zope3 around? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Generate edit form from user setting
Am Donnerstag, 17. August 2006 23:04 schrieb Fred Drake: On 8/17/06, Florian Lindner [EMAIL PROTECTED] wrote: I have a zope.app.preference.preference.PreferenceGroup based on an IUserSettings interface for which I want to generate an edit form. I've tried to do it with a class based on EditForm but that does not worked for me since the EditFrom changes the self.context object. If I simply replace self.context by the object I got from UserPreferences it complains about PreferenceGroup being not adaptable to IUserSettings (and it's right about that). Sounds like you want to create an adapter. The adapter is what's used for getting/setting values. I also thought about that. But if I write an adapter from PreferenceGroup to IUserSettings to all that the adapter would do is to assign values the values from the PreferenceGroup to IUserSettings. Ok it's more generic but at the end the same like assigned the values to the request itself. Is it okay to change self.context in the __init__ method of the view class with a PreferenceGroup object? (I just didn't know it it's not confusing the something in the ComponentArchitecture...) Of course I need to initialize the from with the values from the the PreferenceGroup object. Is there a better way than modifying the request like request.form['form.max_size'] for each field? I couldn't find one in the documentation but I'm almost sure there is a more elegant solution (since it's Zope!). Did you look at the get_rendered argument to zope.formlib.form.FormField? Though I suspect the adapter I suggested above would do the trick. Mmmhh, that's also one call for each field. I think I'll try it with the adapter. Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] How does the static-apidoc script works?
Am Mittwoch, 6. September 2006 12:25 schrieb Stephan Richter: On Monday 14 August 2006 17:46, Florian Lindner wrote: ow does that script works? Executing gives an error: [EMAIL PROTECTED] ~/Zope3 $ python utilities/static-apidoc /home/florian/z3-doc/ Traceback (most recent call last): File utilities/static-apidoc, line 37, in ? main() File /home/florian/Zope3/src/zope/app/apidoc/static.py, line 504, in main maker.start() File /home/florian/Zope3/src/zope/app/apidoc/static.py, line 200, in start self.browser._links_factory.urltags = urltags File /home/florian/Zope3/src/mechanize/_mechanize.py, line 505, in __getattr__ raise AttributeError( AttributeError: class 'zope.app.apidoc.static.PublisherBrowser' instance has no attribute _links_factory (perhaps you forgot to .select_form()?) You know, this is probably due to a new mechanize version. You would have to update the scripts probably to the latest mechanize. I've managed to fix the script so far that it works with the OnlineBrowser() (self.browser = OnlineBrowser()). If I use the PublisherBrowser() I get a ConfigurationError: - return chooseClasses(method, environment) /home/florian/Zope3/src/zope/app/publication/httpfactory.py(33)chooseClasses() - factory = factoryRegistry.lookup(method, content_type, environment) /home/florian/Zope3/src/zope/app/publication/requestpublicationregistry.py(97)lookup() - raise ConfigurationError('No registered publisher found ' Should I modify it in a way that it always uses the OnlineBrowser() and check in? Maybe I will have time to look into the problem with PublisherBrowser() but I doubt so since is examina time in university... Here is some output from the script: [EMAIL PROTECTED] ~/Zope3/utilities $ python static-apidoc /home/florian/z3-doc/ INFO: Starting retrieval. Link 166: http://localhost:8080/++apidoc++/Code/ZConfig/schema/BaseParser/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/ZConfig/schema/BaseParser WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 553: http://localhost:8080/++apidoc++/Code/zope/app/authentication/idpicker/IdPicker/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/app/authentication/idpicker/IdPicker WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 650: http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ContainerModifiedEvent/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ContainerModifiedEvent WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 656: http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ObjectMovedEvent/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ObjectMovedEvent WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1198: http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLFormatChecker/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLFormatChecker WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1200: http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLStatefulImporter/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLStatefulImporter WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1237: http://localhost:8080/++apidoc++/Code/zope/component/interfaces/RegistrationEvent/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/component/interfaces/RegistrationEvent WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1269: http://localhost:8080/++apidoc++/Code/zope/configuration/xmlconfig/ConfigurationHandler/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/configuration/xmlconfig/ConfigurationHandler WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1365: http://localhost:8080/++apidoc++/Code/zope/fssync/metadata/EntriesHandler/index.html WARNING: Internal Server Error (500): http://localhost:8080/++apidoc++/Code/zope/fssync/metadata/EntriesHandler WARNING: +- Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html Link 1846: http://localhost:8080/++apidoc++/Interface/file/index.htm I terminated it at this point. At the end it gets very slow, about one link every two seconds, but it seems to work. Should I check in? Regards, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo
Re: [Zope3-Users] Books example
Am Freitag, 8. September 2006 09:03 schrieb Sébastien VINOT: Hello, I'm using both books to learn Zope3 : - Web component Development with Zope 3 (Philipp Von Weitershausen) The home page of this book is at http://worldcookery.com/ - Zope 3 (Stephan Ritcher) http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book but I don't know if it's in sync with the printed version. I read somewhere that examples are updated somewhere on the web but I can't find out where (I have to admit I did not dig into the second at the moment). Does someone know where example are available ? Regards, florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Logout
Am Freitag, 22. September 2006 09:42 schrieb FB: Hi, On Thu, Sep 21, 2006 at 07:25:06AM -0500, David Johnson wrote: Does anyone know how to logout? We've been using logout.html as the logout page for Zope Realm Basic Auth, and it does not seem to log us out. We're using IE 6. It's not possible to log out when Basic Auth is used (except if you want your users to install a fancy browser extension like Webdeveloper for Firefox). I don't think that's right for the trunk. This feature was checked in lately: Log message for revision 69975: Fix issue 239. Logout feature for Basic HTTP auth. However I haven't tried it. Regards, Florian Use a different auth method (=PAU credential plugin) like cookie-base-auth. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] edit form is not being used
Hello, I have an INewsfeed which is derived from IContentItem. There is an editform defined: editform schema=..interfaces.INewsfeed name=edit.html permission=zope.ManageContent layer=CS.skin.interfaces.IZMISkin menu=zmi_views title=Edit / IContentItem does not define a form of the same name. But when I click inside the ZMI on an newsfeed item the edit form is not used and only an metadata dialog is shown. The introspector shows it: Edit Registriert: /home/florian/Desktop/zope/lib/python/CS/Newsfeed/browser/configure.zcml (Zeile 19) Notwendig: CS.Newsfeed.interfaces.INewsfeed, CS.skin.interfaces.IZMISkin stellt bereit: zope.app.menus.zmi_views Factory-Pfad: zope.app.publisher.browser.menu.BrowserMenuItem But why is not used? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users