From blackeight_zope at yahoo.it Tue Nov 1 06:21:14 2005 From: blackeight_zope at yahoo.it (Paolo Cilmo) Date: Tue Nov 1 06:35:40 2005 Subject: [Zope3-Users] Help us! Calling a Python Script from ZPT In-Reply-To: <4365D4FC.3020001@ita.chalmers.se> Message-ID: <20051101112114.2775.qmail@web25410.mail.ukl.yahoo.com> OK, I perhaps don't have been clear in my previous e-mail. I need to write a little site using ZOPE3 as i using ZOPE2. Really i've also write an application on ZOPE3 by ZMI (the same in ZOPE2). This application insert (by a form) values in a database written in MySQL. Typical use is composed by the following steps: 1- a Page Template containing a form; localhost:8080/Mercatino/iscrizione_form:

Iscrizione

Nome:
Cognome:
E-mail:
Telefono:
User:
Password:
2- Previous form call a new ZPT, iscrizione_html in localhost:8080/Mercatino/iscrizione_html.

Inserimento effettuato

Benvenuto nome cognome!
Sei identificato come user

Non hai inserito il nome

Non hai inserito il cognome

Non hai inserito il telefono

Non hai inserito la mail

Non hai inserito la user

Non hai inserito la password



This ZPT use the package sql expr (but i don't like presentation and logic in the same object...) for use a query. I use "sqlexpr" because i don't know how pass parameter to a ZSQL script (passing parameter to a ZSQL in ZOPE2 work perfectly, but in the damned ZOPE3 NO!!!). How i can pass parameters? 3- THE REAL PROBLEM IS: In ZOPE2, if i want to use a PYTHON code, i insert a Python(script) into a folder and i call the script by using a ZPT (tal:repeat for example). In ZOPE2, NO PROBLEM but..... In ZOPE3, I can't insert a Python script by the ZMI, but i need to write a package (__init__.py, python class, ZCML etc...). I need a lot of examples for: a: write a package for my using and not like examples on zope.org b: write the ZPT that call the package c: acquisition doesn't work like ZOPE2 Now I HOPE that i've been clear. Thanks and sorry for my VERY VERY bad English Jean-Marc Orliaguet ha scritto: Wade Leftwich wrote: > Stephan Richter wrote: > >> >> >> Why not have those templates on the file system? Is there a need for >> users to modify those templates? > > > Yes, users with the job description "web producers", which is to say > people who can do HTML and a bit of scripting, but who do not get > access to the file system. Kind of like the Zope 2 model. We even use > acquisition. > > Also, it seemed to me unwieldy to put 50 directories in the filesystem > to contain the templates for all the sites. But because of my > experience with Zope 2, I assumed TTW was the best way to customize > the application for each site, and I guess I should re-examine that > assumption. > Hi! there is indeed such a category of users, i.e. somewhere between filesystem developers and application users. There will be support for this kind of TTW editing in cpsskins (cf Custom Portlet), but it will be purely limited to "simple" presentation logic. cf. http://www.z3lab.org/sections/front-page/design-features/custom-portlet the difference with the Zope2 model I think is that "web producers" are not going to be ZPT programmers, but more like "site composers" with the ability to do minimal TTW template editing such as shown in the animation. /JM --------------------------------- Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051101/df103244/attachment.htm From fbo2 at gmx.net Tue Nov 1 07:56:23 2005 From: fbo2 at gmx.net (Frank Burkhardt) Date: Tue Nov 1 08:11:03 2005 Subject: [Zope3-Users] View with template In-Reply-To: <4365CD1E.4000102@perse.ch> References: <20051028084543.GA32094@fbo.no-ip.org> <4365CD1E.4000102@perse.ch> Message-ID: <20051101125623.GA23638@fbo.no-ip.org> Hi, On Mon, Oct 31, 2005 at 08:51:58AM +0100, Dominik Huber wrote: [snip] > >How can Zope be forced to use the template instead of __call__ing > >the TestView-Object? > > > > > If you use the the browser:form, browser:edit and/or browser:add > directive your TestView will be mixed in automatically during the setup. > In your example you are going to overwrite the __call__ method of the > mixed-in base class which is invoking the template. If you like to > overwrite the __call__ method, you have to call you base class too: > > class TestView(object): > def __call__(self): > # do something else > return super(TestView, self).__call__() Thank you - that's what I was looking for. Regards, Frank From yusei at domen.cx Wed Nov 2 10:25:17 2005 From: yusei at domen.cx (TAHARA Yusei) Date: Wed Nov 2 10:39:58 2005 Subject: [Zope3-Users] MessageBoard tutorial deprecation warnings In-Reply-To: <1130741588.5524.34.camel@localhost.localdomain> References: <1130741588.5524.34.camel@localhost.localdomain> Message-ID: <87vezbt6le.wl%yusei@domen.cx> Hello. At Mon, 31 Oct 2005 00:53:08 -0600, Brad Allen wrote: > > > The messageboard tutorial in the Zope 3 Developer's Handbook > doesn't seem to work for me. I'm using the copy from > > svn co svn://svn.zope.org/repos/main/book/trunk > > The SVN url listed in the book didn't work, but I'm not > sure this is the right one. > > Anyway, I'm using the "step13" folder, and when I registered > it with my Zope 3.1 instance on Ubuntu, and run Zope, I get > the following in my transcript.log: > > ConfigurationError: ('Invalid value for', 'interface', "Couldn't > import zope.app.workflow.interfaces, No module named workflow.interfaces > in zope.app.workflow.interfaces.IProcessInstanceContainerAdaptable") > > I wanted to see more detail on that error, so I imported the offending > module at the Python interactive prompt. Along the way several > deprecation warnings cropped up (see below). Is there a newer > version of this tutorial I'm missing out on, or should I spend > some time trying to clean this up? I think stateful workflow is no longer supported in zope3. this is a disscusion about stateful workflow. http://mail.zope.org/pipermail/zope3-dev/2005-October/015997.html Best Regards, -- Tahara Yusei yusei@domen.cx From hangzhiyun at gmail.com Wed Nov 2 09:11:18 2005 From: hangzhiyun at gmail.com (Simon Hang) Date: Wed Nov 2 11:08:11 2005 Subject: [Zope3-Users] MessageBoard tutorial deprecation warnings In-Reply-To: <1130741588.5524.34.camel@localhost.localdomain> References: <1130741588.5524.34.camel@localhost.localdomain> Message-ID: <8a8e599a0511020611p23df532v5239092188543da1@mail.gmail.com> Hi Brad, You need to install the workflow add-on package for zope3 and try again. URL as below: http://www.zope.org/Products/Zope3-Packages Deprecation Warnings are only warning. The code won't break because of warnings. Cheers, Simon On 10/31/05, Brad Allen wrote: > > > The messageboard tutorial in the Zope 3 Developer's Handbook > doesn't seem to work for me. I'm using the copy from > > svn co svn://svn.zope.org/repos/main/book/trunk > > The SVN url listed in the book didn't work, but I'm not > sure this is the right one. > > Anyway, I'm using the "step13" folder, and when I registered > it with my Zope 3.1 instance on Ubuntu, and run Zope, I get > the following in my transcript.log: > > ConfigurationError: ('Invalid value for', 'interface', "Couldn't > import zope.app.workflow.interfaces, No module named workflow.interfaces > in zope.app.workflow.interfaces.IProcessInstanceContainerAdaptable") > > I wanted to see more detail on that error, so I imported the offending > module at the Python interactive prompt. Along the way several > deprecation warnings cropped up (see below). Is there a newer > version of this tutorial I'm missing out on, or should I spend > some time trying to clean this up? > > Thanks! > > > ballen@ubu:/var/lib/zope3/instance/sandbox/lib/python$ python > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import book.messageboard.browser.messageboard > book/messageboard/browser/messageboard.py:22: DeprecationWarning: > ActiveStatus: ActiveStatus is now available in > zope.app.component.interfaces.registration. Will be gone in X3.3. > from zope.app.registration.interfaces import ActiveStatus > book/messageboard/browser/messageboard.py:23: DeprecationWarning: ISite: > This interface has been moved to zope.app.component.interfaces. The > reference will be gone in X3.3. > from zope.app.site.interfaces import ISite > book/messageboard/browser/messageboard.py:24: DeprecationWarning: > SiteManager: This class has been moved to zope.app.component.site. The > reference will be gone in X3.3. > from zope.app.site.service import SiteManager, ServiceRegistration > book/messageboard/browser/messageboard.py:24: DeprecationWarning: > ServiceRegistration: The concept of services has been removed. Use > utilities instead. The reference will be gone in X3.3. > from zope.app.site.service import SiteManager, ServiceRegistration > book/messageboard/browser/messageboard.py:25: DeprecationWarning: > LocalUtilityService: Services have been removed. Use site manager API. > The reference will be gone in X3.3. > from zope.app.utility.utility import LocalUtilityService, > UtilityRegistration > book/messageboard/browser/messageboard.py:25: DeprecationWarning: > UtilityRegistration: This class has been moved to > zope.app.component.site. The reference will be gone in X3.3. > from zope.app.utility.utility import LocalUtilityService, > UtilityRegistration > Traceback (most recent call last): > File "", line 1, in ? > File "book/messageboard/browser/messageboard.py", line 26, in ? > from zope.app.workflow.interfaces import > IProcessDefinitionImportHandler > ImportError: No module named workflow.interfaces > >>> > > > > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051103/a82b0ab6/attachment.htm From philipp at weitershausen.de Wed Nov 2 11:59:53 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed Nov 2 12:38:50 2005 Subject: [Zope3-Users] Five 1.2b and 1.3b released! Message-ID: <4368F089.7040502@weitershausen.de> The Five team is happy to announce the release of two Five beta versions today, Five 1.2b and 1.3b! What is Five ------------ Five is a Zope 2 product that allows you to integrate Zope 3 technologies into Zope 2, today. Among others, it allows you to use Zope 3 interfaces, ZCML-based configuration, adapters, browser pages (including skins, layers, and resources), automated add and edit forms based on schemas, object events, as well as Zope 3-style i18n message catalogs. We've tried to keep the Five experience as close to Zope 3 as possible, so this means that what you learn while using Five should also be applicable to Zope 3, and viceversa. More information about Five can be found on our website, http://codespeak.net/z3/five/. Five 1.2 -------- Five 1.2 is the last release line of Five to work with Zope 2.8 and its included Zope X3 3.0. It does not work on Zope 2.7 anymore (use Five 1.1 if you're bound to Zope 2.7) Compared to the 1.1 release a month ago, it introduces the following compelling list of new features: * Local site support Five now supports local sites in Zope 2. Sites are a concept known from Zope 3 and similar to CMF's sites (only that they can be nested). Thanks to Sidnei da Silva for the initial development back in March, Lennart Regebro and Philipp von Weitershausen for bringing it up to date for inclusion into Five 1.2. * Improved event support Five can now make standard Zope 2 containers (aka object managers) send Zope 3-style events for adding, moving, copying and deleting contained objects, instead of calling their manage_afterAdd, manage_beforeDelete, etc. methods. Thanks to Florent Guillaume for thinking through this non-trivial matter and implementing it. * Marker interfaces utility Five now includes a feature known from Zope X3 3.0's introspector, the ability to set marker interfaces on objects to influence their behaviour (such as view or adapter look-up). This also includes a browser page with a page template macro for doing so through-the-web. This feature is based on Sidnei da Silva's Plone-based product Flon. Thanks to him for the original implementation as well as Godefroid Chapelle, Whit Morriss and Yvo Schubbe for bringing it to Five 1.2. * Class registration through ZCML It is now possible to register Zope 2 classes through ZCML so that they show up in the ZMI as addable meta types. This basically obsolete's the boiler-plate ``initialize()`` function in products' ``__init__.py`` files, as well as equipping classes with a ``meta_type`` in the first place. Thanks to Yvo Schubbe for suggesting and implementing this great helper for cleaning out Zope 2 boiler plate code out of products. * New test runner Five 1.2 (and only 1.2) includes a forked copy of Zope 3.2's improved test runner which brings, among others, better doctest debugging and support for running tests on different levels and layers. Thanks to Tres Seaver for integrating this into Five 1.2. For more information please consult the CHANGES document: http://codespeak.net/z3/five/CHANGES.html Five 1.2b can be downloaded at http://codespeak.net/z3/five/release/Five-1.2b.tgz. Five 1.3 -------- Five 1.3 is a straight port of Five 1.2 to Zope 3.2 which will be included in this December's Zope 2.9 release. Five 1.3 itself will also be part of Zope 2.9. It does not introduce any new features compared to Five 1.2, however, some restructuring has been made: * Most of the event work has been folded into Zope 2. That means that Zope 2.9 will ship with event-enabled object managers out of the box! * Several legacy packages were removed from Five as they are now included in Zope 2, such as Zope 3-style interfaces for OFS et.al. as well as the new test runner We are not providing a downloadable tarball of Five 1.3b. Instead it has been integrated into Zope 2.9 with which it will ship. To try out Zope 2.9, you have to currently check out the Zope 2 trunk from the subversion repository. About the Zope 3 Base --------------------- Five is part of the *Zope 3 Base* project, which aims to offer an approachable area for developers of Zope 3 related software. More about the Zope 3 base and its projects can be found on the project website, http://codespeak.net/z3/. From brad at allendev.com Wed Nov 2 17:38:57 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 2 17:53:33 2005 Subject: [Zope3-Users] MessageBoard tutorial deprecation warnings In-Reply-To: <87vezbt6le.wl%yusei@domen.cx> References: <1130741588.5524.34.camel@localhost.localdomain> <87vezbt6le.wl%yusei@domen.cx> Message-ID: >I think stateful workflow is no longer supported in zope3. > >this is a disscusion about stateful workflow. >http://mail.zope.org/pipermail/zope3-dev/2005-October/015997.html Thanks. Ok, then I will skip the chapter "Approval Workflow for Messages". I now realize that trying to implement "step13" from SVN was a mistake, resulting from my confusion about how the "step" directories correlate with the tutorials in the Zope 3 Developer's Guide. I made the mistake of focusing all my attention on just Chapter 13, and not looking ahead to see that Chapter 14 correlates to "step2" in SVN. I thought that the "steps" listed within Chapter 13 correlated with the "step" directories in SVN, and was puzzled when things seemed not to quite match up. Now, back to "step1" in the SVN... From brad at allendev.com Wed Nov 2 17:43:24 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 2 17:57:56 2005 Subject: [Zope3-Users] namespaces.zope.org doesn't resolve Message-ID: Most of the zcml configuration files I've seen contain xmlns="http://namespaces.zope.org/zope". I wanted to read about what was in that namespace, so I tried to load that page in a web browser. This name just doesn't seem to resolve in DNS. I guess my ignorance about XML is showing here. Where do I find the actual namespace? Thanks! From srichter at cosmos.phy.tufts.edu Wed Nov 2 17:48:11 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Wed Nov 2 18:02:45 2005 Subject: [Zope3-Users] namespaces.zope.org doesn't resolve In-Reply-To: References: Message-ID: <200511021748.12159.srichter@cosmos.phy.tufts.edu> On Wednesday 02 November 2005 17:43, Brad Allen wrote: > Most of the zcml configuration files I've seen contain > xmlns="http://namespaces.zope.org/zope". I wanted to read about what > was in that namespace, so I tried to load that page in a web browser. > This name just doesn't seem to resolve in DNS. ?I guess my ignorance > about XML is showing here. Where do I find the actual namespace? Namespaces only have to be URIs. They do not have to represent URIs with some content. You can find an overview of all ZCML namespaces and elements in the apidoc: http://localhost:8080/++apidoc++ Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From adam at 4js.com.au Thu Nov 3 08:09:37 2005 From: adam at 4js.com.au (Adam Summers) Date: Thu Nov 3 08:24:33 2005 Subject: [Zope3-Users] Validation of schemas? In-Reply-To: References: Message-ID: <436A0C11.1060101@4js.com.au> Hi again, Thanks for the help so far. Using schemas I can do the following: class IBuddy(interface.Interface): """Provides access to basic buddy information""" fullname = TextLine(title=_("Name")) email = TextLine(title=_("Email Address"), required=False) phone = TextLine(title=_("Phone Contact"), required=False) @interface.invariant def buddyInvariants(ob): if ob.fullname.startswith("Z"): raise zope.interface.Invalid("Names cannot start with Z") if ob.email is None and ob.phone is None: raise zope.interface.Invalid("Email and Phone cannot both be None") and: class Buddy(persistent.Persistent): """Buddy Information""" zope.interface.implements(IBuddy) def __init__(self,fullname=None, email=None, phone=None): self.fullname = fullname self.email = email self.phone = phone IBuddy.validateInvariants(self) This will do the validation on add. But how do I get the schema to be validated on an update to it? One way I can see is to have update method with named parameters (which does the validation at the end of the method), but then (I think) I lose the ability to have a directive to generate the html form based on the schema for free. Any suggestions? Thanks in advance, Adam gnotari@linkgroup.it wrote: >zope3-users-bounces@zope.org wrote on 31/10/2005 06.12.43: > > > > >>Just added this to FAQ (http://zissue.berlios.de/z3/z3faq.html). >>I expects more contribution in coming months. >> >> >>How to validate two or more fields simultaneously? >>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >>Use `invariants` to control more fields. >> >>Look at zope.interface/README.txt for details. >> >>Let's consider this more specific question asked to list: >> >> How do I implement a validation rule that says either email or phone >> have to exist, but not necissarily both. >> >> Using the buddy demo as an example, with the following interface:: >> >> class IBuddy(zope.interface.Interface): >> """Provides access to basic buddy information""" >> >> fullname = TextLine(title=_("Name")) >> email = TextLine(title=_("Email Address")) >> phone = TextLine(title=_("Phone Contact")) >> >>First we have to make a callable object, either a simple function or >>callable instance of a class:: >> >> def contacts_invariant(obj): >> if not (obj.email or obj.phone): >> raise Exception("At least one contact info is rquired") >> >>Now use `validateInvariants` method of the interface to validate:: >> >> buddy = Buddy() >> buddy.email = u"user.id@some.address.com" >> IBuddy.validateInvariants(buddy) >> >> > >What I would want to be further explained is: When should I call >validateInvariants? >Of course I would call it when I'm creating or editing the object. Then, >frequently, just after an add or edit form. >More: can I then use auto generated forms (by using events after the form, >but how?), or I just have do define a custom form? >And then: what do I do if the validation falils? How do I return the form, >possibly with an error message? > >I feel these are genuine FAQs, and I still don't have answers for many of >them. Working through them at a steday pace, though ;) >Thanks for all your help, really. > >ciao >Guido > >_______________________________________________ >Zope3-users mailing list >Zope3-users@zope.org >http://mail.zope.org/mailman/listinfo/zope3-users > > From RossBoylan at stanfordalumni.org Fri Nov 4 00:07:39 2005 From: RossBoylan at stanfordalumni.org (Ross Boylan) Date: Fri Nov 4 00:07:45 2005 Subject: [Zope3-Users] documentation on Field types Message-ID: <20051104050739.GZ4731@wheat.boylan.org> Where should I look for documentation on Field types? By this, I mean a current, exhaustive list of allowed Field types and their arguments. I suspect when I go to the API documentation and enter zope.schema I'm getting the values, with some translation. But since those entries are in terms of interfaces and not the actual names to use (e.g., IText, not Text), I'd like to know more about how they relate. The "Programming with Zope 3" Tutorial and Richter's Developer's Handbook both discuss and list various options, but they have several limitations: * they aren't current * they aren't exhaustive * they aren't in the online help system. I'm looking for something that meets those requirements. The online book, in the entry Interfaces and Schemas | Schema Fields, begins "This document highlights unusual and subtle aspects of various fields and field classes, and is not intended to be a general introduction to schema fields. Please see README.txt for a more general introduction." I suggest changing this two ways. First, the "Schema Fields" section should appear after "Schemas." Second, the reference should be changed from "README.txt" (which is non-unique and wasn't even present in my Debian distro) to "Schemas". "Schemas" appears to be the same as the README.txt that I eventually found in the source tree. As far as I can tell, no section of the Book in the online help has anything near a complete discussion of the allowed field types. From RossBoylan at stanfordalumni.org Fri Nov 4 22:32:31 2005 From: RossBoylan at stanfordalumni.org (Ross Boylan) Date: Fri Nov 4 22:32:35 2005 Subject: [Zope3-Users] at sea with basic setup Message-ID: <20051105033231.GA23338@wheat.boylan.org> I'd like to create some users, set authentication methods, and so on. After a lot of fooling around with the GUI and looking at various docs, I conclude I have no idea what's going on. To complicate matters, there were some issue with my installation on Debian (using the package in testing) so that some of the products aren't available. I wonder if any of them are key to getting things going. Do I need to create something like a Zope 2 user folder? Are all users defined in the principals file on disk? I tried installing a Site Manager object. The Site Management screen shows a lot of entries (e.g., Authenticator Plugin) that say there are no entries available yet. I installed some objects that seemed related, gave them names, and tried to hook them up with this screen. The only thing that seems to have worked is the unique id tool. I'd appreciate some pointers. Thanks From twcook at shaw.ca Sat Nov 5 12:25:45 2005 From: twcook at shaw.ca (Tim Cook) Date: Sat Nov 5 12:25:58 2005 Subject: [Zope3-Users] at sea with basic setup In-Reply-To: <20051105033231.GA23338@wheat.boylan.org> References: <20051105033231.GA23338@wheat.boylan.org> Message-ID: <1131211545.3718.33.camel@DaVinci> On Fri, 2005-11-04 at 19:32 -0800, Ross Boylan wrote: > I'd like to create some users, set authentication methods, and so on. > After a lot of fooling around with the GUI and looking at various > docs, I conclude I have no idea what's going on. ... > I'd appreciate some pointers. Best tip is to read this: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage/Zope3Book Then go out and buy a hard copy. Cheers, -- Tim Cook, Consultant CHASE Health Informatics, Inc. GnuPG Key is available at http://www.chasehealthinformatics.com/Members/twcook -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051105/730e4437/attachment.bin From RossBoylan at stanfordalumni.org Sat Nov 5 13:58:05 2005 From: RossBoylan at stanfordalumni.org (Ross Boylan) Date: Sat Nov 5 13:58:09 2005 Subject: [Zope3-Users] at sea with basic setup In-Reply-To: <1131211545.3718.33.camel@DaVinci> References: <20051105033231.GA23338@wheat.boylan.org> <1131211545.3718.33.camel@DaVinci> Message-ID: <20051105185805.GK4731@wheat.boylan.org> On Sat, Nov 05, 2005 at 09:25:45AM -0800, Tim Cook wrote: > On Fri, 2005-11-04 at 19:32 -0800, Ross Boylan wrote: > > I'd like to create some users, set authentication methods, and so on. > > After a lot of fooling around with the GUI and looking at various > > docs, I conclude I have no idea what's going on. > > ... > > > I'd appreciate some pointers. > > Best tip is to read this: > http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage/Zope3Book > I looked at it, but the info on setup is limited. It tells how to install zope, but not really how to setup the instance, especially through the interface. E.g., p. 92 says it assumes you have created principal.zcml, but I don't really see anything about what should go in it. Further, the security framework appears to have been overhauled since the book was written (probably not in a way that affects what's in the book). I've found statements about the different components of the security framework, a reference to a default security policy, and info about how to code security. There's even info on how to write new types of authenticators. What I haven't found is info on the format of the principals file (though what's there provides lots of clues), how or if different credentials and authentication methods can be set via the ZMI, whether I need to create a site management folder, what to do with the options on the site management tab, whether I need to create user folders... Somewhere, maybe the Zope3 Dev Handbook, I saw a statement that user names needed a period. I'm not sure if that's true, since it's not mentioned elsewhere and my admin user doesn't have a period in the name and I can login as admin. Basically, I'm looking for a site administrator's guide or equivalent information. > Then go out and buy a hard copy. > > Cheers, From td at yoma.com.au Sat Nov 5 17:28:31 2005 From: td at yoma.com.au (Tom Dossis) Date: Sat Nov 5 17:36:23 2005 Subject: [Zope3-Users] at sea with basic setup In-Reply-To: <20051105033231.GA23338@wheat.boylan.org> References: <20051105033231.GA23338@wheat.boylan.org> Message-ID: <436D320F.8020904@yoma.com.au> Ross Boylan wrote: > I'd like to create some users, set authentication methods, and so on. > After a lot of fooling around with the GUI and looking at various > docs, I conclude I have no idea what's going on. > > To complicate matters, there were some issue with my installation on > Debian (using the package in testing) so that some of the products > aren't available. I wonder if any of them are key to getting things > going. > > Do I need to create something like a Zope 2 user folder? > Are all users defined in the principals file on disk? > > I tried installing a Site Manager object. The Site Management screen > shows a lot of entries (e.g., Authenticator Plugin) that say there are > no entries available yet. I installed some objects that seemed > related, gave them names, and tried to hook them up with this screen. > The only thing that seems to have worked is the unique id tool. > Hi Ross, There's a related posting at.. http://mail.zope.org/pipermail/zope3-users/2005-October/001321.html The principal folder plugin provides something equivalent to a zope2 user folder in that you can manage principals from the zmi. From andreas at work.de Tue Nov 8 05:38:59 2005 From: andreas at work.de (Andreas Elvers) Date: Tue Nov 8 05:51:46 2005 Subject: [Zope3-Users] sqlos, sites and local utilities Message-ID: Hi, sorry for asking it here but sqlos mailing list seems dead. Has anyone yet tried sqlos with database connections created as local utilities ? At one point sqlos tries to get the utility in connection.py Line 88. newconn = zapi.queryUtility(IZopeDatabaseAdapter, name, default=None, context=context) The context points to a sqlobject instance. The problem is that these instances seem to have no parent and thus will fail the lookup my local utility and will raise an 'NoneType' object is not callable error later in the code when trying to adapt. When you try the sqlos example everything is fine, since the database connection is defined in configure.zcml as a global utility. My current idea is to expose the enclosing folder as a context to query utility. But I don't know if setting references in sqlobject instances is such a great idea. Thanks for any input, - Andreas From marita.werner at iuveno-net.de Tue Nov 8 07:11:41 2005 From: marita.werner at iuveno-net.de (Marita Werner) Date: Tue Nov 8 07:11:44 2005 Subject: [Zope3-Users] Redirect to Editform Message-ID: <437095FD.6070400@iuveno-net.de> Hi! My Problem: I want to add an object and after clicking on the "Add" Button there should be a redirect to an editform. I read Stephan Richters book about "messageboard" and read about nextUrl but that does not help me. Can anybody help me? Thanks, Marita From fbo2 at gmx.net Wed Nov 9 04:59:55 2005 From: fbo2 at gmx.net (Frank Burkhardt) Date: Wed Nov 9 05:00:11 2005 Subject: [Zope3-Users] Sourcetext-mux Message-ID: <20051109095955.GA11524@fbo.no-ip.org> Hi, I found a code fragment in an example-application which enables a View-Object to render a SourceText using a renderer of the user's choice. class ViewClass(object): def render(self): entry_text = zapi.createObject(None, self.context.renderer, self.context.text) view = zapi.getView(removeAllProxies(entry_text), '', self.request) result = view.render() context.renderer contains a token of the 'SourceTypes'-Vocabulary (i.e. 'zope.source.rest'), context.text is the text to be rendered. The 'result' should be some kind of html (xhtml preferred :-) ). Zope Complains about this code, telling me, not to use zapi.getView() but zapi.getMultiAdapter() but there's no hint, what parameters to use for getMultiAdapter. Does anyone know the correct getMultiAdapter()-line - maybe with an explaination? Thank you, Frank From hangzhiyun at gmail.com Wed Nov 9 23:48:14 2005 From: hangzhiyun at gmail.com (Simon Hang) Date: Wed Nov 9 23:48:16 2005 Subject: [Zope3-Users] apache as zope3's frontend and NTLM Message-ID: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> Dear all, I'm trying to use apache as zope3's frontend, and do NTLM authentication as well. I've done: 1. Installed mod_ntlm for apache 1.3, and tested. 2. Create a VirtualHost for zope3 instance, forwarding http request using rewrite engine. And tested. Now I try to put things together => A virtualhost can do NTLM authentication and forward request to zope3, my virtual configration of apache as below: DocumentRoot c:/myroot Servername myserver ErrorLog logs/myerror.log CustomLog logs/myaccess.log common RewriteEngine On RewriteRule ^(/?.*) http://localhost:8080/++vh++http:myserver:808/++$1 [P,L] AuthName "realm" AuthType NTLM NTLMAuth On NTLMAuthoritative On NTLMDomain mydomain NTLMOfferBasic Off NTLMBasicPreferred Off require valid-user Everytime I try to access the page, the brower show me error message as below: Authorization RequiredThis server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. What's wrong in my settings? Thanks in advance, Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051110/aa3f9c02/attachment.htm From chris at simplistix.co.uk Thu Nov 10 03:02:27 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Thu Nov 10 04:24:42 2005 Subject: [Zope3-Users] apache as zope3's frontend and NTLM In-Reply-To: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> Message-ID: <4372FE93.9080400@simplistix.co.uk> Simon Hang wrote: > 1. Installed mod_ntlm for apache 1.3, and tested. Really? Did you get this to work? I've heard it was flakey and/or broken... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From philipp at weitershausen.de Thu Nov 10 12:06:39 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Nov 10 12:05:47 2005 Subject: [Zope3-Users] Re: Zope3 design question In-Reply-To: References: Message-ID: <43737E1F.3090208@weitershausen.de> rubberduckee wrote: > Hi, I'm relatively new to Zope 3 (by have some Zope 2/ Plone > developement experience) and I'm need to get some light on some > architectural challenges that I'm currently faced with. > > I know that this might be too general a question (or perhaps a dumb > one) but I'm hoping that someone could help guide me in the right > direction. How does one go about designing an application that will > allow for dynamic schemas i.e. schemas built at run time? Users would > be able to 'extend' the schemas TTW. Would using a database be a > better option rather that to use ZopeDB or a marriage of both? Hi there, please use the zope3-users for questions that don't concern the actual development *of* Zope 3. The zope3-users list is for development *with* Zope 3 which seems like what you're trying to do. We've once had the ability of editing schemas TTW, but I'm not sure if this is still the case. At least I don't think it's part of a release tarball of Zope 3. Philipp From philipp at weitershausen.de Thu Nov 10 12:12:03 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Thu Nov 10 12:16:40 2005 Subject: [Zope3-Users] Re: Sourcetext-mux In-Reply-To: <20051109095955.GA11524@fbo.no-ip.org> References: <20051109095955.GA11524@fbo.no-ip.org> Message-ID: <43737F63.2080403@weitershausen.de> Frank Burkhardt wrote: > Hi, > > I found a code fragment in an example-application which enables a > View-Object to render a SourceText using a renderer of the user's choice. > > class ViewClass(object): > def render(self): > entry_text = zapi.createObject(None, > self.context.renderer, > self.context.text) > view = zapi.getView(removeAllProxies(entry_text), '', self.request) > result = view.render() > > context.renderer contains a token of the 'SourceTypes'-Vocabulary (i.e. > 'zope.source.rest'), context.text is the text to be rendered. The 'result' should be some > kind of html (xhtml preferred :-) ). > > Zope Complains about this code, telling me, not to use zapi.getView() but zapi.getMultiAdapter() > but there's no hint, what parameters to use for getMultiAdapter. > > Does anyone know the correct getMultiAdapter()-line - maybe with an explaination? The equivalent line would be: zapi.getMultiAdapter((object, request), Interface, name=u'') I just recently ported my wcsite package (available on http://worldcookery.com/Downloads) to Zope 3.1. It has code very similar to this one and provides examples of how the deprecation warnings are correctly avoided in Zope 3.1+. Best regards Philipp From rubberduckee at gmail.com Thu Nov 10 12:11:58 2005 From: rubberduckee at gmail.com (rubberduckee) Date: Thu Nov 10 12:35:15 2005 Subject: [Zope3-Users] Re: Zope3 design question References: <43737E1F.3090208@weitershausen.de> Message-ID: On Fri, 11 Nov 2005 01:06:39 +0800, Philipp von Weitershausen wrote: >rubberduckee wrote: >> Hi, I'm relatively new to Zope 3 (by have some Zope 2/ Plone >> developement experience) and I'm need to get some light on some >> architectural challenges that I'm currently faced with. >> >> I know that this might be too general a question (or perhaps a dumb >> one) but I'm hoping that someone could help guide me in the right >> direction. How does one go about designing an application that will >> allow for dynamic schemas i.e. schemas built at run time? Users would >> be able to 'extend' the schemas TTW. Would using a database be a >> better option rather that to use ZopeDB or a marriage of both? > >Hi there, > >please use the zope3-users for questions that don't concern the actual >development *of* Zope 3. The zope3-users list is for development *with* >Zope 3 which seems like what you're trying to do. > >We've once had the ability of editing schemas TTW, but I'm not sure if >this is still the case. At least I don't think it's part of a release >tarball of Zope 3. > >Philipp Thanks, will do that in the future. Do you know why this particular feature was 'dropped'? Thanks -ec From jsmith030416 at yahoo.co.uk Thu Nov 10 19:55:23 2005 From: jsmith030416 at yahoo.co.uk (John Smith) Date: Thu Nov 10 19:55:25 2005 Subject: [Zope3-Users] configure.zcml entries for using adapters. Message-ID: <20051111005524.21121.qmail@web26501.mail.ukl.yahoo.com> I have a content component called 'journey' which provides three attributes: journey_description, journey_date, and distance_travelled. These 'journey' objects live in a container called 'car'. A car has attributes like owner, registration etc. So far, Everything is fine. I thought I would try to use adapters to extend the functionality of a 'car' object so that in the zmi_views, I could have a 'totals' page, showing the sum of the distance_travelled attributes of all the car's journey objects. I created an interface for the adapter, IDistanceTotal which describes one method, getTotalDistance. I created and adapter class, CarTotalDistanceAdapter. I updated configure.zcml like this: I tested the correct operation of the adapter in accordance with: Zope 3 Developer's Handbook,p142 and also with Web Component Development with Zope 3, page 149. The adapter was recognized, the getTotalDistance method appeared as an attribute of the Car object and valid results appeared for the distance travelled. I then created a nice page template which contains this snippet:
where context is the Car object. Now, here is my problem: no matter what I do in the configure.zcml file, I cannot seem to get the context object to pick up the getTotalDistance method from the adapter. Depending on the security/permissions settings I either see: forbidden attribute or not found errors. I have tried studying the code of the zwiki product but to no avail. Am I right in thinking that my problems are related to the configure.zcml file? Any pointers gratefully received. I can get the ISized examples from the books to work ok. Thanks to all. John ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com From hangzhiyun at gmail.com Thu Nov 10 23:39:41 2005 From: hangzhiyun at gmail.com (Simon Hang) Date: Thu Nov 10 23:39:42 2005 Subject: [Zope3-Users] apache as zope3's frontend and NTLM In-Reply-To: <43735908.5010007@simplistix.co.uk> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4372FE93.9080400@simplistix.co.uk> <8a8e599a0511100546r7d78cd9cx6d3b679800313aa1@mail.gmail.com> <43735908.5010007@simplistix.co.uk> Message-ID: <8a8e599a0511102039q3f0574fdyc5abecc00e13a546@mail.gmail.com> Not under heavy load. Any machine should be able to handle this. I use the config below DocumentRoot /myplace/httpdoc Servername myserver ErrorLog logs/myserver-error.log CustomLog logs/myserver-access.log common RewriteEngine On RewriteRule ^c:/ftscompass/htdocs(/?.*) http://localhost:8080/++vh++http:myserver:808/++$1 [P,L] AuthName "NTLM" AuthType NTLM NTLMAuth On NTLMAuthoritative On NTLMDomain mydomain NTLMOfferBasic On NTLMBasicPreferred Off require valid-user But now, next question is how to let zope know the authenticated user? REMOTE_USER is only available in CGI & SSL mode. How to pass this before apache proxy the request? Anybody can help? Thanks, Simon On 11/11/05, Chris Withers wrote: > > How much load are you putting this under? > > Chris > > Simon Hang wrote: > > Hi Chris, > > Yes, it's working. > > I'm using Unofficial MOD_NTLM Apache Module from > > http://modntlm.jamiekerwick.co.uk/. > > It looks like can make both thing working, and I will double check... > > I will update tomorrow if any progress.. > > Simon > > > > On 11/10/05, Chris Withers wrote: > > > >>Simon Hang wrote: > >> > >>>1. Installed mod_ntlm for apache 1.3, and tested. > >> > >>Really? Did you get this to work? I've heard it was flakey and/or > >>broken... > >> > >>cheers, > >> > >>Chris > >> > >>-- > >>Simplistix - Content Management, Zope & Python Consulting > >>- http://www.simplistix.co.uk > >> > >> > > > > > > -- > Simplistix - Content Management, Zope & Python Consulting > - http://www.simplistix.co.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051111/8ef5934d/attachment.htm From chris at simplistix.co.uk Fri Nov 11 04:11:19 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Fri Nov 11 05:02:41 2005 Subject: [Zope3-Users] apache as zope3's frontend and NTLM In-Reply-To: <8a8e599a0511102039q3f0574fdyc5abecc00e13a546@mail.gmail.com> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4372FE93.9080400@simplistix.co.uk> <8a8e599a0511100546r7d78cd9cx6d3b679800313aa1@mail.gmail.com> <43735908.5010007@simplistix.co.uk> <8a8e599a0511102039q3f0574fdyc5abecc00e13a546@mail.gmail.com> Message-ID: <43746037.1050701@simplistix.co.uk> Simon Hang wrote: > Not under heavy load. Any machine should be able to handle this. Ah, hmmm, do you know how it would behave under high load? Our current use case resulted in problematic behaviour under high load and I wonderd if this had been addressed in the version you are using.. > But now, next question is how to let zope know the authenticated user? > REMOTE_USER is only available in CGI & SSL mode. Really? i just thought REMOTE_USER was put in the CGI environment, which Zope had access to no matter how it ran? Zope 2 had a "REMOTE_USER mode" but I don't know about Zope 3 I'm afraid :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From vijay.nakhawa at gmail.com Sat Nov 12 03:56:27 2005 From: vijay.nakhawa at gmail.com (Vijay Nakhawa) Date: Sat Nov 12 03:56:28 2005 Subject: [Zope3-Users] configure.zcml entries for using adapters. Message-ID: <6c466d2d0511120056v5ae4ae04h106d7fec1227ef83@mail.gmail.com> I am struggler in learning zope3. Please forgive me if i am wrong. How about using an intermediate view component? in template1.pt
In zcml where view class is : from adapters import CarTotalDistanceAdapter class RoughView: def __init__(self,context,request): self.context = context self.request = request self.adapt = CarTotalDistanceAdapter() def vgetTotalDistance(self): return self.adapt.getTotalDistance() From vijay.nakhawa at gmail.com Sat Nov 12 04:12:14 2005 From: vijay.nakhawa at gmail.com (Vijay Nakhawa) Date: Sat Nov 12 04:12:15 2005 Subject: [Zope3-Users] Re: configure.zcml entries for using adapters. In-Reply-To: <6c466d2d0511120056v5ae4ae04h106d7fec1227ef83@mail.gmail.com> References: <6c466d2d0511120056v5ae4ae04h106d7fec1227ef83@mail.gmail.com> Message-ID: <6c466d2d0511120112l516849farf0bf4efb7154c95a@mail.gmail.com> Sorry there is a bug in line of class RoughView: write:===> self.adapt = CarTotalDistanceAdapter(context) instead of self.adapt = CarTotalDistanceAdapter() On 11/12/05, Vijay Nakhawa wrote: > I am struggler in learning zope3. > Please forgive me if i am wrong. > How about using an intermediate view component? > > in template1.pt > >
> > In zcml > > class=".someModule.RoughView" > template = "template1.pt" > ..... > /> > > where view class is : > > from adapters import CarTotalDistanceAdapter > > class RoughView: > > def __init__(self,context,request): > self.context = context > self.request = request > self.adapt = CarTotalDistanceAdapter() > > def vgetTotalDistance(self): > return self.adapt.getTotalDistance() > From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:18:14 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:18:24 2005 Subject: [Zope3-Users] sqlos - getting factory of NoneType In-Reply-To: <200510221826.28576.vyv@euroholding.ru> References: <200510221826.28576.vyv@euroholding.ru> Message-ID: <200511120718.14649.srichter@cosmos.phy.tufts.edu> On Saturday 22 October 2005 10:26, Vetlugin Yury wrote: > I`m using sqlos trunk. Saying simply it allow me to use RDB tables as an > zope objects. It look nice, i can see objects (rows in RDB table), can edit > them and even delete them. I assume the sqlos guys sent you over here? Otherwise asking the SQLOS guys might be more fruitful. > But when I`m trying to add an > > ? ? class="test.main.Person" > ? ? title="Person" > ? ? description="Person objects" > ? ? view="addperson.html" > ? ? permission="zope.ManageContent" > ? ? /> > > tag to my configure.zcml - zapi.getFactories() returns me factory of > NoneType (with name something like "BrowserAdd__test.main.Person" No, the above code looks fine. The created factory name seems also ok. > Without mentioned addMenuItem tag - everything is OK. Okay, so we call those configuration directives. > So, the question is - how can i define "proper" factory? You can create a factory using the directive by itself or inside the directive. There are plenty examples out there describing this. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:21:25 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:21:28 2005 Subject: [Zope3-Users] Executing utility specific code on server startup In-Reply-To: <435A7087.5040904@chrislehmann.net> References: <435A7087.5040904@chrislehmann.net> Message-ID: <200511120721.26008.srichter@cosmos.phy.tufts.edu> On Saturday 22 October 2005 13:01, Chris Lehmann wrote: > I have a utility that needs to start several threads when zope starts > up. ?What is the best way to accomplish this? > > So far I have tried to use the IDatabaseOpenedWithRoot and > IProcessStarting events but when I try and register them with the > following code, my handlers do not get called. ?Code from the > constructor of my utility class: > > zapi.getGlobalSiteManager().subscribe([IProcessStartingEvent],None, > self.onStartup) > > What am I doing wrong? You need to make this registration using ZCML. Having this code in the utility constructor is far too late. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:23:13 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:23:22 2005 Subject: [Zope3-Users] Application with objects incl relations / references In-Reply-To: <3412A3302CEE@mri.com.au> References: <3412A3302CEE@mri.com.au> Message-ID: <200511120723.13090.srichter@cosmos.phy.tufts.edu> On Sunday 23 October 2005 21:06, Joshua Burvill wrote: > With the usual references/relations between objects, eg customer may have > more that one address, more than one quote, quote has many quote_items, etc > > Can someone give me a high level description/overview of what I need to > use/do in zope3 to make something like this. What you want is a relationship package. SchoolTool has schooltool.relationship, there is Zemantic and a couple others. Pick one and be happy. I have only used SchoolTool's package so far, and I like it. It is very Pythonic and works well for us. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:30:14 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:30:17 2005 Subject: [Zope3-Users] How is sending a HTTP POST in Zope3 supposed to work ? In-Reply-To: References: Message-ID: <200511120730.14152.srichter@cosmos.phy.tufts.edu> On Thursday 27 October 2005 05:44, Michael Haubenwallner wrote: > osting to the object itself equals a GET request. > Posting to the @@edit.html view of the object results in a > ?>>> ?UserError: The character set specified in the content type > ($charset) does not match file content. > error, even with charset set in the request headers. How does your request look like? Note that we use POST in the edit form, so things should be fine. If this is not working for you, I would write a custom view maybe. > Are there any functional tests existing for the HTTP POST method ? I doubt it, but it would be nice, if you could write one. > Aside: how would i create a default view for a POST request for a > certain object ? See the SchoolTool REST interface. It does all those type of things. The tinyu bit longer answer is: Develop a view class that implements a method called "POST" and then register this method as a view for IHTTPRequest. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:37:11 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:37:19 2005 Subject: [Zope3-Users] Validation of schemas? In-Reply-To: <436A0C11.1060101@4js.com.au> References: <436A0C11.1060101@4js.com.au> Message-ID: <200511120737.11931.srichter@cosmos.phy.tufts.edu> On Thursday 03 November 2005 08:09, Adam Summers wrote: > This will do the validation on add. But how do I get the schema ?to be > validated on an > update to it? You could write your own property class that does the invariant checks. See zope.schema.fieldproperty.FieldProperty In fact, if you feel heroic, you should just add the invariance check to that code and check it in! That would be a great feature.! > One way I can see is to have update method with named parameters (which > does the validation at the end of the method), but then (I think) I lose > the ?ability to have a directive to generate the html > form based on the schema for free. That would be eek! Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:51:24 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:51:27 2005 Subject: [Zope3-Users] Redirect to Editform In-Reply-To: <437095FD.6070400@iuveno-net.de> References: <437095FD.6070400@iuveno-net.de> Message-ID: <200511120751.24312.srichter@cosmos.phy.tufts.edu> On Tuesday 08 November 2005 07:11, Marita Werner wrote: > I want to add an object and after clicking on the "Add" Button there > should be a redirect to an editform. > > I read Stephan Richters book about "messageboard" and read about nextUrl > but that does not help me. Why does that not help you? nextURL() is really the method you want to override in your custom add view class. I know why it seems difficult though. Here is the scoop. You probably have troubles getting to the created content object. The trick is to override the add() method as well, so that you can store the new content object's absolute URL: def add(self, content): located = self.context.add(content) self.absURL = zapi.absoluteURL(located, self.request) return located def nextURL(self): return self.absURL + '@@edit.html' Note that I did not test the code, but it should be correct. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 07:57:16 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 07:57:19 2005 Subject: [Zope3-Users] at sea with basic setup In-Reply-To: <20051105033231.GA23338@wheat.boylan.org> References: <20051105033231.GA23338@wheat.boylan.org> Message-ID: <200511120757.16414.srichter@cosmos.phy.tufts.edu> On Friday 04 November 2005 22:32, Ross Boylan wrote: > I'd like to create some users, set authentication methods, and so on. > After a lot of fooling around with the GUI and looking at various > docs, I conclude I have no idea what's going on. Tim suggested reading the books and he is right. I'll note that the online version is outdated and has some issues that were resolved in the paper copy of my book. > To complicate matters, there were some issue with my installation on > Debian (using the package in testing) so that some of the products > aren't available. ?I wonder if any of them are key to getting things > going. SVN trunk. :-) > Do I need to create something like a Zope 2 user folder? Yes, but it is called an authentication utility. > Are all users defined in the principals file on disk? No. > I tried installing a Site Manager object. ?The Site Management screen > shows a lot of entries (e.g., Authenticator Plugin) that say there are > no entries available yet. ?I installed some objects that seemed > related, gave them names, and tried to hook them up with this screen. > The only thing that seems to have worked is the unique id tool. As Tim also pointed out, read the zope.app.authentication *.txt files. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:05:21 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 08:05:24 2005 Subject: [Zope3-Users] sqlos, sites and local utilities In-Reply-To: References: Message-ID: <200511120805.22071.srichter@cosmos.phy.tufts.edu> On Tuesday 08 November 2005 05:38, Andreas Elvers wrote: > Hi, > > sorry for asking it here but sqlos mailing list seems dead. > > Has anyone yet tried sqlos with database connections created as local > utilities ? At one point sqlos tries to get the utility in connection.py > Line 88. > > newconn = zapi.queryUtility(IZopeDatabaseAdapter, name, > default=None, > context=context) > > The context points to a sqlobject instance. The problem is that these > instances seem to have no parent and thus will fail the lookup my local > utility and will raise an 'NoneType' object is not callable error later > in the code when trying to adapt. > > When you try the sqlos example everything is fine, since the database > connection is defined in configure.zcml as a global utility. > > My current idea is to expose the enclosing folder as a context to query > utility. But I don't know if setting references in sqlobject instances > is such a great idea. If the sqlobject instance does not have a parent, then that's bad. It probably does not have a parent, because it is usually wrapped using a location proxy, which is lost inside a method. I think the smart thing to do here would be what you suggested or to write a subclass of sqlobject that implements ILocation. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:09:01 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 08:09:04 2005 Subject: [Zope3-Users] configure.zcml entries for using adapters. In-Reply-To: <20051111005524.21121.qmail@web26501.mail.ukl.yahoo.com> References: <20051111005524.21121.qmail@web26501.mail.ukl.yahoo.com> Message-ID: <200511120809.01393.srichter@cosmos.phy.tufts.edu> On Thursday 10 November 2005 19:55, John Smith wrote: > I then created a nice page template which contains > this snippet: > >
/> > > where context is the Car object. This is wrong, because Car does not have a function called getTotalDistance. In the view class do: class View: def getTotalDistance(self): total = interfaces.IDistanceTotal(self.context) return total.getTotalDistance() In the view do:
Note that you should never ever put a python call into your template. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:12:34 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 08:12:36 2005 Subject: [Zope3-Users] documentation on Field types In-Reply-To: <20051104050739.GZ4731@wheat.boylan.org> References: <20051104050739.GZ4731@wheat.boylan.org> Message-ID: <200511120812.34684.srichter@cosmos.phy.tufts.edu> On Friday 04 November 2005 00:07, Ross Boylan wrote: > Where should I look for documentation on Field types? ?By this, I mean > a current, exhaustive list of allowed Field types and their arguments. There is none. > I suspect when I go to the API documentation and enter zope.schema I'm > getting the values, with some translation. ?But since those entries > are in terms of interfaces and not the actual names to use (e.g., > IText, not Text), I'd like to know more about how they relate. Well, all data fields defined in those interfaces are keyword arguments in the constructor. > The "Programming with Zope 3" Tutorial and Richter's Developer's > Handbook both discuss and list various options, but they have several > limitations: > * they aren't current > * they aren't exhaustive > * they aren't in the online help system. > > I'm looking for something that meets those requirements. Look at zope.schema._field and zope.schema._bootstrapfields Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Sat Nov 12 08:19:13 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Sat Nov 12 08:19:15 2005 Subject: [Zope3-Users] Complex Adapter Requirements - Named Adapters? In-Reply-To: <36d212000510301116v1f2ca3d3v@mail.gmail.com> References: <36d212000510301116v1f2ca3d3v@mail.gmail.com> Message-ID: <200511120819.13727.srichter@cosmos.phy.tufts.edu> On Sunday 30 October 2005 14:16, James Allwyn wrote: > One thought I had, was creating an interface IStandard, with > attributes like "meetsstandard" and "nameofstandard", and then > subclass this, e.g. to IAccreditationScheme and INationalCode (where > "Accreditation Scheme" and "National Code" are the names of two of the > standards). But I get a little stuck conceptually at the point where I > try to handle, for example, the fact that for some ISharedHouse > objects, IAccreditationScheme would be suitable, whilst for others it > wouldn't, because of their location. In fact it's likely that in the > future we will need to recognise two or more standards for a > particular accommodation type (so IAccreditationScheme and IHouseCheck > chould both apply to ISharedHouse objects, in differect areas). This is not such a complex case as you think. If you register an adapter from ISharedHouse to IAccreditationScheme then it will be only available for this interface and not for IAccommodation in general. I would even write a specific IAccreditationScheme for every scheme you support; thus you do not even need named adapters. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From alecmunro at gmail.com Sat Nov 12 11:40:55 2005 From: alecmunro at gmail.com (Alec Munro) Date: Sat Nov 12 11:40:57 2005 Subject: [Zope3-Users] Recommended policy for extension of the built-in skins and macros? Message-ID: <9819d58b0511120840s8d52679v180b83f74535f0f@mail.gmail.com> Hi All, I've managed to dip my toes rather deeply in Zope3 without ever approaching the skins/layers aspect of it. I'm finally in a position to do that, and most of the examples I find extend the Rotterdam skin, and simply override it's macros. Is this simply for convenience, as there is a lot of useful functionality provided by these macros? Or is there some grander reason for using the existing with simple customizations? The main thing I could think of was that by doing this, you will can generally ensure consistent macro naming across different sites, which I suppose is helpful. I'm a very minimalist guy as far as HTML goes, so my initial inclination is generally to start with with the simplest thing possible, and expand it when necessary. What are people's experiences with this (keeping in mind that I am likely misunderstanding some large part of the way skins and layers are supposed to work :) ? Thanks, Alec Munro From philipp at weitershausen.de Sat Nov 12 14:03:23 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat Nov 12 14:04:25 2005 Subject: [Zope3-Users] Re: Zope3 design question In-Reply-To: References: <43737E1F.3090208@weitershausen.de> Message-ID: <43763C7B.5090705@weitershausen.de> rubberduckee wrote: >>We've once had the ability of editing schemas TTW, but I'm not sure if >>this is still the case. At least I don't think it's part of a release >>tarball of Zope 3. >> >>Philipp > > Thanks, will do that in the future. Do you know why this particular > feature was 'dropped'? Well, something that hasn't been released in the first place can't be dropped. The problem is that it just hasn't been maintained lately because other things were the priority. This might change in the future and anyone's welcome to contribute. The current code is mostly at zope.app.schemacontent. Philipp From philipp at weitershausen.de Sat Nov 12 14:28:26 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat Nov 12 14:29:50 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> Message-ID: <4376425A.9050807@weitershausen.de> Simon Hang wrote: > Dear all, > > I'm trying to use apache as zope3's frontend, and do NTLM authentication > as well. Well, traditionally it's been part of Zope's responsibility to do credentials extraction and user authentication. That doesn't mean it couldn't be done by the webserver in front of Zope; there might just be other implications that you and I can't think of ;). > I've done: > 1. Installed mod_ntlm for apache 1.3, and tested. > 2. Create a VirtualHost for zope3 instance, forwarding http request > using rewrite engine. And tested. > > Now I try to put things together => A virtualhost can do NTLM > authentication and forward request to zope3, my virtual configration of > apache as below: > > > DocumentRoot c:/myroot > Servername myserver > ErrorLog logs/myerror.log > CustomLog logs/myaccess.log common > RewriteEngine On > RewriteRule ^(/?.*) > http://localhost:8080/++vh++http:myserver:808/++$1 [P,L] > > > AuthName "realm" > AuthType NTLM > NTLMAuth On > NTLMAuthoritative On > NTLMDomain mydomain > NTLMOfferBasic Off > NTLMBasicPreferred Off > require valid-user > > > > > Everytime I try to access the page, the brower show me error message as > below: > > > Authorization Required > > This server could not verify that you are authorized to access the > document requested. Either you supplied the wrong credentials (e.g., bad > password), or your browser doesn't understand how to supply the > credentials required. > > What's wrong in my settings? Well, Zope 3 doesn't care that Apache has authenticated your user. It doesn't see that. If you want the Zope 3 security system to interact with Apache's, here's a suggestion (not sure if it'll actually work): - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using the "E" flag at the end of rewrite rule: [P,L,E=REMOTE_USER:%{REMOTE_USER}] - Have a custom ICredentialsPlugin that's simply looks at this env variable in the request for the log-in credentials. To challenge the user for authentication, it would simply use the same authentication realm as set in the apache.conf, so that it gets picked up by Apache when the user provides the credentials. - Have a custom IAuthenticatorPlugin that uses the credential data of the former plug-in to create a principal object from it. It wouldn't really need to do any actual authentication because that had already been done by Apache. The only thing this plug-in needs to do is convert the credentials data into an actual principal object. Hope that helps. Philipp From fg at nuxeo.com Sat Nov 12 14:36:27 2005 From: fg at nuxeo.com (Florent Guillaume) Date: Sat Nov 12 14:36:30 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <4376425A.9050807@weitershausen.de> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> Message-ID: <4376443B.7060809@nuxeo.com> Philipp von Weitershausen wrote: > Simon Hang wrote: > >>Dear all, >> >>I'm trying to use apache as zope3's frontend, and do NTLM authentication >>as well. > > > Well, traditionally it's been part of Zope's responsibility to do > credentials extraction and user authentication. That doesn't mean it > couldn't be done by the webserver in front of Zope; there might just be > other implications that you and I can't think of ;). > > >>I've done: >>1. Installed mod_ntlm for apache 1.3, and tested. >>2. Create a VirtualHost for zope3 instance, forwarding http request >>using rewrite engine. And tested. >> >>Now I try to put things together => A virtualhost can do NTLM >>authentication and forward request to zope3, my virtual configration of >>apache as below: >> >> >> DocumentRoot c:/myroot >> Servername myserver >> ErrorLog logs/myerror.log >> CustomLog logs/myaccess.log common >> RewriteEngine On >> RewriteRule ^(/?.*) >>http://localhost:8080/++vh++http:myserver:808/++$1 [P,L] >> >> >> AuthName "realm" >> AuthType NTLM >> NTLMAuth On >> NTLMAuthoritative On >> NTLMDomain mydomain >> NTLMOfferBasic Off >> NTLMBasicPreferred Off >> require valid-user >> >> >> >> >>Everytime I try to access the page, the brower show me error message as >>below: >> >> >> Authorization Required >> >>This server could not verify that you are authorized to access the >>document requested. Either you supplied the wrong credentials (e.g., bad >>password), or your browser doesn't understand how to supply the >>credentials required. >> >>What's wrong in my settings? > > > Well, Zope 3 doesn't care that Apache has authenticated your user. It > doesn't see that. If you want the Zope 3 security system to interact > with Apache's, here's a suggestion (not sure if it'll actually work): > > - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using > the "E" flag at the end of rewrite rule: > > [P,L,E=REMOTE_USER:%{REMOTE_USER}] Will that really work? env variables are only useful in CGI mode, but proxying doesn't involve CGI. Rather I'd advise using additional parameters to the URL, like we do here for Zope 2 for instance: http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf > - Have a custom ICredentialsPlugin that's simply looks at this env > variable in the request for the log-in credentials. To challenge the > user for authentication, it would simply use the same authentication > realm as set in the apache.conf, so that it gets picked up by Apache > when the user provides the credentials. And this plugin would have to get the credentials from the URL instead of the env variable. I wish apache had a proper way to add request headers during proxying... Florent > > - Have a custom IAuthenticatorPlugin that uses the credential data of > the former plug-in to create a principal object from it. It wouldn't > really need to do any actual authentication because that had already > been done by Apache. The only thing this plug-in needs to do is convert > the credentials data into an actual principal object. > > Hope that helps. > > Philipp -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com From philipp at weitershausen.de Sat Nov 12 15:01:41 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat Nov 12 15:01:42 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <4376443B.7060809@nuxeo.com> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com> Message-ID: <43764A25.10700@weitershausen.de> Florent Guillaume wrote: >> Well, Zope 3 doesn't care that Apache has authenticated your user. It >> doesn't see that. If you want the Zope 3 security system to interact >> with Apache's, here's a suggestion (not sure if it'll actually work): >> >> - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using >> the "E" flag at the end of rewrite rule: >> >> [P,L,E=REMOTE_USER:%{REMOTE_USER}] > > > Will that really work? env variables are only useful in CGI mode, but > proxying doesn't involve CGI. Rather I'd advise using additional > parameters to the URL, like we do here for Zope 2 for instance: > > http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf Ah, yes. I thought of this initially but found the env way to be cleaner, simply assuming that mod_rewrite would pass the current env along on the proxy request. It seems it doesn't. Good example config, by the way. >> - Have a custom ICredentialsPlugin that's simply looks at this env >> variable in the request for the log-in credentials. To challenge the >> user for authentication, it would simply use the same authentication >> realm as set in the apache.conf, so that it gets picked up by Apache >> when the user provides the credentials. > > > And this plugin would have to get the credentials from the URL instead > of the env variable. I wish apache had a proper way to add request > headers during proxying... Yup and yup. Philipp From pkoppatz at web.de Sat Nov 12 16:06:31 2005 From: pkoppatz at web.de (Peter Koppatz) Date: Sat Nov 12 16:06:43 2005 Subject: [Zope3-Users] error on start Message-ID: <6895AD0C-C405-4AFC-94B9-FB6D6948EB31@web.de> Hello, I performed the following steps: svn co svn://svn.zope.org/repos/main/Zope3/trunk Zope3 (At revision 40077.) cd Zope3 /usr/local/bin/python2.4 setup.py -q build_ext -i cp sample_principals.zcml principals.zcml /usr/local/bin/python2.4 z3.py and I got the following output: AttributesNSImpl(newattrs, qnames)) File "/Users/peter/programme/Zope3/src/zope/configuration/ xmlconfig.py", line 222, in startElementNS self.context.begin(name, data, info) File "/Users/peter/programme/Zope3/src/zope/configuration/ config.py", line 550, in begin self.stack.append(self.stack[-1].contained(__name, __data, __info)) File "/Users/peter/programme/Zope3/src/zope/configuration/ config.py", line 849, in contained return RootStackItem.contained(self, name, data, info) File "/Users/peter/programme/Zope3/src/zope/configuration/ config.py", line 717, in contained factory = self.context.factory(self.context, name) File "/Users/peter/programme/Zope3/src/zope/configuration/ config.py", line 496, in factory raise ConfigurationError("Unknown directive", ns, n) zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/ peter/programme/Zope3/site.zcml", line 13.2-13.40 ZopeXMLConfigurationError: File "/Users/peter/programme/Zope3/ securitypolicy.zcml", line 11.2 ConfigurationError: ('Unknown directive', u'http:// namespaces.zope.org/zope', u'role') What is the missing part? Peter From hangzhiyun at gmail.com Sat Nov 12 18:48:40 2005 From: hangzhiyun at gmail.com (Simon Hang) Date: Sat Nov 12 18:48:41 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <43764A25.10700@weitershausen.de> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de> Message-ID: <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com> Thanks for the help. I feel not comfortable to put the username in URL. User may be able to bypass the authentication and direct access zope with username in URL. And that's true, Apache can pass environment variable via mod_rewrite. What's a pity. Now the only solution I found is only working in Apache2 not 1.3. I can use mod_header. requestheader can add http header to request before mod_rewrite pass it to zope. I can put REMOTE_USER in http header and zope will be able to pick it up. User will still be able to bypass the check if they can use special web browser which can add http header. But at least with standard IE & Firefox, this method will be safe. But I'm still using Apache 1.3. Above solution can't apply. :( I'm giving up. Maybe just use some browser script to submit current username to CredentialsPlugin. This will be easy, just write my own version of loginform.pt, and that will work. But it's ugly. Thanks, Simon On 11/13/05, Philipp von Weitershausen wrote: > > Florent Guillaume wrote: > >> Well, Zope 3 doesn't care that Apache has authenticated your user. It > >> doesn't see that. If you want the Zope 3 security system to interact > >> with Apache's, here's a suggestion (not sure if it'll actually work): > >> > >> - Have Apache forward the REMOTE_USER CGI env variable, e.g. by using > >> the "E" flag at the end of rewrite rule: > >> > >> [P,L,E=REMOTE_USER:%{REMOTE_USER}] > > > > > > Will that really work? env variables are only useful in CGI mode, but > > proxying doesn't involve CGI. Rather I'd advise using additional > > parameters to the URL, like we do here for Zope 2 for instance: > > > > http://svn.nuxeo.org/trac/pub/file/CMFNtlmSso/trunk/doc/vhost_sso.conf > > Ah, yes. I thought of this initially but found the env way to be > cleaner, simply assuming that mod_rewrite would pass the current env > along on the proxy request. It seems it doesn't. > > Good example config, by the way. > > >> - Have a custom ICredentialsPlugin that's simply looks at this env > >> variable in the request for the log-in credentials. To challenge the > >> user for authentication, it would simply use the same authentication > >> realm as set in the apache.conf, so that it gets picked up by Apache > >> when the user provides the credentials. > > > > > > And this plugin would have to get the credentials from the URL instead > > of the env variable. I wish apache had a proper way to add request > > headers during proxying... > > Yup and yup. > > Philipp > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051113/593d9355/attachment.htm From philipp at weitershausen.de Sun Nov 13 00:24:57 2005 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sun Nov 13 00:23:58 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de> <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com> Message-ID: <4376CE29.8060201@weitershausen.de> Simon Hang wrote: > Thanks for the help. > > I feel not comfortable to put the username in URL. User may be able to > bypass the authentication and direct access zope with username in URL. True, it's not the nicest solution. But you could make it safer by first stripping the according request variable from the QUERY_STRING. mod_rewrite is quite powerful in that respect. > Now the only solution I found is only working in Apache2 not 1.3. I can > use mod_header. requestheader can add http header to request before > mod_rewrite pass it to zope. I can put REMOTE_USER in http header and > zope will be able to pick it up. User will still be able to bypass the > check if they can use special web browser which can add http header. But > at least with standard IE & Firefox, this method will be safe. Here you could strip any REMOTE_USER header or request variable from the incoming request so that the REMOTE_USER that Zope sees is always the one set by Apache, or none (even if the browser client tried to supply its own one). > But I'm still using Apache 1.3. Above solution can't apply. :( Too bad, Apache 2.0 is quite nice. Philipp From Sven.Schomaker at Linie-M.de Mon Nov 14 02:55:15 2005 From: Sven.Schomaker at Linie-M.de (Sven Schomaker) Date: Mon Nov 14 02:53:38 2005 Subject: [Zope3-Users] Maybe bug in pagetemplate parser? Message-ID: <1131954915.6777.85.camel@localhost.localdomain> Hi all, currently I'm trying to output a pretty tiny code snippet in a page template, but the compilation fails due to a nesting error. It seems as if the pt engine erroneously parses the following snippet, complaining about a nesting error on the closing div: It also fails if I declare the whole script content as XML CDATA section using Message-ID: <200511141018231.SM01236@mobile02> Hi Sven > -----Original Message----- > From: zope3-users-bounces@zope.org > [mailto:zope3-users-bounces@zope.org] On Behalf Of Sven Schomaker > Sent: Monday, November 14, 2005 8:55 AM > To: zope3-dev; Zope3 users list > Subject: [Zope3-Users] Maybe bug in pagetemplate parser? > > Hi all, > > currently I'm trying to output a pretty tiny code > snippet in a page template, but the compilation > fails due to a nesting error. It seems as if the > pt engine erroneously parses the following snippet, > complaining about a nesting error on the closing > div: > > > > > It also fails if I declare the whole script > content as XML CDATA section using > Is this is user error or a parser bug? Some > help is very appreciated:-) This is a bug, please add a issue to the bugtracker! The parser engine tries to interprete the
tag. I guess the normal hacks used in onther script languages will work. Try this: > Greetings Sven > > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > From jamesallwyn at gmail.com Mon Nov 14 05:03:35 2005 From: jamesallwyn at gmail.com (James Allwyn) Date: Mon Nov 14 05:03:37 2005 Subject: [Zope3-Users] Complex Adapter Requirements - Named Adapters? In-Reply-To: <200511120819.13727.srichter@cosmos.phy.tufts.edu> References: <36d212000510301116v1f2ca3d3v@mail.gmail.com> <200511120819.13727.srichter@cosmos.phy.tufts.edu> Message-ID: <36d212000511140203s5e841636y@mail.gmail.com> On 12/11/05, Stephan Richter wrote: > On Sunday 30 October 2005 14:16, James Allwyn wrote: > > One thought I had, was creating an interface IStandard, with > > attributes like "meetsstandard" and "nameofstandard", and then > > subclass this, e.g. to IAccreditationScheme and INationalCode (where > > "Accreditation Scheme" and "National Code" are the names of two of the > > standards). But I get a little stuck conceptually at the point where I > > try to handle, for example, the fact that for some ISharedHouse > > objects, IAccreditationScheme would be suitable, whilst for others it > > wouldn't, because of their location. In fact it's likely that in the > > future we will need to recognise two or more standards for a > > particular accommodation type (so IAccreditationScheme and IHouseCheck > > chould both apply to ISharedHouse objects, in differect areas). > > This is not such a complex case as you think. > > If you register an adapter from ISharedHouse to IAccreditationScheme then it > will be only available for this interface and not for IAccommodation in > general. I would even write a specific IAccreditationScheme for every scheme > you support; thus you do not even need named adapters. OK, so by targeting the registration of the adapter I can make sure each adapter is not available for types of accommodation object that it would not apply to. I'm with you on that. My thoughts about named adapters were related to the 'other side of the coin', where I have more than one scheme (and hence adapter) that would apply to one type of accommodation (for example the schemes represented by IAccreditationScheme and IHouseCheck would both apply to ISharedHouses). I guess what I want is to have both IHouseCheck and IAccreditationScheme available for ISharedHouses *in general*, and to select either (or none) for a given *instance* of ISharedHouse. Are named adapters the way to go for this requirement, or am I not understanding some mechanism in Stephan's suggestion that makes this possible without invoking that level of complexity? Thanks for the guidance so far. James From johanc at easypublisher.com Mon Nov 14 06:44:44 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Mon Nov 14 06:44:42 2005 Subject: [Zope3-Users] Getting the content object from a widget Message-ID: <437878AC.9090703@easypublisher.com> Hi, I'm having trouble in finding a consistent way to locate the content object from a widget (view) class. (This is when using complex widgets like the ObjectWidget.) Some background. I'm trying to implement a ImageField and a FileField so I can add fields for Image and File objects to my schema. After experimenting with the IObject field for a while I've done the following things (I've only done the Image part, but files should be a matter of cut&paste): - Created an ImageField class (I basically just copied the Object implementation) - I've created an ImageWidget class (derived from ObjectWidget) and registered it as a view for the ImageField. - I've also added a custom IImage interface and Image implementation, because I want to add fields to the IImage. (I'm guessing that I "should" use annotations, but it's not gone happen in a long while, this is consuming far too much of my time as it is.) This works quite well (after endless fight with Z3 too understand how the schema system works). One of the hardest problem has been how to get information about my Image object from the view. In the ObjectWidget view the context is the field, the field in it's turn as a context that is the content object. So what I've done so far is just to climb up the context tree to get to an object not defining a context (and that has been the content object I'm after, but this strategy doesn't work when adding a content object for instance, because there isn't a content object too be found.) So I'm looking for a good generic way to find the content object (or None if it doesn't exist). Regards, Johan PS. I've also noticed that to be able to make web requests to the image object I need to specify the __name__ attribute when setting up the the field (just so that you know). Fields normaly lack the Location interfaces so one needs to figure out the location manually. Also fields need special traversers to be traversable from the web, it's a consequence of the explicit nature of Z3 I guess.) -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Mon Nov 14 08:43:33 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Mon Nov 14 08:43:31 2005 Subject: [Fwd: Re: [Zope3-Users] Getting the content object from a widget] Message-ID: <43789485.8070101@easypublisher.com> -------- Original Message -------- Subject: Re: [Zope3-Users] Getting the content object from a widget Date: Mon, 14 Nov 2005 14:14:02 +0100 From: Johan Carlsson To: Johan Carlsson References: <437878AC.9090703@easypublisher.com> Johan Carlsson wrote: Well, I extended the search loop to look like this: def _getParent(self): curr=self while hasattr(curr, 'context') and \ (IField.providedBy(curr) or \ IInputWidget.providedBy(curr)): curr=curr.context return curr Which means that it returnes the first non field non widget it finds. It kind of does the trick. One would have though I could just use: def _getParent(self): field=self.context content=field.context return content But there is situations where a widget has a widget as it's context. For instance the default ObjectWidget uses an ObjectWidgetView as it's view class and when ObjectWidget sets it up it supplies context=self (e.g. a widget as context). I don't know why it's designed this way, in my ImageWidget, which is based on ObjectWidget, I've cut out the ObjectWidgetView and does every thing in the first view class. I did need to change the page template to use view instead of context but othervice it works ok (so far). If anyones interested I can make the ImageField code available. Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From jsmith030416 at yahoo.co.uk Mon Nov 14 16:00:04 2005 From: jsmith030416 at yahoo.co.uk (John Smith) Date: Mon Nov 14 16:00:06 2005 Subject: [Zope3-Users] Renaming folder causes NotFoundError Message-ID: <20051114210004.1503.qmail@web26511.mail.ukl.yahoo.com> At the highest level of my content pages (ie the blue pages in the zmi) i had a folder called 'myfolder'. This folder contained my test objects ( the Car and Journey example from my previous post). The data was trivial and no loss to anyone. I'm still experimenting. Anyhow, I tried to rename the folder to something more descriptive, and Zope3 keeps coming up with the "There has been a system error" page, and on the terminal it say s NotFoundError, 'myfolder'. I have gone into the ZODB directly, and the root['Application'] item contains the folder and its contents, but with the new name 'MileageTracker'. Firstly, I was a bit surprised that ZopeX3-3.0.0 did this on a simple rename, although possibly it has something to do with the contents of 'myfolder' which where my own attempts at creating containers. But now I'm intrigued because somewhere inside my ZODB the system has remembered the old folder name even the root['Application'] mapping object only seems to know the object by its new name. I have tried renaming the object back to its original name, and committing the transaction, but that does not work, an incremented integer seems to be added to the name. As I said, I'm not bothered about the data itself, it is just that I would like to use Zope3 in a production environment and I'd like to know how to recover from this type of thing. I've tried debugging the source by putting in print statements and as best I can tell, the magic is somewhere around line 604 in zope.app.registration.registration.py where "Adapters" is the supplied name and a serviceregistration object is createed whose componentPath attributes is 'myfolder'. From where in the ZODB is it reading this value! Any help gratefully received, John ___________________________________________________________ Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/ From biggers at utsl.com Mon Nov 14 16:47:26 2005 From: biggers at utsl.com (Mark R. Biggers) Date: Mon Nov 14 16:47:29 2005 Subject: [Zope3-Users] how to run "all tests" for Z3 svn-trunk (bundle)? Message-ID: <17273.1518.441142.720283@dexter.saiph.com> Hello, I had to munge top-level 'test.py' to get it to work for the Z3.1 release 'tar.gz' bundle. It worked fine after that, and all the unit-tests ran clean - impressive. Now, as you can see below, from this build-recipe, that that's not gonna cut it. I've nosed all about the Z3 svn-trunk dirs and files, trying to get a handle on how to run all the Z3 svn-trunk tests. If anyone has any ideas, that would be most helpful. thank you, ----mark -------------------------------- # Sun Nov 13 20:28:30 2005, Mon Nov 14 15:16:54 2005 ZSRC=/tools/zope/Zope3/Build ## there is no 3.2 release, yet... ZVERS=Zope-3.2.0a1 ZINS=/usr/local/Zope/${ZVERS} LOG=$ZSRC/${ZVERS}.log py=/usr/bin/python2.4 cd $ZSRC svn checkout svn://svn.zope.org/repos/main/Zope3/trunk Zope3_svn cd Zope3_svn svn co svn://svn.zope.org/repos/main/zpkgtools/trunk zpkgtools cd releases ## zpkg attempts a SVN checkout, by rel-name... ## ../../zpkgtools/bin/zpkg -r Zope-3.2.0a1 -C Zope.cfg Zope ../zpkgtools/bin/zpkg -C Zope.cfg Zope mv Zope-0.0.0.tgz $ZSRC cd $ZSRC mv -f $LOG $LOG.prev /bin/rm -rf ${ZVERS} tar zxf Zope-0.0.0.tgz mv Zope-0.0.0 $ZVERS cd $ZSRC/$ZVERS # CONFIGURE: read if you want more details... less README.txt ./configure --help env OPT='-O3 -Wall -march=i686' \ ./configure --prefix=$ZINS \ --force \ --with-python=$py \ >> $LOG 2>&1 # BUILD make CFLAGS='-O3 -Wall -march=i686' >> $LOG 2>&1 & # TEST - !! no go !! for Z3-trunk ... make CFLAGS='-O3 -Wall -march=i686' test >> $LOG 2>&1 & # cut 'n paste session of 'test.py' contents amdahl:398 $ python2.4 Python 2.4.1 (#2, May 5 2005, 11:32:06) [GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys, os >>> from distutils.util import get_platform >>> PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3]) >>> print PLAT_SPEC linux-i686-2.4 >>> here = os.path.dirname(os.path.realpath(__file__)) Traceback (most recent call last): File "", line 1, in ? NameError: name '__file__' is not defined >>> here = os.path.dirname(os.path.realpath('test.py')) >>> print here /mnt/hdc8/ZOPE/Zope-3.2.0a1 >>> lib = os.path.join(here, "build", "lib." + PLAT_SPEC) >>> print lib /mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4 >>> sys.path.append(lib) >>> print sys.path ['', '/tools/python/dist-py', '/mnt/hdc8/ZOPE/Zope-3.2.0a1', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/site-python', '/mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4', '/mnt/hdc8/ZOPE/Zope-3.2.0a1/build/lib.linux-i686-2.4'] >>> import zope.app.testing.test Traceback (most recent call last): File "", line 1, in ? ImportError: No module named test > From chris at simplistix.co.uk Tue Nov 15 06:02:06 2005 From: chris at simplistix.co.uk (Chris Withers) Date: Tue Nov 15 06:02:12 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <4376CE29.8060201@weitershausen.de> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de> <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com> <4376CE29.8060201@weitershausen.de> Message-ID: <4379C02E.7090201@simplistix.co.uk> Philipp von Weitershausen wrote: > True, it's not the nicest solution. But you could make it safer by first > stripping the according request variable from the QUERY_STRING. > mod_rewrite is quite powerful in that respect. Is it just me, or should a deep feeling of uneasiness accompany the extraction of authentication credentials from a query string? ;-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From dman at dman13.dyndns.org Tue Nov 15 09:24:52 2005 From: dman at dman13.dyndns.org (Derrick Hudson) Date: Tue Nov 15 09:24:51 2005 Subject: [Zope3-Users] Re: apache as zope3's frontend and NTLM In-Reply-To: <4379C02E.7090201@simplistix.co.uk> References: <8a8e599a0511092048t2c93ccbg4280e9c1a65c70e3@mail.gmail.com> <4376425A.9050807@weitershausen.de> <4376443B.7060809@nuxeo.com> <43764A25.10700@weitershausen.de> <8a8e599a0511121548g3728ef4fl74a5833b5da428dc@mail.gmail.com> <4376CE29.8060201@weitershausen.de> <4379C02E.7090201@simplistix.co.uk> Message-ID: <20051115142452.GA27021@dman13.dyndns.org> On Tue, Nov 15, 2005 at 11:02:06AM +0000, Chris Withers wrote: | Philipp von Weitershausen wrote: | >True, it's not the nicest solution. But you could make it safer by first | >stripping the according request variable from the QUERY_STRING. | >mod_rewrite is quite powerful in that respect. | | Is it just me, or should a deep feeling of uneasiness accompany the | extraction of authentication credentials from a query string? ;-) It's not just you. :-) The hole this creates is: someone makes an HTTP request directly to Zope bypassing apache altogether. This request could simply present any username desired. Some ways to limit the exposure of the hole is to have zope listen on the loopback interface only. Then prevent all shell access on the system. The only remaining hole at this point is if someone can abuse some other network-accessible service and coerce it into making the request (or to open a back door). -D -- Bugs come in through open windows. Keep Windows shut! www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051115/6209f07f/attachment.bin From antonio.beamud at linkend.net Tue Nov 15 15:03:08 2005 From: antonio.beamud at linkend.net (Antonio Beamud Montero) Date: Tue Nov 15 15:03:15 2005 Subject: [Zope3-Users] Validation of schemas? In-Reply-To: <200511120737.11931.srichter@cosmos.phy.tufts.edu> References: <436A0C11.1060101@4js.com.au> <200511120737.11931.srichter@cosmos.phy.tufts.edu> Message-ID: <1132084989.4754.24.camel@homer.linkend.net> El s?b, 12-11-2005 a las 07:37 -0500, Stephan Richter escribi?: > On Thursday 03 November 2005 08:09, Adam Summers wrote: > > This will do the validation on add. But how do I get the schema to be > > validated on an > > update to it? > > You could write your own property class that does the invariant checks. See > > zope.schema.fieldproperty.FieldProperty > > In fact, if you feel heroic, you should just add the invariance check to that > code and check it in! That would be a great feature.! If I define a field in a schema like: groups = List(title=u'Groups', default=[], description=u'Groups of the contacts', value_type=TextLine(title=u"Group")) and in the class implementing this interface: groups = FieldProperty(icontact.IContact['groups']) The problem is how to define that groups is a PersistentList. If I define the default schema as "default=PersistentList()" an error happens... ConfigurationError: ('Invalid value for', 'interface', "([], )") Thanks. From gnotari at linkgroup.it Wed Nov 16 06:31:37 2005 From: gnotari at linkgroup.it (gnotari@linkgroup.it) Date: Wed Nov 16 06:29:01 2005 Subject: [Zope3-Users] Add menu Message-ID: We're redefining the container views in the project we're working at. We have not yet redefined the skin (more on that in a later mail :), and we're still using rotterdam. We're a little at loss because the Add menu disappeared from the pages, though, and we can't make out the logic behind its behaviour. Can someone shed some light on the logic behing the display of this menu? Ciao Guido From andreas at work.de Wed Nov 16 10:13:23 2005 From: andreas at work.de (Andreas Elvers) Date: Wed Nov 16 10:21:08 2005 Subject: [Zope3-Users] Re: sqlos, sites and local utilities In-Reply-To: <200511120805.22071.srichter@cosmos.phy.tufts.edu> References: <200511120805.22071.srichter@cosmos.phy.tufts.edu> Message-ID: Stephan Richter wrote: > On Tuesday 08 November 2005 05:38, Andreas Elvers wrote: [...] >>Has anyone yet tried sqlos with database connections created as local >>utilities ? At one point sqlos tries to get the utility in connection.py >>Line 88. >> >> newconn = zapi.queryUtility(IZopeDatabaseAdapter, name, >> default=None, >> context=context) >> >>The context points to a sqlobject instance. The problem is that these >>instances seem to have no parent and thus will fail the lookup my local >>utility and will raise an 'NoneType' object is not callable error later >>in the code when trying to adapt. >> >>When you try the sqlos example everything is fine, since the database >>connection is defined in configure.zcml as a global utility. >> >>My current idea is to expose the enclosing folder as a context to query >>utility. But I don't know if setting references in sqlobject instances >>is such a great idea. > > > If the sqlobject instance does not have a parent, then that's bad. It probably > does not have a parent, because it is usually wrapped using a location proxy, > which is lost inside a method. I think the smart thing to do here would be > what you suggested or to write a subclass of sqlobject that implements > ILocation. Hi, While digging a bit depper into my problem I found out, that implementing ILocation will not do the trick, since the mentioned exception is caused by a factory call, and a factory will never have a __parent__ or am I totally wrong here ? Anyway I have created a functional unit test to demonstrate the problem. In fact the unit test shows that sqlos will always lookup global utilities and never local utilities. Here is the test. It will fail in the last block on "testsite['personcontainer'] = personcontainer". Regards - Andreas -------------- next part -------------- First we need to set up some folder structure to set up a site. >>> from zope.app import zapi >>> from zope.app.folder import Folder >>> from zope.app.container.contained import Contained >>> from sqlos.testing.sampleperson import SamplePersonContainer, createTestingTables >>> from zope.app.component import interfaces as componentInterfaces >>> from zope.app.component.site import LocalSiteManager,SiteManagerContainer >>> from sqlos.container import SQLObjectContainer >>> class LocalSitePersonContainer(SamplePersonContainer, SiteManagerContainer, Contained): ... pass >>> root = getRootFolder() >>> testsite = Folder() >>> root['testsite'] = testsite >>> componentInterfaces.ISite.providedBy(testsite) False >>> sm = LocalSiteManager(testsite) >>> testsite.setSiteManager(sm) >>> componentInterfaces.ISite.providedBy(testsite) True Now we set up a local database utility >>> from zope.app.rdb.interfaces import IZopeDatabaseAdapter >>> from zope.app.component.interfaces.registration import ActiveStatus,InactiveStatus >>> from sqlos.testing.testdb import SQLiteda >>> from zope.app.utility import UtilityRegistration >>> dbAdapter = SQLiteda(u'dbi://:memory:') >>> reg = UtilityRegistration('sqlite',IZopeDatabaseAdapter,dbAdapter) >>> default = sm['default'] >>> key = default.registrationManager.addRegistration(reg) >>> zapi.traverse(default.registrationManager, key).status = ActiveStatus >>> localUtility = sm.queryUtility(IZopeDatabaseAdapter,'sqlite') >>> localUtility >>> localUtility is dbAdapter True Ok. Now we have a site in root/testsite with a registered sqlite adapter. We make sure that our localUtility is not identical to the global sqlite utility that has been registered through ftesting.zcml. >>> gsm = zapi.getGlobalSiteManager() >>> globalUtility = gsm.queryUtility(IZopeDatabaseAdapter,'sqlite') >>> globalUtility is not localUtility True Now we populate testsite with data. We do this by using direct SQL, because there is currently no support for local sites in testcode. >>> from zope.component.interfaces import ISiteManager >>> cursor = localUtility().cursor() >>> cursor.execute( ... '''create table dog ( ... id integer primary key, ... fullname varchar(50) not null, ... owner varchar(20) not null)''') >>> cursor.execute( ... '''create table sample_isolated_person ( ... id integer primary key, ... domains text, ... fullname varchar(50) not null, ... username varchar(20) not null, ... password varchar(20) not null)''') >>> cursor.execute( ... '''create table sample_person ( ... id integer primary key, ... fullname varchar(50), ... username varchar(20), ... password varchar(20))''') Now that we have setup database tables we should be able to create the personcontainer without errors. >>> personcontainer = LocalSitePersonContainer() >>> testsite['personcontainer'] = personcontainer >>> localUtility2 = ISiteManager(personcontainer).queryUtility(IZopeDatabaseAdapter,'sqlite') >>> localUtility2 is localUtility True From eucci.group at gmail.com Wed Nov 16 15:38:37 2005 From: eucci.group at gmail.com (Jeff Shell) Date: Wed Nov 16 16:07:48 2005 Subject: [Zope3-Users] Denying permissions for 'everybody' - which principals to use? Message-ID: <88d0d31b0511161238i6f34db7bhd571cc2077bad81c@mail.gmail.com> For a simple content management system we're building, I've started working on a simple security interface which is supposed to enable / disable 'view' (and dublin core view). The setup that I have - or want to have - is a UI that says: Who can see this item? - Everybody - Nobody (grants view to zope.Manager and our.cms.ContentEditor roles only, for now) - Specific Users If 'specific users' is selected, users from the local principal folder are listed for selection. I seem to have my implementation working somewhat - I can go to the normal Grant screen and see specific users have 'Allow' checked for the view permissions managed by my sharing view. And 'zope.anybody' is denied: >>> pprint(settingsForObject(jobs)) [(u'jobs', {'principalPermissions': [{'permission': 'zope.View', 'principal': u'brcmscms.user2', 'setting': PermissionSetting: Allow}, {'permission': 'zope.View', 'principal': 'zope.anybody', 'setting': PermissionSetting: Deny}, {'permission': 'zope.app.dublincore.view', 'principal': u'brcmscms.user2', 'setting': PermissionSetting: Allow}, {'permission': 'zope.app.dublincore.view', 'principal': 'zope.anybody', 'setting': PermissionSetting: Deny}], 'principalRoles': [], 'rolePermissions': []}), ... When I traverse to the object in question in another browser, I get prompted for login. But if I supply different credentials (ie, one of the users not Allowed explicit view privileges), I'll still see the page. Am I denying the right person here? Globally, the permission is set up as follows: {'permission': 'zope.View', 'role': 'zope.Anonymous', 'setting': PermissionSetting: Allow}, Should I Deny access to the zope.Anonymous role? To the Everybody group? To the Unauthenticated Group? Right now, I only deny the principal: def denyUnauthenticated(self): """ Explicitly deny the view permissions for unauthenticated users. """ anybody = zapi.getUtility(IUnauthenticatedPrincipal).id pmanager = IPrincipalPermissionManager(self.context) for permission in self._view_permissions: pmanager.denyPermissionToPrincipal(permission, anybody) This is in Zope 3.1.0 on Python 2.3.5 The point of this simple 'sharing' interface is to let our customer have a press folder that they can restrict access to by allowing only limited people in to it. We're trying to keep the user interface as simple as possible. From jsmith030416 at yahoo.co.uk Wed Nov 16 18:21:42 2005 From: jsmith030416 at yahoo.co.uk (John Smith) Date: Wed Nov 16 18:21:44 2005 Subject: [Zope3-Users] Zope3 broke when renaming folder Message-ID: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com> Dear Zope users, Does anyone have a map as to where Zope3 stores its data inside the ZODB? the application data is in .root()['Application'] and I can see my folders there. But what about the registration processes: is there some mapping somewhere inside the ZODB that I can edit to get my zope to restart? What happened was I renamed a folder and zope3 had an error. Renaming the folder to its previous value in ZODB does not seem to have any effect, and the system refuses to let me do anything: undo, delete etc. At this point, my only option, is to delete Data.fs and start again, but this seems a bit nuclear, for what must surely be a bit of ZODB editing, if I but knew where to look. Thanks, John ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com From td at yoma.com.au Wed Nov 16 18:35:49 2005 From: td at yoma.com.au (Tom Dossis) Date: Wed Nov 16 18:33:10 2005 Subject: [Zope3-Users] Zope3 broke when renaming folder In-Reply-To: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com> References: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com> Message-ID: <437BC255.5050904@yoma.com.au> John Smith wrote: > Dear Zope users, > > Does anyone have a map as to where Zope3 stores its > data inside the ZODB? > > the application data is in > .root()['Application'] and I can see my folders > there. > > But what about the registration processes: is there > some mapping somewhere inside the ZODB that I can edit > to get my zope to restart? > > What happened was I renamed a folder and zope3 had an > error. Renaming the folder to its previous value in > ZODB does not seem to have any effect, and the system > refuses to let me do anything: undo, delete etc. At > this point, my only option, is to delete Data.fs and > start again, but this seems a bit nuclear, for what > must surely be a bit of ZODB editing, if I but knew > where to look. Hi John, You seem to be accessing the zodb directly. Have you already tried via zope3? Just in case you haven't look at 'Accessing objects (without the debugger)' in doc/DEBUG.txt From fg at nuxeo.com Wed Nov 16 20:38:39 2005 From: fg at nuxeo.com (Florent Guillaume) Date: Wed Nov 16 20:38:42 2005 Subject: [Zope3-Users] Re: Zope3 broke when renaming folder In-Reply-To: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com> References: <20051116232142.28802.qmail@web26509.mail.ukl.yahoo.com> Message-ID: <437BDF1F.2050901@nuxeo.com> John Smith wrote: > Dear Zope users, > > Does anyone have a map as to where Zope3 stores its > data inside the ZODB? > > the application data is in > .root()['Application'] and I can see my folders > there. > > But what about the registration processes: is there > some mapping somewhere inside the ZODB that I can edit > to get my zope to restart? > > What happened was I renamed a folder and zope3 had an > error. Renaming the folder to its previous value in > ZODB does not seem to have any effect, and the system > refuses to let me do anything: undo, delete etc. At > this point, my only option, is to delete Data.fs and > start again, but this seems a bit nuclear, for what > must surely be a bit of ZODB editing, if I but knew > where to look. We can't help you without the precise circumstances, the error and the traceback. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com From fdrake at gmail.com Thu Nov 17 00:01:55 2005 From: fdrake at gmail.com (Fred Drake) Date: Thu Nov 17 00:01:56 2005 Subject: [Zope3-dev] RE: [Zope3-Users] Maybe bug in pagetemplate parser? In-Reply-To: <200511141018231.SM01236@mobile02> References: <1131954915.6777.85.camel@localhost.localdomain> <200511141018231.SM01236@mobile02> Message-ID: <9cee7ab80511162101t6583d75ck3170e189b3bd50d3@mail.gmail.com> On 11/14/05, Roger Ineichen wrote: > This is a bug, please add a issue to the bugtracker! > The parser engine tries to interprete the
tag. Though this is most certainly a contentious feature, this is not a bug in the parser, but a bug in the template itself. The parser is a bit stricter than most browsers. If you don't agree, please read the HTML 4.01 specification very carefully before following up; this has been discussed to death many times. > I guess the normal hacks used in onther script languages will > work. Try this: > > No, that won't work; the *template* still has the same bug. Try this: (Note that the break introduced in the script source is between the "<" and the next character.) -Fred -- Fred L. Drake, Jr. "Society attacks early, when the individual is helpless." --B.F. Skinner From johanc at easypublisher.com Thu Nov 17 06:52:55 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 06:52:52 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? Message-ID: <437C6F17.4060300@easypublisher.com> Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 07:05:51 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:05:46 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C6F17.4060300@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> Message-ID: <437C721F.30709@easypublisher.com> Johan Carlsson wrote: > > Anyone had any success with ZCatalog in Zope 3? > > I'm trying to add indexes to the catalog > but I get an ComponentLookupError: > > Error type: zope.component.interfaces.ComponentLookupError > Error object: (, '') > > I'm not sure how to setup the IntIds utility, what I've done so far > is just add one and give it an random name. My bad, ComponentLookupError is what I get if I don't have setup an IntIds utility, if I have set one up (currently mine is named IntIds in the tools folder of the root site manager) I get: Error type: zope.app.keyreference.interfaces.NotYet Error object: -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From vladdrac at gmail.com Thu Nov 17 07:17:53 2005 From: vladdrac at gmail.com (Ivo van der Wijk) Date: Thu Nov 17 07:17:54 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C6F17.4060300@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> Message-ID: On 11/17/05, Johan Carlsson wrote: > > Anyone had any success with ZCatalog in Zope 3? > > I'm trying to add indexes to the catalog > but I get an ComponentLookupError: > > Error type: zope.component.interfaces.ComponentLookupError > Error object: (, '') > > I'm not sure how to setup the IntIds utility, what I've done so far > is just add one and give it an random name. > I managed to create a working Catalog/IntId setup in cubic, along with actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). I can't remember details right now (been to long), but you could take a peak at the code at https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ Specifically, https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py and https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py might give you some directions. Regards, Ivo -- Drs. I.R. van der Wijk / m3r Consultancy B.V. Linux/Python/Zope/Plone and Open Source solutions PO-box 51091, 1007 EB Amsterdam, The Netherlands Email: ivo m3r.nl From j.kartnaller at robotech.at Thu Nov 17 07:14:27 2005 From: j.kartnaller at robotech.at (j.kartnaller) Date: Thu Nov 17 07:18:56 2005 Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C721F.30709@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> Message-ID: Johan Carlsson wrote: > Johan Carlsson wrote: > >> >> Anyone had any success with ZCatalog in Zope 3? >> >> I'm trying to add indexes to the catalog >> but I get an ComponentLookupError: >> >> Error type: zope.component.interfaces.ComponentLookupError >> Error object: (, '') The IntId utility must not have an name as you see in the message. Just rename your IntId utility and your up and running. >> >> I'm not sure how to setup the IntIds utility, what I've done so far >> is just add one and give it an random name. > > > My bad, ComponentLookupError is what I get if I don't have setup an > IntIds utility, if I have set one up (currently mine is named IntIds > in the tools folder of the root site manager) I get: > > Error type: zope.app.keyreference.interfaces.NotYet > Error object: > > J?rgen From johanc at easypublisher.com Thu Nov 17 07:26:38 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:26:35 2005 Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> Message-ID: <437C76FE.5020705@easypublisher.com> j.kartnaller wrote: > Johan Carlsson wrote: > >> Johan Carlsson wrote: >> >>> >>> Anyone had any success with ZCatalog in Zope 3? >>> >>> I'm trying to add indexes to the catalog >>> but I get an ComponentLookupError: >>> >>> Error type: zope.component.interfaces.ComponentLookupError >>> Error object: (, '') > > The IntId utility must not have an name as you see in the message. > Just rename your IntId utility and your up and running. The name doesn't seem to have any importance (see my correction). Also (afaik) it's not possible to add a object with an empty name through the ZMI. Thanks anyway, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 07:28:10 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:28:06 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> Message-ID: <437C775A.6000500@easypublisher.com> Ivo van der Wijk wrote: > On 11/17/05, Johan Carlsson wrote: > >>Anyone had any success with ZCatalog in Zope 3? >> >>I'm trying to add indexes to the catalog >>but I get an ComponentLookupError: >> >>Error type: zope.component.interfaces.ComponentLookupError >>Error object: (, '') >> >>I'm not sure how to setup the IntIds utility, what I've done so far >>is just add one and give it an random name. >> > > > I managed to create a working Catalog/IntId setup in cubic, along with > actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). > > I can't remember details right now (been to long), but you could take > a peak at the code at > > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ > > Specifically, > > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py > and > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py > > might give you some directions. Excellent, Probably exactly what I need :-) I'll have a look. Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 07:32:05 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:32:04 2005 Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> Message-ID: <437C7845.3080203@easypublisher.com> j.kartnaller wrote: > Johan Carlsson wrote: > >> Johan Carlsson wrote: >> >>> >>> Anyone had any success with ZCatalog in Zope 3? >>> >>> I'm trying to add indexes to the catalog >>> but I get an ComponentLookupError: >>> >>> Error type: zope.component.interfaces.ComponentLookupError >>> Error object: (, '') > > The IntId utility must not have an name as you see in the message. > Just rename your IntId utility and your up and running. No I was infact quite worng, it is possible to change the ZMI, just that one has too do it though the Site Manager not the contents view. And it solves the problem too. Thanks a bunch! Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 07:33:26 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:33:22 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> Message-ID: <437C7896.1060101@easypublisher.com> Ivo van der Wijk wrote: > On 11/17/05, Johan Carlsson wrote: > >>Anyone had any success with ZCatalog in Zope 3? >> >>I'm trying to add indexes to the catalog >>but I get an ComponentLookupError: >> >>Error type: zope.component.interfaces.ComponentLookupError >>Error object: (, '') >> >>I'm not sure how to setup the IntIds utility, what I've done so far >>is just add one and give it an random name. >> > > > I managed to create a working Catalog/IntId setup in cubic, along with > actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). > > I can't remember details right now (been to long), but you could take > a peak at the code at > > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ > > Specifically, > > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py > and > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py > > might give you some directions. The code you gave me shows the same showed the same problem as J?rgen pointied out, the IntId needs to have '' as id. Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 07:34:12 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 07:34:08 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C6F17.4060300@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> Message-ID: <437C78C4.4030406@easypublisher.com> And thanks both of you for really fast replies :-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From vladdrac at gmail.com Thu Nov 17 07:37:28 2005 From: vladdrac at gmail.com (Ivo van der Wijk) Date: Thu Nov 17 07:37:30 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C7896.1060101@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> Message-ID: On 11/17/05, Johan Carlsson wrote: > > The code you gave me shows the same showed the same problem as J?rgen > pointied out, the IntId needs to have '' as id. I remember having some real issues with IntId / Catalog, I doubt if they ever really got fixed. Check the patch in INSTALL.txt: https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt It once used to work for me, at least :) -- Drs. I.R. van der Wijk / m3r Consultancy B.V. Linux/Python/Zope/Plone and Open Source solutions PO-box 51091, 1007 EB Amsterdam, The Netherlands Email: ivo m3r.nl From j.kartnaller at robotech.at Thu Nov 17 07:47:31 2005 From: j.kartnaller at robotech.at (j.kartnaller) Date: Thu Nov 17 08:03:13 2005 Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C76FE.5020705@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> <437C76FE.5020705@easypublisher.com> Message-ID: Johan Carlsson wrote: > j.kartnaller wrote: > >> Johan Carlsson wrote: >> >>> Johan Carlsson wrote: >>> >>>> >>>> Anyone had any success with ZCatalog in Zope 3? >>>> >>>> I'm trying to add indexes to the catalog >>>> but I get an ComponentLookupError: >>>> >>>> Error type: zope.component.interfaces.ComponentLookupError >>>> Error object: (, '') >> >> >> The IntId utility must not have an name as you see in the message. >> Just rename your IntId utility and your up and running. > > > The name doesn't seem to have any importance (see my correction). > Also (afaik) it's not possible to add a object with an empty name > through the ZMI. This is a know issue which was solved in the trunk and will be in 3.2. Anyway you can rename after creating the utility. J?rgen From johanc at easypublisher.com Thu Nov 17 08:46:54 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 08:46:50 2005 Subject: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> <437C721F.30709@easypublisher.com> <437C76FE.5020705@easypublisher.com> Message-ID: <437C89CE.4070204@easypublisher.com> j.kartnaller wrote: >> The name doesn't seem to have any importance (see my correction). >> Also (afaik) it's not possible to add a object with an empty name >> through the ZMI. > > > This is a know issue which was solved in the trunk and will be in 3.2. > > Anyway you can rename after creating the utility. Yeah, I noticed that after my first responce. Thanks again, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 08:47:32 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 08:47:32 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> Message-ID: <437C89F4.3090101@easypublisher.com> Ivo van der Wijk wrote: > On 11/17/05, Johan Carlsson wrote: > > >>The code you gave me shows the same showed the same problem as J?rgen >>pointied out, the IntId needs to have '' as id. > > > I remember having some real issues with IntId / Catalog, I doubt if > they ever really got fixed. Check the patch in INSTALL.txt: > > https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt > > It once used to work for me, at least :) Ah, thanks for the heads up. Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 09:05:41 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 09:05:37 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C89F4.3090101@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> Message-ID: <437C8E35.5090002@easypublisher.com> Johan Carlsson wrote: > Ivo van der Wijk wrote: > >> On 11/17/05, Johan Carlsson wrote: >> >> >>> The code you gave me shows the same showed the same problem as J?rgen >>> pointied out, the IntId needs to have '' as id. >> >> >> >> I remember having some real issues with IntId / Catalog, I doubt if >> they ever really got fixed. Check the patch in INSTALL.txt: >> >> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt >> >> It once used to work for me, at least :) > > Ah, thanks for the heads up. Now I see, that's exactly what been bitting my butt all along. The patch fixes the problem! Thanks again, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From gary at zope.com Thu Nov 17 09:28:24 2005 From: gary at zope.com (Gary Poster) Date: Thu Nov 17 09:28:28 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C8E35.5090002@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> Message-ID: <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> On Nov 17, 2005, at 9:05 AM, Johan Carlsson wrote: > Johan Carlsson wrote: >> Ivo van der Wijk wrote: >>> On 11/17/05, Johan Carlsson wrote: >>> >>> >>>> The code you gave me shows the same showed the same problem as >>>> J?rgen >>>> pointied out, the IntId needs to have '' as id. >>> >>> >>> >>> I remember having some real issues with IntId / Catalog, I doubt if >>> they ever really got fixed. Check the patch in INSTALL.txt: >>> >>> https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/ >>> INSTALL.txt >>> >>> It once used to work for me, at least :) >> Ah, thanks for the heads up. > > Now I see, that's exactly what been bitting my butt all along. > > The patch fixes the problem! Hm. A very quick look at the patch concerns me a bit. Am I right that, if you apply the patch, then requests that are currently raising a NotYet for you will instead silently fail, not cataloging what you requested? That seems undesirable to me. I'd prefer the exception. If I'm on the right track here, then the extentcatalog in the zc.catalog package in the sandbox probably is one of possibly many other better solutions than the patch. It postpones cataloging to the end of the transaction, which I believe will remove the NotYet exceptions *and* successfully catalog your data. Apologies if my quick patch read is off base. Gary From johanc at easypublisher.com Thu Nov 17 10:11:49 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 10:11:47 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> Message-ID: <437C9DB5.50005@easypublisher.com> Gary Poster wrote: > > Hm. A very quick look at the patch concerns me a bit. Am I right > that, if you apply the patch, then requests that are currently raising > a NotYet for you will instead silently fail, not cataloging what you > requested? That seems undesirable to me. I'd prefer the exception. > > If I'm on the right track here, then the extentcatalog in the > zc.catalog package in the sandbox probably is one of possibly many > other better solutions than the patch. It postpones cataloging to the > end of the transaction, which I believe will remove the NotYet > exceptions *and* successfully catalog your data. In my case I'm not interested in cataloging anything, there reason is I'm just adding new fields to a newly created catalog and there aren't any object to catalog just yet. I'm guessing Ivo has similare problems because he also are creating the catalog programmetically. I'm doing this as a part of a custom add view that defines a overrided createAndAdd(self, data), I think Ivo does it in a more CMF like fashion (just after quick glans on his code). I don't have the faintest idea what NotYet is supposted to be raise for? Accutally I'm haveing problems finding the code that does this because the traceback is Zope 3 cryptic and I don't have a debugger setup either. (I was hoping not having to care about the innerworks of the catalog, but that maybe is too much too hope for ;-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From dominik.huber at perse.ch Thu Nov 17 10:49:38 2005 From: dominik.huber at perse.ch (Dominik Huber) Date: Thu Nov 17 10:49:47 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C9DB5.50005@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> Message-ID: <437CA692.6040400@perse.ch> Hi Johan Your problem is that the catalog is not locatable itself during the addition of its indexes (-> state within the create and add method), therefore the location of the indexes cannot be located and the NotYetError is raised. You can move your code to an ObjectAddedEvent-subscriber for your object. handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) Regards, Dominik Johan Carlsson wrote: > Gary Poster wrote: > >> >> Hm. A very quick look at the patch concerns me a bit. Am I right >> that, if you apply the patch, then requests that are currently >> raising a NotYet for you will instead silently fail, not cataloging >> what you requested? That seems undesirable to me. I'd prefer the >> exception. >> >> If I'm on the right track here, then the extentcatalog in the >> zc.catalog package in the sandbox probably is one of possibly many >> other better solutions than the patch. It postpones cataloging to >> the end of the transaction, which I believe will remove the NotYet >> exceptions *and* successfully catalog your data. > > > In my case I'm not interested in cataloging anything, there reason is > I'm just adding new fields to a newly created catalog and there > aren't any object to catalog just yet. > > I'm guessing Ivo has similare problems because he also are creating > the catalog programmetically. > > I'm doing this as a part of a custom add view that defines a > overrided createAndAdd(self, data), I think Ivo does it > in a more CMF like fashion (just after quick glans on his code). > > I don't have the faintest idea what NotYet is supposted to be > raise for? Accutally I'm haveing problems finding the code > that does this because the traceback is Zope 3 cryptic and > I don't have a debugger setup either. > > (I was hoping not having to care about the innerworks of the catalog, > but that maybe is too much too hope for ;-) > > Johan > > > > > -- Dominik Huber Perse Engineering GmbH Jurastrasse 9a CH-5406 Baden E-Mail: dominik.huber@perse.ch Telefon: ++41 56 534 7730 -------------- next part -------------- A non-text attachment was scrubbed... Name: dominik.huber.vcf Type: text/x-vcard Size: 154 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051117/6b6c340d/dominik.huber.vcf From johanc at easypublisher.com Thu Nov 17 10:54:06 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 10:54:03 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CA692.6040400@perse.ch> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> Message-ID: <437CA79E.9000108@easypublisher.com> Dominik Huber wrote: > Hi Johan > Your problem is that the catalog is not locatable itself during the > addition of its indexes (-> state within the create and add method), > therefore the location of the indexes cannot be located and the > NotYetError is raised. You can move your code to an > ObjectAddedEvent-subscriber for your object. > > for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent" > handler=".addCatalogAndIndex" > /> > > handler pseudo code: > > def addCatalogAndIndex(obj, event): > sm = zapi.getNextSiteManager(obj) > catalog = Catalog() > addLocalUtility(sm, 'XY', ICatalog, catalog) > catalog[name] = Index(name, IAnyInterface) Ok, that's by the way how Ivo does it (I've just read). Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Thu Nov 17 11:26:01 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 11:25:57 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CA692.6040400@perse.ch> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> Message-ID: <437CAF19.1070707@easypublisher.com> Dominik Huber wrote: > Hi Johan > Your problem is that the catalog is not locatable itself during the > addition of its indexes (-> state within the create and add method), > therefore the location of the indexes cannot be located and the > NotYetError is raised. You can move your code to an > ObjectAddedEvent-subscriber for your object. > > for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent" > handler=".addCatalogAndIndex" > /> > > handler pseudo code: > > def addCatalogAndIndex(obj, event): > sm = zapi.getNextSiteManager(obj) > catalog = Catalog() > addLocalUtility(sm, 'XY', ICatalog, catalog) > catalog[name] = Index(name, IAnyInterface) I've tried this, it doesn't remove the NotYet problem though!?? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From dominik.huber at perse.ch Thu Nov 17 11:32:29 2005 From: dominik.huber at perse.ch (Dominik Huber) Date: Thu Nov 17 11:32:35 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CAF19.1070707@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> <437CAF19.1070707@easypublisher.com> Message-ID: <437CB09D.4010407@perse.ch> Johan Carlsson wrote: > Dominik Huber wrote: > >> Hi Johan >> Your problem is that the catalog is not locatable itself during the >> addition of its indexes (-> state within the create and add method), >> therefore the location of the indexes cannot be located and the >> NotYetError is raised. You can move your code to an >> ObjectAddedEvent-subscriber for your object. >> >> > for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent" >> handler=".addCatalogAndIndex" >> /> >> >> handler pseudo code: >> >> def addCatalogAndIndex(obj, event): >> sm = zapi.getNextSiteManager(obj) >> catalog = Catalog() >> addLocalUtility(sm, 'XY', ICatalog, catalog) >> catalog[name] = Index(name, IAnyInterface) > > > I've tried this, it doesn't remove the NotYet problem though!?? Our framework relies on that concept and it is still working ;) Did you assert to add the catalog to the sitemanagement folder before adding its indexes? Dominik -------------- next part -------------- A non-text attachment was scrubbed... Name: dominik.huber.vcf Type: text/x-vcard Size: 154 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051117/fc43f1ef/dominik.huber.vcf From johanc at easypublisher.com Thu Nov 17 12:12:32 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Thu Nov 17 12:12:29 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CB09D.4010407@perse.ch> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> <437CAF19.1070707@easypublisher.com> <437CB09D.4010407@perse.ch> Message-ID: <437CBA00.1060102@easypublisher.com> Dominik Huber wrote: > Johan Carlsson wrote: >> I've tried this, it doesn't remove the NotYet problem though!?? > > > Our framework relies on that concept and it is still working ;) > Did you assert to add the catalog to the sitemanagement folder before > adding its indexes? I found the error, in the AddView I had to remove the security context to be able to setup things, I don't need that in the event handler. The removed security context appears to have been the reason for the NotYet problems. Thanks for kicking me in the right direction :-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From td at yoma.com.au Thu Nov 17 17:26:13 2005 From: td at yoma.com.au (Tom Dossis) Date: Thu Nov 17 17:23:29 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CA692.6040400@perse.ch> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> Message-ID: <437D0385.1010505@yoma.com.au> Dominik Huber wrote: > > for=".IYourObject zope.app.container.interfaces.IObjectAddedEvent" > handler=".addCatalogAndIndex" > /> > > handler pseudo code: > > def addCatalogAndIndex(obj, event): > sm = zapi.getNextSiteManager(obj) > catalog = Catalog() > addLocalUtility(sm, 'XY', ICatalog, catalog) > catalog[name] = Index(name, IAnyInterface) > > Regards, > Dominik From the apidoc for IWriteContainer.__setitem__(name, object) it states.. ''If an add event is generated and the object can be adapted to IObjectAddedEvent, then the adapter's addNotify method is called with the event.'' This could be alternative way to implement the the subscriber solution above. However, from looking at the code (Zope3.1) it doesn't seem to to what the apidoc claims. Does anybody know if this is still intended? -Tom From johanc at easypublisher.com Fri Nov 18 05:58:20 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Fri Nov 18 05:58:16 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C6F17.4060300@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> Message-ID: <437DB3CC.1090101@easypublisher.com> Hi again, The ComponentLookupError have re appeared! > Error type: zope.component.interfaces.ComponentLookupError > Error object: (, '') What happend was that I had a IntId utitlity in the root site (renamed to '') that answered the request when I added the Indexes in a sub site. So the question is how do I rename the IntId utility programmatically or why doesn't the following code ad a utility (maybe it's not registered correctly to be use right after it's been added but needs some events to trigger first??? First I do this: intids = IntIds() tools['intid'] = intids #I thought this was equal to rename the intid-util to ''!? intids_reg = UtilityRegistration('', IIntIds, intids) rm.addRegistration(intids_reg) intids_reg.status = ActiveStatus Right after that I do this: catalog = Catalog() for index_name, index_attribute, idx_if, attr_call, index_type in indexes: idx = index_type(index_attribute, idx_if, attr_call) catalog[index_name] = idx tools['catalog'] = catalog catalog_reg = UtilityRegistration('catalog', ICatalog, catalog) rm.addRegistration(catalog_reg) catalog_reg.status = ActiveStatus This is all called from an event handler, like Dominik pointed out I should do it. -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Fri Nov 18 06:02:57 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Fri Nov 18 06:02:55 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437DB3CC.1090101@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437DB3CC.1090101@easypublisher.com> Message-ID: <437DB4E1.5010603@easypublisher.com> Johan Carlsson wrote: > Hi again, > > The ComponentLookupError have re appeared! > > > Error type: zope.component.interfaces.ComponentLookupError > > Error object: (, '') > > What happend was that I had a IntId utitlity in the root site (renamed > to '') that answered the request when I added the Indexes in a sub site. > > So the question is how do I rename the IntId utility programmatically > or why doesn't the following code ad a utility (maybe it's not > registered correctly to be use right after it's been added but needs > some events to trigger first??? So, with som testing I figured out that the name is set to '' but it doesn't get accessible right away: zapi.getAllUtilitiesRegisteredFor(IIntIds) returns an empty tuple. Is there some kind of flush-call or commit-call that needs to be executed? -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From johanc at easypublisher.com Fri Nov 18 06:22:18 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Fri Nov 18 06:22:14 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437CBA00.1060102@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437C7896.1060101@easypublisher.com> <437C89F4.3090101@easypublisher.com> <437C8E35.5090002@easypublisher.com> <0D36F0A8-7AE7-4FD4-9E0D-408468C358C4@zope.com> <437C9DB5.50005@easypublisher.com> <437CA692.6040400@perse.ch> <437CAF19.1070707@easypublisher.com> <437CB09D.4010407@perse.ch> <437CBA00.1060102@easypublisher.com> Message-ID: <437DB96A.9060203@easypublisher.com> Johan Carlsson wrote: > Dominik Huber wrote: > >> Johan Carlsson wrote: > >>> I've tried this, it doesn't remove the NotYet problem though!?? >> >> Our framework relies on that concept and it is still working ;) >> Did you assert to add the catalog to the sitemanagement folder before >> adding its indexes? > > I found the error, in the AddView I had to remove the security context > to be able to setup things, I don't need that in the event handler. > The removed security context appears to have been the reason for the > NotYet problems. > > Thanks for kicking me in the right direction :-) Looks like I was wrong on the NotYet too. It doesn't work in a event handler either :-( Ivos patch is still the only thing that works. /Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From eucci.group at gmail.com Fri Nov 18 13:24:05 2005 From: eucci.group at gmail.com (Jeff Shell) Date: Fri Nov 18 13:30:07 2005 Subject: [Zope3-Users] Generations - a missed use case? (Evolving an application for the first time) Message-ID: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com> I have an application where I'm trying to use 'zope.app.generations' for the first time. And after much pulling of hair and looking at the core code, I found what may be a missed scenario. Basically, we deployed this application for a customer and now they want some changes. It changes the schema of one item to store values in tuples instead of strings. I wrote an evolve module, 'evolve1.py' in myapp.generations, made the schema manager, registered it as a utility, bla bla bla. But my code seemed like it would never run. I'd run the debuzope script and look at the database root['zope.app.generations'], and there was 'myapp' with the value of 1. I'd keep deleting that key and committing the transaction, but my code would still never run. I tried running it manually using pdb.run() to step through it and make sure that it was finding the right objects and doing its job. My code was fine. So I looked at the code in zope.app.generations.generations and found this interesting tidbit: for key, manager in findManagers(): generation = generations.get(key) if generation == manager.generation: continue if generation is None: # This is a new database, so no old data if IInstallableSchemaManager.providedBy(manager): try: manager.install(context) except: transaction.abort() logging.getLogger('zope.app.generations').exception( "Failed to install %s", key) raise generations[key] = manager.generation transaction.commit() continue (the code continues from there There's one problem here - in my situation, it's NOT A NEW DATABASE. There is old data that needs to be evolved, but there's no record of a generation for this application because there was no need for a schema manager until now. I really like the concept and general implementation of the schema manager, but this scenario is driving me crazy. I could write an 'install' script, but that doesn't really cover this situation. After install is run, the database marks the application generation. This makes sense for new applications installing themselves - there's no old data to update, so if the application is at generation 5, for example, it doesn't need to be evolved to '5' if all of the data that's installed or used is already in generation 5 form. (ie - if I were deploying my application fresh today, my fields would already be tuples instead of strings). But my situation, where I already have a deployed application, is not covered by this. I *could* write an 'install' script for the schema manager that did this first evolution that I need to do. But then that installer would have to be updated with all of the future evolutions as well - since in theory, I could update an application from before the schema manager and need to bring it up to generation 5 or 8 from essentially 0. It seems like the Schema Manager needs an 'evolve from 0' option, with '0' being set by the evolution script of no previous evolution was found but (somehow) existing data could be detected. The other solutions seem to be: * Write an install script that then manually calls all of the evolvers to bring things up to the current generation. * Always put a schema manager in your application, with the starting generation of 0, so that you can upgrade in the future. Neither option seems quite tenable - like a bad hack that goes against the Zope 3 concepts. You shouldn't need a schema manager utility until you need it, and having a script that manually does 'evolve1.evolve(context); evolve2.evolve(context)'... seems like it goes against the sort of problem that the generations system is trying to solve. Is there something about the schema manager/generations system that I missed? From marc at rijken.org Sun Nov 20 09:07:02 2005 From: marc at rijken.org (Marc Rijken) Date: Sun Nov 20 09:07:01 2005 Subject: [Zope3-Users] Skin traversing error In-Reply-To: <200509062321.50572.srichter@cosmos.phy.tufts.edu> References: <1126051263.14377.8.camel@localhost.localdomain> <200509062321.50572.srichter@cosmos.phy.tufts.edu> Message-ID: <43808306.6040706@rijken.org> Hi all, I have a site with his own skin. In the skin there are some resources. When I try to get the resource via localhost/@@/logo.gif I get the logo. When I try get the resource via localhost/site/@@/logo.gif I get a NotFound error. What can be the cause of this? It has something to do with the site "site" in my Zope3-instance. Who can help me? Best regards, Marc From jim at zope.com Sun Nov 20 10:31:48 2005 From: jim at zope.com (Jim Fulton) Date: Sun Nov 20 10:31:50 2005 Subject: [Zope3-Users] Generations - a missed use case? (Evolving an application for the first time) In-Reply-To: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com> References: <88d0d31b0511181024g79258187u93ed29ff1448af40@mail.gmail.com> Message-ID: <438096E4.1050000@zope.com> Jeff Shell wrote: > I have an application where I'm trying to use 'zope.app.generations' > for the first time. And after much pulling of hair and looking at the > core code, I found what may be a missed scenario. > > Basically, we deployed this application for a customer and now they > want some changes. It changes the schema of one item to store values > in tuples instead of strings. I wrote an evolve module, 'evolve1.py' > in myapp.generations, made the schema manager, registered it as a > utility, bla bla bla. But my code seemed like it would never run. > > I'd run the debuzope script and look at the database > root['zope.app.generations'], and there was 'myapp' with the value of > 1. I'd keep deleting that key and committing the transaction, but my > code would still never run. I tried running it manually using > pdb.run() to step through it and make sure that it was finding the > right objects and doing its job. My code was fine. So I looked at the > code in zope.app.generations.generations and found this interesting > tidbit: > > for key, manager in findManagers(): > generation = generations.get(key) > > if generation == manager.generation: > continue > > if generation is None: > # This is a new database, so no old data > > if IInstallableSchemaManager.providedBy(manager): > try: > manager.install(context) > except: > transaction.abort() > logging.getLogger('zope.app.generations').exception( > "Failed to install %s", > key) > raise > > generations[key] = manager.generation > transaction.commit() > continue > > (the code continues from there > > There's one problem here - in my situation, it's NOT A NEW DATABASE. > There is old data that needs to be evolved, but there's no record of a > generation for this application because there was no need for a schema > manager until now. > > I really like the concept and general implementation of the schema > manager, but this scenario is driving me crazy. I could write an > 'install' script, but that doesn't really cover this situation. After > install is run, the database marks the application generation. This > makes sense for new applications installing themselves - there's no > old data to update, so if the application is at generation 5, for > example, it doesn't need to be evolved to '5' if all of the data > that's installed or used is already in generation 5 form. (ie - if I > were deploying my application fresh today, my fields would already be > tuples instead of strings). > > But my situation, where I already have a deployed application, is not > covered by this. I *could* write an 'install' script for the schema > manager that did this first evolution that I need to do. But then that > installer would have to be updated with all of the future evolutions > as well - since in theory, I could update an application from before > the schema manager and need to bring it up to generation 5 or 8 from > essentially 0. Note that a common strategy for install scripts is to run evolution scripts. This is fairly straightforward. The assumption of the generations system was that you would use it from the start. You make a good point though that many people won't pay attention to the generations system until they need it, which, as things are, is too late. > It seems like the Schema Manager needs an 'evolve from 0' option, with > '0' being set by the evolution script of no previous evolution was > found but (somehow) existing data could be detected. The other > solutions seem to be: > > * Write an install script that then manually calls all of the evolvers > to bring things up to the current generation. > * Always put a schema manager in your application, with the starting > generation of 0, so that you can upgrade in the future. > > Neither option seems quite tenable - like a bad hack that goes against > the Zope 3 concepts. You shouldn't need a schema manager utility until > you need it, Fron a practical perspective, I agree. > and having a script that manually does > 'evolve1.evolve(context); evolve2.evolve(context)'... seems like it > goes against the sort of problem that the generations system is trying > to solve. I don't really see why. See below. > Is there something about the schema manager/generations system that I missed? Only this: I don't want to saddle developers with supporting all old versions of their products. In many cases, this could represent a very significant burden. There are really 2 related cases: install and catchup. Install is meant for situations in which an application hasn't been used before, while catchup is for apps that need to get around not providing generation support in the past. Unfortunately, there's no way for the generation system to know which situation applies. Presumably, an install script can have the logic to know this and perform some appropriate action. Note too that an application that needs to catch up from an "unmanaged" generation to a current generation might prefer to provide a direct conversion, rather than taking intermediate steps. Assuming that the best way to catch up is by running all evolution scripts from (before) the beggining is guessing too much. In summary, I think that the installation script is the right way to handle this situation. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org From mailinglists at xgm.de Sun Nov 20 16:57:03 2005 From: mailinglists at xgm.de (Florian Lindner) Date: Sun Nov 20 16:57:03 2005 Subject: [Zope3-Users] PAU and Session Credentials Message-ID: <200511202257.03402.mailinglists@xgm.de> 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:
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 From dominik.huber at perse.ch Mon Nov 21 09:17:26 2005 From: dominik.huber at perse.ch (Dominik Huber) Date: Mon Nov 21 09:17:37 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437DB3CC.1090101@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <437DB3CC.1090101@easypublisher.com> Message-ID: <4381D6F6.7090000@perse.ch> Johan Carlsson wrote: > .... > > > Right after that I do this: > > > catalog = Catalog() > for index_name, index_attribute, idx_if, attr_call, index_type > in indexes: > idx = index_type(index_attribute, idx_if, attr_call) > catalog[index_name] = idx > tools['catalog'] = catalog > catalog_reg = UtilityRegistration('catalog', ICatalog, catalog) > rm.addRegistration(catalog_reg) > catalog_reg.status = ActiveStatus change the order and it will work: catalog = Catalog() tools['catalog'] = catalog catalog_reg = UtilityRegistration('catalog', ICatalog, catalog) rm.addRegistration(catalog_reg) catalog_reg.status = ActiveStatus # add the indexes after the catalog is set to the tools for index_name, index_attribute, idx_if, attr_call, index_type in indexes: idx = index_type(index_attribute, idx_if, attr_call) catalog[index_name] = idx regards, Dominik -------------- next part -------------- A non-text attachment was scrubbed... Name: dominik.huber.vcf Type: text/x-vcard Size: 154 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051121/f953afc6/dominik.huber.vcf From johanc at easypublisher.com Mon Nov 21 09:38:43 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Mon Nov 21 09:38:46 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <4381D6F6.7090000@perse.ch> References: <437C6F17.4060300@easypublisher.com> <437DB3CC.1090101@easypublisher.com> <4381D6F6.7090000@perse.ch> Message-ID: <4381DBF3.9010102@easypublisher.com> Dominik Huber wrote: > Johan Carlsson wrote: > >> .... >> >> >> Right after that I do this: >> >> >> catalog = Catalog() >> for index_name, index_attribute, idx_if, attr_call, index_type >> in indexes: >> idx = index_type(index_attribute, idx_if, attr_call) >> catalog[index_name] = idx >> tools['catalog'] = catalog >> catalog_reg = UtilityRegistration('catalog', ICatalog, catalog) >> rm.addRegistration(catalog_reg) >> catalog_reg.status = ActiveStatus > > > change the order and it will work: > > catalog = Catalog() > tools['catalog'] = catalog > catalog_reg = UtilityRegistration('catalog', ICatalog, catalog) > rm.addRegistration(catalog_reg) > catalog_reg.status = ActiveStatus > # add the indexes after the catalog is set to the tools > for index_name, index_attribute, idx_if, attr_call, index_type > in indexes: > idx = index_type(index_attribute, idx_if, attr_call) > catalog[index_name] = idx That seemed resonablu, unfortunately it didn't help. Thanks anyway, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From antonio.beamud at linkend.net Tue Nov 22 06:49:05 2005 From: antonio.beamud at linkend.net (Antonio Beamud Montero) Date: Tue Nov 22 06:49:14 2005 Subject: [Zope3-Users] template unparsed Message-ID: <1132660146.6671.10.camel@localhost.localdomain> Hi all: I've implemented a simple contact content object, and I've registered a page as view of the content, only for testing pourpouses... The problem is, I can see the page, but the page is not rendered with the values of the contact... I've registered with: No error or warning appears... I can create the contact via ZMI, but I can see its values... What can be the problem...? From zedobject at gmail.com Tue Nov 22 19:34:39 2005 From: zedobject at gmail.com (Milind Khadilkar) Date: Tue Nov 22 19:34:40 2005 Subject: [Zope3-Users] Compatibility Message-ID: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> Hi, Is it correct to say that one of the major objectives of Zope 3 as opposed to zope-x ( viz. compatibility with Zope 2, or at least an easy way for importing products from zope 2) has not been achieved? The 'x' was removed on grounds of being ready for production use, not on grounds of compatibility. The release announcement for 3.1 also mentions continuing efforts to ease transition from zope 2 to zope 3. Is it meant to be the same as "ability to import products"? Thanks ZedObject -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051123/18b06a76/attachment.htm From srichter at cosmos.phy.tufts.edu Tue Nov 22 20:08:32 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue Nov 22 20:08:42 2005 Subject: [Zope3-Users] Compatibility In-Reply-To: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> Message-ID: <200511222008.32620.srichter@cosmos.phy.tufts.edu> On Tuesday 22 November 2005 19:34, Milind Khadilkar wrote: > Is it correct to say that one of the major objectives of Zope 3 ?as opposed > to zope-x ( viz. compatibility with Zope 2, or at least an easy way for > importing products from zope 2) has not been achieved? The 'x' was removed > on grounds of being ready for production use, not on grounds of > compatibility. The release announcement for 3.1 also mentions continuing > efforts to ease transition from zope 2 to zope 3. Is it meant to be the > same as "ability to import products"? My opinion is that you will never be able to import your Zope 2 product as a packge in plain Zope 3. HAving said that, there are continuous efforts, such as Five and Goldegg, to bring Zope 3 technology into Zope 2. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Tue Nov 22 20:09:53 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue Nov 22 20:09:56 2005 Subject: [Zope3-Users] template unparsed In-Reply-To: <1132660146.6671.10.camel@localhost.localdomain> References: <1132660146.6671.10.camel@localhost.localdomain> Message-ID: <200511222009.53875.srichter@cosmos.phy.tufts.edu> On Tuesday 22 November 2005 06:49, Antonio Beamud Montero wrote: > What can be the problem...? You need to provide us with much more information, such as the contact implementation, the content of contact.pt, etc. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From faassen at infrae.com Wed Nov 23 06:37:59 2005 From: faassen at infrae.com (Martijn Faassen) Date: Wed Nov 23 06:37:53 2005 Subject: [Zope3-Users] Compatibility In-Reply-To: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> Message-ID: <43845497.7040706@infrae.com> Milind Khadilkar wrote: > Is it correct to say that one of the major objectives of Zope 3 as opposed > to zope-x ( viz. compatibility with Zope 2, or at least an easy way for > importing products from zope 2) has not been achieved? Unfortunately the whole 'X' story was always interpreted differently by different people. It's unfortunate, and our (the Zope 3 project's) mistake, that your interpretation ("Zope 2 products work in Zope 3") ever was made possible in the first place... > The 'x' was removed > on grounds of being ready for production use, not on grounds of > compatibility. The release announcement for 3.1 also mentions continuing > efforts to ease transition from zope 2 to zope 3. Is it meant to be the same > as "ability to import products"? As Stephan said in his reply, I find it unlikely that you'll ever be able to run Zope 2 products in Zope 3. We're taking the other direction -- Zope 2 products run in Zope 2 obviously, but we're making sure that with Five, more and more Zope 3 code also works in Zope 2. This allows you to start porting code over to Zope 3 while it remains to work in Zope 2. Five is hardly the perfect transition tool; most of Zope 3 code doesn't work in Zope 2 either without significant modifications. Step by step however this gap is being bridged. Regards, Martijn From faassen at infrae.com Wed Nov 23 06:49:12 2005 From: faassen at infrae.com (Martijn Faassen) Date: Wed Nov 23 06:49:03 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <437C6F17.4060300@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> Message-ID: <43845738.8050400@infrae.com> Johan Carlsson wrote: > > Anyone had any success with ZCatalog in Zope 3? Sure. I'm not sure what the problem is but I see you get a lot of replies. We (Infrae) certainly got it working without having to patch anything. Um, the setup code we use it something like: def _registerUtility(context, class_, interface, name=u''): if not name: cname = class_.__name__ else: cname = name if name and name in context: raise ValueError, u'Utility %s already registered!' % name utility = class_() context[cname] = utility registration = UtilityRegistration(name, interface, utility) key = context.registrationManager.addRegistration(registration) zapi.traverse(context.registrationManager, key).status = ActiveStatus return utility in setup code... from zope.app.intid.interfaces import IIntIds from zope.app.catalog.interfaces import ICatalog from zope.app.intid import IntIds from zope.app.catalog.catalog import Catalog _registerUtility(default, IntIds, IIntIds) _registerUtility(default, Catalog, ICatalog, u'my_catalog') and then to make indexes registered, something like: from zope.app import zapi from zope.app.catalog.field import FieldIndex catalog = zapi.getUtility(ICatalog, u'my_catalog') catalog['something'] = FieldIndex('something', ISomeInterface) _registerUtility is rather messy but it works.. Anyway, once you do get the catalog working, you may want to check out hurry.query, which makes querying the Zope 3 catalog a lot easier (in my opinion): http://codespeak.net/svn/z3/hurry/trunk Regards, Martijn From zedobject at gmail.com Wed Nov 23 09:51:38 2005 From: zedobject at gmail.com (Milind Khadilkar) Date: Wed Nov 23 09:51:39 2005 Subject: [Zope3-Users] Compatibility In-Reply-To: <43845497.7040706@infrae.com> References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> <43845497.7040706@infrae.com> Message-ID: <116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com> In light of these insights, I feel the Zope home page should be re-drafted so as to present alternatives clearly to newcomers. Currently, Zope 3 is not presented prominently, causing newcomers to start with Zope 2 by default. Regards Milind Khadilkar On 11/23/05, Martijn Faassen wrote: > > Milind Khadilkar wrote: > > Is it correct to say that one of the major objectives of Zope 3 as > opposed > > to zope-x ( viz. compatibility with Zope 2, or at least an easy way for > > importing products from zope 2) has not been achieved? > > Unfortunately the whole 'X' story was always interpreted differently by > different people. It's unfortunate, and our (the Zope 3 project's) > mistake, that your interpretation ("Zope 2 products work in Zope 3") > ever was made possible in the first place... > > > The 'x' was removed > > on grounds of being ready for production use, not on grounds of > > compatibility. The release announcement for 3.1 also mentions continuing > > efforts to ease transition from zope 2 to zope 3. Is it meant to be the > same > > as "ability to import products"? > > As Stephan said in his reply, I find it unlikely that you'll ever be > able to run Zope 2 products in Zope 3. We're taking the other direction > -- Zope 2 products run in Zope 2 obviously, but we're making sure that > with Five, more and more Zope 3 code also works in Zope 2. This allows > you to start porting code over to Zope 3 while it remains to work in Zope > 2. > > Five is hardly the perfect transition tool; most of Zope 3 code doesn't > work in Zope 2 either without significant modifications. Step by step > however this gap is being bridged. > > Regards, > > Martijn > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051123/649c6b4b/attachment.htm From johanc at easypublisher.com Wed Nov 23 10:14:38 2005 From: johanc at easypublisher.com (Johan Carlsson) Date: Wed Nov 23 10:14:40 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <43845738.8050400@infrae.com> References: <437C6F17.4060300@easypublisher.com> <43845738.8050400@infrae.com> Message-ID: <4384875E.5040500@easypublisher.com> Martijn Faassen wrote: > Johan Carlsson wrote: > >> >> Anyone had any success with ZCatalog in Zope 3? > > > Sure. I'm not sure what the problem is but I see you get a lot of > replies. We (Infrae) certainly got it working without having to patch > anything. > > Um, the setup code we use it something like: > > def _registerUtility(context, class_, interface, name=u''): > if not name: > cname = class_.__name__ > else: > cname = name > if name and name in context: > raise ValueError, u'Utility %s already registered!' % name > utility = class_() > context[cname] = utility > registration = UtilityRegistration(name, interface, utility) > key = context.registrationManager.addRegistration(registration) > zapi.traverse(context.registrationManager, key).status = ActiveStatus > return utility > > in setup code... > > from zope.app.intid.interfaces import IIntIds > from zope.app.catalog.interfaces import ICatalog > from zope.app.intid import IntIds > from zope.app.catalog.catalog import Catalog > > _registerUtility(default, IntIds, IIntIds) > _registerUtility(default, Catalog, ICatalog, u'my_catalog') > > and then to make indexes registered, something like: > > from zope.app import zapi > from zope.app.catalog.field import FieldIndex > > catalog = zapi.getUtility(ICatalog, u'my_catalog') > catalog['something'] = FieldIndex('something', ISomeInterface) > > _registerUtility is rather messy but it works.. Thanks Martijn, From a quick glans at your code the notisable difference is that I don't call zapi.getUtility(ICatalog, u'my_catalog') to get the catalog, that just might do the trick. (I jsut grab the catalog from the container: c['catalog']. I'll let you know when I get a chance to test it. Does you code for adding catalogs and adding fields get called in the same request? Mine does, it gets called right after each other, and I'm thinking in the lines of that there is something that doesn't get setup in the correct order, which is why I think getUtility might work better. > Anyway, once you do get the catalog working, you may want to check out > hurry.query, which makes querying the Zope 3 catalog a lot easier (in my > opinion): > > http://codespeak.net/svn/z3/hurry/trunk I'll check it out :-) Cheers, johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM From atrium601 at gmail.com Wed Nov 23 10:23:48 2005 From: atrium601 at gmail.com (Rui Gamito) Date: Wed Nov 23 10:23:58 2005 Subject: [Zope3-Users] Zope 3 and Plone? Message-ID: <1132759428.8880.1.camel@localhost.localdomain> Hi all. Does anyone know if plone 2.1.1 works ok with zope 3? RG . From reinoud.v at n.leeuwen.net Wed Nov 23 10:28:57 2005 From: reinoud.v at n.leeuwen.net (Reinoud van Leeuwen) Date: Wed Nov 23 10:28:59 2005 Subject: [Zope3-Users] Zope 3 and Plone? In-Reply-To: <1132759428.8880.1.camel@localhost.localdomain> References: <1132759428.8880.1.camel@localhost.localdomain> Message-ID: <20051123152857.GK67050@spoetnik.xs4all.nl> On Wed, Nov 23, 2005 at 03:23:48PM +0000, Rui Gamito wrote: > Hi all. > > Does anyone know if plone 2.1.1 works ok with zope 3? Yes: it does not. -- __________________________________________________ "Nothing is as subjective as reality" Reinoud van Leeuwen reinoud.v@n.leeuwen.net http://www.xs4all.nl/~reinoud __________________________________________________ From faassen at infrae.com Wed Nov 23 11:44:07 2005 From: faassen at infrae.com (Martijn Faassen) Date: Wed Nov 23 11:43:58 2005 Subject: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3? In-Reply-To: <4384875E.5040500@easypublisher.com> References: <437C6F17.4060300@easypublisher.com> <43845738.8050400@infrae.com> <4384875E.5040500@easypublisher.com> Message-ID: <43849C57.1090303@infrae.com> Johan Carlsson wrote: > Martijn Faassen wrote: [snip] > Does you code for adding catalogs and adding fields get called > in the same request? Yes, it's done when an application root is installed. Regards, Martijn From fbenoit at centile.com Wed Nov 23 11:54:42 2005 From: fbenoit at centile.com (Benoit frederic) Date: Wed Nov 23 11:54:48 2005 Subject: [Zope3-Users] Plone 2.1 and Zope3 Message-ID: <1132764883.2665.34.camel@linuxfred> Hi all, i am new with zope and i would like to know if plone2.1 can be installed with Zope3? (the installation documentation of plone2.1 only mention Zope2.7 and Zope2.8). As far as i know Zope3 needs a zcml configuration file for each Package we install, is there some scripts to create them automatically? thanks for anwser Regards, Frederic From lists at andreas-jung.com Wed Nov 23 12:03:50 2005 From: lists at andreas-jung.com (Andreas Jung) Date: Wed Nov 23 12:03:58 2005 Subject: [Zope3-Users] Plone 2.1 and Zope3 In-Reply-To: <1132764883.2665.34.camel@linuxfred> References: <1132764883.2665.34.camel@linuxfred> Message-ID: Plone only runs with Zope 2 because of totally different Zope codebases. -aj --On 23. November 2005 17:54:42 +0100 Benoit frederic wrote: > Hi all, > i am new with zope and i would like to know if plone2.1 can be installed > with Zope3? (the installation documentation of plone2.1 only mention > Zope2.7 and Zope2.8). > As far as i know Zope3 needs a zcml configuration file for each Package > we install, is there some scripts to create them automatically? > > thanks for anwser > Regards, > > Frederic > > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051123/858a8da8/attachment.bin From faassen at infrae.com Thu Nov 24 10:08:39 2005 From: faassen at infrae.com (Martijn Faassen) Date: Thu Nov 24 10:08:18 2005 Subject: [Zope3-Users] Compatibility In-Reply-To: <116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com> References: <116b13090511221634n380c356bw81ae4aa6cc0ab0d5@mail.gmail.com> <43845497.7040706@infrae.com> <116b13090511230651g5b8569e6q210e9d29ec08c190@mail.gmail.com> Message-ID: <4385D777.1080707@infrae.com> Milind Khadilkar wrote: > In light of these insights, I feel the Zope home page should be re-drafted > so as to present alternatives clearly to newcomers. Currently, Zope 3 is not > presented prominently, causing newcomers to start with Zope 2 by default. > Yes, an effort to improve the web presence of Zope 3 is sorely needed. Regards, Martijn From mailinglists at xgm.de Thu Nov 24 16:46:45 2005 From: mailinglists at xgm.de (Florian Lindner) Date: Thu Nov 24 16:46:38 2005 Subject: [Zope3-Users] PAU and Session Credentials In-Reply-To: <200511202257.03402.mailinglists@xgm.de> References: <200511202257.03402.mailinglists@xgm.de> Message-ID: <200511242246.45438.mailinglists@xgm.de> Am Sonntag, 20. November 2005 22:57 schrieb Florian Lindner: > 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: > [...] No one got a idea how to make the principal folder working? Thanks, Florian From christian.lueck at ruhr-uni-bochum.de Thu Nov 24 18:06:22 2005 From: christian.lueck at ruhr-uni-bochum.de (=?UTF-8?B?Q2hyaXN0aWFuIEzDvGNr?=) Date: Thu Nov 24 17:56:17 2005 Subject: [Zope3-Users] PAU and Session Credentials In-Reply-To: <200511202257.03402.mailinglists@xgm.de> References: <200511202257.03402.mailinglists@xgm.de> Message-ID: <4386476E.60601@ruhr-uni-bochum.de> 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... :-) > 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. Regards, Christian From brad at allendev.com Fri Nov 25 15:34:26 2005 From: brad at allendev.com (Brad Allen) Date: Fri Nov 25 15:34:30 2005 Subject: [Zope3-Users] How to hide the ZMI Message-ID: I'm working on a simple site which, to start with, just uses bare ZPT functionality. I've been reading Philkon's book sections dealing with TAL, TALES, and METAL, and it's starting to make some sense. The part I'm stuck on is how to make the ZMI disappear so the end user sees only the page I designed. Do I have to go through the process of making a special skin for my ZPT pages, or is there some easier way? Thanks! From brad at allendev.com Fri Nov 25 18:15:24 2005 From: brad at allendev.com (Brad Allen) Date: Fri Nov 25 18:15:29 2005 Subject: [Zope3-Users] reST for content editors Message-ID: I'd prefer to allow content editors on my site to avoid having to type HTML, and have heard that reST might be a good, wiki-like choice. However, it's not clear to me how to get that working with ZPT content insertions. Would I need to build a new content class for this, or is there some easier way? Thanks! From mdudzikml at gmail.com Fri Nov 25 20:04:44 2005 From: mdudzikml at gmail.com (Michael Dudzik) Date: Fri Nov 25 20:04:47 2005 Subject: [Zope3-Users] reST for content editors Message-ID: <1132967084.21774.248351107@webmail.messagingengine.com> On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen" said: > I'd prefer to allow content editors on my site to avoid having to > type HTML, and have heard that reST might be a good, wiki-like > choice. However, it's not clear to me how to get that working with > ZPT content insertions. Would I need to build a new content class for > this, or is there some easier way? When a similar issue came up for me, all I did was add an additional type field to the content object then created a "render" method in the view, something like this for a 'description' field: def renderdescription(self): # for rest, self.context.descriptiontype would be 'zope.source.rest' source = zapi.createObject(None,self.context.descriptiontype, self.context.description) textview = zapi.getView(source,'',self.request) html = view.render() return html And then just used "view/renderdescription" in my templates. On grepping the zope codebase quickly, it looks like the more "modern" way to do this would be to use getMultiAdapter like: source = zapi.createObject(type,text) renderer = zapi.getMultiAdapter((source, self.request)) return renderer.render() I have no idea why I have an extra 'None' argument in my code, above See zope/app/preference/browser.py for an example From mdudzikml at gmail.com Fri Nov 25 20:07:53 2005 From: mdudzikml at gmail.com (Michael Dudzik) Date: Fri Nov 25 20:07:58 2005 Subject: [Zope3-Users] reST for content editors In-Reply-To: <1132967084.21774.248351107@webmail.messagingengine.com> References: <1132967084.21774.248351107@webmail.messagingengine.com> Message-ID: <1132967273.21993.248352267@webmail.messagingengine.com> On Fri, 25 Nov 2005 19:04:44 -0600, "Michael Dudzik" said: > On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen" > said: > > I'd prefer to allow content editors on my site to avoid having to > > type HTML, and have heard that reST might be a good, wiki-like > > choice. However, it's not clear to me how to get that working with > > ZPT content insertions. Would I need to build a new content class for > > this, or is there some easier way? > > When a similar issue came up for me, all I did was add an additional > type field to the content object then created a "render" method in the > view, something like this for a 'description' field: > > def renderdescription(self): > # for rest, self.context.descriptiontype would be 'zope.source.rest' > source = zapi.createObject(None,self.context.descriptiontype, > self.context.description) > textview = zapi.getView(source,'',self.request) > html = view.render() typo - should be: html = textview.render() > return html > > And then just used "view/renderdescription" in my templates. > > On grepping the zope codebase quickly, it looks like the more "modern" > way to do this would be to use getMultiAdapter like: > > source = zapi.createObject(type,text) > renderer = zapi.getMultiAdapter((source, self.request)) > return renderer.render() > > I have no idea why I have an extra 'None' argument in my code, above > > See zope/app/preference/browser.py for an example From mdudzikml at gmail.com Fri Nov 25 20:13:20 2005 From: mdudzikml at gmail.com (Michael Dudzik) Date: Fri Nov 25 20:13:21 2005 Subject: [Zope3-Users] reST for content editors Message-ID: <1132967600.22336.248352376@webmail.messagingengine.com> I forgot the important part. In the template, what was previously tal:content="view/description" is replaced with tal:replace="structure view/renderdescription" On Fri, 25 Nov 2005 19:07:53 -0600, "Michael Dudzik" said: > > On Fri, 25 Nov 2005 19:04:44 -0600, "Michael Dudzik" > said: > > On Fri, 25 Nov 2005 17:15:24 -0600, "Brad Allen" > > said: > > > I'd prefer to allow content editors on my site to avoid having to > > > type HTML, and have heard that reST might be a good, wiki-like > > > choice. However, it's not clear to me how to get that working with > > > ZPT content insertions. Would I need to build a new content class for > > > this, or is there some easier way? > > > > When a similar issue came up for me, all I did was add an additional > > type field to the content object then created a "render" method in the > > view, something like this for a 'description' field: > > > > def renderdescription(self): > > # for rest, self.context.descriptiontype would be 'zope.source.rest' > > source = zapi.createObject(None,self.context.descriptiontype, > > self.context.description) > > textview = zapi.getView(source,'',self.request) > > html = view.render() > > typo - should be: > html = textview.render() > > > return html > > > > And then just used "view/renderdescription" in my templates. > > > > On grepping the zope codebase quickly, it looks like the more "modern" > > way to do this would be to use getMultiAdapter like: > > > > source = zapi.createObject(type,text) > > renderer = zapi.getMultiAdapter((source, self.request)) > > return renderer.render() > > > > I have no idea why I have an extra 'None' argument in my code, above > > > > See zope/app/preference/browser.py for an example > > _______________________________________________ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users From brad at allendev.com Sat Nov 26 00:51:03 2005 From: brad at allendev.com (Brad Allen) Date: Sat Nov 26 00:51:08 2005 Subject: [Zope3-Users] How to hide the ZMI In-Reply-To: References: Message-ID: >I'm working on a simple site which, to start with, just >uses bare ZPT functionality. I've been reading Philkon's >book sections dealing with TAL, TALES, and METAL, >and it's starting to make some sense. > >The part I'm stuck on is how to make the ZMI disappear >so the end user sees only the page I designed. >Do I have to go through the process of making a special skin >for my ZPT pages, or is there some easier way? Never mind, I figured this one out. Just get rid of the @@whatever at the end of the URL. From mailinglists at xgm.de Sun Nov 27 08:42:55 2005 From: mailinglists at xgm.de (Florian Lindner) Date: Sun Nov 27 08:42:43 2005 Subject: [Zope3-Users] PAU and Session Credentials In-Reply-To: <4386476E.60601@ruhr-uni-bochum.de> References: <200511202257.03402.mailinglists@xgm.de> <4386476E.60601@ruhr-uni-bochum.de> Message-ID: <200511271442.55404.mailinglists@xgm.de> 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 From mailinglists at xgm.de Sun Nov 27 12:57:45 2005 From: mailinglists at xgm.de (Florian Lindner) Date: Sun Nov 27 12:57:33 2005 Subject: [Zope3-Users] unauthenticated principal Message-ID: <200511271857.46126.mailinglists@xgm.de> 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 From pms2111 at columbia.edu Mon Nov 28 06:06:31 2005 From: pms2111 at columbia.edu (pms2111@columbia.edu) Date: Mon Nov 28 06:06:38 2005 Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check" problems Message-ID: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu> Hi, I am new to Zope and am having problems installing it on a fresh Red Had Linux AS 4 machine. In summary, Zope3 seems to compile without error (and the daemon can even get started), but "make check" causes errors to occur on the ZEO tests. Something about "No child processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests. I am not running as root. Since this linux distribution uses Python 2.3.4 as the default, I downloaded and compiled Python 2.4.1. The new python interpreter was "make altinstall" into /usr/bin/python2.4 as to not clobber the original /usr/bin/python which Red Hat utils seem to be dependent upon. Here is some background on my system: $ whoami psun $ uname -a Linux plato 2.6.9-22.0.1.EL #1 Tue Oct 18 18:29:40 EDT 2005 i686 i686 i386 GNU/Linux $ /usr/bin/python2.4 Python 2.4.1 (#1, Nov 28 2005, 18:39:16) [GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> The following is an abridged transcript of the steps I used to try and install Zope3: $ tar -zxf Zope-3.1.0.tgz $ cd Zope-3.1.0 $ ./configure --with-python /usr/bin/python2.4 Configuring Zope installation Using Python interpreter at /usr/bin/python2.4 $ make /usr/bin/python2.4 install.py -q build $ make check /usr/bin/python2.4 install.py -q build /usr/bin/python2.4 test.py -v Running UNIT tests at level 1 Running UNIT tests from /home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4 ...[many many dots]... Error in test checkReadOnlyStorage (ZEO.tests.testConnection.FileStorageReconnectionTests) Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 270, in run self.tearDown() File "/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/ZEO/tests/ConnectionTests.py", line 122, in tearDown os.waitpid(pid, 0) OSError: [Errno 10] No child processes Error in test checkReconnectFallback (ZEO.tests.testConnection.FileStorageReconnectionTests) Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 270, in run self.tearDown() File "/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/ZEO/tests/ConnectionTests.py", line 122, in tearDown os.waitpid(pid, 0) OSError: [Errno 10] No child processes [Many more errors in originating from ZEO/tests/* files omitted] ......... Failure in test testRunIgnoresParentSignals (zdaemon.tests.testzdrun.ZDaemonTests) Traceback (most recent call last): File "/usr/lib/python2.4/unittest.py", line 260, in run testMethod() File "/home/psun/src/Zope-3.1.0/build/lib.linux-i686-2.4/zdaemon/tests/testzdrun.py", line 237, in testRunIgnoresParentSignals self.assert_(is_started, "spawned process failed to start in a minute") File "/usr/lib/python2.4/unittest.py", line 309, in failUnless if not expr: raise self.failureException, msg AssertionError: spawned process failed to start in a minute ................... Ran 6991 tests in 311.657s FAILED (failures=1, errors=18) make: *** [check] Error 1 However, the daemon seems to run OK, and I can connect to http://localhost:8080. Can anyone help me with this? I have been racking my brains for hours trying to figure this out. Thanks! --Peter Sun From tim.peters at gmail.com Mon Nov 28 10:46:44 2005 From: tim.peters at gmail.com (Tim Peters) Date: Mon Nov 28 10:46:53 2005 Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check" problems In-Reply-To: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu> References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu> Message-ID: <1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com> [pms2111@columbia.edu] > I am new to Zope and am having problems installing it on a fresh Red > Had Linux AS 4 machine. In summary, Zope3 seems to compile without > error (and the daemon can even get started), but "make check" > causes errors to occur on the ZEO tests. Something about "No child > processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests. > I am not running as root. There was a long thread about a probably-related symptom in August: http://mail.zope.org/pipermail/zope/2005-August/161025.html Alas, AFAICT, it was never resolved. There are suggestions about what to _try_ to do in the thread referenced above, but AFAICT they weren't tried. ... From pms2111 at columbia.edu Mon Nov 28 12:01:57 2005 From: pms2111 at columbia.edu (Peter Sun) Date: Mon Nov 28 12:01:56 2005 Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check" problems References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu> <1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com> Message-ID: <000c01c5f43d$74426d60$0201000a@DasFuhrer> Ahh.. .. I'm so sorry that I did not check that mail archive. Thanks for taking the time to reply and point me in the right direction. Their discussion is right on point. --Peter Sun ----- Original Message ----- From: "Tim Peters" To: Cc: Sent: Monday, November 28, 2005 11:46 PM Subject: Re: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check" problems [pms2111@columbia.edu] > I am new to Zope and am having problems installing it on a fresh Red > Had Linux AS 4 machine. In summary, Zope3 seems to compile without > error (and the daemon can even get started), but "make check" > causes errors to occur on the ZEO tests. Something about "No child > processes." It also fails on zdaemon.tests.testzdrun.ZDaemonTests. > I am not running as root. There was a long thread about a probably-related symptom in August: http://mail.zope.org/pipermail/zope/2005-August/161025.html Alas, AFAICT, it was never resolved. There are suggestions about what to _try_ to do in the thread referenced above, but AFAICT they weren't tried. ... From tim.peters at gmail.com Mon Nov 28 13:15:01 2005 From: tim.peters at gmail.com (Tim Peters) Date: Mon Nov 28 13:22:07 2005 Subject: [Zope3-Users] Installing Zope3 on Redhat AS 4 has "make check" problems In-Reply-To: <000c01c5f43d$74426d60$0201000a@DasFuhrer> References: <1133175991.438ae4b746b98@cubmail.cc.columbia.edu> <1f7befae0511280746x63fc11d1xbf633acd0b1fe528@mail.gmail.com> <000c01c5f43d$74426d60$0201000a@DasFuhrer> Message-ID: <1f7befae0511281015o2d276cd0n374fb3983243dba8@mail.gmail.com> [Peter Sun, about http://mail.zope.org/pipermail/zope/2005-August/161025.html ] > Ahh.. .. I'm so sorry that I did not check that mail archive. Not a problem -- it was a different list, and not necessarily easy to find that old thread. > Thanks for taking the time to reply and point me in the right direction. Their > discussion is right on point. Except it didn't reach a conclusion, so eventually bit you too. If you figure out what's really happening, please let us know! The old thread not only didn't resolve it, it never (IIRC) even generated a likely theory for the waitpid() failures. BTW, you had another test (testRunIgnoresParentSignals) fail with "spawned process failed to start in a minute". For that one, look for file "donothing.sh" and make sure its execute bit is set. In some combinations of Zope + Python, the execute bit on donothing.sh is getting cleared, and then testRunIgnoresParentSignals spins its wheels for a minute wating for donothing.sh to (despite its name ) "do something". donothing.sh won't exist in the next Zope3 release. From brad at allendev.com Tue Nov 29 17:45:26 2005 From: brad at allendev.com (Brad Allen) Date: Tue Nov 29 17:45:44 2005 Subject: [Zope3-Users] need guidance Message-ID: I'm still in the midst of an effort at learning Zope 3, while try to build a real website for it. I have ambitions for using Zope 3 in several different projects, and am actively working on a Zope 3 website that I hope to have looking presentable if not fully functional by mid-December. It will probably look a lot like a static site at first, with a few added features like messageboard functionality (I hope it will be ok for me to use MessageBoard from Stephan Richter's book for a non-profit site). Later we will want to add features for wiki, blogging, event calendar, and document library. Another Zope 3 project for the future is to convert an ecommerce site I had previously built in PHP. I've been using Python at my day job now for a couple of years, and have decided I no longer have time for PHP--I want to switch the site to Python, probably using Zope 3. This site's main purpose is to allow customers to search, view, and purchase from a catalog of auto parts. With these two different types of sites in mind, some design questions have come up in relation to Zope 3. For the auto parts site, I am thinking about designing an AutoPart content component. This will allow the business owner to edit his catalog of auto parts via the web. Suppose he starts instantiating a lot of auto parts, and editing them. Later, we decide we need to refactor the base class, and maybe create a few child classes. That leaves me with a big cleanup chore, because a lot of old AutoPart instances are sitting around in the database. What's the normal pattern for dealing with this kind of cleanup? Am I better off just using SQL tables to provide persistence, and not storing my object instances in ZODB? At least with SQL, it's easy enough to manipulate the content data, and just re-instantiate AutoPart objects from SQL when needed. I'm trying to come to an understanding of when it's best to keep data in the ZODB, and when it's best to use SQL instead. Maybe there are tools for handling ZODB data that I don't know about. Another question about ZODB is whether to use it to store page templates. If I build a lot of ZPT pages and macros and store them through the ZMI, and then later want to rearrange the folder structure, I'm guessing it will be a pain to change a lot of hard-coded path references. If I use text files outside the ZODB, then I can use a host of text editor tools for searching across multiple files. I like the idea of letting end users have something like the ZMI for editing content, and am hoping it will be possible avoid putting much TAL and METAL markup in documents in the ZMI, but rather have the .pt files pull content from the ZODB. However, it's not clear to me how to make that work. The examples in the books have the .pt files in the filesystem; I don't recall seeing any the ZMI/ZODB. Here is another question. Suppose I'm working with a team of developers. Should we each set up our own separate Zope3 instance, and do SVN checkouts into our own separate, local /lib/python directories inside the instance? How then would we merge any changes done in the ZODB? On the other hand, having all team members try to share a single Zope 3 instance seems unworkable... Thanks for any insights you can provide. From chrism at plope.com Tue Nov 29 17:50:30 2005 From: chrism at plope.com (Chris McDonough) Date: Tue Nov 29 17:50:41 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: Message-ID: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> Hi Brad, On Nov 29, 2005, at 5:45 PM, Brad Allen wrote: > Here is another question. Suppose I'm working with a team of > developers. Should we each set up our own separate Zope3 instance, > and do SVN checkouts into our own separate, local /lib/python > directories inside the instance? How then would we merge any > changes done in the ZODB? On the other hand, having all team > members try to share a single Zope 3 instance seems unworkable... I wrote a short treatise on this subject at http://www.plope.com/ Members/chrism/zope_collab/view that you may want to take a look at. It's written with Zope 2 in mind but the issues and mechanics remain the same. - C From tl at gocept.com Tue Nov 29 18:16:48 2005 From: tl at gocept.com (Thomas Lotze) Date: Tue Nov 29 18:33:41 2005 Subject: [Zope3-Users] (Ab)using utilities Message-ID: Hi, in an application we build using Zope 3, I've been noticing a tendency to use utilities quite a lot. For instance, suppose we have a top level container which holds items of type one. There are also items of types two and three somehow connected to the top level container. To avoid having to filter item types all the time, we don't just want to mix them in among the type one items. However, we don't want to put folders in the top level container to hold all type two or type three items, resp., either. The reason being a feeling that such folders would not provide well-defined enough access: they might be renamed, or there might be more than one folder holding items of either type. Our current solution is to register utilities that handle type two and three items, and turn them into folders actually containing the items while we're at it. This does provide uniqueness of the type two and three item containers, as well as well-defined access by an interface name. However, I'm not at all sure that containing application data is what utilities are meant for. Is it? I get a feeling that we might want folders as attributes of the top-level container, for all the uniqueness and well-defined access that provides. But would that be Zope-3-ish? -- Thomas From brad at allendev.com Tue Nov 29 22:07:13 2005 From: brad at allendev.com (Brad Allen) Date: Tue Nov 29 22:07:18 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> Message-ID: Chris McDonough wrote: >>Here is another question. Suppose I'm working with a team of >>developers. Should we each set up our own separate Zope3 instance, >>and do SVN checkouts into our own separate, local /lib/python >>directories inside the instance? How then would we merge any >>changes done in the ZODB? On the other hand, having all team >>members try to share a single Zope 3 instance seems unworkable... > >I wrote a short treatise on this subject at >http://www.plope.com/Members/chrism/zope_collab/view that you may >want to take a look at. >It's written with Zope 2 in mind but the issues and mechanics remain the same. Ok, so this kind of discussion makes me wonder how much I can do without ZODB, or at least whether I can just use the ZODB files like any other binary files in the SVN repository. Having to write scripts to regenerate them sounds like a lot of ass-ache. Is there any reason why I can't just check in those data.fs files into SVN along with my Python packages, so that other team members can check them out into their respective Zope instances? From duncan.mcgreggor at gmail.com Tue Nov 29 22:29:06 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Tue Nov 29 22:29:35 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> Message-ID: <5f870c883c623793e47b7c4baa9e8f44@gmail.com> On Nov 29, 2005, at 8:07 PM, Brad Allen wrote: >>> Here is another question. Suppose I'm working with a team of >>> developers. Should we each set up our own separate Zope3 instance, >>> and do SVN checkouts into our own separate, local /lib/python >>> directories inside the instance? How then would we merge any changes >>> done in the ZODB? On the other hand, having all team members try to >>> share a single Zope 3 instance seems unworkable... >> >> I wrote a short treatise on this subject at >> http://www.plope.com/Members/chrism/zope_collab/view that you may >> want to take a look at. >> It's written with Zope 2 in mind but the issues and mechanics remain >> the same. > > Ok, so this kind of discussion makes me wonder how much I can do > without ZODB, or at least whether I can just use the ZODB files like > any other binary files in the SVN repository. Having to write scripts > to regenerate them sounds like a lot of ass-ache. Is there any reason > why I can't just check in those data.fs files into SVN along with my > Python packages, so that other team members can check them out into > their respective Zope instances? It sounds like a pain, and to be honest, at first it is a bit arduous. Not only does it get faster and become second nature, but chunks of it can be generalized and reused. It really doesn't take that long to get accustomed to it. And once you start doing it regularly, you gain a tremendous amount. Not just in the mere knowledge acquired, either... there's a subtle shift in your programming where you give extra attention to the data-generating/-populating code, which in turn makes you architect your information better ahd brings higher overall levels of organization to your project. Additionally, the ability to generate a new instance of a project complete with a fresh-and-ready ZODB is of immense value when working on a project with multiple developers or teams of developers. Several times, we have saved literally days of work taking advantage of this. I'm sure others that take even better advantage of this have saved perhaps weeks. I give it two thumbs up ;-) d From chrism at plope.com Tue Nov 29 23:01:12 2005 From: chrism at plope.com (Chris McDonough) Date: Tue Nov 29 23:01:33 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> Message-ID: <75EF5B11-D9DE-4489-B8AD-D86FF549850C@plope.com> On Nov 29, 2005, at 10:07 PM, Brad Allen wrote: > > Chris McDonough wrote: >>> Here is another question. Suppose I'm working with a team of >>> developers. Should we each set up our own separate Zope3 >>> instance, and do SVN checkouts into our own separate, local /lib/ >>> python directories inside the instance? How then would we merge >>> any changes done in the ZODB? On the other hand, having all team >>> members try to share a single Zope 3 instance seems unworkable... >> >> I wrote a short treatise on this subject at http://www.plope.com/ >> Members/chrism/zope_collab/view that you may want to take a look at. >> It's written with Zope 2 in mind but the issues and mechanics >> remain the same. > > Ok, so this kind of discussion makes me wonder how much I can do > without ZODB, or at least whether I can just use the ZODB files > like any other binary files in the SVN repository. Having to write > scripts to regenerate them sounds like a lot of ass-ache. Hehe. I like that description. ;-) Yes, it is. Although there is at least one tool that helps with just this called GenericSetup for Zope 2. I suspect that tool could be made to work with Zope 3 with a bit of work. > Is there any reason why I can't just check in those data.fs files > into SVN along with my Python packages, so that other team members > can check them out into their respective Zope instances? No, as long as your code matches the pickles in the database binary stored in CVS. The problems start when you need to change the code in a way that makes the pickles in the database incompatible with the code; for example if you need to change the name of an instance attribute in one of your classes; the pickles have the values stored in the old attribute name and your new code expects the new attribute name. So the code fails on the old data. This is of course the same problem you have when you need to change the schema of a relational database and you have an existing database instance. That said, Zope 3 comes with a tool named "generations" that allows you to evolve database pickles in a uniform way by writing evolution scripts. - C From chrism at plope.com Tue Nov 29 23:12:48 2005 From: chrism at plope.com (Chris McDonough) Date: Tue Nov 29 23:12:50 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <5f870c883c623793e47b7c4baa9e8f44@gmail.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: <322B2C14-03AC-479C-A278-732CFD860806@plope.com> On Nov 29, 2005, at 10:29 PM, Duncan McGreggor wrote: > Additionally, the ability to generate a new instance of a project > complete with a fresh-and-ready ZODB is of immense value when > working on a project with multiple developers or teams of > developers. Several times, we have saved literally days of work > taking advantage of this. I'm sure others that take even better > advantage of this have saved perhaps weeks. Yes. You could also just check in a generated database into CVS and use that with some of the same benefit but FWIW, I find the biggest value in being able to review this kind of setup code is that it serves as a kind of documentation as to *how* an iinitial database got created. Also, setup code is often complex and subtle because it's "where the rubber meets the road" in a production configuration. Being able to replicate it on demand with subtle changes (like port numbers and filenames) is valuable when you want to roll out a system into production. - C From brad at allendev.com Wed Nov 30 00:57:05 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 00:57:09 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <5f870c883c623793e47b7c4baa9e8f44@gmail.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: Duncan McGreggor >It sounds like a pain, and to be honest, at first it is a bit >arduous. Not only does it get faster and become second nature, but >chunks of it can be generalized and reused. It really doesn't take >that long to get accustomed to it. And once you start doing it >regularly, you gain a tremendous amount. Not just in the mere >knowledge acquired, either... there's a subtle shift in your >programming where you give extra attention to the >data-generating/-populating code, which in turn makes you architect >your information better ahd brings higher overall levels of >organization to your project. So this style of Zope 3 development involves not using ZODB so much for permanent storage, but instead as a temporary scaffolding on which to hang the current version of class instances and their content. When you refactor your classes and interfaces, you just re-instantiate everything into the ZODB to recreate the site. It sounds great, except not all data can be simply regenerated. For stuff like port numbers and configuration, fine, it can be in ZCML or embedded in Python scripts. But the site content generated by end users has to be stored somewhere, too,. If you throw away your ZODB and regenerate it, what happens to that data? Does your regeneration script transfer all that data to the newly generated ZODB? I'd be interested in seeing the particulars of how you guys do that stuff. I've yet to run across a direct mention of how to create an arbitrary ZODB and start reading and writing objects. That seems to be a big piece missing from my understanding of how to work with Zope 3. Every ZODB example I've seen in the books seems to involve creating a content object that can be added via the ZMI. However, I'm not finished with either book, and I have very likely missed something. From chrism at plope.com Wed Nov 30 01:17:56 2005 From: chrism at plope.com (Chris McDonough) Date: Wed Nov 30 01:18:06 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: > So this style of Zope 3 development involves not using > ZODB so much for permanent storage, but instead as a > temporary scaffolding on which to hang the current version > of class instances and their content. When you refactor > your classes and interfaces, you just re-instantiate everything > into the ZODB to recreate the site. For development, yes. > > It sounds great, except not all data can be simply regenerated. > For stuff like port numbers and configuration, fine, it can be > in ZCML or embedded in Python scripts. But the site content > generated by end users has to be stored somewhere, too,. > If you throw away your ZODB and regenerate it, what happens > to that data? Does your regeneration script transfer > all that data to the newly generated ZODB? While you're developing, it's much easier because the *content* in your ZODB doesn't typically have any value during development. If it does have value during development, you have a development model that's not similar to mine. But obviously, after you go into production, the content does have value, and preserving this value is the purpose of GenericSetup for Zope 2. It's a "dump and reload" solution which allows you to create a represention of your ZODB data and its associated hierarchy as files on a filesystem. You can basically push a button to dump the data in your ZODB ro files, and then create a new ZODB, instantiate the tool, and push a button to reload it. Zope 3's "filesystem synchronization" capability is similar in concept, although I don't know if that has been maintained recently. > I'd be interested in seeing the particulars of how > you guys do that stuff. I do it all the time for customer jobs and there are examples in CMF for Zope 2 (e.g. the "SiteGenerator") but I don't have any code that uses Zope 3 that does site generation. > I've yet to run across a direct > mention of how to create an arbitrary ZODB and > start reading and writing objects. That seems to > be a big piece missing from my understanding > of how to work with Zope 3. Every ZODB example > I've seen in the books seems to involve creating a content > object that can be added via the ZMI. However, I'm > not finished with either book, and I have very likely > missed something. There are tons of examples about how to access ZODB data outside of the context of Zope around, do a little googling. The thing that might make it a little mindbending is that "accessing data in ZODB" is just.. Python. You open the database, get the root Zope object, and then traverse to an object in the database (usually via getattr or getitem or whatever the folder API is) and call methods on it or read attributes from it or whatever. There's really not much to it. It's largely the same as writing code in your content classes, but you can do it from a Python prompt. Zope 2 has "zopectl debug" which dumps you off at a Python prompt with the name "app" built in to the root Zope object. Note that this is not particular to any version of Zope. Zope is just a consumer of ZODB, and the issues are the same no matter what consumer of ZODB you're using. - C From alen.stanisic at gmail.com Wed Nov 30 02:02:37 2005 From: alen.stanisic at gmail.com (Alen Stanisic) Date: Wed Nov 30 02:02:53 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> Message-ID: <1133334157.3761.76.camel@localhost.localdomain> Hi Brad, On Tue, 2005-11-29 at 21:07 -0600, Brad Allen wrote: [...] > Ok, so this kind of discussion makes me wonder how much I can do > without ZODB, or at least whether I can just use the ZODB files like > any other binary files in the SVN repository. Having to write scripts > to regenerate them sounds like a lot of ass-ache. Is there any reason > why I can't just check in those data.fs files into SVN along with my > Python packages, so that other team members can check them out into > their respective Zope instances? I might be missing something but not sure why would one want to store a database in SVN. I could understand that people doing TTW Zope 2 development would have source code in ZODB but Zope 3 does not have any TTW development functionality at the moment and all of your source should be on the file system. Python scripts could automate building a site or site utilities and I would have that sort of stuff in svn. But as far as persistent content goes this is more of a data backup/migration issue. fssync I think was mentioned on the list for pulling content objects out of ZODB in Zope3 on the file system but not sure if it is available yet. Alen From duncan.mcgreggor at gmail.com Wed Nov 30 04:44:22 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 04:44:59 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: On Nov 29, 2005, at 10:57 PM, Brad Allen wrote: >> It sounds like a pain, and to be honest, at first it is a bit >> arduous. Not only does it get faster and become second nature, but >> chunks of it can be generalized and reused. It really doesn't take >> that long to get accustomed to it. And once you start doing it >> regularly, you gain a tremendous amount. Not just in the mere >> knowledge acquired, either... there's a subtle shift in your >> programming where you give extra attention to the >> data-generating/-populating code, which in turn makes you architect >> your information better ahd brings higher overall levels of >> organization to your project. > > So this style of Zope 3 development involves not using > ZODB so much for permanent storage, but instead as a > temporary scaffolding on which to hang the current version > of class instances and their content. When you refactor > your classes and interfaces, you just re-instantiate everything > into the ZODB to recreate the site. Like Chris said, a qualified "yes" -- i.e., during development. For a production alternative, he pointed to the generations tool. I haven't had a need to use it yet, but I've heard folks talking about it. > It sounds great, except not all data can be simply regenerated. > For stuff like port numbers and configuration, fine, it can be > in ZCML or embedded in Python scripts. But the site content > generated by end users has to be stored somewhere, too. I have several sites with base content that is pre-populated from python scripts and external files. > If you throw away your ZODB and regenerate it, what happens > to that data? Does your regeneration script transfer > all that data to the newly generated ZODB? Whenever I am told by client that they want me to build an application for them, and they want to be able to add data/content while I do it, I either gently educate them on the proven process that we use, or I walk away from the project. Maintaining content during development is almost always a nightmare. There are tools to use to enable this... approach... but in my mind (and many others') it's just not a good way to do development. To come a little closer to answering your question, the only time that I have ever needed this kind of thing is on projects where we were delivering a product to multiple clients, pre-populated with default content. All of that content was added via python. > I'd be interested in seeing the particulars of how > you guys do that stuff. I've yet to run across a direct > mention of how to create an arbitrary ZODB and > start reading and writing objects. As soon as you create an instance of a content object, you've written to the ZODB. Whenever you render a page that presents a content object, you've read from the ZODB. z3 "protects" the developer from the ZODB. You never have to do direct reads/writes. You're simply operating within a z3 "app"... As for particulars, there are several emails in the archives for this list that detail z3 site setups. Even better, there are examples in the wild. IIRC, the cubic project had an example for this, and the "worldcookery" demo site might too. I'd certainly check out schooltool to see what they have done. Code-based site creation/setup/configuration will provide you with lots of ideas, hands-on examples, and a good sense of how to approach this. > That seems to > be a big piece missing from my understanding > of how to work with Zope 3. Every ZODB example > I've seen in the books seems to involve creating a content > object that can be added via the ZMI. However, I'm > not finished with either book, and I have very likely > missed something. Yeah, I think you're looking for code-based content addition -- is that right? If so, you're going to want to spend some time looking at zope.app.zapi (a lot of which comes from zope.component). In particular, the createObject() function. Take a look at those projects I mentioned above... and other folks may have good suggestions for code examples on site creation and pre-population of content. Hang in there ;-) d From srichter at cosmos.phy.tufts.edu Wed Nov 30 07:55:10 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Wed Nov 30 07:55:23 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: Message-ID: <200511300755.10932.srichter@cosmos.phy.tufts.edu> On Tuesday 29 November 2005 17:45, Brad Allen wrote: > Another question about ZODB is whether to use it to store page > templates. If I build a lot of ZPT pages and macros and store them > through the ZMI, and then later want to rearrange the folder > structure, I'm guessing it will be a pain to change a lot of > hard-coded path references. If I use text files outside the ZODB, > then I can use a host of text editor tools for searching across > multiple files. > > I like the idea of letting end users have something like the ZMI for > editing content, and am hoping it will be possible avoid putting much > TAL and METAL markup in documents in the ZMI, but rather have the .pt > files pull content from the ZODB. However, it's not clear to me how > to make that work. The examples in the books have the .pt files in > the filesystem; I don't recall seeing any the ZMI/ZODB. We are currently not supporting TTW development. Thus, in Zope 3 you cannot develop templates TTW well yet. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From srichter at cosmos.phy.tufts.edu Wed Nov 30 07:56:18 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Wed Nov 30 07:56:25 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: Message-ID: <200511300756.18636.srichter@cosmos.phy.tufts.edu> On Tuesday 29 November 2005 17:45, Brad Allen wrote: > Here is another question. Suppose I'm working with a team of > developers. Should we each set up our own separate Zope3 instance, > and do SVN checkouts into our own separate, local /lib/python > directories inside the instance? How then would we merge any changes > done in the ZODB? On the other hand, having all team members try to > share a single Zope 3 instance seems unworkable... Yep, SVN is the way to go; we do this in Zope 3 projects all the time. Since no code lives in the ZODB, there is no need for sharing ZODB content. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From brad at allendev.com Wed Nov 30 12:38:02 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 12:38:13 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: At 1:17 AM -0500 11/30/05, Chris McDonough wrote: >While you're developing, it's much easier because the *content* in >your ZODB doesn't typically have any value during development. If >it does have value during development, you have a development model >that's not similar to mine. Well, I generally try to follow an iterative approach like that described in Agile or Extreme Programming styles ( ). The idea is to get something into production very quickly, let users bang on it, and then produce a new version based on feedback from users...and then do it again, and again, etc. There is no big lead time for "development-only"; the cycle is more like develop-release-use-develop-release-use, etc. During that cycle, end user data needs to be carried over to each new version. At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote: >Whenever I am told by client that they want me to build an >application for them, and they want to be able to add data/content >while I do it, I either gently educate them on the proven process >that we use, or I walk away from the project. Maintaining content >during development is almost always a nightmare. There are tools to >use to enable this... approach... but in my mind (and many others') >it's just not a good way to do development. In this case, the users want to start using a message board ASAP. This means they will be adding content to ZODB right away. I don't see how I can get away from having them put content into ZODB. At 1:17 AM -0500 11/30/05, Chris McDonough wrote: >But obviously, after you go into production, the content does have >value, and preserving this value is the purpose of GenericSetup for >Zope 2. It's a "dump and reload" solution which allows you to >create a represention of your ZODB data and its associated hierarchy >as files on a filesystem. You can basically push a button to dump >the data in your ZODB ro files, and then create a new ZODB, >instantiate the tool, and push a button to reload it. Zope 3's >"filesystem synchronization" capability is similar in concept, >although I don't know if that has been maintained recently. I guess another approach would be to NOT throw away my ZODB, but just delete and regenerate selected container folders, leaving the user content alone. From your postings about how the ZODB is accessible directly from Python, it sounds like that should be do-able. Hopefully it won't be too tough to tackle... At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote: >Yeah, I think you're looking for code-based content addition -- is >that right? If so, you're going to want to spend some time looking >at zope.app.zapi (a lot of which comes from zope.component). In >particular, the createObject() function. Take a look at those >projects I mentioned above... and other folks may have good >suggestions for code examples on site creation and pre-population of >content. Thanks. A little searching turned up , which looks like the place for me to dig into. I will also check out the source code. Thanks! From duncan.mcgreggor at gmail.com Wed Nov 30 12:45:50 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 12:46:21 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: <85a8631f46dbba13f272d1dc134ab0ec@gmail.com> On Nov 30, 2005, at 10:38 AM, Brad Allen wrote: > At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote: >> Whenever I am told by client that they want me to build an >> application for them, and they want to be able to add data/content >> while I do it, I either gently educate them on the proven process >> that we use, or I walk away from the project. Maintaining content >> during development is almost always a nightmare. There are tools to >> use to enable this... approach... but in my mind (and many others') >> it's just not a good way to do development. > > In this case, the users want to start using a message board ASAP. This > means they will be adding content to ZODB right away. I don't see how > I can get away from having them put content into ZODB. Just tell them that ASAP == 'when development for the first release has been completed' ;-) >> Yeah, I think you're looking for code-based content addition -- is >> that right? If so, you're going to want to spend some time looking at >> zope.app.zapi (a lot of which comes from zope.component). In >> particular, the createObject() function. Take a look at those >> projects I mentioned above... and other folks may have good >> suggestions for code examples on site creation and pre-population of >> content. > > Thanks. A little searching turned up > , which looks like the place > for me to dig into. I will also check out the source code. Thanks! Hmm, again, I think you *might* want to stay away from an approach that interacts directly with the ZODB. Unless you're not using z3/Zope 2... If you want pre-populated content in a z3 project, you probably want to be creating site instances to which you would add utilities and content. I may be misperceiving your needs, though... d From brad at allendev.com Wed Nov 30 13:41:47 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 13:41:53 2005 Subject: [Zope3-Users] list archives for zope3-users Message-ID: I'm looking for a better way to search and read the list archives for this list. Here are the list archives that I know about. Text file archives: http://mail.zope.org/pipermail/zope3-users Searchable mail archive: http://www.mail-archive.com/zope3-users@zope.org/ Gmane provides a variety of ways to view the list, but the search options are still pretty limited. http://dir.gmane.org/gmane.comp.web.zope.zope3.user I wish there was some way to access mailing list archives via a POP3 interface, so that I could use my mail app of choice. In my case, Eudora is my favorite app for searching and viewing mailing lists. Unfortunately, I've only got a couple of months of Zope3-users in Eudora. I haven't found that the text file archives to be easily importable. Does anyone else on this list use Eudora? If so, I'd very much appreciate a copy of your Eudora mailbox file for the Zope3 users list. If anyone else has thoughts on the best way to search the mailing list archives, I'd appreciate hearing about it. I'd prefer to avoid asking questions that others have already asked. From srichter at cosmos.phy.tufts.edu Wed Nov 30 13:49:29 2005 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Wed Nov 30 13:49:32 2005 Subject: [Zope3-Users] list archives for zope3-users In-Reply-To: References: Message-ID: <200511301349.30007.srichter@cosmos.phy.tufts.edu> On Wednesday 30 November 2005 13:41, Brad Allen wrote: > If anyone else has thoughts on the best way to search the mailing > list archives, I'd appreciate hearing about it. I'd prefer to avoid > asking questions that others have already asked. I use google. :-) Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training From duncan.mcgreggor at gmail.com Wed Nov 30 13:49:24 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 13:49:54 2005 Subject: [Zope3-Users] list archives for zope3-users In-Reply-To: References: Message-ID: On Nov 30, 2005, at 11:41 AM, Brad Allen wrote: > If anyone else has thoughts on the best way to search the mailing list > archives, I'd appreciate hearing about it. I'd prefer to avoid asking > questions that others have already asked. Hey Brad, I feel like we're becoming best friends ;-) I use google. Here's a google search string example for searching the zope3-users maillist for "ZODB": site:http://mail.zope.org location:pipermail/zope3-users ZODB d From duncan.mcgreggor at gmail.com Wed Nov 30 13:52:06 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 13:52:20 2005 Subject: [Zope3-Users] list archives for zope3-users In-Reply-To: References: Message-ID: <70f65c5060e783b811845becef3e326e@gmail.com> On Nov 30, 2005, at 11:49 AM, Duncan McGreggor wrote: >> If anyone else has thoughts on the best way to search the mailing >> list archives, I'd appreciate hearing about it. I'd prefer to avoid >> asking questions that others have already asked. > > Hey Brad, I feel like we're becoming best friends ;-) > > I use google. Here's a google search string example for searching the > zope3-users maillist for "ZODB": > > site:http://mail.zope.org location:pipermail/zope3-users ZODB Doh. My bad, that should have been: site:http://mail.zope.org inurl:pipermail/zope3-users ZODB From brad at allendev.com Wed Nov 30 14:02:12 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 14:02:20 2005 Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance Message-ID: Based on discussion in the 'need guidance' thread, I started looking into how to access the Zope ZODB directly from within Python scripts. I haven't gotten very far yet. I'm still at the beginning of the docs at trying out the example code. I got stuck trying to open the Data.fs file in my Zope instance. Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ZODB import FileStorage, DB >>> storage = FileStorage.FileStorage('Data.fs') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/site-packages/ZODB/FileStorage/FileStorage.py", line 112, in __init__ self._lock_file = LockFile(file_name + '.lock') File "/usr/lib/python2.4/site-packages/ZODB/lock_file.py", line 57, in __init__ self._fp = open(path, 'r+') IOError: [Errno 13] Permission denied: 'Data.fs.lock' >>> storage = FileStorage.FileStorage('Data.fs') I tried shutting down the Zope 3 instance, the the same traceback appeared anyway. I checked to make sure I had the filename right: >>> import os >>> os.path.isfile('Data.fs') True How do I clear the lock on the file? Thanks! From lists at nabble.com Wed Nov 30 14:05:09 2005 From: lists at nabble.com (kooto (sent by Nabble.com)) Date: Wed Nov 30 14:05:11 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: References: Message-ID: <1721636.post@talk.nabble.com> Brad Allen wrote: > > I'm looking for a better way to search and read the list archives for > this list. Here are the list archives that I know about. > ... > > If anyone else has thoughts on the best way to search the mailing > list archives, I'd appreciate hearing about it. I'd prefer to avoid > asking questions that others have already asked. > Nabble is another searchable archive like Gmane. http://www.nabble.com/Zope-f6706.html The difference is that it allows the cataloging of all Zope lists (zope, zope3, users, dev, db, plone ...) into one combined forum where users can search and browse in one single place, vs having to go to each individual list to search. It also has a powerful search and a clean UI. -- Sent from the Zope3 - users forum at Nabble.com: http://www.nabble.com/list-archives-for-zope3-users-t647430.html#a1721636 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051130/3581bf77/attachment.htm From brad at allendev.com Wed Nov 30 14:13:45 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 14:13:54 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <85a8631f46dbba13f272d1dc134ab0ec@gmail.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> <85a8631f46dbba13f272d1dc134ab0ec@gmail.com> Message-ID: At 10:45 AM -0700 11/30/05, Duncan McGreggor wrote: > >Hmm, again, I think you *might* want to stay away from an approach >that interacts directly with the ZODB. Unless you're not using >z3/Zope 2... I didn't see this posting until after I started a new thread called "Direct ZODB access in a Zope3 instance". So, why is it a bad idea? From brad at allendev.com Wed Nov 30 14:25:57 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 14:26:01 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <200511300755.10932.srichter@cosmos.phy.tufts.edu> References: <200511300755.10932.srichter@cosmos.phy.tufts.edu> Message-ID: At 7:55 AM -0500 11/30/05, Stephan Richter wrote: >We are currently not supporting TTW development. Thus, in Zope 3 you cannot >>develop templates TTW well yet. Ok, that alters my plans somewhat. But I can still have end user contribute/edit content within the ZMI, right? Maybe a ZPT component just isn't the right choice for that. I will see if I can get Zwiki installed and running sometime today. Maybe that will provide a more appropriate content component for end users. From dman at dman13.dyndns.org Wed Nov 30 14:31:59 2005 From: dman at dman13.dyndns.org (Derrick Hudson) Date: Wed Nov 30 14:31:34 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: <70f65c5060e783b811845becef3e326e@gmail.com> References: <70f65c5060e783b811845becef3e326e@gmail.com> Message-ID: <20051130193159.GA31815@dman13.dyndns.org> On Wed, Nov 30, 2005 at 11:52:06AM -0700, Duncan McGreggor wrote: | On Nov 30, 2005, at 11:49 AM, Duncan McGreggor wrote: | | >>If anyone else has thoughts on the best way to search the mailing | >>list archives, I'd appreciate hearing about it. I'd prefer to avoid | >>asking questions that others have already asked. | > | >Hey Brad, I feel like we're becoming best friends ;-) | > | >I use google. Here's a google search string example for searching the | >zope3-users maillist for "ZODB": | > | >site:http://mail.zope.org location:pipermail/zope3-users ZODB | | Doh. My bad, that should have been: | | site:http://mail.zope.org inurl:pipermail/zope3-users ZODB ^^^^^ OOh, nice. I didn't know about that feature, but wished there was something like that. Thanks. -D -- Better a little with righteousness than much gain with injustice. Proverbs 16:8 www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/4cf8dade/attachment.bin From lists at nabble.com Wed Nov 30 14:32:13 2005 From: lists at nabble.com (kooto (sent by Nabble.com)) Date: Wed Nov 30 14:32:14 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: <1721636.post@talk.nabble.com> References: <1721636.post@talk.nabble.com> Message-ID: <1722071.post@talk.nabble.com> kooto wrote: > > > Brad Allen wrote: >> >> If anyone else has thoughts on the best way to search the mailing >> list archives, I'd appreciate hearing about it. I'd prefer to avoid >> asking questions that others have already asked. >> > > Nabble is another searchable archive like Gmane. http://www.nabble.com/Zope-f6706.html > Actually, Nabble also has a combined archive for all Zope3 lists under the Zope category: http://www.nabble.com/Zope3-f13629.html I saw the suggestion of using Google "site:http://mail.zope.org inurl:pipermail/zope3-users ZODB" to search. I guess this is ok as long as you realize that Google does not index all the messages - typically, 10% of the pages from a site can get into the Google index (and most of them tend to be old). Plus, the recent messages will not be in Google index for sometime so you will probably miss the recent messages in Google search. -- Sent from the Zope3 - users forum at Nabble.com: http://www.nabble.com/list-archives-for-zope3-users-t647430.html#a1722071 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope3-users/attachments/20051130/1f7393cb/attachment.htm From duncan.mcgreggor at gmail.com Wed Nov 30 14:33:06 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 14:33:36 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> <85a8631f46dbba13f272d1dc134ab0ec@gmail.com> Message-ID: <491cfe5b4f8427e3fd6e99e1a1ea337e@gmail.com> On Nov 30, 2005, at 12:13 PM, Brad Allen wrote: >> Hmm, again, I think you *might* want to stay away from an approach >> that interacts directly with the ZODB. Unless you're not using >> z3/Zope 2... > > I didn't see this posting until after I started a new thread called > "Direct ZODB access in a Zope3 instance". So, why is it a bad > idea? Well, it's a great idea if your application is non-zope python with a need for "versioned" storage. It's not such a good idea if your application is a zope app because those app servers do so much of the work for you, with many years of honing put into them. The best thing to do is learn how to use the app server/framework such that your work is minimized (both short- and long-term) and such that the final product is a stable as possible (building on prior, tested, and proven work). Direct access in a z3 app is usually made for debugging purposes, and used with the pdb, can be very effective for hunting down and solving issues. As per your other email, the reason you had problems was because your z3 instance was already running. If you are not using ZEO, you need to stop z3 in order to gain access to the ZODB. Have you seen Benji's quick start guide? In addition to Stephan Richter's book, you ought to read Philipp von Weitershausen's book too. As of zope3.1, it's a little out of date, but only in a few areas. The conceptual explanations and careful, hands-on, examples-based approach is pure gold. His and Stephan's book are the perfect couple ;-) Links: http://worldcookery.com/ (Philipp's book is here) http://www.benjiyork.com/quick_start/ In addition, I've written a python script that auto-generates a starter z3 project for you, after asking a couple questions. If you want to use it, I'd be more than willing to answer any questions about it (an thus improve it) off-list. You can download it here: http://www.zope.org/Members/adytumsolutions/z3project_starter I'll got back to your original post and try to do a better job of answering your questions. d From dman at dman13.dyndns.org Wed Nov 30 14:39:02 2005 From: dman at dman13.dyndns.org (Derrick Hudson) Date: Wed Nov 30 14:41:45 2005 Subject: [Zope3-Users] Re: need guidance In-Reply-To: References: <200511300755.10932.srichter@cosmos.phy.tufts.edu> Message-ID: <20051130193902.GB31815@dman13.dyndns.org> On Wed, Nov 30, 2005 at 01:25:57PM -0600, Brad Allen wrote: | At 7:55 AM -0500 11/30/05, Stephan Richter wrote: | >We are currently not supporting TTW development. Thus, in Zope 3 you cannot | >>develop templates TTW well yet. | | Ok, that alters my plans somewhat. But I can still have end | user contribute/edit content within the ZMI, right? Of course users can contribute content. Don't confuse content with content type. The type involves coding and extending the functionality of the base system. Content itself is basically just text. Content is the same as 'data'. What users can't contribute, because TTW isn't well supported, is code and behavior. The developers will produce the code and implement all the needed behavior, then the users will produce the content. | Maybe a ZPT component just isn't the right choice for that. | | I will see if I can get Zwiki installed and running sometime today. | Maybe that will provide a more appropriate content component | for end users. It is if you are looking for the dynamic that a wiki provides. HTH, -D -- > SELECT * FROM users WHERE clue > 0 0 rows returned (http://www.thinkgeek.com/images/products/zoom/no-clue.jpg) www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/9502ff70/attachment.bin From michael at d2m.at Wed Nov 30 14:12:35 2005 From: michael at d2m.at (Michael Haubenwallner) Date: Wed Nov 30 14:43:34 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: References: Message-ID: Brad Allen wrote: > I'm looking for a better way to search and read the list archives for > this list. Here are the list archives that I know about. > > Text file archives: > http://mail.zope.org/pipermail/zope3-users > > Searchable mail archive: > http://www.mail-archive.com/zope3-users@zope.org/ > > Gmane provides a variety of ways to view the list, but the search > options are still pretty limited. > http://dir.gmane.org/gmane.comp.web.zope.zope3.user > Gmane recently added a new search interface, start here: http://search.gmane.org/?group=gmane.comp.web.zope.zope3.user Michael -- http://zope.org/Members/d2m http://planetzope.org From michael at d2m.at Wed Nov 30 14:07:37 2005 From: michael at d2m.at (Michael Haubenwallner) Date: Wed Nov 30 14:47:41 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: References: Message-ID: Brad Allen wrote: > I'm looking for a better way to search and read the list archives for > this list. Here are the list archives that I know about. > > Text file archives: > http://mail.zope.org/pipermail/zope3-users > > Searchable mail archive: > http://www.mail-archive.com/zope3-users@zope.org/ > > Gmane provides a variety of ways to view the list, but the search > options are still pretty limited. > http://dir.gmane.org/gmane.comp.web.zope.zope3.user > > I wish there was some way to access mailing list archives via a POP3 > interface, so that I could use my mail app of choice. In my case, Eudora > is my favorite app for searching and viewing mailing lists. > Unfortunately, I've only got a couple of months of Zope3-users in > Eudora. I haven't found that the text file archives to be easily > importable. > > Does anyone else on this list use Eudora? If so, I'd very much > appreciate a copy of your Eudora mailbox file for the Zope3 users list. > > If anyone else has thoughts on the best way to search the mailing list > archives, I'd appreciate hearing about it. I'd prefer to avoid asking > questions that others have already asked. You can use http://www.google.com/search?sitesearch=mail.zope.org&q=zope3-users for a start and refine the query with your searchterm Michael -- http://zope.org/Members/d2m http://planetzope.org From chrism at plope.com Wed Nov 30 14:49:11 2005 From: chrism at plope.com (Chris McDonough) Date: Wed Nov 30 14:49:23 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com> On Nov 30, 2005, at 12:38 PM, Brad Allen wrote: > At 1:17 AM -0500 11/30/05, Chris McDonough wrote: >> While you're developing, it's much easier because the *content* in >> your ZODB doesn't typically have any value during development. If >> it does have value during development, you have a development >> model that's not similar to mine. > > Well, I generally try to follow an iterative approach like that > described in Agile or Extreme Programming styles ( en.wikipedia.org/wiki/Extreme_Programming > ). The idea is to get > something into production very quickly, let users bang on it, and > then produce a new version based on feedback from users...and then > do it again, and again, etc. There is no big lead time for > "development-only"; the cycle is more like develop-release-use- > develop-release-use, etc. During that cycle, end user data needs to > be carried over to each new version. FWIW, I wouldn't characterize the system into which those users put content into as a development system (aka development sandbox). Instead I'd call it a "demo" sandbox. Sure, the data in a demo sandbox needs to be enduring or you can't do iterative development because the customer will have no frame of reference between iterations, as all of their content will be gone. But data in a *development* sandbox is not very interesting and can be changed or thrown out at will. For example, I really don't care what's in a news article on my development sandbox. If the title of a news article says "Bush Invades Grenada" or "Ipsum Dolorum", it's all the same to me. I'm not actually reading the content, I'm just making it possible for the customer to add and change content abstractly. What the content says has no value to me. But there is the issue of keeping the demo system up to date while I do development because it *does* have value to the customer, so it's of course something that needs to be dealt with. So to get there, the mechanics I use are like this: - I create a buildout that builds the software I need to create a sandbox. Typically, this is Zope, ZEO, maybe a relational database, maybe an LDAP database, and so forth. I've done this many times, so it typically only takes me half a day or so, because I steal judiciously from other buildouts I've done. The job of the buildout is to put files on the filesystem. - I create a site generator, that puts some data I need into the ZODB. The job of the site generator is to put data in the ZODB. This also takes just a little bit, typically, because I've done it many times. - As I do development, I create scripts which evolve the database content from one code generation to the next as necessary. When I want to set up a new development sandbox, I run the buildout and the site generator on my own system. Then I continue to write code. When I finish "iteration 1", I set up a demo sandbox for the customer on one of his systems using the same buildout and site generator mechanisms. I continue developing in my development sandbox on my own system. In the meantime, presumably my customer is using and evaluating the "demo" system, which is running a only-slightly-older version of the code than what exists in my development sandbox, and also contains "real" data due to the fact they're adding and changing content. The customer never sees my development sandbox, only I do. I don't have his new content, but I don't really care. I'm able to deal more abstractly with the problem we're trying to solve than he or she might be, so having the most up to date content (or sometimes not having any content at all) in my development sandbox is not really an issue for me. In the meantime, if I'm working with other developers, they also run the buildout and site generator code and work in a sandbox *on their own system*. They never see page renderings generated by my development sandbox. I never see theirs. When we need to share code, we do so by checking our Zope product code in and out of CVS or subversion. We maintain the site generator and buildout as necessary as things change. As we move towards another iteration, if I need to, while I'm writing code, I write evolution scripts that are capable of fixing ZODB data in place between milestone revisions of code. I happen to know exactly when I need to do this, because I've been working with ZODB for many years. Other developers working with me do the same. When the project reaches a development milestone, I push out my development code to the customer's demo system and run the evolution scripts on the demo system. Their content remains intact, and they begin evaluating again and we start all over again for the next milestone. You say above that there's no big lead time for "development only". If you mean that you can't make time to do the above, I can understand the sentiment; I've heard it many times. But I just haven't found any other sane way to do it over the years I've been using Zope, so I feel like I've learned how to do this "the hard way" and I think it has a lot of value; every other method I've tried falls down in one or more important ways, particularly when I need to do collaborative development. HTH, - C From duncan.mcgreggor at gmail.com Wed Nov 30 14:52:43 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 14:53:16 2005 Subject: [Zope3-Users] need guidance In-Reply-To: References: Message-ID: <5af44b2a9c7f9ad72e076c29949944b9@gmail.com> On Nov 29, 2005, at 3:45 PM, Brad Allen wrote: > I'm still in the midst of an effort at learning Zope 3, while try to > build a real website for it. I have ambitions for using Zope 3 in > several different projects, and am actively working on a Zope 3 > website that I hope to have looking presentable if not fully > functional by mid-December. Do you have a zope2 background? With a background in zope2 and twisted, I found z3 very easy (delightful) to learn. My first z3 site was done from scratch, with graphic design, custom user-editable content in under 3 weeks. I was an instant z3 fan. > Another Zope 3 project for the future is to convert an ecommerce site > I had previously built in PHP. I've been using Python at my day job > now for a couple of years, and have decided I no longer have time for > PHP--I want to switch the site to Python, probably using Zope 3. This > site's main purpose is to allow customers to search, view, and > purchase from a catalog of auto parts. You will definitely want to start getting familiar with pythonic site creation in z3, particularly, setting up a catalog (IntId, Catalog, Index-creation, etc.). All of my query needs are met (so far) by simple python calls to catalog.SearchResults and then a lambda for sorting. Martijn Faassen wrote a great query wrapper called "hurry" that you will almost certainly want to investigate/use: http://faassen.n--tree.net/blog/view/weblog/2005/09/09/0 > For the auto parts site, I am thinking about designing an AutoPart > content component. This will allow the business owner to edit his > catalog of auto parts via the web. Suppose he starts instantiating a > lot of auto parts, and editing them. Later, we decide we need to > refactor the base class, and maybe create a few child classes. That > leaves me with a big cleanup chore, because a lot of old AutoPart > instances are sitting around in the database. As Chris mentioned before, to my understanding, this is a perfect use-case for generations, so you should be covered (if it's up to date...). > I'm trying to come to an understanding of when it's best to keep data > in the ZODB, and when it's best to use SQL instead. Maybe there are > tools for handling ZODB data that I don't know about. As a general trend, people that have highly-relational data tend to prefer using RDBMSs. I have no current projects for which I use an RDBMS, but I have in the past. I also have a very strong preference for object databases ;-) > Another question about ZODB is whether to use it to store page > templates. If I build a lot of ZPT pages and macros and store them > through the ZMI, and then later want to rearrange the folder > structure, I'm guessing it will be a pain to change a lot of > hard-coded path references. If I use text files outside the ZODB, then > I can use a host of text editor tools for searching across multiple > files. I think this has been answered. There's no current TTW dev. But you will come to dearly love filesystem dev, especially with multiple developers working on the same code ;-) > I like the idea of letting end users have something like the ZMI for > editing content, and am hoping it will be possible avoid putting much > TAL and METAL markup in documents in the ZMI, but rather have the .pt > files pull content from the ZODB. However, it's not clear to me how to > make that work. The examples in the books have the .pt files in the > filesystem; I don't recall seeing any the ZMI/ZODB. Perhaps I can clarify with a typical example: * you have a z3 project, all the code is on the file system * you will create custom content objects * you will create a "skin" for the project -- this is how it will look to end users * you can use the ZMI for administration tasks (such as creating/editing content) -- you can customize the ZMI to look like anything you want * you can modify your custom skin to present various editing/management options to the end users Perhaps this makes thins more clear? > Here is another question. Suppose I'm working with a team of > developers. Should we each set up our own separate Zope3 instance, and > do SVN checkouts into our own separate, local /lib/python directories > inside the instance? IMO, definitely ;-) HTH, d From dman at dman13.dyndns.org Wed Nov 30 15:01:26 2005 From: dman at dman13.dyndns.org (Derrick Hudson) Date: Wed Nov 30 15:01:01 2005 Subject: [Zope3-Users] Re: need guidance In-Reply-To: References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> Message-ID: <20051130200126.GC31815@dman13.dyndns.org> On Wed, Nov 30, 2005 at 11:38:02AM -0600, Brad Allen wrote: | At 1:17 AM -0500 11/30/05, Chris McDonough wrote: | >While you're developing, it's much easier because the *content* in | >your ZODB doesn't typically have any value during development. If | >it does have value during development, you have a development model | >that's not similar to mine. | | Well, I generally try to follow an iterative approach like that | described in Agile or Extreme Programming styles | ( ). The idea is | to get something into production very quickly, let users bang on it, | and then produce a new version based on feedback from users...and | then do it again, and again, etc. There is no big lead time for | "development-only"; the cycle is more like | develop-release-use-develop-release-use, etc. During that cycle, end | user data needs to be carried over to each new version. This isn't a problem. This is really the same thing, just with shorter cycles. (you show a 'release' step in your lifecycle, and each release is just that -- a release to production, not an intermediary part of developer collaboration) | At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote: | >Whenever I am told by client that they want me to build an | >application for them, and they want to be able to add data/content | >while I do it, I either gently educate them on the proven process | >that we use, or I walk away from the project. Maintaining content | >during development is almost always a nightmare. There are tools to | >use to enable this... approach... but in my mind (and many others') | >it's just not a good way to do development. | | In this case, the users want to start using a message board ASAP. For a messageboard you may want to see if any existing solutions fit your needs. Perhaps you don't need to custom code your own. If you do need to custom code your own, perhaps the message board example (in the zope3 repository) can serve as a suitable starting point. | This means they will be adding content to ZODB right away. I don't | see how I can get away from having them put content into ZODB. I see now. This is a different story than I understood from the earlier messages. Earlier you talked about putting the ZODB in svn for developer collaboration. That is quite different from the scenario of upgrading a production system. It sounds like the 'generations' framework is what you need. In your cycle you will develop and once you release version 1, a production system will be deployed. Users using that system will create content in the ZODB. Based on feedback you begin developing version 2. Version 2 may change the schema of some objects. When you release version 2, the production system will be upgraded. Using the generations framework the existing content in the ZODB will be evolved to fit the new schema and the application is again available for users to continue adding content. | At 1:17 AM -0500 11/30/05, Chris McDonough wrote: | >But obviously, after you go into production, the content does have | >value, and preserving this value is the purpose of GenericSetup for | >Zope 2. It's a "dump and reload" solution which allows you to | >create a represention of your ZODB data and its associated hierarchy | >as files on a filesystem. You can basically push a button to dump | >the data in your ZODB ro files, and then create a new ZODB, | >instantiate the tool, and push a button to reload it. Zope 3's | >"filesystem synchronization" capability is similar in concept, | >although I don't know if that has been maintained recently. Chris is describing part of the same process. He is talking about techniques to upgrade the software on a production system without losing preexisting data on that production system. During development and pre-release testing you won't have any critical data and each developer can simply recreate a new ZODB to work with. For more automated and repeatable testing your team should create some sample data and the scripts to populate a new installation with that data. If you don't do this then each time a developer or tester starts over with a clean database, then will need to expend time manually creating ad-hoc sample data to test with. The difference is the development environment vs. the production environment. HTH, -D -- A violent man entices his neighbor and leads him down a path that is not good. Proverbs 16:29 www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051130/da308417/attachment.bin From duncan.mcgreggor at gmail.com Wed Nov 30 15:05:01 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 15:05:31 2005 Subject: [Zope3-Users] content object migration (was: need guidance) In-Reply-To: <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com> Message-ID: <39ec67c12c70a18813e0fcce6cd1c36f@gmail.com> On Nov 30, 2005, at 12:49 PM, Chris McDonough wrote: > As we move towards another iteration, if I need to, while I'm writing > code, I write evolution scripts that are capable of fixing ZODB data > in place between milestone revisions of code. I happen to know > exactly when I need to do this, because I've been working with ZODB > for many years. Other developers working with me do the same. Awesome email, Chris -- thanks for sharing! In particular, I am tantalized by the paragraph above ;-) As I alluded in a previous post, this has been a very painful point for myself an other developers with whom I have worked. For one client, we used the CMFPlone.MigrationTool on a Zope2/Plone project where content addition was occurring throughout the development phase. I found the tool cumbersome and the whole process most painful and distasteful. Do you employ an analogous tool or elegant manual approach for z3 projects? If you have no tool, have you guys compiled a best practices doc (informal or otherwise) whereby those of us inexperienced in these particulars could benefit? Thanks! d From alecmunro at gmail.com Wed Nov 30 15:11:46 2005 From: alecmunro at gmail.com (Alec Munro) Date: Wed Nov 30 15:11:50 2005 Subject: [Zope3-Users] My principals not being found by PrincipalRegistry Message-ID: <9819d58b0511301211m11fc0cf3q154bfd2332d06eb1@mail.gmail.com> Specifically, this relates to the undo page. I have my own class of principal folder, as well as several classes of principals. These work for login, but when looking at the undo page, I get "not available". Is there something I manually have to do in order to get my principals to be available in the PrincipalRegistry, or have I screwed up somewhere else? Thanks, Alec Munro From brad at allendev.com Wed Nov 30 16:05:33 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 16:05:42 2005 Subject: [Zope3-Users] need guidance In-Reply-To: <5af44b2a9c7f9ad72e076c29949944b9@gmail.com> References: <5af44b2a9c7f9ad72e076c29949944b9@gmail.com> Message-ID: At 12:52 PM -0700 11/30/05, Duncan McGreggor wrote: >Do you have a zope2 background? With a background in zope2 and >twisted, I found z3 very easy (delightful) to learn. My first z3 >site was done from scratch, with graphic design, custom >user-editable content in under 3 weeks. I was an instant z3 fan. I did spend some time trying out Zope 2 a couple of years ago, but didn't get very far past the basics. That was before I had really gotten into Python. What got me interested in Z3 was that our local Python user group (http://www.python.org/dfw) has been recently looking at a variety of Python web frameworks. Based on reading parts of Stephan Richter's Zope 3 Developer's Guide, I got the impression that Zope 3 was the most mature and featureful available. The intros to chapters 7 and 8 had some inspiring bits about the kind of experience and thinking went into the architecture of Zope 3. We had some meetings involving getting Zope 3 up and running on Ubuntu, the MessageBoard tutorial, etc. After awhile, I realized that we really should have started with the Philikon book first (Web Component Development with Zope 3), because it spent more time explaining the basics (like TAL and METAL, for example). I'm still going back and forth between the two books as I continue learning Zope 3. Btw, I found that the cheapest place to buy both Zope 3 books is Nerdbooks.com. I'm a bit biased, because Nerdbooks provides a meeting space for the DFW Python user's group, and I want to promote Nerdbooks as much as possible due to their generosity in hosting user groups in the Dallas area, as well as the way they provide an unusual combination of a vast technical book selection with the lowest prices around (lower than Amazon by a good bit). As for the easiness and delightfulness of learning Zope 3, that's not the general perception in our Python user group, and clearly a big part of the Python community is diverted into other frameworks such as Django, TurboGears, and TwistedWeb. How to improve the perception of Zope 3 could probably be a separate discussion thread unto itself. I favor the notion of making a separate Zope 3 site, or at least clearing out the old, outdated documentation at the current site. For a newbie, it's hard to tell what's current and what's outdated. At 12:33 PM -0700 11/30/05, Duncan McGreggor wrote: >As per your other email, the reason you had problems was because >your z3 instance was already running. If you are not using ZEO, you >need to stop z3 in order to gain access to the ZODB. > >Have you seen Benji's quick start guide? In addition to Stephan >Richter's book, you ought to read Philipp von Weitershausen's book >too. As of zope3.1, it's a little out of date, but only in a few >areas. The conceptual explanations and careful, hands-on, >examples-based approach is pure gold. His and Stephan's book are the >perfect couple ;-) Actually, I totally missed Benji's "Zope 3 Quick Start Guide" (). I had seen mention of it on the list, but I somehow got it mixed up with "Zope 3 in 30 Minutes" . From alecmunro at gmail.com Wed Nov 30 16:16:12 2005 From: alecmunro at gmail.com (Alec Munro) Date: Wed Nov 30 16:16:14 2005 Subject: [Zope3-Users] Permission required for renaming? Message-ID: <9819d58b0511301316iea84etc2c42448c15a1b2c@mail.gmail.com> Hi List, My users are unable to rename things, seemingly everywhere. They can add, remove, but not rename, or cut/copy. I'm not sure how to set the permission for this. Thanks, Alec From brad at allendev.com Wed Nov 30 17:07:14 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 17:07:18 2005 Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance In-Reply-To: References: Message-ID: I'm copying some discussion here from another thread called "need guidance". At 12:33 PM -0700 11/30/05, Duncan McGreggor wrote: >>Hmm, again, I think you *might* want to stay away from an approach >>that interacts directly with the ZODB. Unless you're not using >>z3/Zope 2... Brad Allen replied: >I didn't see this posting until after I started a new thread called >"Direct ZODB access in a Zope3 instance". So, why is it a bad >idea? Duncan McGreggor replied: >Well, it's a great idea if your application is non-zope python with >a need for "versioned" storage. > >It's not such a good idea if your application is a zope app because >those app servers do so much of the work for you, with many years of >honing put into them. > >The best thing to do is learn how to use the app server/framework >such that your work is minimized (both short- and long-term) and >such that the final product is a stable as possible (building on >prior, tested, and proven work). > >Direct access in a z3 app is usually made for debugging purposes, >and used with the pdb, can be very effective for hunting down and >solving issues. Ok, so using the app/server framework to read and write from ZODB is the way to go. I'm trying to understand exactly how that works. The books show how to register components using ZCML, but that doesn't create instances, right? As far as I can remember seeing, a human has to click something in the ZMI Add menu to create an instance in the ZODB. Meanwhile, the chapter in Philikon's book on persistence just shows how to create persistent classes and talks about how they work, but it doesn't say anything about how to insert an instance into ZODB. I guess this whole topic wasn't really explained in the books, unless I missed something (quite likely). An earlier posting from Duncan gives me a hint: At 2:44 AM -0700 11/30/05, Duncan McGreggor wrote: >Yeah, I think you're looking for code-based content addition -- is >that right? If so, you're going to want to spend some time looking >at zope.app.zapi (a lot of which comes from zope.component). In >particular, the createObject() function. Take a look at those >projects I mentioned above... and other folks may have good >suggestions for code examples on site creation and pre-population of >content The createObject() function documentation doesn't explicitly say it's creating an object in the ZODB, either in the Philikon book or in the API documentation at ++apidoc++. It might be nice to have something about that mentioned... How do I actually get a handle to an object in the ZODB, so I can manipulate attributes? From brad at allendev.com Wed Nov 30 17:10:01 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 17:10:04 2005 Subject: [Zope3-Users] need guidance Message-ID: At 12:33 PM -0700 11/30/05, Duncan McGreggor wrote: >In addition, I've written a python script that auto-generates a >starter z3 project for you, after asking a couple questions. If you >want to use it, I'd be more than willing to answer any questions >about it (an thus improve it) off-list. You can download it here: > http://www.zope.org/Members/adytumsolutions/z3project_starter Wow, cool. This looks like it could be a time-saver. Thanks! From chrism at plope.com Wed Nov 30 17:41:38 2005 From: chrism at plope.com (Chris McDonough) Date: Wed Nov 30 17:41:45 2005 Subject: [Zope3-Users] content object migration (was: need guidance) In-Reply-To: <39ec67c12c70a18813e0fcce6cd1c36f@gmail.com> References: <6A5A9B2E-1F2F-42D7-B56A-73E21BD41D0C@plope.com> <5f870c883c623793e47b7c4baa9e8f44@gmail.com> <7C72D99E-BFD3-454D-AFE5-FA02205E32FD@plope.com> <39ec67c12c70a18813e0fcce6cd1c36f@gmail.com> Message-ID: <3292E4DD-C642-44E7-9272-8083E244A76B@plope.com> On Nov 30, 2005, at 3:05 PM, Duncan McGreggor wrote: > > On Nov 30, 2005, at 12:49 PM, Chris McDonough wrote: > >> As we move towards another iteration, if I need to, while I'm >> writing code, I write evolution scripts that are capable of fixing >> ZODB data in place between milestone revisions of code. I happen >> to know exactly when I need to do this, because I've been working >> with ZODB for many years. Other developers working with me do the >> same. > > Awesome email, Chris -- thanks for sharing! Actually, egads, rereading it, I think I may have sounded like a bit of a prick, but glad you got some value! ;-) > > In particular, I am tantalized by the paragraph above ;-) As I > alluded in a previous post, this has been a very painful point for > myself an other developers with whom I have worked. For one client, > we used the CMFPlone.MigrationTool on a Zope2/Plone project where > content addition was occurring throughout the development phase. I > found the tool cumbersome and the whole process most painful and > distasteful. I haven't used that particular tool.. > > Do you employ an analogous tool or elegant manual approach for z3 > projects? If you have no tool, have you guys compiled a best > practices doc (informal or otherwise) whereby those of us > inexperienced in these particulars could benefit? Tools do exist. Last year, Jim was nice enough to finish the "generations" machinery for Z3 which to my knowledge currently ships with Zope 3. You can take a look at it at http://svn.zope.org/Zope3/ trunk/src/zope/app/generations/ . I created a Zope 2 product that used this machinery at the time... it's available via http:// cvs.zope.org/Products/zzz_generations/ . Docs are pretty slim for the Z2 version, so it's not immediately useful, but if you can figure out how to register a product with an initial version, it becomes useful thereafter. I use zopectl debug to do that myself. ;-) The nice thing about this kind of tool is that there is exactly one action for its UI consumers to take: upgrade. The only way they can screw it up is to *not* do that. ;-) - C From duncan.mcgreggor at gmail.com Wed Nov 30 19:01:35 2005 From: duncan.mcgreggor at gmail.com (Duncan McGreggor) Date: Wed Nov 30 19:02:04 2005 Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance In-Reply-To: References: Message-ID: <74821222eea2a36da03359c810ca7aa8@gmail.com> On Nov 30, 2005, at 3:07 PM, Brad Allen wrote: > Ok, so using the app/server framework to read and write from ZODB is > the way to go. I'm trying to understand exactly how that works. The > books show how to register components using ZCML, but that doesn't > create instances, right? As far as I can remember seeing, a human has > to click something in the ZMI Add menu to create an instance in the > ZODB. About ZCML: it's kinda hard to get used to. I hated it at first. But it makes more sense that most other ways of doing things... the problem is that we've gotten used to mixing configuration and code. ZCML is the quiet hero in this regard: it gives us the long-needed tool to separate configuration from application. And if you think about it, this really makes the most sense. If you've got a hundred clients that want to use your product, each of those clients should only have to change configurations, not the actual code itself. Additionally, I really like the clean approach that z3 has as a result of ZCML: if you haven't configured it, you aren't going to see it/use it (as an end-user, I mean). This appeals to the security engineer in me ;-) It also makes things wonderfully simple as far as enabling/disabling features. Back to your question: ZCML doesn't actually do anything -- z3 looks at it to "know" what to do. So, in order for z3 to know about content objects, custom views, resources like images, etc., you have to put it in ZCML (well, for some things you can put it in python, too). As far as the ZMI is concerned, there are entries you need to make in your configuration files that tell z3 to (for instance) have a custom content object appear in the "Add" menu. If you have made that entry in your ZCML file(s), users will be able to click something in the ZMI, and a content instance will be created. ZCML is confusing at first because of the many features and the conceptually different aspects of application configuration for which it is responsible. To keep all of these straight, I ask myself questions like: * is this part of my code just purely content object? * is this part application internals? * is this part management UI related? * is this part content presentation? * is this part just look at feel (page structure and CSS)? I tend to put each of those in their own areas or sub areas (read "directories"). They each have different ZCML files; a top-level ZCML file includes the ones from the next level down, etc. The best way to come to term with this stuff (in my mind) is to jump in and start using it, even if it doesn't make sense at first. Much will be revealed simply trough the doing of it. BTW, As a result of practices such as these, the z3 projects I have worked on have been the conceptually best organized projects I've ever been a part of. > Meanwhile, the chapter in Philikon's book on persistence just shows > how to create persistent classes and talks about how they work, but it > doesn't say anything about how to insert an instance into ZODB. It's done for you "automatically" -- when you click "add my page" on the ZMI menu (given that you have a content object called "my page"), it is inserted into the ZODB. >> Yeah, I think you're looking for code-based content addition -- is >> that right? If so, you're going to want to spend some time looking at >> zope.app.zapi (a lot of which comes from zope.component). In >> particular, the createObject() function. Take a look at those >> projects I mentioned above... and other folks may have good >> suggestions for code examples on site creation and pre-population of >> content > > How do I actually get a handle to an object in the ZODB, so I can > manipulate attributes? z3 utilizes a component-based approach - both in the way that it was built and in the way that applications are built using it. To "get a hold" of certain components, you use various useful functions that are provided in the zapi (many of which come from the components package). One of the most common ways of getting a hold of an object or object type is by interface lookup. So, if you want to create something, you'll need a context for that object's creation. Quite frequently, that context will be a site. There are many ways to do this, and it depends on how you have designed your z3 project. I'm not being deliberately obtuse ;-) This is the point where you need to look at sample code, or pour over book chapters. I would like to post some of the code that I've done that's related to the topic, but most of it is very special-case... and it assumes fairly detailed z3 knowledge. What we really need for discussions like this is some nice demo code... does anyone have something like that? I know Gary Poster emailed the list with some best practices for getting a site and adding a catalog to it. But, IIRC it was not code (maybe some pseudo code?). Ah, here it is: http://mail.zope.org/pipermail/zope3-users/2005-September/001078.html Here's a thread for making a folder a site: http://mail.zope.org/pipermail/zope3-users/2005-May/000548.html It might be worth the effort to start up a peer-review thread here that demos a simple site build, pre-populating with some simple content. That would be a fantastic resource for folks. Hmmm. In fact, it might be a good idea to do another z3project_starter script that included code like that... You're going to want to read up on interfaces, component-based design, z3 utilities, and subscribers. And there's lots of super smart dudes on the mail list that know this stuff inside and out who can assist as your getting your head around this stuff. It's totally worth the effort. I've used tons of web frameworks, and as far as I am concerned, this one (z3) takes the cake. IMO, component-based development is the only way to fly ;-) d From brad at allendev.com Wed Nov 30 20:56:30 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 20:56:33 2005 Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance In-Reply-To: <74821222eea2a36da03359c810ca7aa8@gmail.com> References: <74821222eea2a36da03359c810ca7aa8@gmail.com> Message-ID: Brad Allen wrote: >>Meanwhile, the chapter in Philikon's book on persistence just shows >>how to create persistent classes and talks about how they work, but >>it doesn't say anything about how to insert an instance into ZODB. Duncan McGreggor wrote: >It's done for you "automatically" -- when you click "add my page" on >the ZMI menu (given that you have a content object called "my >page"), it is inserted into the ZODB. Yes, I learned that early on in the MessageBoard tutorial. But all the talk about doing automatic ZODB regeneration in the other thread implies the ability to create object instances in the ZODB at specified locations WITHOUT having to manually click for every single object instance. From brad at allendev.com Wed Nov 30 21:28:22 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 21:28:27 2005 Subject: [Zope3-Users] Direct ZODB access in a Zope3 instance In-Reply-To: <74821222eea2a36da03359c810ca7aa8@gmail.com> References: <74821222eea2a36da03359c810ca7aa8@gmail.com> Message-ID: At 5:01 PM -0700 11/30/05, Duncan McGreggor wrote: >z3 utilizes a component-based approach - both in the way that it was >built and in the way that applications are built using it. To "get a >hold" of certain components, you use various useful functions that >are provided in the zapi (many of which come from the components >package). One of the most common ways of getting a hold of an object >or object type is by interface lookup. Ok, suppose there is a ZPT Page object located in the ZMI/ZODB in the following folder path: /SiteName/UserContent/Articles/IntroText To "get ahold" of the object from within Python...by that I mean bind a variable name to an object...you say I should use an interface lookup. I don't get it. I've seen how to validate whether an object implements an interface, or whether an interfaces is providedBy an object, but I don't know how to lookup an object via an interface. In the case of a ZPT, it implements a lot of different interfaces : zope.app.zptpage.interfaces.IZPTPage zope.app.zptpage.interfaces.IRenderZPTPage zope.app.publication.interfaces.IFileContent zope.app.annotation.interfaces.IAttributeAnnotatable zope.pagetemplate.interfaces.IPageTemplateSubclassing persistent.interfaces.IPersistent zope.app.container.interfaces.IContained Which one would I pick to use for a lookup? And if I picked the right one, wouldn't I get back a list of objects, rather than the specific one I want? I guess I'm asking if there is a function that will allow me to do this: introText = getObject ('/SiteName/UserContent/Articles/IntroText') From there, I'd expect to be able to rename the object, move it to a different directory, delete it, copy it, put it inside another object, change attributes, call methods on it, etc. Am I misguided in wanting this? I am just wondering how to get at user generated data, manipulate it, export it, etc. I've seen how to get at objects in the ZODB via TALES expressions, but all I can with that is display it, right? From brad at allendev.com Wed Nov 30 21:44:50 2005 From: brad at allendev.com (Brad Allen) Date: Wed Nov 30 21:44:57 2005 Subject: [Zope3-Users] Re: list archives for zope3-users In-Reply-To: <1722071.post@talk.nabble.com> References: <1721636.post@talk.nabble.com> <1722071.post@talk.nabble.com> Message-ID: I think my favorite is Nabble, though of the two links Kooto provided, the one that contains only Zope3 list postings seems to most useful. At 11:05 AM -0800 11/30/05, kooto (sent by Nabble.com) wrote: >Nabble is another searchable archive like Gmane. >http://www.nabble.com/Zope-f6706.html At 11:32 AM -0800 11/30/05, kooto (sent by Nabble.com) wrote: >Actually, Nabble also has a combined archive for all Zope3 lists >under the Zope category: >http://www.nabble.com/Zope3-f13629.html