RE: [Zope] Adding roles in 2.3b2 and CVS
I've got this problem as well - who wants to report it? Zope Version Zope 2.3.0b2 (source release, python 1.5.2, linux2) Python Version 1.5.2 (#1, Dec 21 2000, 15:29:32) [GCC egcs-2.91.66 19990314/Linux (egcs- System Platform linux-sparc Process Id 23242 (1024) Running For 18 hours 53 min 23 sec Error Type: TypeError Error Value: too many arguments; expected 2, got 3 Traceback (innermost last): File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope23/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope23/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_defined_roles) File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_defined_roles) File /usr/local/Zope23/lib/python/AccessControl/Role.py, line 489, in manage_defined_roles (Object: ApplicationDefaultPermissions) TypeError: (see above) Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Martijn Pieters [mailto:[EMAIL PROTECTED]] Sent: 22 January 2001 12:02 To: Phil Harris Cc: [EMAIL PROTECTED] Subject: Re: [Zope] Adding roles in 2.3b2 and CVS On Mon, Jan 22, 2001 at 11:31:27AM -, Phil Harris wrote: Has anyone else had trouble adding roles when using 2.3b2 and CVS versions of Zope? There seems to be a consistent bug in ZopeDIR/lib/python/AccessControl/role.py. The calls to self.manage_access(self,REQUEST) seem to have too many arguments, am I right? I 'fixed' my version of the file ut someone with more nouse will need to check this out. Would this be better reported in the collector? Reporting to the Collector is a good idea, especially if you can reproduce the problem. -- Martijn Pieters | Software Engineer mailto:[EMAIL PROTECTED] | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ - ___ 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 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] Another problem with Login Manager
Yes, I've seen that and would love to know what causes it. I didn't find out why, but it isn't doing it now. It may be to di with the Roles the user has. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Steffen Bergmann [mailto:[EMAIL PROTECTED]] Sent: 19 January 2001 09:34 To: [EMAIL PROTECTED] Subject: [Zope] Another problem with Login Manager With the help from yesterday I got the Login Manager started. But if I want to change the userAuthenticate Method there was a problem. I cant get into the Managementview of my testfolder. Always when I click on the testfolder in the Managementscreen of ZOPE, it returns the index_html of the testfolder in the viewscreen and not in the managementscreen. This problem only returns when I login with my User. With other users it doesnt. Steffen ___ 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 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] Calling ZSQL from PythonMethods (was RE: [Zope] ZSQL, Python methods and XMLRPC)ods and XMLRPC)
Hmm - with regard calling ZSQL method from PythonMethod, this works: def pythonmethod(self): a = [] for v in self.SQL_list_something(): a.append(v.field) return a dtml-var pythonmethod *But* of course I can't pass "self" over XMLRPC. Why does self.ZSQL_method() work, but: def pythonmethod(meth): a = [] for v in meth(): a.append(v.field) return a dtml-var "pythonmethod(ZSQL_method)" Give "__call__ not defined"? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -----Original Message- From: Mayers, Philip J [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 22:37 To: '[EMAIL PROTECTED]' Subject: [Zope] ZSQL, Python methods and XMLRPC I've three questions (but I'm making progress!): 1) In 2.2.5, how can I call a ZSQL method from a Python Method - I'm passing the method in as a parameter, and the furthest I get says "__call__ not defined". Do PythonScripts obivate the need for this? I assume I can just do this: for record in context.folder.subfolder.SQL_method(val1='a',val2='b'): # do stuff Does that work? 2) When calling a DTML method over XMLRPC, dtml-in "SQL_method(username=AUTHENTICATED_USER)" doesn't work, but dtml-in "SQL_method(username=REQUEST.AUTHENTICATED_USER)" does. Why? 3) Why aren't record values (the return of an SQL method) marshallable over XMLRPC. I get this: cannot marshal extension class ExtensionClass at 70356ff4 objects Regards, Phil ___ 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 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: How to backup Zope data base?
Well, bad _technically_, or bad _evil_? G It does have the sole advantage you can pull a portion of your tree, and some people have had Data.fs problems (not me thankfully). But in general I'd guess backing up Data.fs to be the best way. How does it copy with non-atomicity of disk writes? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: 19 January 2001 17:02 To: Andreas Tille Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] Re: How to backup Zope data base? Andreas Tille wrote: On Fri, 19 Jan 2001, Stephane Bortzmeyer wrote: On Thursday 18 January 2001, at 13 h 52, the keyboard of "Mayers, Philip J" [EMAIL PROTECTED] wrote: This certainly isn't *efficient*, but it works: This is great because absolutely the thing I was looking for ... Thanks for the zexp part Philip! That's actually a really bad way to back up Zope :-S Copying data.fs is much more reliable and _much_ less strenuous on your server, especially if it's a big Data.fs cheers, Chris ___ 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 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] Data type coercion and records
*Now* I remember why I like Zope so much... I'm using the ":records" to marshall a complex hierarchical form, and I'm a little worried by this comment: http://www.zope.org/Members/Zen/howto/FormVariableTypes Note: Before creating a second record and adding an attribute, Zope gets the last record in the list and checks to see if that record has the attribute. If the first record doesn't have the attribute, it inserts the attribute and value instead of creating a new record. For example, if the user entered a name and age for Member #1 and only an email for Member #2, the list will have only one record. That record will contain the name and age attribute from Member #1 as well as the email attribute from Member #2. This isn't a problem for me, *except* sigh. I want to be able to tickbox certain fields to delete them, as well as alter the values in the textboxes to alter other fields. *BUT*, my HTML manual says that "CHECKBOX name/value pairs are only submitted to the server if the field is checked" So, I would expect this: dtml-var standard_html_header table dtml-if listdtml-in list tr tddtml-a;/td dtml-if btddtml-b;/td/dtml-if /tr /dtml-in/dtml-if /table formtable tr tdinput type="text" name="list.a:records" value="1a"/td tdinput type="checkbox" name="list.b:records" value="1b"/td /trtr tdinput type="text" name="list.a:records" value="2a"/td tdinput type="checkbox" name="list.b:records" value="2b"/td /trtr tdinput type="text" name="list.a:records" value="3a"/td tdinput type="checkbox" name="list.b:records" value="3b"/td /trtr tdinput type="text" name="list.a:records" value="4a"/td tdinput type="checkbox" name="list.b:records" value="4b"/td /trtr /table input type="submit" value="test" /form dtml-var standard_html_footer To read: 1a 2a 3a 4b 4a If you just ticked the 4th listbox. But it doesn't - it works as I "want" it to work, i.e. it reads: 1a 2a 3a 4a 4b Why? I'm glad this does, but as the saying goes, if you don't understand it, it can bite you when you least expect it. I've tested this under netscape 6 and IE5.0. I know I can work around it (set the value field of the checkbox to contain the information it's referring to) but I'm curious as to what's going on. I note that if you swap the textbox and checkbox around, it does indeed "break", and the delete is associated with the previous record as you'd expect. So - I suspect the behavious of "records" changed at some point? My question then becomes - does the HTML/HTTP spec guarantee that if I put the checkboxes *after* the textboxes, and Zope is marshalling the records in a useful fashion, this will always work on a conforming browser? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] Help with getting started with Login Manager
Try this: http://www.zope.org/Members/jok/SQL_based_LoginManager Some extra pointers: Step 7: Customize the LoginManger instance to call the SQL methods You'll have this /root /folder /acl_users (LoginManager) /UserSource SQL_check_user SQL_get_password SQL_get_roles You're then supposed to add DTML Methods called userAuthenticate,userExists,userRoles *BUT* if you do this, you'll be locked out. Instead, add xuserAuthenticate xuserExists xuserRoles Edit test the DTML methods, then when you're sure they work, batch rename them (i.e. tick the boxes next to all three, then click rename). They'll be renamed as an atomic unit, and hopefully the LoginManager will work. It can be very frustrating to get going though - Once you've completed step 6, I recommend taking a copy of "folder" i.e. /root /folder (...etc...) /copy_of_folder (...etc...) If you break it, you can get back to /root, delete folder, copy "copy_of_folder" back to "folder" and not have to start from scratch. Very time saving. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Steffen Bergmann [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 09:32 To: [EMAIL PROTECTED] Subject: [Zope] Help with getting started with Login Manager Hi ! I installed the Login Manager to my Zope, but I dont know how to use it. I want to authenticate my users with an SQL database. Is there anywhere good documentation about Login Manager. And how does the Login Manager solve the N*M problem with managing the users. Regards Steffen ___ 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 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] Solved (was RE: Data type coercion and records)
Doh - my fault... RTFM I think... I think I misread the linked page. When unmarshalling the records, Zope will only create a new record in the list if the current record already has the given attribute. So, provided you always put the textboxes before the checkboxes, it will always work. Unless there are non-compliant browsers out there... Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Mayers, Philip J Sent: 18 January 2001 12:26 To: '[EMAIL PROTECTED]' Subject: Data type coercion and "records" *Now* I remember why I like Zope so much... I'm using the ":records" to marshall a complex hierarchical form, and I'm a little worried by this comment: http://www.zope.org/Members/Zen/howto/FormVariableTypes snip ___ 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 backup Zope data base?
This certainly isn't *efficient*, but it works: wget -http-user=usename -http-pass=password http://your.site.com/Zope/path/to/wherever/manage_exportObject?download%3Ain t=1 Will get you a .zexp of "/path/to/wherever", whereas: wget blah http://your.site.com/Zope/manage_exportObject?download%3Aint=1toxml=Y Will get you an XML export of your entire site. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Etienne Labuschagne [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 07:26 To: Zope user list (E-mail) Subject: [Zope] How to backup Zope data base? Hi all What is the best way to backup Zope's database whithout stopping Zope? When I use backup, it just says that the file is in use and cannot be backed up. What I have done so far is to copy the file in explorer and back that up - but it feels kludgey and I'm not sure if I get the database in a state that is safe. Thanks all Etienne Tel: (012) 348 4586 Cel: 082 442 8981 Fax: (012) 361 8355 ___ 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 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] manage_exportObject checks Referer header (RE: [Zope] How to backup Zope data base?)up Zope data base?)
My earlier suggestion: wget --http-user=username --http-pass=password \ http://server.name/Zope/path/to/folder/manage_exportObject?download%3Aint=1 Does not work (on Zope 2.2.5 at least) but this: wget --http-user=username --http-pass=password \ --header="Referer: http://server.name/Zope/path/to/folder/manage_importExportForm"\ http://server.name/Zope/path/to/folder/manage_exportObject?download%3Aint=1 ...does. Why does manage_exportObject check the Referer header? Is this by design? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message----- From: Mayers, Philip J [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 13:52 To: 'Etienne Labuschagne'; '[EMAIL PROTECTED]' Subject: RE: [Zope] How to backup Zope data base? This certainly isn't *efficient*, but it works: wget -http-user=usename -http-pass=password http://your.site.com/Zope/path/to/wherever/manage_exportObject?download%3Ain t=1 Will get you a .zexp of "/path/to/wherever", whereas: wget blah http://your.site.com/Zope/manage_exportObject?download%3Aint=1toxml=Y Will get you an XML export of your entire site. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Etienne Labuschagne [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 07:26 To: Zope user list (E-mail) Subject: [Zope] How to backup Zope data base? Hi all What is the best way to backup Zope's database whithout stopping Zope? When I use backup, it just says that the file is in use and cannot be backed up. What I have done so far is to copy the file in explorer and back that up - but it feels kludgey and I'm not sure if I get the database in a state that is safe. Thanks all Etienne Tel: (012) 348 4586 Cel: 082 442 8981 Fax: (012) 361 8355 ___ 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 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 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] ZSQL, Python methods and XMLRPC
I've three questions (but I'm making progress!): 1) In 2.2.5, how can I call a ZSQL method from a Python Method - I'm passing the method in as a parameter, and the furthest I get says "__call__ not defined". Do PythonScripts obivate the need for this? I assume I can just do this: for record in context.folder.subfolder.SQL_method(val1='a',val2='b'): # do stuff Does that work? 2) When calling a DTML method over XMLRPC, dtml-in "SQL_method(username=AUTHENTICATED_USER)" doesn't work, but dtml-in "SQL_method(username=REQUEST.AUTHENTICATED_USER)" does. Why? 3) Why aren't record values (the return of an SQL method) marshallable over XMLRPC. I get this: cannot marshal extension class ExtensionClass at 70356ff4 objects Regards, Phil ___ 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] Form data type coercion syntax and javascript
Not a problem per-se, just a query - how are people dealing with things like this: dtml-var standard_html_header FORM SELECT MULTIPLE NAME="test" /SELECT SCRIPT LANGUAGE="JavaScript" function populate(form) { for (var i=0;i4;i++) { form.test.options[i] = new Option("Red"+i,"color_red"); if (i == 0) form.test.options[i].selected = true; } return false; } /SCRIPT INPUT TYPE="BUTTON" onClick="populate(this.form)" VALUE="Fill in" INPUT TYPE="SUBMIT" VALUE="Go" /FORM dtml-var standard_html_footer If a user selects multiple values, of the dynamic list, Zope will coerce them to a list when the form is input. *BUT*, if they select a single value, it'll be a single string/integer. Normally, you'd do this: SELECT NAME="test:list" But how do you access it from JavaScript then? I'm doing this: function populate(form) { var list = form; for (var j=0;jform.length;j++) { if (form.elements[j].name == "test:list") list = form.elements[j]; } if (list == form) return false; for (var i=0;i4;i++) { list.options[i] = new Option("Red"+i,"color_red"); if (i == 0) list.options[i].selected = true; } return false; } Anything more elegant? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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: SQL Method, dtml-with and namespace weirdness
Heh. Oh well, you win some, you lose some! I appear to be losing some - maybe I should drink less caffine? I can work around the problem for the moment, but either: 1) I *totally* misunderstand how dtml-with works 2) It's misbehaving itself under some circumstances To recap: two SQL method returning [different] (name,domain) are used like this: dtml-in SQL_method1 Pdtml-name;/P - POINT A Pdtml-domain;/P dtml-in SQL_method2 Pdtml-name;/P- POINT B Pdtml-domain;/P dtml-with aFolder Pdtml-name;/P - POINT C Pdtml-domain;/P /dtml-with /dtml-in /dtml-in This will print: name1 domain1 name2 domain2 name1 domain1 That is: *inside* the dtml-with, the variables "name" and "domain" appear to be reset to their values in the *outer* dtml-in tag, not the innermost. This *only* happens if both SQL methods return variables named the same, and it *only* affects those two variables (so, I can work around it). Is this expected behaviour? Anyone who wants to see this problem can have Manager access to a test subtree I setup that reproduces the problem exactly. I realise it's far more likely that the problem lies with me - but what is the problem? Also - your comment about SQL methods vis. the DTML namespace has cleared up a longstanding confusion of mine - thanks! Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED]] Sent: 10 January 2001 20:59 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] REPOST: dtml-with doesn't work Usually, I complain that problem reports are too terse. But, your's was very big, such that I did not read it carefully. It is very difficult to get it right for everyone. Just a remark: SQL methods do *NOT* look at the DTML namespace *AT ALL*, just at REQUEST (or the expliciitly passed keyword arguments). Thus, "dtml-with", "dtml-let" and friends are all ineffective with respect to ZSQL methods. May be, that explains your problem. May be not, as I am not sure, that you need the values indeed inside a ZSQL method. I can assure you: "dtml-with" does work. Dieter ___ 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 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] REPOST: dtml-with doesn't work
Hopefully that will get someone's attention. I have an SQL method that returns (name,domain,otherstuff) I have a DTML method (/root/host/show) that looks like this: dtml-comment 'name' and 'domain' are set to the primary hostname and domain at this point by whatever calls this DTML method POINT A /dtml-comment dtml-in "HDB_get_ip_aliases(ip=ip)" dtml-commentPOINT B/dtml-comment dtml-let name2=name domain2=domain dtml-with alias dtml-commentPOINT C/dtml-comment dtml-with "_.namespace(name=name2,domain=domain2)" dtml-commentPOINT D/dtml-comment dtml-var show /dtml-with /dtml-with /dtml-let /dtml-in The folder structure is: /root /alias show /host show At the points marked B and D, dtml-var name and dtml-var domain work fine, but at point B, name and domain have been reset to what they were at point A. Why? This is totally broken - I'm *this* far from downloading the servlet engine and giving up completely. Zope appears to be completely non-intuitive in many respects, and combined with the generally lamentable documentation, is taking up more of my time than I'm willing to spend on a theoretically simple task. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] Special-name of variables called 'name' or 'domain'
That was how I had the code originally. Didn't help. I've already read the Zope 'book' (if I were using 2.3 (which I can't, because LoginManager doesn't work OOTB), I'd be using Python methods to do most of this instead. I'm not, I'm using 2.2.5) Thanks anyway. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: 10 January 2001 13:09 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] Special-name of variables called 'name' or 'domain' "Mayers, Philip J" wrote: snip Try this: Change your show method in root to be as follows: dtml-in get_machine_hosts dtml-var show_row dtml-in get_host_aliases dtml-var show_row /dtml-in /dtml-in And add another DTML method in root as follows: show_row: TR TDdtml-var ip missing/TD TDdtml-name;/TD TDdtml-domain;/TD /TR so you have: /root get_machine_hosts (SQL method) get_host_aliases (SQL method) show (dtml method) show_row (dtml method) Does that solve your problem? (I know it doesn't sovle any concerns you have about dtml-with and SQL method, but your posting wasn't exactly to reproduce, and so even if submitted to the collector, isn't likely to get followed up) While I'm at it, is dtml-with foldernamedtml-var dtmlmethod/dtml-with really the best way to call a DTML method of a folder? Mostly, yes... BTW, checkout http://www.zope.org/Members/michel/ZB/ and have a good read :-) cheers, Chris ___ 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] SQL Method, dtml-with and namespace weirdness
Sorry - I'm being unclear: the result is exactly the same either way i.e. the variables "name" and "domain" seem to be reset to the values from outside the dtml-in block when entering the dtml-with block. I'm wondering if it's a bug in the postgres DA, since I can't reproduce it with a quick gadfly test. I'm just going to try it out now. I'm using Zope 2.2.5, PoPy 2.0.1 from SourceForce, and ZPoPyDA-1.1-pre2 - I couldn't get any (potentially more stable) combination of PoPy or ZPoPyDA to work. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: 10 January 2001 13:30 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] SQL Method, dtml-with and namespace weirdness "Mayers, Philip J" wrote: Change your show method in root to be as follows: dtml-in get_machine_hosts dtml-var show_row dtml-in get_host_aliases dtml-var show_row /dtml-in /dtml-in And add another DTML method in root as follows: show_row: TR TDdtml-var ip missing/TD TDdtml-name;/TD TDdtml-domain;/TD /TR so you have: /root get_machine_hosts (SQL method) get_host_aliases (SQL method) show (dtml method) show_row (dtml method) That was how I had the code originally. Didn't help. What happens when you try that? Errors? Unexpected values? I've already read the Zope 'book' Yes, it is frustrating how long it's taking for that to get printed, I wonder what's holding it up? (if I were using 2.3 (which I can't, because LoginManager doesn't work OOTB), I remember seeing the posts relating to that, did you ever find out why it wasn't working? I'd be using Python methods to do most of this instead. I'm not, I'm using 2.2.5) Wise choice, but you mean python scripts in 2.3 ;-) You can actually download Python _Methods_ right now and use them in 2.2.5: http://www.zope.org/Members/4am/PythonMethod cheers, Chris ___ 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] SQL Method, dtml-with and namespace weirdness
Ok, using Postgresql 7.0.2-2, PoPo 2.0.1, ZPoPyDA 1.1-pre2, Zope 2.2.5, here's a reproducible scenario: Create the following tables in your database: create table bugtest1 ( name text, domain text, ); create table bugtest2 ( name text, domain text, refer text, foreign key(refer) references bugtest1(name) ); insert into bugtest1 values ('a','aa'); insert into bugtest1 values ('b','bb'); insert into bugtest1 values ('c','cc'); insert into bugtest2 values ('w','ww','a'); insert into bugtest2 values ('x','xx','a'); insert into bugtest2 values ('y','yy','a'); insert into bugtest2 values ('z','zz','a'); insert into bugtest2 values ('g','gg','b'); insert into bugtest2 values ('h','hh','b'); insert into bugtest2 values ('i','hh','b'); Create the following folder structure: /root dbconn (ZPoPyDA connection to whatever database you just put the tables in) index_html get_host (Z SQL method) get_alias (Z SQL method) /alias show /host show /root/get_host select * from bugtest1 /root/get_alias select * from bugtest2 dtml-sqlgroup where dtml-sqltest name column=refer type=string /dtml-sqlgroup /root/alias/show TRTD/TDTDdtml-name;/TDTDdtml-domain;/TD/TR /root/host/host TRTDdtml-name;/TDTDdtml-domain;/TD/TR /root/index_html: 1: dtml-var standard_html_header 2: TABLE 3: dtml-in get_host 4: dtml-with hostdtml-var show/dtml-with 5: dtml-in "get_alias(name=name)" 6: dtml-let name2=name 7: domain2=domain 8: dtml-with alias 9: TRTDPOINT A/TDTDdtml-name;/TDTDdtml-domain;/TD/TR 10: TRTDPOINT B/TDTDdtml-name2;/TDTDdtml-domain2;/TD/TR 11: dtml-var show 12: /dtml-with 13: TRTDPOINT C/TDTDdtml-name;/TDTDdtml-domain;/TD/TR 14: TRTDPOINT D/TDTDdtml-name2;/TDTDdtml-domain2;/TD/TR 15: /dtml-let 16: /dtml-in 17: /dtml-in 18: /TABLE 19: dtml-var standard_html_footer The output of all that is (a bit hard to read): a aa POINT A a aa POINT B w ww a aa POINT C w ww POINT D w ww POINT A a aa POINT B x xx a aa POINT C x xx POINT D x xx POINT A a aa POINT B y yy a aa POINT C y yy POINT D y yy POINT A a aa POINT B z zz a aa POINT C z zz POINT D z zz snipped for clarity So: at point A, the "name" and "domain" variables have been overwritten with the "name" and "domain" variables as they were on line 6/7, *BUT* name2 and domain2 haven't been overwritten (point B). BUT, outside the dtml-with tab (point C) "name" and "domain" are at their correct values. So - given that the dtml-with tag "must" work, I'm clearly not understanding *how* it works. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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 Scripts in 2.2.x
Oops, ignore that - copied the wrong error from the window (from an earlier attempt). The *real* error was that I was running zpasswd as root with a umask of 077, which of course meant the webserver and Zope couldn't read the resulting file. So, the LoginManager product appears to work, but the problem now is when I try to add a LoginManager to a folder, I get a NameError for 'path', with a traceback: Traceback (innermost last): File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope23/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope23/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: addLoginManager) File /usr/local/Zope23/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: addLoginManager) File /usr/local/Zope23/lib/python/App/special_dtml.py, line 120, in __call__ (Object: addLoginManager) (Info: /usr/local/Zope23/lib/python/Products/LoginManager/addLoginManager.dtml) File /usr/local/Zope23/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: addLoginManager) File /usr/local/Zope23/lib/python/DocumentTemplate/DT_In.py, line 633, in renderwob (Object: UserSourcesMetaTypes(this())) File /usr/local/Zope23/lib/python/DocumentTemplate/DT_Util.py, line 331, in eval (Object: UserSourcesMetaTypes(this())) (Info: UserSourcesMetaTypes) File /usr/local/Zope23/lib/python/ZPublisher/HTTPRequest.py, line 772, in __getitem__ NameError: (see above) Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Mayers, Philip J Sent: 09 January 2001 10:01 To: 'Bill Anderson' Subject: RE: [Zope] Python Scripts in 2.2.x No, I'm afraid not: Traceback (innermost last): File "/usr/local/Zope23/lib/python/OFS/Application.py", line 405, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/Zope23/lib/python/Products/LoginManager/__init__.py", line 1, in ? import LoginManager, LoginMethods, UserSources File "/usr/local/Zope23/lib/python/Products/LoginManager/LoginManager.py", line 8, in ? from Products.ZPatterns.Specialists import Specialist File "/usr/local/Zope23/lib/python/Products/ZPatterns/__init__.py", line 1, in ? import Rack, Specialists, Customizers, AttributeProviders, SheetProviders File "/usr/local/Zope23/lib/python/Products/ZPatterns/Rack.py", line 9, in ? from DataSkins import DataSkin File "/usr/local/Zope23/lib/python/Products/ZPatterns/DataSkins.py", line 1, in ? from DynPersist import DynPersist ImportError: No module named DynPersist Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Bill Anderson [mailto:[EMAIL PROTECTED]] Sent: 09 January 2001 04:42 To: Mayers, Philip J Subject: Re: [Zope] Python Scripts in 2.2.x Mayers, Philip J wrote: I need to use LoginManager, which doesn't seem to work with 2.3, It does after a minor modification... http://www.egroups.com/message/zope/47172 Bill Anderson ___ 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] Special-name of variables called 'name' or 'domain'
I've got some SQL method, and a folder structure, and am seeing some *very* annoying results. Namely, dtml-with seems to cancel out variable assignments from an enclosing dtml-in /root get_machine_hosts (SQL method) get_host_aliases (SQL method) show (dtml method) /host show (dtml method) /alias show (dtml method) get_machine_hosts takes 'machineid' and returns 'name','domain','ip', e.g. (for a 5-homed box) get_machine_hosts('535252'): www,random.com,192.168.3.2 mail,hosting.com,192.168.3.3 news,random.com,192.168.3.4 sqldb,random.com,192.168.3.5 workstation,random.com,192.168.3.6 get_host_aliases takes 'ip' and returns 'name','domain' e.g. get_host_aliases('192.168.3.3') [mail.random.com]: 'pop3','random.com' 'smtp','random.com' 'mail','random.com' 'imap','random.com' But, I'm having problems with the 'in' and 'with' tags using the variable 'name'. The DTML methods are: /root/show dtml-in get_machine_hosts dtml-with hostdtml-var show/dtml-with /dtml-in /root/host/show TR TDdtml-ip;/TD TDdtml-name;/TD TDdtml-domain;/TD /TR dtml-in get_host_aliases dtml-commentPOINT A/dtml-with dtml-with alias dtml-commentPOINT B/dtml-with dtml-var show /dtml-with /dtml-in /root/alias/show TR TD/TD TDdtml-name;/TD TDdtml-domain;/TD /TR Now, assuming I'm looking at machineid 535252 (mail.random.com). I get this: | 192.168.3.3 | mail | hosting.com | | | mail | hosting.com | | | mail | hosting.com | | | mail | hosting.com | | | mail | hosting.com | That is, the variable 'name' and 'domain' aren't set correctly. But, if I modify /root/host/show as follows: TR TDdtml-ip;/TD TDdtml-name;/TD TDdtml-domain;/TD /TR dtml-in get_host_aliases dtml-commentPOINT A/dtml-with TR TD/TD TDdtml-name;/TD TDdtml-name;/TD /TR dtml-with alias dtml-commentPOINT B/dtml-with dtml-var show /dtml-with /dtml-in I get: | 192.168.3.3 | mail | hosting.com | | | pop3 | random.com | | | mail | hosting.com | | | imap | random.com | | | mail | hosting.com | | | smtp | random.com | | | mail | hosting.com | | | webmail | random.com | | | mail | hosting.com | It would appear that the dtml-with alias tag wipes out the 'name' and 'domain' variables back to the values they had outside the dtml-in get_host_aliases tag, so calling /root/alias/show gives wrong data. Very odd. *BUT*, if I use 'aliasname' and 'aliasdomain' as the variable names, everything is OK. WTF? While I'm at it, is dtml-with foldernamedtml-var dtmlmethod/dtml-with really the best way to call a DTML method of a folder? Regard, Phil ___ 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 in 2.2.x
I need to use LoginManager, which doesn't seem to work with 2.3, and I need to use Python Scripts, which are not available (?) for 2.2.x - any ideas? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] LoginManager broken?
Ye gods... Ok, steps I had to take to get LoginManager working 1) Create a folder, call it "test" 2) In that folder, add a LoginManager with a GenericUserSource, with *just* "Basic Auth Login" selected. Leave the rest as defaults. 3) In the newly-created ACL-users folder, you'll find "forbiddenPage", "loginForm" and "logoutForm" - you can delete loginForm. Give logoutForm and forbiddenPage the "Manager" proxy role 4) In the UserSource folder/object underneath acl_users, add a) A connection to the SQL database you'll be using b) an SQL method "check_user" with a parameter "username", which does a "select username from usertable where username = dtml-sqlvar username type=string" c) an SQL method "check_user" with parameters "username" and "password", which does a "select username from usertable where username = dtml-sqlvar username type=string and password = dtml-sqlvar password type=string" d) an SQL method "get_roles" with a paramter "username" that does "select groupname from group_members where username = dtml-sqlvar username type=string" (or whatever is appropriate for your database) 5) Add the DTML methods WITH A DIFFERENT NAME - DON'T add userAuthenticate,userExists,userRoles - add (say) xuserAuthenticate,xuserExists,xuserRoles a) xuserExists should read: dtml-in "HDB_check_user(username=username)" dtml-if "_['sequence-item'].username == username" dtml-return "_.int('1')" /dtml-if /dtml-in dtml-return "_.int('0')" b) xuserAuthenticate should read: dtml-in "HDB_check_password(username=username,password=password)" dtml-if "_['sequence-item'].username == username" dtml-return "_.int('1')" /dtml-if /dtml-in dtml-return "_.int('0')" c) xuserRoles should read dtml-call "REQUEST.set('ret', '')" dtml-in "HDB_get_roles(username=username)" dtml-call "REQUEST.set('ret', ret+' '+groupname)" /dtml-in dtml-return ret 6) Give the "Manager" proxy role to the DTML methods, so they can access the SQL methods you just created 7) Turn off acquisition of the permissions on the test folder, and be sure to add read permissions to any local roles you're using 8) Make a copy of the test folder now, before it all goes wrong... 9) Batch rename the DTML method (e.g. s/x(.*)/$1/g in perl-speak) - if you're lucky, it will work. I have to say, I'm not hugely impressed... Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Mayers, Philip J [mailto:[EMAIL PROTECTED]] Sent: 11 December 2000 20:34 To: '[EMAIL PROTECTED]' Subject: RE: [Zope] LoginManager broken? Thanks, I'll take a look. Re: LoginManager - After a fast turnaround (confirming my ample faith in Open Source software) Magnus Heino pointed me in the right direction - the dtml methods and SQL objects need to be inside the UserSource folder, *not* the LoginManager folder as the Howto implies (or maybe I just can't read...). Can someone confirm that the SQL methods need to be inside the UserSource folder? (which is mildly annoying, but there we go...) I'm still having some problems getting multiple roles working, but it's behaving itself for now. Now all I have to do is solve my LIMIT problem... Regards, Phil +----------+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 11 December 2000 20:18 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] LoginManager broken? You might look at http://www.zope.org/Members/dlpierson/sqlLogin for a different approach that works for me in early testing. Note that it needs additional work before being turned loose on a live site. Dan Pierson "Mayers, Philip J" [EMAIL PROTECTED] writes: Does it even *work*? Even a little bit? Because other than repeating the same process 12 damn times, so far I'm not convinced. Maybe I'll look in the source code to see if there's actually anything in the files (other than a HOWTO.txt, which is empty, which BTW is more annoying than there not being one). The "LoginManager with SQL database" on the Zope site seems to end up with me having a folder I can't access through the management interface (unless you count "management" as "this is the index_html" document) Wow, thanks! Now I have to delete it and start all over again... In all seriousness - there *must* be one person who has gotten an SQL-backed LoginManger wo
[Zope] PCGI crash problem with SQL/LIMIT
I'm running Zope 2.2.4 and am having a *very* annoying problem (either I'm missing something, or Zope is broken). I've got an SQL table called "users". An SQL query of the form: select * from users limit 10 Works, but: select * from users Fails spectacularly - pcgi_publisher crashes with the error message: Temporarily Unavailable The resource you requested is temporarily unavailable - please try again later. (116) unable to connect, fd=6 I then get a 20 second timeout while PCGI restarts Zope. Grr. Help please Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] LoginManager broken?
Does it even *work*? Even a little bit? Because other than repeating the same process 12 damn times, so far I'm not convinced. Maybe I'll look in the source code to see if there's actually anything in the files (other than a HOWTO.txt, which is empty, which BTW is more annoying than there not being one). The "LoginManager with SQL database" on the Zope site seems to end up with me having a folder I can't access through the management interface (unless you count "management" as "this is the index_html" document) Wow, thanks! Now I have to delete it and start all over again... In all seriousness - there *must* be one person who has gotten an SQL-backed LoginManger working with 2.2.4 - surely? Thanks for all the great work (little bugs aside...) - Zope is a wonderful product! Now if only it could serve XML as well as Cocoon... Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] LoginManager broken?
Thanks, I'll take a look. Re: LoginManager - After a fast turnaround (confirming my ample faith in Open Source software) Magnus Heino pointed me in the right direction - the dtml methods and SQL objects need to be inside the UserSource folder, *not* the LoginManager folder as the Howto implies (or maybe I just can't read...). Can someone confirm that the SQL methods need to be inside the UserSource folder? (which is mildly annoying, but there we go...) I'm still having some problems getting multiple roles working, but it's behaving itself for now. Now all I have to do is solve my LIMIT problem... Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 11 December 2000 20:18 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] LoginManager broken? You might look at http://www.zope.org/Members/dlpierson/sqlLogin for a different approach that works for me in early testing. Note that it needs additional work before being turned loose on a live site. Dan Pierson "Mayers, Philip J" [EMAIL PROTECTED] writes: Does it even *work*? Even a little bit? Because other than repeating the same process 12 damn times, so far I'm not convinced. Maybe I'll look in the source code to see if there's actually anything in the files (other than a HOWTO.txt, which is empty, which BTW is more annoying than there not being one). The "LoginManager with SQL database" on the Zope site seems to end up with me having a folder I can't access through the management interface (unless you count "management" as "this is the index_html" document) Wow, thanks! Now I have to delete it and start all over again... In all seriousness - there *must* be one person who has gotten an SQL-backed LoginManger working with 2.2.4 - surely? Thanks for all the great work (little bugs aside...) - Zope is a wonderful product! Now if only it could serve XML as well as Cocoon... Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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 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] XMLRPC accessing Zope DTML/SQL methods
Ok, so this works: def extmethod(self, REQUEST): return str(REQUEST) From the web that prints the string Representation of REQUEST. But, over XMLRPC, this: s=xmlrpblib.Server("http://server.name/Zope/path/") s.path.extmethod() Returns the string representation of REQUEST, but *this* s.path.extmethod('rrr') return 'rrr'. What's happening? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED]] Sent: 07 November 2000 21:35 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] XMLRPC accessing Zope DTML/SQL methods snip helpful replies ___ 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] XMLRPC accessing Zope DTML/SQL methods
sigh Getting there. Note to the wise - when using PCGI and Apache, sometimes Zope won't notice that you've edited an internal method source file... The cache in Data.fs gets out-of-date. Ok. So, I have this working: def callSQLmethod(self, REQUEST): s=self.sqlMethod(self, REQUEST) y = [] for x in s: y.append(x) return str(y) Called over XMLRPC, this gives me: [r instance at 853ee30, r instance at 84f2810, r instance at 84f29f0, r instance at 84b1528] Fine, I can extract the result data later... How can I pass paramters to the method without overwriting the REQUEST value - I need access to that, so I can get environment variables, namely the SSL certificate subject name. Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Mayers, Philip J [mailto:[EMAIL PROTECTED]] Sent: 08 November 2000 10:29 To: '[EMAIL PROTECTED]' Subject: RE: [Zope] XMLRPC accessing Zope DTML/SQL methods Ok, so this works: def extmethod(self, REQUEST): return str(REQUEST) From the web that prints the string Representation of REQUEST. But, over XMLRPC, this: s=xmlrpblib.Server("http://server.name/Zope/path/") s.path.extmethod() Returns the string representation of REQUEST, but *this* s.path.extmethod('rrr') return 'rrr'. What's happening? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED]] Sent: 07 November 2000 21:35 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] XMLRPC accessing Zope DTML/SQL methods snip helpful replies ___ 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 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] XMLRPC accessing Zope DTML/SQL methods
I'm planning on using Zope as some middleware to an SQL database backend. Zope will implement the per-row ACL checking and such for the database application, and there are two clients - a simple web-based Zope frontend, and a larger standalone Java application. I'd like the Java app to communicate with Zope using XMLRPC, so that I can re-use the middleware portion, and take advantage of SSL'd HTTP, along with all the other bonuses such as not trusting the client :o) But: I'm having problems that indicate I don't understand how External Methods or the XMLRPC call support works. I have an SQL query method backed by a persistent DB connection. I want to call that method over XMLRPC remotely. How do I do that? Namely, how do I pass named arguments to the SQL method? Also, I did some simple External Method examples, and acquisition doesn't seem to work as advertised: This: def testf(self, REQUEST): return self.index_html() Gives an error "standard_html_header not found". What's going on? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] dtml-let and quoting(?) or forcing to string
All, I've just setup a test Zope installation. So far, very impressive. I'm using a Postgresql database containing a network hierarchy (basically, a table with a "network" column, and a "parentnet" column). I'm trying to display this with a tree view, using the following DTML: dtml-let network="0/0" dtml-tree id=network branches_expr="network_children(parentnet=network)" bdtml-var network/b dtml-var descr /dtml-tree /dtml-let Where the network "0/0" is the pseudo-parent of every other network. The problem is, python (or DTML, I don't know) interprets this as a divide by zero, and it fails. The other alternative "0.0.0.0/0" also fails: Expression (Python) Syntax error: invalid syntax , for tag dtml-let network="0.0.0.0/0", on line 15 of test_html (I'm doing all this through the web management interface). I'm not familiar with Python (yet - the book is on it's way) but in the command-line interpreter, this works fine: "0.0.0.0/0" '0.0.0.0/0' "0/0" '0/0' I need to cast the value to dtml-let to a string. How? I know how to do this in Perl/C/Java/Pascal, but it's not obvious to me why this isn't working. Yours, dumbly Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ ___ 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] SQL trees...
Excellent. That answers that. I'm loath to ask this, since it's supposedly a FAQ, but I'm having trouble with the tree... Following: http://www.zope.org/Members/anthony/tree-coding-tricks I've got: dtml-let network="'0/0'" dtml-tree id=network branches_expr="network_children(parentnet=network)" bdtml-var network/b dtml-var descr /dtml-tree /dtml-let The SQL query is working - "test"ing network_children will give the correct hierarchy. However, the tree generated looks like this: 192.168/16 192.168/16 192.168/16 10/8 172.20/16 10/8 192.168/16 10/8 172.20/16 172.20/16 192.168/16 10/8 172.20/16 10/8 etc Basically, the tree only seems to ever contain the top-level (children of the root of the tree). The children of all the nodes is... another copy of the root top-level nodes! Whu?!? A search for several variations of "SQL tree" in all the relevant list/site archives didn't seem to help. Any ideas? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Chris Withers [mailto:[EMAIL PROTECTED]] Sent: 21 August 2000 15:23 To: Mayers, Philip J Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] dtml-let and quoting(?) or forcing to string "Mayers, Philip J" wrote: dtml-let network="0/0" dtml-tree id=network branches_expr="network_children(parentnet=network)" bdtml-var network/b dtml-var descr /dtml-tree /dtml-let Anything in a DTML tag that's inside "" is python, usually ;-) So, your dtml-let should be: dtml-let network="'0/0'" which is kinda yucky, don't you think? cheers, Chris ___ 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 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] SQL trees...
Confirmed. Downgrading to 2.1.4 fixed it. How annoying... Thanks a lot! Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Philipp Auersperg [mailto:[EMAIL PROTECTED]] Sent: 21 August 2000 18:31 To: Mayers, Philip J; [EMAIL PROTECTED] Subject: Re: [Zope] SQL trees... Which Zope version do you use ? When I read your message I have a deja-vu: I encountered the same output when I use SQL based trees under Zope 2.1.6, it is a bug somewhere in the SQL method handling that appeared in 2.1.6 and is fixed in 2.2.0. Solution: switch back to 2.1.4 or forward to 2.2.0 or patch the existing 2.1.6 Philipp Auersperg (zwork) ___ 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 )