[Zope] Parameter in ZSQL
Hello All here's the problem my Zope 2.2.0 is running on win98 my Database is a MySQL I created a ZSQL method named ShowProduct with parameter product_id the template as follows : select * from products where sqltest product_id type=string why can't I call the ZSQL method directly (without using the GET/POST variables)? I try to call it like this dtml-let product_id="1" dtml-in ShowProduct ...(i would like to insert some of programs here if this is working) /dtml-in /dtml-let it always returns error like this Error Type: Bad Request Error Value: ['product_id'] can anyone help please? is there any workaround for this? TIA -IGUN- ICQ:1474584 ___ 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] Parameter in ZSQL
call : dtml-in "ShowProduct(product_id=1)" with let you just define a variable in the current namespace Philipp Auersperg (zwork) *** REPLY SEPARATOR *** On 13.08.2000 at 17:27 Indra Gunawan wrote: Hello All here's the problem my Zope 2.2.0 is running on win98 my Database is a MySQL I created a ZSQL method named ShowProduct with parameter product_id the template as follows : select * from products where sqltest product_id type=string why can't I call the ZSQL method directly (without using the GET/POST variables)? I try to call it like this dtml-let product_id="1" dtml-in ShowProduct ...(i would like to insert some of programs here if this is working) /dtml-in /dtml-let it always returns error like this Error Type: Bad Request Error Value: ['product_id'] can anyone help please? is there any workaround for this? TIA -IGUN- ICQ:1474584 ___ 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] Zope on Linux, Oracle on another machine (Solaris) what to do?
Chris Beaumont wrote: Hello, Newbie question here... Thank you for any and all help... The subject line says it all.. What's the best way to connect an instance of Zope running on a Linux box to an instance of Oracle 7.3 running on a Solaris box in the same subnet... You have to set up the Oracle client library (OCI) on the Linux box. The (slightly) tricky part is setting up the file Oracle SQL*Net uses to know where the server(s) are. That file is $ORACLE_HOME/network/admin/tnsnames.ora (I could be slightly off-key on the path, but is certainly named tnsnames.ora). In there, you create an entry for each Oracle instance you want to access (see the manual or use one of the examples provided - if you cannot figure it out, mail me and I'll provide an example; I do not have Oracle installed here at home). Then you set up your database connection within Zope just as if it were a local database - Zope will not know, as the Oracle library (wit SQL*Net) hides this detail quite effectively. I have such a set-up working on Oracle 7.3 server on Solaris (Zope is on a Sparcstation 5 running Solaris 7, the Oracle Server is an Enterprise 4000 running Solaris 2.6 for now). You probably do not want to use ODBC. It tends to be slower, and generally is another layer of software that can break without giving you enough benefit for the hassle, in my opinion.) On a different key, I'll try out Interbase on my testbed system and see how that works. Looks like a viable alternative, for now. Much smaller footprint than Oracle, and significantly cheaper. HTH, Jan ___ 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] ZCatalog attachments?
Simon Coles writes: We have binary files stored in Zope, for example Word documents (but could be any of a variety of document types). We would like to be able to index and search the contents of these files using ZCatalog. So if a Word file contains the word "Fred", then any search for "Fred" would include that file in the list of documents returned. Someone else already told you, that you must create a parameterless method (it need not necessary be named "PrincipiaSearchSource") that returns the files content. You may not need to keep the rendered version around but may be able to extract the plain text on demand. I think, there is a "word.dll" that provides access to MS Word from applications. Alternatively, you could control Word via COM. Ther is a Perl (I know, I know...) script to convert Word DOC files into HTML. That should work well enough to make the stuff searchable (I would use doc2html.pl | lynx -d to get a pure ASCII version, though). It is probably fast enough to just render on the fly (i.e., upon indexing). HTH, Jan ___ 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] GUF
On Fri, 11 Aug 2000, Mathias Bengtsson wrote: Does anybody know how the login is handled by GUF. I use cookie authentication and I get the loginptomt when I try to access a page that has authenticate permissions. But when I try to login I don't know how to get the user logged i.e I don't know how to set the cookie. Can anybody help me ? Why do you need to set cookie on your own ? In typical case GUF sets it for you if it had succesfully authenticated new user (your method userAuthenticate has returned '1'). Anyway, probably it will work if you set this manually. The cookie is named (AFAIR) '_guf', and has some random-looking content - a key identifying user. You can look in source to see, how this content is computed. [EMAIL PROTECTED] /--\ | `long long long' is too long for GCC | \--/ ___ 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] Fw: [Zope] Parameter in ZSQL
Thanks man that really works..!!... I want to ask another question can I retrieve a random row from a table? if can, could anyone tell me (using the same table and scheme from the previous question) Thanks again Mr Philipp Auersperg -IGUN- ICQ:1474584 call : dtml-in "ShowProduct(product_id=1)" with let you just define a variable in the current namespace 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 )
[Zope] Ivalid Integer from Zope
I am using the Znolk Input Wizzard with postgresql tables. One of the variables in the table is an integer and can have null values. However, in the update and insert forms, if I attempt to leave the value null, I get the following error from Zope: "Invalid integer value for weight.bcs" The variable is defined throughout as :dtml-var bcs null="" Any help would be appreciated. ___ 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] JavaScript help!
Maybe not a Zope specific question but the problem arises only with Zope DTML. The documentEdit.dtml page in OFS has this little HTML: TEXTAREA NAME="data:text" WRAP="Off" COLS="50" ROWS="20"/TEXTAREA And what I want to do is trigger a JavaScript that replaces specific characters in the textarea box to others. I.e. Replace swedish ö with HTML: ouml; The problem is the name of the textarea box! It is called "name:text" If I replace the name of the textarea box to say "data", then my JavaScript works fine. I have tried to "eval" the box, but to no effect. Any ideas?? -- Here's the JavaScript source: script language="JavaScript1.2" !-- // function changeChars() // replace swedish chars with HTML ones. function changeChars() { var box = eval("document.manage_edit_form.data:text"); var datatext = box.value; var newdatatext; newdatatext = datatext.replace("å","aring;"); newdatatext = newdatatext.replace("Å","Aring;"); newdatatext = newdatatext.replace("ä","auml;"); newdatatext = newdatatext.replace("Ä","Auml;"); newdatatext = newdatatext.replace("ö","ouml;"); newdatatext = newdatatext.replace("Ö","Ouml;"); box.value = newdatatext; } -- /script --- Here's the JavaScript error: invalid label. document.manage_edit_form.data:text ..^ ___ 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] Ivalid Integer from Zope
How about dtml-var bcs null=0? (Just a guess, but I would expect a zero length string to be an invalid integer value). I am using the Znolk Input Wizzard with postgresql tables. One of the variables in the table is an integer and can have null values. However, in the update and insert forms, if I attempt to leave the value null, I get the following error from Zope: "Invalid integer value for weight.bcs" The variable is defined throughout as :dtml-var bcs null="" ___ 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] accessing PARENTS from python???
I am trying to access the PARENT of an object in a python class of mine. I want to use the absolute_url() of the parent in a variable. I though it could be done the following way, but got an error: parent=self.PARENTS[0] aurl = parent.absolute_url() I then tried using REQUEST. It works, but doesn't give the correct information. Instead of giving me the parent of the current object(self), it gives the parent of the DTML page in which the object was called. parent=self.REQUEST.PARENTS[0] aurl = parent.absolute_url() How do you resolve the PARENT object of an object? Kevin Howe ___ 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 PARENTS from python???
Kevin Howe wrote: I am trying to access the PARENT of an object in a python class of mine. I want to use the absolute_url() of the parent in a variable. I though it could be done the following way, but got an error: parent=self.PARENTS[0] aurl = parent.absolute_url() I then tried using REQUEST. It works, but doesn't give the correct information. Instead of giving me the parent of the current object(self), it gives the parent of the DTML page in which the object was called. parent=self.REQUEST.PARENTS[0] aurl = parent.absolute_url() How do you resolve the PARENT object of an object? you might want to try an alternative method using acquisition aurl = self.aq_parent.absolute_url() Kapil ___ 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] GUF
Mathias Bengtsson writes: Does anybody know how the login is handled by GUF. I use cookie authentication and I get the loginptomt when I try to access a page that has authenticate permissions. But when I try to login I don't know how to get the user logged i.e I don't know how to set the cookie. Can anybody help me ? Setting the cookie is done automatically by GUF. 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 )
Re: [Zope] Broken Links and Orphan Checking
Darin Lee writes: Is there any way within Zope to parse HTML to look for broken links and orphaned files? The site I am building will have many Zope dynamic componants, but also a good share of wrapped static HTML pages maintained by content contributors in Frontpage/Dreamweaver. I know that orphaned files and broken links *will* become a problem over time. There was a discussion of this issue recently in this list. Look into the list's archive for valuable hints. 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 )
RE: [Zope] application/octet-stream vs. application/msword
Jean Jordaan writes: The other thing I'm wondering is, it looks as if '.doc' should *always* be recognized as msword. How could it sometimes turn up as octet-stream? To add documents I call: a href="manage_addProduct/ccDoc/ccDocClass_factory" Add a document./a The initial method of 'ccDocClass_factory' is 'ccDocClass_addForm', and that form's action is 'ccDocClass_add' which eventually calls: dtml-call "manage_addFile('', file, '')" The problem is, currently, not interesting enough for me to analyse is seriously. This may change, when some day, I or a collegue runs against strange content type assignment. If you know, that you add only "*.doc" files in your "ccDocClass_add, why not add explicitely "content_type='application/msword'", i.e. dtml-call "manage_addFile('', file, '',content_type='application/msword')" 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 )
Re: [Zope] file uploading from IE browser
David Zhu writes: I'ved followed the online How-To on implementing a simple service for parsing uploaded files via the browser. But strangely, it only works for Netscape browsers. When I test the uploading using IE, the supposed file object becomes a string object, causing all sorts of problems. How am I suppose to get the file object from IE browsers? Thanks in advance! Did you use? form ... METHOD="POST" ENCTYPE="multipart/form-data" 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 )
Re: [Zope] In-tag Batch processing
Tom Deprez writes: But I'm using Zope 2.2 So what am I doing wrong? I do not know... Maybe, my memory misleads me. I *belief* I got a message from DC that the patch has been integrated in 2.2. If you still see the problem, try to apply the patch. If that does not solve your problem, send me your DTML code for analysis. Dieter At 23:02 10/08/2000 +0200, Dieter Maurer wrote: Tom Deprez writes: But how can you provide a link to the next batch of items at the start of the batch table? You need Zope 2.2 or the patch at URL:http://www.dieter.handshake.de/pyprojects/zope/dt_in.pat or you use the "next" argument of the "in" tag. ___ 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] Ivalid Integer from Zope
I will fix this for the next release (est. next week). This happens when nothing is entered in the textfield for the integer value. In the meanwhile you have to do the check in the insert/update SQL method: dtml-if "_['btest.val']!=''" !--#sqlvar btest.val type=int -- dtml-else null /dtml-if *** REPLY SEPARATOR *** On 13.08.2000 at 10:31 Herring, William O. wrote: I am using the Znolk Input Wizzard with postgresql tables. One of the variables in the table is an integer and can have null values. However, in the update and insert forms, if I attempt to leave the value null, I get the following error from Zope: "Invalid integer value for weight.bcs" The variable is defined throughout as :dtml-var bcs null="" Any help would be appreciated. ___ 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] using Zope add on products
Hi All I just need a little help, (Zope Newbie:) ) I want to create a website creator, I want to provide my end users with a 1-2 page form with lots of check boxes, list boxes, etc.. Once the users has finished making his/hers selections, I want my product to go and create the web site. easy :) Now for the questions, How do I call other products from mine? ie, say I have install the Znavigator product. On my create website form the users has chosen a default menu of 'home','products','services','contacts'. From my product I want to be able to call the Znavigator , create the menu, than create the menu items. I can us manage_addFolder to create folders, but I can not figure out how to call add on products? Is there documentation on all the manage_ functions? Can anyone point me in the right direction, Please -- E-Mail: Stephen Cimarelli [EMAIL PROTECTED] Date: 14-Aug-00 Time: 09:20:12 ClariNet Internet Solutions +61 3 9486 0811 www.clari.net.au -- ___ 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] A very newbie question
I need to know the value of (sequence-index mod 3)=0 in something like dtml-if "sequence-index mod 3)=0" how do I use the mod function correctly? since the divmod function is actualy returning 2 pair of value. Thanks guys. -IGUN- ICQ:1474584 ___ 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] A very newbie question
dtml-if "_['sequence-index']%3 ==0" Indra Gunawan wrote: I need to know the value of (sequence-index mod 3)=0 in something like dtml-if "sequence-index mod 3)=0" how do I use the mod function correctly? since the divmod function is actualy returning 2 pair of value. Thanks guys. -IGUN- ICQ:1474584 ___ 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 ) -- Terry Kerr ([EMAIL PROTECTED]) Adroit Internet Solutions Pty Ltd (www.adroit.net) Phone: +613 9563 4461 Fax: +613 9563 3856 Mobile: +61 414 938 124 ICQ: 79303381 ___ 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] A very newbie question
Indra, Try: dtml-if "_.divmod(_.int(_['sequence-item']),3)[0]==0" hth Phil [EMAIL PROTECTED] - Original Message - From: "Indra Gunawan" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 14, 2000 2:38 AM Subject: [Zope] A very newbie question I need to know the value of (sequence-index mod 3)=0 in something like dtml-if "sequence-index mod 3)=0" how do I use the mod function correctly? since the divmod function is actualy returning 2 pair of value. Thanks guys. -IGUN- ICQ:1474584 ___ 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] A very newbie question
oops, Should hae been: dtml-if "_.divmod(_.int(_['sequence-item']),3)[1]==0" hth Phil [EMAIL PROTECTED] - Original Message - From: "Indra Gunawan" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 14, 2000 2:38 AM Subject: [Zope] A very newbie question I need to know the value of (sequence-index mod 3)=0 in something like dtml-if "sequence-index mod 3)=0" how do I use the mod function correctly? since the divmod function is actualy returning 2 pair of value. Thanks guys. -IGUN- ICQ:1474584 ___ 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 )