Re: [Zope] SiteAccess smashes 'REQUEST.resolve_url(...)' in DTML ?
- Original Message - From: Martin Grönemeyer [EMAIL PROTECTED] dtml-with "REQUEST.resolve_url('http://mydomain/home/index_html')" dtml-var title /dtml-with throws Error Type: ValueError Error Value: Different namespace. REQUEST.resolve_url requires that the URL you pass to it begins with REQUEST.script, otherwise it will throw this Exception. It treats the URL very much like one coming from a browser, so all SiteRoots and Access Rules affect the result. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] manage_users problem
- Original Message - From: Steve Drees [EMAIL PROTECTED] I have the following code stuffed away in a DTML Method dtml-call "REQUEST.set('name','steve3')" dtml-call "REQUEST.set('password','test')" dtml-call "REQUEST.set('confirm','test')" dtml-call "REQUEST.set('roles','RegisteredUser')" dtml-call "acl_users.manage_users('Add',REQUEST,RESPONSE)" Roles is supposed to be a list. Try: dtml-call "REQUEST.set('roles',['RegisteredUser'])" Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Moving the html_standard_header in an another folder...
- Original Message - From: Dan Rusch [EMAIL PROTECTED] Try this !--#var "Models.standard_html_header(_.None,_)"-- One important caveat to keep in mind here: If standard_html_header acquires any object or property that is meant to be context-sensitive (eg. it is defined in the root, overridden in some folders, and overridden again in some documents), then placing it in "Models" can have surprising effects. These can sometimes be fixed by using "this()" instead of "_.None" in the call. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] fmt weirdness
- Original Message - From: Chris Withers [EMAIL PROTECTED] dtml-var "_.DateTime()" fmt="%d %B %Y" ...works fine dtml-var "_.DateTime()" fmt='%d %B %Y' ...barfs with a 'Document Template Parse Error': The dtml parser only likes double-quoted attribute values. It sees the above as having attributes "fmt='%d", "%B", and "%Y'". Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to catch URL in DTMLDocuments/Methods
- Original Message - From: Ian Sparks [EMAIL PROTECTED] The conceptual problem I have is that DTMLMethods/Documents don't have a parameters tag like SQLMethods do, so I don't see how I can "trap" parts of the URL like SQLMethods do and use them internally in my Method/Document. There isn't an automatic way to do this; SQLMethods are specially written to be traversable. There are three (fairly complex) ways to do this that I can think of: 1. Subclass DTMLDocument and mix in the class SQLMethods use for traversability. Probably hard. 2. Use a PythonMethod, and make one of its parameters 'traverse_subpath'. Then you can traverse through this PythonMethod and use the parameter to do what you want. Not bad, but you need to know PythonMethods. 3. Use a SiteAccess Access Rule on the folder, having it check to see if the next object to be traversed is your DTMLMethod. If so (and if the next name doesn't start with 'manage'!) remove the rest of the traversal path and store it in a REQUEST variable. Not too bad, but SiteAccess is fragile (it doesn't work with Zope 2.2a). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Property Question
- Original Message - From: Tom Scheidt [EMAIL PROTECTED] result = [] for item in self.objectValues( [ 'DTML Document' ] ): if item.hasProperty( 'publish' ): (and if there is something entered in the 'publish' field) result.append( item ) return result If you just meant, is the value of the 'publish' property is "true" (nonblank string, nonzero int, etc.) then you want: result = [] for item in self.objectValues( [ 'DTML Document' ] ): if item.hasProperty( 'publish' ) and item.publish: result.append( item ) return result Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Virtual hosts: How to make proper intra-site URL's?
- Original Message - From: Rob W. W. Hooft [EMAIL PROTECTED] I have set up a site: www.site In this site, there are a few virtual hosts: www.host1 -- www.site/Host1 www.host2 -- www.site/Host2 Thanks to a nice access rule, both the left and right names can be used to refer to the information. So far so good. You mention an Access Rule, but do you have SiteRoots in the Host1 and Host2 folders? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Containment or context
I have paraphrased your example at http://www.zope.org/Wikis/zope-dev/AcquisitionFeedback We are considering providing some way for you to acquire properties in the way you expected. You can read more about this in the pages connected to the AcquisitionFeedback page. - Original Message - From: Stephen Harrison [EMAIL PROTECTED] [snip] http://www.zope.org/Members/Hoekstra/ChangingContexts1 it states that PARENTS is defined as the acquisition parents of an object. But this is not true. PARENTS is the list of objects traversed to get to the *published* object. If you visit "/foo/bar/foo/bar/baz", then PARENTS will contain [bar, foo, bar, foo, /]. If baz calls another method, PARENTS is unaffected, as are the URLn and BASEn variables. Only absolute_url() is affected. The only way (right now) to search for a property in the order PARENTS mentions them is to do so explicitly, by looping through the elements of PARENTS and checking their 'aq_explicit' for the property. Example Python snippet: for p in REQUEST['PARENTS']: if hasattr(p.aq_explicit, propname): return getattr(p, propname) raise AttributeError, propname Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] SiteAccess 2.0.0b1 released
Finally, SiteAccess 2 for use with Zope 2.2b1 and up is ready. http://www.zope.org/Members/4am/SiteAccess2 Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] From where does nothing spring from?
- Original Message - From: "Graham Chiu" [EMAIL PROTECTED] dtml-var "REQUEST.set('error',f_Email.isNotEmail(f_Email,_))" where f_Email is an instance of the product, then the words 'None' are returned as well, and render to the screen. REQUEST.set returns None. You want to use dtml-call instead of dtml-var, to ignore the returned value. Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] SiteAccess 2.0.0 beta 2
Jacques A . Vidrine discovered a chunk of code I accidentally left where it didn't belong, which messed up the adding of SiteRoots. I've uploaded v2.0.0b2 to zope.org, but if you've already downloaded beta 1, you can fix your installation by just editing SiteRoot.py and deleting the lines of method manage_afterAdd after the call to BeforeTraverse.registerBeforeTraverse. Then you can either delete and re-add the SiteRoots, or run the upgrade script again. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] scared
- Original Message - From: josh on [EMAIL PROTECTED] I have reinstalled zope and zodb, and copied the data.fs across. It was about two days old. All the changes that I had made were gone. Luckily I made a backup of my app yesterday by exporting it. I must have a bad understanding of how this works. I had imagined that everytime I hit CHANGE, that the data.fs file would have been updated. That is how it is supposed to work, yes. If the data really isn't in your Data.fs (as opposed to being there, but inaccessible somehow) then that's a serious Zope bug. This may sound stupid, but have you tried using a different browser or aggressively clearing the cache on your current browser? Sometimes a browser has handed me a days-old folder contents view from its cache, but refreshing fixes it. When the computer crashed where were all my current changes? Is there a temp file I might be able to recover, as I am still missing quite a few hours work! You should take another copy of your original Data.fs and run Tranalyzer on it (http://www.zope.org/Members/tsarna/Tranalyzer) for clues as to what's really in it. If it shows no transactions more recent than the two-days old ones, let us know. The lesson that I have learnt is to back up regularly by exporting. Is this the right conclusion? Backups are never a bad idea. You shouldn't have to export, though; copying Data.fs, even while the system is running, should give you a good backup. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] SiteAccess in 2.0.0b2?
- Original Message - From: T.J. Mannos [EMAIL PROTECTED] I'm having trouble getting SiteAccess 2.0.0b2 to work with Zope 2.2.0b2. The first odd thing that happens is when I create a new SiteRoot, it says that this object already has a SiteRoot (which it doesn't), but creates it anyway. The second is: it doesn't seem to work at all! The value of URL1 still has the :9080 port and the wrong virtual server. Any ideas? What's your platform (win, linux, *bsd)? Is this a Zope database which has been upgraded from an earlier version of Zope? If so, were you using SiteAccess 1.x with that earlier version? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB performance: reads to writes
- Original Message - From: Jimmie Houchin [EMAIL PROTECTED] Will an app as described above still suffer from problems with high writes? Possibly, but only if there are hidden hotspots. For example, in your message-appending scenario, are these messages being added to the same Folder? If so, the Folder is getting written with each object added to it, and will be a source of conflict. If the objects that your users are editing are cataloged, the Catalog is a hotspot. There are two independent attacks on this problem underway: 1. Make Folders and Catalogs store meta-data about their contents in a data structure consisting of small persistent objects, like B-Tree nodes. This reduces the scope of potential conflict (and the size of the update required by a write) to the size of one of these nodes. 2. Implement the application-level conflict handling you read about, so that Folders and Catalogs can decide that two writes don't conflict after all, and merge them into a single update. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZODB performance: reads to writes
- Original Message - From: Jimmie Houchin [EMAIL PROTECTED] This is what I understand based on your reply and from the paper by Jim. 1. That there are solutions currently being worked on by DC (implied). Yes, worked on does not mean 'Coming Soon to a Zope near You!' :) 2. That if an app, either by it's nature or thru it's developers design, eliminates or handles conflicts before commits are made to the ZODB, that high write situations are not a problem. AFAIK, these are both correct. Is number 1. below something that would take place with BTree Folders? Yes. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Adding Products Breaking Zope
- Original Message - From: Oleg Broytmann [EMAIL PROTECTED] My problem is with SiteAccess 1.0.1 with Zope 2.1.6 on Debian Unstable (Woody). Is it simply that this version of SiteAccess was written for an earlier version of Zope and is no longer compatible? Or am I just doing something wrong? Yes. Downgrading to 2.1.4 will help. SiteAccess 1.0.1 is meant to work with Zope 2.1.6 (and does, for me). I'd like to get it working for you folks, as well. Does a fresh, empty install of Zope w/SiteAccess on your respective platforms have this problem? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Accessing .gif on disk with Python Product?
From: Martijn Pieters [EMAIL PROTECTED] misc_ is a root level object. Using absolute_url you are acquiring it into your Instance URL, which is not necessary (and will hamper off-server caching). Use dtml-SCRIPT_NAME; instead (which will give you the absolute url of the root object in all cases): img src="dtml-SCRIPT_URL;/misc_/myProduct/chooserIcon" border=0 I sugget using "dtml-BASE1;", since SCRIPT_NAME doesn't work well with virtual hosting. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Accessing .gif on disk with Python Product?
From: Martijn Pieters [EMAIL PROTECTED] I still think something else was broken, SiteAccess should (and does, as far as I know) stay away from SCRIPT_NAME. Yep. Environment/CGI variables are left alone by the virtual hosting machinery; only Zope-specific ones are altered. An example of a virtual hosting setup which won't work with SCRIPT_NAME: Apache on machine www.foo.com proxies requests for /Zope/* to machine z.foo.com:8080. In this case SCRIPT_NAME is blank, and the src of an image on http://www.foo.com/Zope/page constructed with it would resolve to http://www.foo.com/image.gif, rather than http://www.foo.com/Zope/image.gif. This is not a contrived example -- people are doing this. SCRIPT_NAME will work in simple cases, but BASE1 ought to work in all cases, and using it is a better habit to have in general. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Accessing .gif on disk with Python Product?
From: Martijn Pieters [EMAIL PROTECTED] SCRIPT_NAME will work in simple cases, but BASE1 ought to work in all cases, and using it is a better habit to have in general. We better file a Collector item on this then, as the current Zope Management Interface uses it still. Done. I also tacked on a proposal to add BASE_PATHn and URL_PATHn variables to ease the transition. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] JavaScript help!
function changeChars() { var box = eval("document.manage_edit_form.data:text"); This should be: var box = document.manage_edit_form['data:text']; JavaScript, like DTML, lets you access objects with funny names using subscript notation. Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How To Shoot Yourself In The Foot With Zope
From: "Jean Jordaan" [EMAIL PROTECTED] In order to get more debugging info about the environment I'm working in, I included 'dtml-var REQUEST' in my 'standard_html_footer'. This worked so nicely, I added 'dtml-var RESPONSE' too, arguing that the REQUEST is probably only half the story. However, adding 'dtml-var RESPONSE' turned out to be pretty stupid, since it caused some kind of recursion (the response contains the response?) which had Zope taking up 99% of CPU and rendering *nothing*. Bad idea, as you discovered. REQUEST is designed to render itself and provide all sorts of useful information. RESPONSE is designed to accept and control output. Attempting to render it makes it try to return the final page text. I can't tell you exactly what's going on internally to make Zope unhappy, but I *can* say "don't do that". Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Odd problems with SiteAccess?
From: "Christopher Heschong" [EMAIL PROTECTED] I have a directory with a SiteAccess rule in it. Under that directory, versions and Zcatalogs no longer seem to work. Does your rule manipulate the traversal path? Versions and ZCatalogs have an unfortunate dependency (which needs to be removed) on the path through which they are accessed. Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] base instead of SiteAccess
From: "George Osvald" [EMAIL PROTECTED] I am using ProxyPass configuration with Apache and SiteAccess. [snip] The subdirectory of my web site is 'okstudio'. [snip] I was trying to use SiteAccess on my home machine but could not get it working. It would not work for http://localhost or http://localhost:8080 ..and so and so. I'm going to guess at your configuration; please correct me where I miss: 1. Apache with "ProxyPass / http://localhost:8080/okstudio " 2. SiteRoot in "/okstudio" with Base == "http://www.okstudio.com" and Path == "/" You want to be able to run a copy at home, connect directly to Zope, and browse the site. At home, set the Base=="" and add the following Access Rule in your root: dtml-let path="REQUEST.path" dtml-unless expr="path and path[-1] == 'okstudio' " dtml-call expr="path.append('okstudio')" /dtml-unless /dtml-let This way, requests to http://localhost:8080 will get rewritten to http://localhost:8080/okstudio without affecting URLs (thanks to the Path=="/" in the SiteRoot). Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Problem with SiteAccess 1.0.1
From: William JOYE [EMAIL PROTECTED] I have some minor problems with SiteAccess 1.0.1 and Zope 2.1.6 + hotfix. 1. When click on the folder that contain SiteRoot, I need to enter again login and password. Why ? Most likely, because you have a Base set in your SiteRoot that differs from the base URL you had logged into. Your browser will not send your authentication information to a URL with a different host name. 2. When I delete an object, I have always an script error message. Why ? Sorry, you'll need to be more specific. When you delete an object inside the SiteRooted folder, or anywhere? What error message? (traceback too, please) Are these problems already fixed ? Is the SiteAccess 1.0.1 product stable enough to use it in production ? It runs all of my domains, and those of a fair number of other people. YMMV. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteAccess 2.0b3 missing setURL?
From: "albert boulanger" [EMAIL PROTECTED] An oversight or is there a change in API? Change in API; You want REQUEST.setServerURL, which is documented here: http://www.zope.org/Members/michel/Projects/Interfaces/ImplementingVirtualHo sts Cheers, Evan @ 4-am digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Silly string question
From: Satheesh Babu [EMAIL PROTECTED] I want to print the following line exactly as it appears on a web page (no HTML coding). !--#include file="header.inc" -- These aren't general solutions, but off the top of my head (tested): dtml-var expr=" '' "!--#include file="header.inc" -- dtml.missing--;!--#include file="header.inc" -- Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: superuser confusion
From: "Chris McDonough" [EMAIL PROTECTED] On Mon, 4 Sep 2000, Chris Withers wrote: Well, okay, let me rephrase the question: Why is it bad for the bootstrap user to own anything? It used to be considered okay before Zope 2.2, so was has been changed/discovered that makes this now such a bad idea that despite loads of newbie pain and confusion, it's still worth while/necessary? I've got to say I agree with you here. I'm still not 100% sure why the superuser or bootstrap user can't own anything. It's due to a combination of the trojan horse issue and the sticky authentication issue, I think. You really don't want to be authenticated as super very often, because while you are, if you visit a page someone else wrote, they can make your browser do evil things to your site. This is also true of Managers, but less so. Similarly, a page owned by non-super has tighter permissions than one owned by the super would. Ideally, people working in a site should be operating with the bare minimum of privileges to get the job done. The super should only be called in when no one else can fix it. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] That :method thingy.. where's it documented?
From: Brad Clements [EMAIL PROTECTED] Thanks but that's not really what I'm looking for. I thought there was a type ":method" that could be used as a way to call a method.. Perhaps I'm just going crazy. No, you're right, and the page Rik referenced really should be updated to include it. If "foo:method" is included in a form (usually by making it the name of a submit button, or an option in a pick list) then "foo" is effectively added to the end of the URL path. There is also ":default_method", the value of which is used if no ":method" is specified. So: form action="act" input type="text" name="foo" input type="hidden" name=":default_method" value="def" input type="submit" name="m1:method" value="1" input type="submit" name="m2:method" value="2" /form ...will invoke "act/m1" or "act/m2" depending on whether you push button "1" or "2", or "act/def" if you push the enter key (thereby submitting the form without pressing either button). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] re module through the web security
From: Chris Withers [EMAIL PROTECTED] One of Zope's key strengths is its granular security, right? So why isn't it the reponsibility of the site designer/maintainer/owner/whatever to ensure that only people he trusts have the ability to write DTML? Fear not. In the brand new shiny PythonMethods Product coming soon (really!) to a Zope near you, you will have the ability to say: ModuleSecurityInfo('re').protect('compile', 'Use the "re" module') ...and suddenly anyone to whom you grant 'Use the "re" module' permission will be able to 'from re import compile' in their Python Methods. Anyone else will be able to 'import re', but not access any of its contents. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] re module through the web security
From: Dan L. Pierson [EMAIL PROTECTED] http://dev.zope.org/Wikis/DevSite/Projects/PythonMethods/GuardedImport I looked there. Ah, but I was sneaky and went and updated it just before posting ;-) You do have to follow a link or two, but it isn't hard to find (any more). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Call for Python Method opinions
If you want any say in how official Zope Python Methods work, I recommend heading over to: http://dev.zope.org/Wikis/DevSite/Projects/PythonMethods/StandardPythonMetho dModule ...soonest. If you have feedback on any part of the project, please contribute, but the link above is the squishiest part of the design, and possibly the most important to many of you. User-style documentation is still scanty, but getting better. Comments on where it needs to be stronger are welcome. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteRoot (SiteAccess) problem
From: Joshua Brauer [EMAIL PROTECTED] I'm running a new server with 2.2.1 and Siteaccess 2.0.0 b3 and I don't get a "SiteRoot" item in the available items list. I can copy site roots and move them, but I cannot create new site roots... After reinstalling SiteAccess ( restarting) I still have problems. Any ideas? Err... if you delete the SiteAccess Product object (not the directory!) from Control Panel/Products and restart, does it come back unbroken? Do the existing SiteRoots do their jobs? General Info: * Zope version: Zope 2.2.1 (binary release, python 1.5.2, linux2-x86) * Python version: 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC egcs-2.91.66 19990314/Linux (egcs- * System Platform: linux-i386 Installed Products: [snip list of every Zope Product ever made, practically] I ... wow. Speechless, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Set Access Rule wish
From: Albert Boulanger [EMAIL PROTECTED] Its nice that the icon for the method, who is the access rule's target, is changed. However, I think also there needs to be some indicator on the folder involved as well. Unfortunately, the rule icon is already a fragile hack. If you copy, rename, export, or otherwise move an Access Rule, it ceases to be an active rule, but the icon doesn't go away. The only thing which gets rid of it is using Set Access Rule to turn it off. I'd like to come up with something more robust; I'm open to implementation suggestions. Keep in mind that the container and object involved don't know anything about Access Rules. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] 'showREQUEST' or 'show_REQUEST' ?
From: Steve Alexander [EMAIL PROTECTED] I get an error when I try to add a DTML Method with REQUEST anywhere in the id. This is fruit of a needlessly broad restriction on REQUEST traversal, and is fixed in CVS. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to Pass values to a DTML method ??
Dieter Maurer You should include two positional parameters as well: dtml-var "some_method(_.None,_,param=value)" I've recently had explained to me a way that is more robust, and possibly less confusing, than this idiotic idiom. I think it may start appearing in docs and training. dtml-let param="value"dtml-var some_method/dtml-let ...or even better... dtml-let param="value"dtml.-some_method;/dtml-let ...which allows nicely for stuff like: dtml-let foo="sequence-item" bar="foo.objectIds()" firstbar="bar[0]" a href="dtml-firstbar;"First!/a /dtml-let Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] [zwiki] What is the 'Wiki-Safetybelt'?
From: "Jean Jordaan" [EMAIL PROTECTED] Wiki-Safetybelt: 968246577.617 What is is, and do I need to keep it if I want to ftp them back in? It's a weak protection for when two people grab a copy of a wiki page, edit it, then post their conflicting changed pages. When the second person posts, Zope will notice that their Wiki-Safetybelt doesn't match the timestamp of the page, warn them that it has changed, and refuse their update. Removing the Safetybelt will eliminate this check, IIRC, and should work fine. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to Pass values to a DTML method ??
From: Stuart Foster [EMAIL PROTECTED] The first example is what I was doing. But felt it was hard to follow. However I would be interested in why it would be considered more robust. I probably misused the word; what I meant was that the dtml-let form is less likely to have errors like forgetting the first two "magic" parameters or writing "sequence-item" instead of "_['sequence-item']", and can take advantage of current dtml-let features such as cascading assignment (foo=1, bar=foo+1, etc) and future ones such as extended-attribute syntax (foo-name-name="x" instead of foo="_[_[x]]"). I have considered proposing that we graft dtml-let's capabilities onto the other tags, so that we could write stuff like: dtml-var set-foo="getFoo()" var=foo set-param1=" 'text' " set-param2="id" ...or... dtml-in in="seq" set-seqKey=sequence-key set-letter="seqKey[0]" dtml-letter; /dtml-in Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] zope 2.2.1 and python 1.6
From: Nils Kassube [EMAIL PROTECTED] According to Guido van Rossum in http://linuxtoday.com/news_story.php3?ltsn=2000-09-07-011-21-OS-CY-SW you are not able to use GPL'ed Zope products with Python 1.6 (or 2.0) until the dispute is settled. No copyright-based licence whatsoever, including but not limited to the GPL, ZPL, and the licence on Microsoft Word, can ever prevent you from *using* any software you like, in any combination. They can only constrain *distribution* of that software and derived works. This is a serious problem for software authors, but not for people running Zope-based sites. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] trouble with SiteAccess; can't manage subtree mapped to inaccessible domain name
From: "Fred Yankowski" [EMAIL PROTECTED] How do I get out of this jam? I tried deleting the Products/SiteAccess folder, restarting Zope, and deleting the SiteAccess product from the Control_Panel/Products view, but now I'm getting an AttributeError when I try to access the subtree that has a SiteAccess object. Since I can't get to that tree, I can't figure out how to delete that object. Is there some way to delete it by name from a higher point in the tree? Yow! No need for such extreme measures. Put SiteAccess back, then open the management interface for the subtree folder in your Zope, using: http://your.zope/the-subtree/_SUPPRESS_SITEROOT/manage_main ...and delete the SiteRoot. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteAccess2 problem
From: Oliver Wrede [EMAIL PROTECTED] I am trying to use SiteAccess2 with a site which has imported SiteAccess1 objects. Have you used Extensions/updata.py to upgrade these objects? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope with Apache
From: James Howe [EMAIL PROTECTED] We are running Zope behind an Apache server. We've got things configured so that it mostly works. However, we noticed that the "breadcrumbs" list at the top of a workspace screen doesn't work correctly. This was broken with respect to virtual hosting, as well, and the fix for that in the CVS trunk may also take care of what you're seeing. Should be in Zope 2.3 (soon, I hope). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Black Magic
From: Chris Withers [EMAIL PROTECTED] Pierre-Julien Grizel wrote: It seems that in fact the DTML document doesn't actually pass _.None and _ to my object. WHY ?? This is deep voodoo that I don't fully understand. To me, it appears that what you get depends on how your __call__ was called... The arguments vary dependign on whether: -you were called from a bit of DTML -traversed directly through a URL -called from soem python you wrote Here's the scoop: 1. DTML Methods' __call__ signature is (client=None, REQUEST={}, RESPONSE=None, **kw). The client, REQUEST, and keyword arguments are layered to form the namespace for the Method, with the keywords on top, then the client, then REQUEST. 2. If you call a DTML Method in a Python expression, its namespace will be empty unless you explicitly pass a client, REQUEST, and/or keyword arguments. 3. URL traversal automatically tries to look up parameter names in the REQUEST. Both REQUEST and RESPONSE are found in REQUEST, so they are passed to the Method. 4. When an object is named in the name attribute of a DTML tag, the DTML code checks to see whether the object is callable and has a true attribute called "isDocTemp". If so, it passes the namespace to the REQUEST parameter. Otherwise, if the object is callable it calls it with no arguments. Thus, to simulate dtml-var foo in Python code, including DTML expressions, you must either use "obj(_.None, _)" or "obj(REQUEST=_)". Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] REQUEST.set size
From: Paul Zwarts [EMAIL PROTECTED] ValueError: PQsendQuery() -- query is too long. Maximum length is 16382 This is purely a PostgreSQL issue; Some (all? not sure.) versions of PostgreSQL have a hard limit on the length of query strings. You have to break your query into multiple smaller queries. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Black Magic
From: Fred Yankowski [EMAIL PROTECTED] The information you just provided about the DTML Method "call signature" and the like is very useful. Is this kind of reference material written down somewhere in a guide/how-to/wiki/...? The only thing I could find offhand is http://www.zope.org//Wikis/DevSite/Projects/PythonMethods/NamespaceObjectInterface, which I wrote. I don't know if ZDP or someone else has documented it. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Easiest way to turn X-Forwarded-For to Remote-IP?
From: Marcin Kasperski [EMAIL PROTECTED] X-Forwarded-For header (REQUEST['HTTP_X_FORWARDED_FOR']). Does there exist some sample of such usage? Can such a change be performed before authorization? You could do this with an Access Rule in your root folder, containing: dtml-call expr="REQUEST.set('REMOTE_ADDR', REQUEST['HTTP_X_FORWARDED_FOR'])" Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Apache/ProxyPass : environment variables
From: Aaron Straup Cope [EMAIL PROTECTED] Thanks. It appears, though, that there is no way to do this without appending a query string to the redirected URL. Is this correct? That, or mangling the URL in some way and then unmangling on the Zope end. If someone out there has any experience with Apache modules, they could earn the undying gratitude of many Zopistas by enhancing mod_forwarding to do this sort of thing. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZMethod (Safe)
From: Chris Withers [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Now, how about internal/external? Safe and Flexible are probably more meaningful words there ;-) ZMethod is growing though ;-) We've pretty much settled on restricted/unrestricted here. In honor of the presidential Indecision 2000 race, we're seriously thinking about revamping and rerunning the poll, so ZMethod may well get its moment in the spotlight. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZMethod (Safe)
From: Jason Cunliffe [EMAIL PROTECTED] Good news: 'ZMethod' is nice and 'sounds' good, however one says it. I agree, but then everyone around here thought that Zopelet was fairly unobjectionable, even though nobody really *liked* it. 1. 'closed' / 'open' 2. 'builtin' / 'custom' 3. 'local' / 'custom' 4. 'client-side' / 'server-side' None of these characterize the fundamental difference between the two things. One applies security restrictions, the other doesn't. Other differences, such as web-editable/zodb-stored vs. filesystem-based are not fundamental. We are contemplating unrestricted code which would be stored in the zodb, and possibly remote-editable through a secure interface. From: [EMAIL PROTECTED] Presumably the focus here is on newbies, not security managers. No newbie will ever want to use a Restricted Python ZMethod. What newbie wants to be limited/strait-jacketed/'kept from the cool stuff'? You are propsing a word with negative conotation for something that should be prefered! Yes, it is accurate, but that is beside the point. The two varieties aren't competing, and we aren't trying to promote one over the other. If a newbie is willing to put up with the risks and awkwardness of the current unrestricted design simply because they sound "cooler", we don't need to stop them. The documentation will present the restricted type first and tout their advantages, but explain clearly when and why you would want to go to the trouble of going unrestricted. Moreover, this also fails the concise/'easy to say' test that was used to kick out several other meritorius naming suggestions. Unrestricted Python ZMethod (8 syllables, 26 letters) is a mouthful! True (although some of the alternatives base names were worse). Considering that there aren't (yet) other language variants, and that I would usually use the restricted kind, I would normally just say "ZMethod". Only if there were some potential confusion would I say "Unrestricted zmethod", or the full title. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZMethod (Safe)
From: Ron Bickers [EMAIL PROTECTED] Since you would normally *say* just ZMethod, I like the suggestion of using "Python ZMethod" and "Python ZMethod (Unrestricted)", vs. spelling out the (Restricted) in the first one. Good point. I'll shop this around and see what folks here think. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Python Script demo site
A few announcements. First, in the interests of sanity and getting things moving, I'm choosing the only name other than "Python Method" to get a positive score in the naming poll. I like it, Guido likes it, the community sort of likes it, so it's official. Zope 2.3 will introduce "Python Script" objects. There will be no "Unrestricted" vs. "Restricted". If you want to write unrestricted code, you can use a good old External Method, or write a small module and import it in a Script object. Finally, if you want to give Python Scripts a try, you can now play with them without any CVS, installation, or Zope version worries. Go to http://ps.4-am.com:9000/ , pick a password, and you'll get your own private area in a trunk CVS checkout of Zope in which to play. I plan to add example Scripts, but for now there's just the raw Zope management interface. When I add examples, I'll announce it here on the Zope list. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Script demo site
From: "Steinar Rune Eriksen" [EMAIL PROTECTED] Would it be useful to (or rather, is it possible to) let one of these scripts call up another one ? Sure. From one of the Python Scripts you just write something like: answer = context.otherscript(1.3, 'foo') ...where context is bound to the Script context, and "otherscript" is the name of the other script. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Script comments
From: "Chris Withers" [EMAIL PROTECTED] Is there going to be a python methdos help tab eventually? Help is on the way. If I specify parameters 'wibble, fish', and then do: dtml-var "mypythonmethod('wibble',1)" ...will wibble='wibble' and fish=1 in the method? Yep. Parameters work normally. Will the bound names still be bound to what they would have been, had I just done dtml-var mypythonmethod ? Likewise, if I do: dtml-let wibble='wibble', fish="1" dtml-var mypthonmethod /dtml-let This is tied up in whether you bind the "caller's namespace" in the Bindings tab. If you do, then calling by name, as above, will automatically look the parameters up in the namespace, so your example will work. If you don't bind the namespace (it isn't bound by default) you can only call by name if there are no parameters. Go to the demo site -- try it out! Finally, I'm not sure, from a user confusion point of view that allowing bound names to also appear in the parameter list is a good idea... They shouldn't, you're right. I'll take care of that soon. Cheers, Evan @ digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to checkout PythonMethod from CVS
From: "Jochen Knuth" [EMAIL PROTECTED] Products/DC/PythonMethod at the moment, i don't know if the new name will result in a new directory. I expect to check it into the Zope2 core trunk under lib/python/Products/PythonScripts when I get back from Thanksgiving vacation. Cheers, Evan @ digicool ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PythonScripts and ExternalMethods
From: Chris Gray [EMAIL PROTECTED] I notice that the CVS tree for Zope2 has incorporated (internal) PythonScripts and gotten rid of (external) PythonScripts. This leaves the old ExternalMethods but without the Bindings tab. Will External Methods eventually include this and present a form for passing argument values when the TryIt tab is used? Jim and I expect to make External Methods obsolete, rather than upgrading them. In the near future, you will be able to get most of the functionality of External Methods from Python Scripts' import capability. In the longer term, we expect Zope 3 to completely change the way you write Zope code. In the meantime, External Methods work pretty well. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PythonScripts and ExternalMethods
From: [EMAIL PROTECTED] Are you talking about how the interaction between Zope and the programmer is performed? Are you talking about API? Or what? Both, and more. The details haven't even begun to be worked out yet, we're still brainstorming. In particular, are you talking about killing DTML? This would be very worrisome, as I have enough code that I would not like to rewrite it all in the near future I envision tools that will make DTML obsolete, but killing it? No, as long as it's useful to you, you'll be able to keep using it. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Important Fix for Zope 2.0 through 2.1.6
Thanks to Jeff Ragsdale, we've finally been able to kill a longstanding bug that allows POST requests to interfere with each other. Symptoms include corrupted or aborted File and Image uploads, and stupid-log messages about "AttributeError: data" killing threads. The attached HTTPServer.py is valid for all Zope 2.0.x and 2.1.x versions. I am posting the patched file for Zope 2.2.x separately. PLEASE BACK UP Zope/ZServer/HTTPServer.py, then replace it with the attached file. Cheers, Evan @ digicool 4-am ## # # Zope Public License (ZPL) Version 1.0 # - # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright #notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright #notice, this list of conditions, and the following disclaimer in #the documentation and/or other materials provided with the #distribution. # # 3. Digital Creations requests that attribution be given to Zope #in any manner possible. Zope includes a "Powered by Zope" #button that is installed by default. While it is not a license #violation to remove this button, it is requested that the #attribution remain. A significant investment has been put #into Zope, and this effort will continue if the Zope community #continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning #features derived from or use of this software must display #the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #In the event that the product being advertised includes an #intact Zope distribution (with copyright and license included) #then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to #endorse or promote products derived from this software without #prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain #the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #Intact (re-)distributions of any official Zope release do not #require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as #patches to official Zope releases. Distributions that do not #clearly separate the patches from the original work must be clearly #labeled as unofficial distributions. Modifications which do not #carry the name Zope may be packaged in any form, as long as they #conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ## """ Medusa HTTP server for Zope changes from Medusa's http_server Request Threads -- Requests are processed by threads from a thread pool. Output Handling -- Output is pushed directly into the producer fifo by the request-handling thread. The HTTP server does not do any post-processing such as chunking. Pipelineable -- This is needed for protocols such as HTTP/1.1 in which mutiple requests come in on the same channel, before responses are sent back. When requests are pipelined, the client doesn't wait for the response before sending another request. The server must ensure that responses are sent back in the same order
[Zope] Important Fix for Zope 2.2.x
Thanks to Jeff Ragsdale, we've finally been able to kill a longstanding bug that allows POST requests to interfere with each other. Symptoms include corrupted or aborted File and Image uploads, and stupid-log messages about "AttributeError: data" killing threads. The attached HTTPServer.py is valid for all Zope 2.2.x versions. I am posting the patched file for earlier Zope versions separately. PLEASE BACK UP Zope/ZServer/HTTPServer.py, then replace it with the attached file. Cheers, Evan @ digicool 4-am ## # # Zope Public License (ZPL) Version 1.0 # - # # Copyright (c) Digital Creations. All rights reserved. # # This license has been certified as Open Source(tm). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions in source code must retain the above copyright #notice, this list of conditions, and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright #notice, this list of conditions, and the following disclaimer in #the documentation and/or other materials provided with the #distribution. # # 3. Digital Creations requests that attribution be given to Zope #in any manner possible. Zope includes a "Powered by Zope" #button that is installed by default. While it is not a license #violation to remove this button, it is requested that the #attribution remain. A significant investment has been put #into Zope, and this effort will continue if the Zope community #continues to grow. This is one way to assure that growth. # # 4. All advertising materials and documentation mentioning #features derived from or use of this software must display #the following acknowledgement: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #In the event that the product being advertised includes an #intact Zope distribution (with copyright and license included) #then this clause is waived. # # 5. Names associated with Zope or Digital Creations must not be used to #endorse or promote products derived from this software without #prior written permission from Digital Creations. # # 6. Modified redistributions of any form whatsoever must retain #the following acknowledgment: # # "This product includes software developed by Digital Creations # for use in the Z Object Publishing Environment # (http://www.zope.org/)." # #Intact (re-)distributions of any official Zope release do not #require an external acknowledgement. # # 7. Modifications are encouraged but must be packaged separately as #patches to official Zope releases. Distributions that do not #clearly separate the patches from the original work must be clearly #labeled as unofficial distributions. Modifications which do not #carry the name Zope may be packaged in any form, as long as they #conform to all of the clauses above. # # # Disclaimer # # THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR ITS # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # This software consists of contributions made by Digital Creations and # many individuals on behalf of Digital Creations. Specific # attributions are listed in the accompanying credits file. # ## """ Medusa HTTP server for Zope changes from Medusa's http_server Request Threads -- Requests are processed by threads from a thread pool. Output Handling -- Output is pushed directly into the producer fifo by the request-handling thread. The HTTP server does not do any post-processing such as chunking. Pipelineable -- This is needed for protocols such as HTTP/1.1 in which mutiple requests come in on the same channel, before responses are sent back. When requests are pipelined, the client doesn't wait for the response before sending another request. The server must ensure that responses are sent back in the same order
Re: [Zope] Important Fix for Zope 2.0 through 2.1.6
From: "Hannu Krosing" [EMAIL PROTECTED] Could something similar be happening in PCGIServer too ? We are getting some weird and hard-to-reproduce errors when activity goes up and several file uploads are going on simultaneously? I'm not sure. I've peeked at the code, and the exact same bug doesn't seem to be at work. One way to tell is to create two File objects, open their Upload tab in side-by-side browser windows, choose the same long file (1MB is good) in both windows, then start the uploads together (as close as you can manage). Next, change one of the windows into a Folder add form (any form will do, really). Now start the large file upload, then quickly submit the add form. If there is a similar bug in PCGIServer, the first experiment will give you a corrupted File (wrong size) and a weird log entry, and the second should kill a thread with an "AttributeError:data" log entry. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] HTTPServer.py patch
From: Oleg Broytmann [EMAIL PROTECTED] I've got the patch from the mailing list. I saw only one replacement HTTPServer.py here - 13979 bytes in size. Looks like you've got the one that only works with Zope 2.0 - 2.1.6. If you're using Zope 2.2.0 or above, you need the other one. See http://www.zope.org/Members/4am/postbugfix Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] What version of Python Methods - no - Scripts for 2.2.4?
From: Ronald L. Roeber [EMAIL PROTECTED] Is the recommended install of Python Scripts for Zope 2.24 this? http://www.zope.org/Members/4am/PythonMethod even though it appears to be exactly one year old today (13-Dec)? Wow, I didn't realize today was its anniversary :-) No, this isn't the recommended install of Python Scripts, but it is the closest thing currently released. Can I just copy the PythonScripts product from my 2.3_a1 Products directory to the appropriate location on a 2.24 server or should I use the PythonMethod from above? Are there implications for upgrades from Methods to Scripts? Am I missing something(s)? (probably) Please advise. PythonMethod and PythonScripts are independent Products, providing objects with different meta-types. They can be installed side-by-side perfectly safely, and both Python Methods and Python Scripts can be used at the same time, and even together. I haven't tried installing PythonScripts in a pre-2.3 Zope, but I have no reason to expect that it would fail, except in one feature: Since pre-2.3 Zopes don't support the __render_with_namespace__ protocol, you would always have to pass parameters explicitly when calling from DTML, and wouldn't be able to bind the caller's namespace. If you want to give it a shot, the worst thing that I would expect it to do is fail and produce error messages when you try to create or use Python Scripts. Want to write a Howto? ;-) Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Important Fix for Zope 2.2.x
From: The Doctor What [EMAIL PROTECTED] Will these be released as Hotfixes? Or just new versions? Or is this it? Hotfixes are pretty much reserved for critical security holes. Zope 2.3 (and possibly an interim 2.2.5 release) and above will have the fix. Fortunately, HTTPServer has had *very* few changes that would render newer versions incompatible with older Zopes, so I didn't have to go with a Windows-unfriendly patch file, and only needed two replacement files. So, yes, this is it. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteAccess and Roles
From: The Doctor What [EMAIL PROTECTED] I tried both Owner and Manager roles in user_acl(2) but it doesn't work! Didn't work in what sense? They couldn't log in, or didn't get the access you expected? More access or less, or just weird? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteAccess and Roles
From: The Doctor What [EMAIL PROTECTED] I tried both Owner and Manager roles in user_acl(2) but it doesn't work! Didn't work in what sense? They couldn't log in, or didn't get the access you expected? More access or less, or just weird? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Difference between Methods and Scripts?
From: Hamish Lawson [EMAIL PROTECTED] I see that the latest version of the O'Reilly Zope book now talks about Python and Perl *Scripts*, but refers still to DTML and ZSQL *Methods*. Does this reflect some actual conceptual difference between a Script and a Method, or is it simply because of the burden of also renaming DTML, ZSQL, etc? DTML and ZSQL Methods (and the older Python Methods) act as though they are bound methods of the object on which they are called. Python Scripts aren't bound to any particular object, although they have access to their context, their container, and their selves. There could be a future class of DTML or ZSQL objects that behave this way, but they would probably be better named Templates than Scripts. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] IE5 / Medusa bug?
From: seb bacon [EMAIL PROTECTED] I imagine the fact that I can make it work by adding index_html is the most telling point, but it's not telling me anything ;) Leaving off index_html causes Zope to add a base href to the head. That's the only difference I can think of. Your page doesn't get cut short in my IE 5.00.2314.1003 (128 bit encryption). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Method and builtin-functions
From: Sven Hohage [EMAIL PROTECTED] I'd like to use Python - Methods but I'm afraid that some builtin-functions are not implemented like type() or list(). This is true. If it is really a problem for you, you may wish to wait for Python Scripts. Another question is if the Python-Method-product is the same thing as the one shipping with Zope 2.3? Zope 2.3 has Python Scripts, which are much more developed and capable than Python Methods. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Product Authors: If you use ZCatalog, READ! (that means you, Chris W. :-)
From: The Doctor What [EMAIL PROTECTED] I would happy to, it looks like it does what I need (having siteaccess). However, I don't see a clear cut description what's changing and how. What needs to be done (in easy to understand language) to make sure it all goes smooth, etc. It's one step off the link given before, and really the one page you need to read: http://dev.zope.org/Wikis/DevSite/Projects/ZCatalogVirtualHostFix/UpgradeFAQ It's a big update, with lots of files. Will this work with 2.2.4? Is it dangerous? If you're asking for guinea pigs (bweep!) then I'm not sure I should be it, as I'm still trying to figure out what's going on in many ways. If you run a copy of your site on this code, it will be evident immediately whether you have problems or not. If that's hard to do, you may want to at least set up a mini-site and export some test data to it. Authors of Products that use ZCatalog: PLEASE give feedback and try to document any problems or workarounds for your Product on the AffectedProducts page (linked from UpgradeFAQ in several places). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Something missing in Python Methods
From: Curtis Maloney [EMAIL PROTECTED] What I want to know is, why can't Python Methods refer to anything not explicitly passed to them? I don't want to have to make everything that invokes the method have to know to pass it half a dozen objects. Isn't the idea of a method to be executed in the namespace of it's parent? I want my method to be able to access objects in it's own folder... Yep. You just need to make the first parameter of your method 'self', and not have any parameters with default values. For example, method plusX:: paramsself, x/params return len(self.objectIds()) + x ...can be called like 'folder.plusX(3)'. You can also acquire objects that your method needs from 'self'. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Lobbying (was: [Zope] html_quote in python methods?)
From: Chris Withers [EMAIL PROTECTED] dtml-call "somemethod(absolute_url()+urlquote(_.getitem(id))" Well, in Python Scripts at least, you can do:: from Products.PythonScripts.standard import special_formats url_quote = special_formats['url-quote'] return url_quote("OK?") It's not great, but it's something. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Why pythonMethod forbids me cutting list?
From: Dirksen [EMAIL PROTECTED] These statements in python method: stock=[3,4] del stock[1] will cause this error: Error Type: Python Method Error Error Value: Forbidden operation DELETE_SUBSCR at line 2 How is that? Python Methods aren't smart enough to know that you created the list yourself, and there's no security risk in allowing you to alter it. Python Scripts remove this limitation. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python script / python method problem
From: Lothar T.E.L. [EMAIL PROTECTED] I am having a problem with one of the examples in Chapter 12 of the Zope book. I am creating a new product called "Zoo Exhibit" comprising of a DTML method, a Python script and, of course, a factory. The Zope book examples are based on Zope 2.3, which includes classes (such as Python Scripts) and behaviors that do not exist in prior versions. Zope 2.3 is currently in alpha testing, and is available through CVS. I have a DTML method sending "id" and "title" to a Python method/script. I am told to create a "Python Script". I assume this is done by creating a "Python Method"? Python Scripts supersede Python Methods, and behave somewhat differently. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Python Scripts update
Python Scripts have gone through a fair number of changes and bugfixes recently. They should now work properly as methods of ZClasses. When you download the source of a Python Script, the title, parameter list, and bindings are added to the source in the form of specially formatted comments. If source with these comments is uploaded or pasted into a Python Script, it will properly set the properties mentioned in the comment block. The default bindings have been changed to be more sensible. If you want to give Python Scripts a try, you can go to http://ps.4-am.com:9000/ , pick a password, and you'll get your own private area in a trunk CVS checkout of Zope in which to play. I promised examples when I first announced this site, and haven't gotten around to writing any. If you have created a script or set of objects on the demo site that you would like to share as an example, please mail me the URL. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] What is python scripts?
From: "Dirksen" [EMAIL PROTECTED] Is that a product(can't find it in zope's product page) or a new version of python method? Where to download? Please point me to the right direction. It is the successor to Python Methods (although they can coexist happily), to be released in 2.3 (now in alpha test). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to set a REQUEST variable inside a PythonMethod?
From: Juan Carlos Corua [EMAIL PROTECTED] REQUEST.update({'NoRows': 4}) and I tried: REQUEST['NoRows'] = 4 and I tried: REQUEST.set('NoRows', 4) That last one should have worked; The first two wouldn't. Do you get an error on the last one? Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Unidentified problem with SiteRoot
From: Kelvin Cheong [EMAIL PROTECTED] I have a problem which i suspect is site root's problem. Shouldn't be; Site Roots only affect the generation of URLs by the REQUEST, and by absolute_url. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteAccess and 2.3.0a2
From: "Timothy Wilson" [EMAIL PROTECTED] I have Evan's excellent SiteAccess product installed on my 2.3.0a1 Zope Thank you. Now that SiteAccess is part of the Zope core, how should I handle the upgrade. Can I simply recompile? It's the same Product, with only cosmetic changes. If you're getting Zope from CVS, you should probably delete your current SiteAccess directory before cvs up. If you're using the tarball, simply don't bother installing SiteAccess in the new installation. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] type in python methods
From: Juan Carlos Corua [EMAIL PROTECTED] How can I compare the type of 2 variables in a python method? The instruction "if type(var1) == type(var2): " doesn't work. _.same_type(var1, var2) should do it. (Without the "_." in Scripts). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] importing string module in python METHOD - a problem that shouldn't be aproblemproblem
From: "Lee" [EMAIL PROTECTED] I have a Python method that needs to use the string module. In the method body I have the 'import string' statement but when I try it = As Shane mentioned, 'import' is only enabled in Python Scripts, but Python Methods pre-import all of the same modules as DTML, including 'string'. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClasses meet PythonScripts, sample request
From: "Jim Washington" [EMAIL PROTECTED] I am not working through that example, but the below is a start on what you seem to need. Let me know what you think. Thanks for the fine examples! I have only one nit to pick; When using Scripts in ZClasses, you will typically want to use 'container', not 'context', since 'context' may not be the ZClass instance, but 'container' always is. Of course, a Script may operate on both the instance and on whatever object it was called on, in which case both 'container' and 'context' will be used. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __setstate__ and acquisition
From: "Matt" [EMAIL PROTECTED] I am using __setstate__ to reload files into memory for objects of a product I have made. This all works nicely, as is it supposed to. The problem though is that the object seems not to know about its environment at that time __setstate__ is called on the bare object, without any acquisition wrappers. All you can do at that time is load state and set volatile attributes for use later. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] mailhost example problem
From: Michael Angelo [EMAIL PROTECTED] i am experiencing a strange problem with using the mailhost example on zope.com. Is your code indented the way it is in your email? I don't think dtml-sendmail and its contents should be indented, since the contents are meant to be the literal text of the message and its headers. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] VirtualHostMonster, PATH_INFO and absolute_url
From: Itai Tavor [EMAIL PROTECTED] 1. When accessing http://10.0.1.21/spam PATH_INFO is /VirtualHostBase/http/10.0.1.21:80/MySite/VirtualHostRoot/spam, which breaks any method that uses PATH_INFO (For example, the login form of LoginManager). Can this be fixed somehow? The Zope virtual hosting machinery doesn't adjust CGI variable. Applications should use URL0 or URLPATH0 instead of PATH_INFO. 2. In this setup, if I got it right, absolute_url() for /MySite/spam should return http://10.0.1.21/spam. But it returns http://10.0.1.21/MySite/spam. Something's broken? Yep, VirtualHostMonster has a bug, now fixed in CVS. Thanks! Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Add this to Wish list
From: Jerome Alet [EMAIL PROTECTED] Please could you include a button "Download Source" to the Python Script edition form ? Already done; There's a link in the paragraph below the text area, and above the upload form (in CVS). Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Did I miss some major change in Z SQL Methods ?
From: "Curtis Maloney" [EMAIL PROTECTED] A Z SQL Method ( Returner.sql.getDetails ) [snip] dtml-with "Returner.getDetails(Returner, User=12)" dtml-var fieldName /dtml-with You want either: dtml-in "Returner.getDetails(Returner, User=12)" dtml-var fieldName /dtml-in ...or... dtml-with "Returner.getDetails(Returner, User=12)[0]" dtml-var fieldName /dtml-with Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] VirtualHostMonster, PATH_INFO and absolute_url
From: "Itai Tavor" [EMAIL PROTECTED] Great, thanks for the fix. It's fine in Zope 2.3b3. I should probably write a Howto for VirtualHostMonster, and ask the folks who've written the various fine SiteAccess-related Howtos to incorporate it. It really is a lot easier and safer to use than SiteRoots 98% of the time. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] VirtualHostMonster, PATH_INFO and absolute_url
From: Philip Aylesworth [EMAIL PROTECTED] I would appreciate that HOWTO. :) I am going to need virtual hosting for a project I am undertaking and don't even know where to begin. Is VirtualHostMonster part of SiteAccess (which I have just discovered when I did a search on zope.org)? Do I need to use apache for it? Should I use apache rather than ZServer if I don't need any of apache's features? If you genuinely don't need Apache, ZServer is certainly good enough. Many people (such as myself) use Apache for a cheap management/performance win serving large utterly static content like images, for battle-tested SSL, and for the ability to run other back-end servers or CGI in parallel. VirtualHostMonster is a newish SiteAccess component that makes virtual hosting easy for the most common cases, where Apache or some other thin back-end is handling the incoming rewriting, and the rewriting consists of host/port renaming and path insertion (http://www.myhost.com/ = http://localhost:8080/myhost). In this case, all you need is one VirtualHostMonster and a slight, easy change to your rewrite/proxy directives. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] SiteRoot 2 errors
From: Stephan Goeldi [EMAIL PROTECTED] I want to add a SiteRoot to my domain subfolder. I installed a fresh Zope 2.2.5 and in the lib/python/Products folder I extracted SiteAccess-2.0.0b4-nonbin.tgz. After this I restarted Zope. When I click to Add SiteRoot, I get the following error message: [snip] File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 566, in read_raw (Object: www/SiteRootAdd) IOError: (see above) Check the file ownership/permissions on the SiteAccess directory and its subdirectories. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition Algebra; interaction of containment and acquisition is confusing
From: Fred Yankowski [EMAIL PROTECTED] for the very last case, "a.b.c.x". I just can't follow why the equivalent expression isn't x.__of__(a).__of__(c.__of__(b.__of__(a))) rather than the more complex answer given: x.__of__(a).__of__(b.__of__(a)).__of__(c.__of__(b.__of__(a))) You can expand any access path into an acquisition expression using the following 3-1/2 rules: 1. Given an unwrapped object 'x', x.child = (child o x) 2. Given a wrapper (self o parent), a. (self o parent).child = self.child o (self o parent) if 'child' is found in 'self'. a. (self o parent).child = parent.child o (self o parent) if 'child' is found in 'parent'. 3. Reduce ((a o b) o (b o c)) to (a o (b o c)) as soon as it appears. So, a.b = (b o a). a.b.c = (b o a).c = (b.c o (b o a)) = (c o (b o a)). Finally, a.b.c.x = (c o (b o a)).x = ((b o a).x o (c o (b o a))) = ((a.x o (b o a)) o (c o (b o a))) = (((x o a) o (b o a)) o (c o (b o a))) When I run the test cases given in the document I see that the latter does match the behavior, but I find that baffling. In particular, why is the effective search order x-a-b-c rather than x-a-c-b? It almost looks like the effective search order could be described as "up through the containment heirarchy, then down through the remaining acquired path", but I'm not at all sure if that's a valid generalization. Almost. It's "up through the containment hierarchy, then the rest of it somehow". Trying to control or predict the exact search order for any but the simplest acquisition trees is a dangerous game. You can read it off directly from the algebra form, as in (((x o a) o (b o a)) o (c o (b o a))) = x, a, b, c (ignoring duplicates), but it's unlikely to be useful, as you saw. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Acquisition Algebra; interaction of containment and acquisition is confusing
From: Fred Yankowski [EMAIL PROTECTED] Now, does that bother anyone besides me? Since acquisition is intrinsic and ubiquitous in Zope, shouldn't we be concerned that it is hard to control or predict? Keep in mind that it is only the *order after containment* that has this problem. For instance, schemes to "skin" a subfolder by changing access paths should ensure that there is always exactly one "skin" implementation in the acquisition path. It is tempting to provide a "default skin" in the containment path, but then you can't override it. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] PythonScript question
From: "Timothy Wilson" [EMAIL PROTECTED] Error Type: TypeError Error Value: argument 1: expected read-only character buffer, instance found [snip] input name="display_date:date" size="20" value=""/td [snip] D = string.split(display_date, '/') You are marshalling 'display_date' as a date, then trying to treat it as a string. You need to either convert it to a string or use date methods. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Python Methods can't construct literal dictionaries?
This is one of the shortcomings of Python Methods that Scripts eliminate. You can work around it by writing: x = {} x.update({y: z}) Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] porting from Python Methods to PythonScripts in 2.3.0; LoginManager too
From: "Fred Yankowski" [EMAIL PROTECTED] + Don't copy over SiteAccess and PythonMethods. + Delete the PythonMethods product from the Control_Panel/Products management folder. Will I have to manually convert each existing Python Method to a PythonScript, or are they essentially the same type? They are radically different types, and can therefore live in the same Zope, side-by-side, without conflicting. There is no automatic conversion process. Simply keep PythonMethods installed, and replace individual Methods with Scripts as you feel the need. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] porting from Python Methods to PythonScripts in 2.3.0;LoginManager too
From: "Jim Washington" [EMAIL PROTECTED] Standard caveats, YMMV, etc, but it does a quick pass on the Methods in the folder where it is and makes Scripts from them when you hit the 'test' tab, saving the old ones as methodname.old. Excellent! Thanks for writing and sharing this -- it looks like a fine candidate for a HOWTO. Cheers, Evan @ digicool 4-am ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-dev] Re: ZCatalog and Unique IDs
- Original Message - From: Chris Withers [EMAIL PROTECTED] who's the CTO? Jim Fulton, Chief Technology Officer. use paths instead of object monikers. Why not do both? Have an POID (CORBA style) to actually identify an object and then use paths of POIDS to identify stuff in a cotnext *when you need to*... comments? A man with one watch knows what time it is; A man with two is never sure. That may not be a problem in this case, but I have a sneaking suspicion it would be. Still, if you can demonstrate that can be valuable and coherent, it could probably be done. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Problems with LoginManager form-based login
- Original Message - From: Phillip J. Eby [EMAIL PROTECTED] Been there, done that. Yours doesn't work either, btw. Well, actually, it does, it's just that it causes a memory leak because it leaves an unintended circular reference. We've got a version that fixes the circular reference, but in a really really ugly way (it does a run-time patch to BaseRequest.close() to remove the poked-in unauthorized() method). The GUF version, at least, doesn't need this drastic a fix. Adding the following line to the top of guf_unauthorized should suffice: del request.RESPONSE.unauthorized Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Traversal Stuff
- Original Message - From: Chris Withers [EMAIL PROTECTED] What this offers is having a URL like: http://mysite.com/folder/object/some/parameters processed by the 'object' object with a parameter of '/some/parameters' or better still a 'URL objects' list as a parameter. This sounds like Traversal Interface stuff so I thought now would be a good time to mention it given the traversal interface is being re-done. ZSQLMethods do this in __bobo_traverse__, through a rather complicated system of temporary traversal objects. Once the new traversal machinery is in place, you'll be able to do it in either __bobo_traverse__ or __before_publishing_traverse__ (the former if you want to be able to do it all the time, the latter only during ZPublisher traversal) by manipulating REQUEST['TraversalRequestNameStack']. The specifics of this are still in flux. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] SiteAccess in 2.0.0b2?
- Original Message - From: T.J. Mannos [EMAIL PROTECTED] I'm having trouble getting SiteAccess 2.0.0b2 to work with Zope 2.2.0b2. The first odd thing that happens is when I create a new SiteRoot, it says that this object already has a SiteRoot (which it doesn't), but creates it anyway. The second is: it doesn't seem to work at all! The value of URL1 still has the :9080 port and the wrong virtual server. Any ideas? What's your platform (win, linux, *bsd)? Is this a Zope database which has been upgraded from an earlier version of Zope? If so, were you using SiteAccess 1.x with that earlier version? Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] NASTY error. Why?
From: Chris Withers [EMAIL PROTECTED] dtml-call "REQUEST['where'][-1].manage_addFolder(id)" Error Type: TypeError Error Value: read-only character buffer, Python Method Looks like the 'id' of something along the line is a method rather than a string. Try "_.getitem('id', 1)". Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] getting request variables values
The value you're after is stored in the 'environ' section of the request. Unlike 'other' and 'cookies' keys, 'environ' keys can't generally be fetched as attributes or keys of REQUEST. You need to access them as REQUEST.environ['keyname']. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Acquisition Confusion :S
From: Chris Withers [EMAIL PROTECTED] Who would be best to ask why it was set up the way it is? I'm sure there are very good reasons for it but the search order in all but the simple cases is very confusing and not as useful as it could be. How much more work would it be to implement the following algorithm, regardless of how the actual containment is? [snip] I haven't got the whole reason, but here are some of the pieces: - never expose a "bare" object, or even one with an incomplete context - allow the user to backtrack along the context chain These two together give you the part about aq_parent always being the previous acquisition result. - allow recovery of containment information - base security on containment These two motivate the simplification of raw acquisition. With the simplification, you get containment-first search and aq_inner.aq_parent gives you your fully-wrapped container. The current acquisition implementation is thus a weird hybrid of containment and context. It retains both sorts of information while providing the search semantics we want security to have. It isn't hard to convert a standard acquisition wrapper into either of the other sort. I'm going to propose adding something like the following functions: def aq_context(ob): context = [] while ob is not None: context.append(ob.aq_base) ob = ob.aq_parent ob = context.pop() while context: ob = context.pop().__of__(ob) return ob def aq_containment(ob): context = [] while ob is not None: context.append(ob.aq_base) ob = ob.aq_inner.aq_parent ob = context.pop() while context: ob = context.pop().__of__(ob) return ob ... so that you could write something like dtml-var expr="aq_context(foo).bar" or dtml-with foo contextdtml-bar;/dtml-with. In the meantime, they make fine External Methods. Cheers, Evan @ digicool 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )