Re: [Zope] Re: how to accumulate data using ZPT

2005-05-24 Thread Tino Wildenhain
Am Dienstag, den 24.05.2005, 04:09 -0700 schrieb prabuddha ray:
> sorry,
> i missed the xplanaition.
> i think this'll explain...
>  python:context.getPenalty(group_code=gcode,item_code=icode);
>  penaltylen python:test(len(penalty)==0)>
> 
> so not:penaltylen ensures that unit_cost is present for this row.
> 
> anyway i think this worked finally :
>  
>   
>   
>  
> 
> 

Why dont you write this as plain python code?
Python Scripts are made for that.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-26 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh:
...
> I absolutelly agree with you, it is like my words.
> 
> But separation of logic and presentation could be done successfully in DTML
> too. ZPT, which have "separation argument" is not as easy to make totally

This is even somewhat correct. If people had the discipline to not abuse
the templating to do complicated logic. 
The major drawbacks of DTML are: 

- one namespace (with transparent layers)
- confusing naming of tags, like  which
  really is  or something
- and the extra tags for flow control, but probably
  the dtml fans can live with it.
- peoples practice to use  even inside
  html-tags attributes, where &dtml-foo; should be used.

> separated design as marketing says, for example see Plone - try to customize
> plone site to absolutelly different custom design - it is near impossible.

Unfortunately Plone is still a bad example for ZPT. It is getting
better but still it has a lot of code and definition in the templates.
Maybe AT would be a way out.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope MailHost Query

2005-05-27 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 12:32 +0200 schrieb Andreas Jung:
> 
> --On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange 
> <[EMAIL PROTECTED]> wrote:
> 
> > hi,
> >
> >  how do i receive mails using Zope mailhost??
> 
> MailHost is only for *sending* but not for receiving mails. Zope is *not* 
> an SMTP server.

But there is a currently not very good documented smtp-server
for zope. 

http://dev.legco.biz/products/smtpservice


-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Receiving mails

2005-05-28 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 11:41 -0700 schrieb Varun Parange:
> hi,
> i have downloaded an SMTP server and using it i can send mails with
> the help of Zope MailHost
>  
> however i would also like to recieve mails how do i do this.
> which additional products do i need to download... 
>  

Maybe you reread the thread you started some days ago:

[Zope] Zope MailHost Query

Especially my answer:

> --On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange 
> <[EMAIL PROTECTED]> wrote:
> 
> > hi,
> >
> >  how do i receive mails using Zope mailhost??
> 
> MailHost is only for *sending* but not for receiving mails. Zope is
*not* 
> an SMTP server.

But there is a currently not very good documented smtp-server
for zope. 

http://dev.legco.biz/products/smtpservice


However, this is not a beginner tool.

Maybe you rather try this one:

http://mjablonski.zope.de/MailBoxer

which works with an existing mail server and is
more easy to use and debug.

Regards
Tino



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] sending attachments

2005-05-29 Thread Tino Wildenhain
Am Samstag, den 28.05.2005, 06:47 -0700 schrieb Varun Parange:
> hi,
>  
> is it possible to send mails with attachments using Zope MailHost??
> if so,...how do u achieve it?
> 

If you have a simple product like this:

EmailTools/__init__.py
--- contents -
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo

from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from MailCrypt import signmail
from email.Encoders import encode_base64

allow_class(BlockFormatter)
allow_class(MIMEBase)
allow_class(MIMEText)
allow_class(MIMEMultipart)
allow_class(Header)
allow_class(signmail)
allow_class(encode_base64)
---

You can send mails with attachment like this:

from Products.EmailTools import
MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64

msg=MIMEMultipart()
inner=MIMEText(mailtext,_charset='iso-8859-1')
msg.attach(inner)
msg.add_header('Subject',str(Header(subject,"iso-8859-1")))

# now the attachments:
for obj in context.attachments.objectValues('File'):
mt,st=obj.content_type.split("/")
p=MIMEBase(mt,st)
p.set_payload(str(obj))
p.add_header('content-disposition', 
 'attachment', 
 filename=obj.getId())
encode_base64(p)
msg.attach(p)

# now you are ready to send the mail like this:

context.YourMailHost.send(msg.as_string(),
  mfrom="Foobar <[EMAIL PROTECTED]>",
  mto=["Someone <[EMAIL PROTECTED]>"])


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-30 Thread Tino Wildenhain
Am Montag, den 30.05.2005, 13:05 +0800 schrieb Ismet Dere:
> I also like DTML a lot, found it way too easy to understand and simple to use.

I wonder how DTML is more easy then an equally simple
python expression in a script?
Lazy people should love ZPT since it saves a lot of typing
compared to DTML - otoh, a general rule seems to be: beginners
tend to write overly comlicated code.

> it was that simplicity of DTML that made me choose and use Zope over
> PHP in the first place.
> 
> if dtml is to be phased out, Zope will be less attractive for new
> users then soon will be irrelevant no matter how sophisticated and
> advanced it may become.

No, it will not phased out. Neither in zope2 nor in zope3.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Uninstall a zope built from source

2005-05-31 Thread Tino Wildenhain
Am Dienstag, den 31.05.2005, 11:27 +0200 schrieb Rob Wilco:
> Hello,
> 
> Some time ago, I built zope from the sources and it worked well. Now I 
> prefer the way Debian easily offers instances and an init.d script.

recent zope versions have that as well (e.g >= 2.7)

> I would like to uninstall the Zope from the source bt I can't find a 
> target for make to do an uninstall.

yes, there is none. 


> I have a googled for a while without success.
> I have few folders named zope in the /usr/local, /var/lib and i am not 
> always sure they belongs to the source install or the debian version.
> 
>   * Does anyone knows about a uninstall script?
> 
>   * If I have to do it by hand, where can I find docs that tells what to 
> remove? (the install python script is long) How to be sure everything is 
> gone?

Which version did you install from source? Are you using the
debian version yet? If not, just apt-get remove --purge zope
first to get rid of all debian traces and then remove 
the zope where you installed it. (Should really be just one
directory for the zope and one per instance depending how
you installed it.)
-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] python question

2005-05-31 Thread Tino Wildenhain
Am Dienstag, den 31.05.2005, 15:34 -0400 schrieb Kate Legere:
> I may be asking this in the wrong place but I have a tal page where I want
> to use python to display only the most recent addition to a folder of files.
> 
> 
> I can sort the folder and return all the files easily with:
>  return sequence.sort(files, (('bobobase_modification_time', 'cmp',
> 'desc'),))
> 
> How do I return just the most recent one? (I tried sorting and then using
> return max(files) but that doesn't give me all the properties and I need
> them for display) 

Use:

return sequence.sort(files, (('bobobase_modification_time',
'cmp','desc'),))[:3]


[:3] is a slice operator which returns

item0...item2

since you sorted descenting by modification time, the
first 3 objects should be the most recent 3.

Regards
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] python question

2005-05-31 Thread Tino Wildenhain
Am Dienstag, den 31.05.2005, 15:38 -0400 schrieb Jim Abramson:
> sort() on a sequence does not return anything.  It operates on the
> [mutable] sequence in place.

sequence is a module in Zope. So she indeed was right.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to read a file object

2005-06-01 Thread Tino Wildenhain
Am Mittwoch, den 01.06.2005, 15:02 +0300 schrieb Vital Lobachevsky:
> John Poltorak wrote:
> > On Wed, Jun 01, 2005 at 12:46:44PM +0200, Andreas Jung wrote:
> > 
> >>
> >>--On 1. Juni 2005 10:01:22 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>>
> >>>How do I go about reading a Zope file object in Python?
> >>
> >>Define what "reading a Zope File object" means? You mean you want the
> >>body of an upload file?
> >>
> >>-aj
> > 
> > 
> > 
> > I mean the thing that is created when I click on 'File' from the drop down 
> > menu of ZMI.
> 
> Suppose your file 'myFile' and your script 'myScript' in the same 
> folder. You can get file data in your script using 'data' property:
> 
> fileData = container.myFile.data
> ...

beside the fact its a not really public attribute, it isnt
even garantied to be s simple string. Most of the time
its a Pdata object chain.

And yes, file/image really lack file semantics.
-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] WebDav or Calendar.

2005-06-01 Thread Tino Wildenhain
Am Mittwoch, den 01.06.2005, 22:15 -0300 schrieb Fernando Lujan:
> Hi,
> 
> I need a Calendar or WebDav product wich runs with Zope, allow me to
> share my calendar with others users using mozilla Calendar, Sunbird.
> evolution, outlook and so on...Something like OpenGroupware. Do
> someone have a good suggestion? :)

http://www.mxm.dk/products/public/mxm_ical_tool/

The ical module from mxm can be used by own code
too, so you dont need the above if you use plain
zope. The glue code, however must then be provided
by you.

In this case:

http://www.mxm.dk/products/public/ical/

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Creating a Product

2005-06-02 Thread Tino Wildenhain
Am Donnerstag, den 02.06.2005, 09:41 -0700 schrieb Varun Parange:
> hi,
>  
> i have add a new directory in my "Products" directory..
>  
> however, when i try to add the __init__.py file , it giver me an
> error..
>  
> 
> Error Type: BadRequest
> Error Value: The id "__init__" is invalid because it begins with an
> underscore.
> 
> 
> how do i add this file?
> 

You do this all in the Filesystem where Zope runs. Hence the name:
Filesystem based products :-)
As oposite to creating objects thru the web. (Which are of course
limited)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Uploading files

2005-06-03 Thread Tino Wildenhain
Am Freitag, den 03.06.2005, 11:09 -0600 schrieb Nikko Wolf:
> Brian Sullivan wrote:
> >> 
> >>how do i upload a file in Zope using a python script??
> > 
> > 
> > http://www.zopelabs.com/cookbook/1006887320
> > 
> > is probably a place to start.
> 
> On that topic: I've got my file upload working properly (it forwards the 
> file data to an external site, then saves only if validation works).
> 
> But I just started to wonder about something; all my tests have been 
> with relatively small files (~40KB) but my end users may be uploading 
> some very large files (possibly as large as 500KB, although not for months).
> 
> In my python script I use:
> filedata = container.REQUEST.file.read()
> then merge this data into a MIME submission for the external web site, 
> and on success, save it locally as a "file".
> 
> My question is -- aside from memory usage, what problems might there be 
> with this approach?
> 
> Will the "read()" return all the content, or is there a possibility that 
> it will return less than the full file contents?  Any timeout issues 
> that I should consider?

Of course does read() return all the data in one string - the python
documentation leaves no doubt here.
You might consider reading in chunks, encoding them while you send
and if validation is successfull, rewind by file.seek(0)
and then manage_addFile() directly with the file object.

Timeout can be an issue with large files and when the remote
server is slow. In this case, you can send some data to the 
clients browser while you work, via context.REQUEST.RESPONSE.write()
Note: once you start using response.write() you cannot use return()
in your script - at least the user wont see any output from it.
You also should catch exeptions and provide meaningfull output
when they happen since the usual exeption handling will work but
the user wont see its output.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] importing encode_base64

2005-06-03 Thread Tino Wildenhain
Am Donnerstag, den 02.06.2005, 10:34 -0700 schrieb Varun Parange:
> hi,
>  
> i am having problems importing encode_base64
>  
> i have created a product in which i have specified:
> '''
> from AccessControl import allow_module, allow_class, allow_type
> from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
> from email.Encoders import encode_base64
> 
> allow_class(encode_base64)
>  
> ''
>  
> however when i try using it:
>  
> from Products.EmailTools import
> MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64
> 
> i get an error saying:
> 
> Error Type: ImportError
> Error Value: cannot import name encode_base64
> 
> All other modules are imported except this one...
> 
Thats funny. I do the same and it works.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] POP3 servers

2005-06-04 Thread Tino Wildenhain
Am Freitag, den 03.06.2005, 13:38 -0700 schrieb Varun Parange:
> hi,
>  
> which are some POP3 servers i can download for free, which are
> interfaceable with Zope

There arent. Neither commercial nor free. Dont think pop3 is 
interesting anyway. I think I saw some IMAP code but I dont know
where. Just feed your search engine of choice and be prepared
to find only fragments.

Sure it would be interesting to have an IMAP server just like
the SMTP server and let them play together. From what I know,
nobody had the time yet.

If you find something interesting, please let me know :)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] importing encode_base64

2005-06-04 Thread Tino Wildenhain
Am Freitag, den 03.06.2005, 22:52 +0200 schrieb Dieter Maurer:
...
> What you almost surely want is:
> 
>  ModuleSecurityInfo('email.Encoders').declarePublic('encode_base64')
> 
This part is currently not documented in great detail.
Thanks for finding and pointing out.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] importing encode_base64

2005-06-04 Thread Tino Wildenhain
Am Freitag, den 03.06.2005, 16:58 -0400 schrieb Paul Winkler:
... 
> > Thats funny. I do the same and it works.
> 
> What zope versions are you guys running?
> 
> Just now I saw something that *may* be related,
> some imports that were fine on zope 2.7.3 are giving me
> trouble on 2.7.6, but this is a very preliminary observation
> and i have not had time to troubleshoot yet.  Monday...

Where I use it and it works is an early 2.7ish. 

Yes I know I should update, but if you did some hacks here and
there (notably removed the hard coded latin-1 every time
you download a ZPT or python script) ... is a greater effort ;)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] POP3 servers

2005-06-04 Thread Tino Wildenhain
Am Samstag, den 04.06.2005, 20:10 +0200 schrieb Dieter Maurer:
> Varun Parange wrote at 2005-6-3 13:38 -0700:
> >which are some POP3 servers i can download for free, which are interfaceable 
> >with Zope
> 
> For Linux (almost surely *nix in general), there
> is "imap": "IMAP4, POP2 and POP3 mail server."
> 
> You can interface Zope with this server via Python's "poplib" and
> "imaplib". You will need to do some work yourself...

I dont think this is the way round he wants ;) 
At least there would be ready to use webmail products which
are available for zope :-)

As I said, zope as imap server would indeed be interesting :-)
Its only a fairly bit of work since the protocol is a bit weird
and the usual clients even more.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Modifying a Dictionaries in an Extenal Method

2005-06-05 Thread Tino Wildenhain
Am Sonntag, den 05.06.2005, 00:05 -0500 schrieb Edward Huixquic:
> Thanks Dieter for your kind reply,
> 
> Here is a complete (a bit long, sorry for that)   example of what is
> happening, here are some  code pieces that  shows this behavior:
> 
> DTML:
> --
>  
> 
> 
>
>   
>   
>
>
> 
> 
> Name: 
> Lastname:
> Account Balance: value="1000">
> 
> Name: 
> Lastname:
> Account Balance: value="2000">
> 
> 
> 
> 
> --
> Python External Method:
> def pyUpdate(self,REQUEST):
> for item in range(len(self.REQUEST['fields'])):
> self.REQUEST['x']=self.REQUEST['fields'][0]
> self.REQUEST['y']=self.REQUEST['fields'][1]
> #   self.REQUEST['fields'][0]['balance']=5000<-I will
> refer to this as first line
> #   self.REQUEST['y']['balance']=5000   < this would
> be the second line
> return self.REQUEST
> ---
> Output of form after pressing the "process" button WITH both lines
> commented  out in the External method, as show above (cut from the
> whole REQUEST output):
> 
>  1000 2000
> form
> process   'process'
> fields[{'balance': '1000', 'lastname': 'Mouse', 'name': 'Mickey'},
> {'balance': '2000', 'lastname': 'Duck', 'name': 'Donald'}]
> 
> fields[{'balance': '1000', 'lastname': 'Mouse', 'name': 'Mickey'},
> {'balance': '2000', 'lastname': 'Duck', 'name': 'Donald'}]
> y {'balance': '2000', 'lastname': 'Duck', 'name': 'Donald'}
> x {'balance': '1000', 'lastname': 'Mouse', 'name': 'Mickey'}
> 
> So, fields behaves as a list and X and Y are dictionaries, right?

No. They look like dictionaries, but they are not dictionaries.
You used :records, which gives you lists of record objects.
You can copy to a real dictionary to do what you want.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Accesing python module

2005-06-05 Thread Tino Wildenhain
Am Sonntag, den 05.06.2005, 16:39 -0400 schrieb Leticia Larrosa:
> Hi:
>  I installed the "PyXml" package, and appear in the "c:\Python24\Lib
> \site-packages" folder and i want to import a module of that library
> from an external method:
> "import xml.dom.ext"
> But i can't import from an external method any of the modules that are
> in the "Lib\site-packages" folder of my python instalation.
> Why can't import them?
> By default an external method have acces to modules that are in "Lib
> \site-packages" of a Python installation?
> I use Zope 2.7.6 
> for windows and Python2.4 ("c:\Python24\Lib\site-packages" !)
> The error that i get is:
...

Zope on windows is packaged with own and right version 
of python, which is 2.3 for all current Zopes.

So you need to use the package for python 2.3
and not 2.4. Next, since zope has own python,
you either copy the module to zopes python
or change startzope.bat to refer to your
installed python2.3.

You cannot just point to or use 2.4, since 
zopes extension classes are compiled for 2.3.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Modifying a Dictionaries in an Extenal Method

2005-06-05 Thread Tino Wildenhain
Am Sonntag, den 05.06.2005, 19:21 -0500 schrieb Edward Huixquic:
> Dieter: Thanks again for your time and your excellent help.
> 
> Below  are some comments of my own to yours message, (hope the post
> doesn't become  too mangled and hard to read).
> 
...
> 
> > > ...
> > >Python External Method:
> > >def pyUpdate(self,REQUEST):
> > >for item in range(len(self.REQUEST['fields'])):
> > >self.REQUEST['x']=self.REQUEST['fields'][0]
> > >self.REQUEST['y']=self.REQUEST['fields'][1]
> > >#   self.REQUEST['fields'][0]['balance']=5000<-I will
> > >refer to this as first line
> > >#   self.REQUEST['y']['balance']=5000   < this would
> > >be the second line
> > >return self.REQUEST
> > 
> > Ouch! This code hurts my eyes!
> 
> Mine also hurt (maybe a bit less than yours,:) )  even I am a newbie,
> I wrote it that way in my example as to make sure there were no weird
> things happening in between wach assignment (more weird things than I
> already had in hand) . x and y are of course very bad variable 
> names and the sample code I wrote really hurts, as you said.
> 
> > 
> > I suggest, you avoid code duplication -- this is more efficient
> > and more readable:
> > 
> > def pyUpdate(self,REQUEST):
> > fields = REQUEST['fields']
> > for item in range(len(fields)):
> > REQUEST['x'] = fields[0]
> > y =REQUEST['y'] = fields[1]
> > fields[0].balance = 5000
> > y.balance = 5000
> > 
> > This is not much more readable, isn't it?

For me, it looks a bit like:

def pyUpdate(self,REQUEST):
 fields=REQUEST['fields']
 x=REQUEST['x']=fields[0]
 y=REQUEST['y']=fields[1]
 x.balance=5000
 y.balance=5000


I dont think the loop above makes any sense :)

> Readable, you bet,   Efficient: don't know yet,  now I know since you
> mentioned, but I just gotta "field test it", that is for sure part of
> the Python learning process as well.
> 
> > 
> > It is still stupid to execute the assignments in a loop (as
> > they are indepentent of the loop variable) but I assume
> > that you simple provides some example code (you hopefully
> > do not use in your real program).

;)

> .   Actually I have done some little programs like this, I must confess.
> In my example, if "fields" actually come from a
> Zsqlmethod.dictionaries()  object, what would be the best way to pass
> thru all and every single one of the records in the list ?


>  
> > > ...
> > >y  {'balance': '2000', 'lastname': 'Duck', 'name': 'Donald'}
> > >x  {'balance': '1000', 'lastname': 'Mouse', 'name': 'Mickey'}
> > >
> > >So, fields behaves as a list and X and Y are dictionaries, right?
> > 

The common idiom goes like this:

results = [{'balance':balanceexpression(item),
'lastname':item.lastname,
'name':item.name}
for item in context.SomeZSQLMethod()]

for example.

For more advise I think we need the big picture (in english
words) what you are doing here.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Accesing python module

2005-06-05 Thread Tino Wildenhain
Am Sonntag, den 05.06.2005, 17:33 -0400 schrieb Leticia Larrosa:
> Thanks to Tino Wildenhain.
> 
> Tino Wildenhain wrote:
> > Zope on windows is packaged with own and right version 
> > of python, which is 2.3 for all current Zopes.
> 
> Zope on Debian (for example) too?

of course :-) Also on netbsd, freebsd, aix,
solaris, c=64 (oups ;))

Well in fact there is development towards
2.4 but it will take its time to become
stable and secure. Zope security depends
much on the specifics of python and newer
versions may have differences there.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Working with CSS'

2005-06-06 Thread Tino Wildenhain
Am Montag, den 06.06.2005, 20:51 -0700 schrieb Jason Leach:
> hi,
> 
> I have a site developed with CSS.  We just translated the site to
> German.  The problem I have is with some embedded graphics.  For
> example:
> #rightcolumn h1 {
>   background: transparent url("i/news_title.jpg") no-repeat top left;
>   height: 38px;
>   width: 180px;
>   margin: 0;
>   padding: 0;
> }
> 
> This is the English graphic.  If people are in the German side, I need
> news_title_de.jpg.  But I'm not sure how to deal with this without
> doing a separate CSS file.

You set some flag for example  ... 
or http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] XMLRPC problems?

2005-06-07 Thread Tino Wildenhain
Am Montag, den 06.06.2005, 15:14 -0700 schrieb Dennis Allison:
> Zope 2.7.6, ZEO, 
> Python 2.4.1 (yes, I know it is not yet official but ...
 ^^^ if you use it, you are on your own to fix or at least
_file_ bugs.


> ZEO runs on the same machine but is accessed through an internal network
> ZMYSQLDA 2.0.9 \
> MySQL-1.1.7/ do you really think they can be related to XMLRPC
problems you yet failed to toll us?

> I've seen a couple of problems attributable to XLRPC failures in our 
> system after an upgrade to Zope 2.7.6.  Has anyone else experienced 
> problems?   I know there were issues at one point, but I believed that 
No. Nobody :-)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Z SQL test in the ZMI aborts on key error

2005-06-07 Thread Tino Wildenhain
Am Dienstag, den 07.06.2005, 12:03 +0100 schrieb Joe Bezier:
> Hi there,
> 
> By any chance are you trying to test a ZSQL method that doesn't 
> (shouldn't) need any query parameters? For some reason (and I'm not the 
> guy who can tell you why...) these types of tests always break - try 
> adding '?query=' to the end of the URL. and see if that helps.
> 

No, they dont always break - if you use a sane *SQLDA, they
work perfectly.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 2.8.0 monkey patch issue

2005-06-13 Thread Tino Wildenhain
Am Montag, den 13.06.2005, 12:26 +0200 schrieb Bernd Dorn:
> Pascal Peregrina wrote:
> > Hi,
> > 
> > I am trying to migrate from Zope 2.7.6 to 2.8.0
> > 
> > In some product I did, I need to monkey patch some OFS and CMF classes (I do
> > this in product init).
> > 
> > I get this error whenever I try to do
> > .__dict__[]= :
> > TypeError: object does not support item assignment
> 
> 'got the same problem
> 
> use:
> setattr(,,)
> 
> must be something about the new implementation of extensionclass

Yes, something... I wonder whats the difference - since I do it 
similar (setattr) in my history monkey patch. However in 2.8:

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113>|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088>|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040>|result=apply(object,args) # Type s to step into published object.
041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311>|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348>|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module App.special_dtml, line 175, in _exec
173 |value = self.ZDocumentTemplate_beforeRender(ns, _marker)
174 |if value is _marker:
175>|try: result = render_blocks(self._v_blocks, ns)
176 |except DTReturn, v: result = v.v
177 |except AttributeError:
TypeError: unbound method manage_change_history() must be called with 
Historical instance as first argument (got nothing instead)


The patch is available here:
http://www.zope.org/Members/tino/PatchHistory/view

if someone likes to try.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Transferring Zope Settings

2005-06-14 Thread Tino Wildenhain
Am Dienstag, den 14.06.2005, 00:09 -0700 schrieb jlegris:
> Hello All,
> 
> I need to transfer Plone/Zope settings from a test instance to a live
> instance of the Zope server. Aside from transferring the entire
> Data.fs file or manually copying scripts and replicating configuration
> settings, is there a simple way to do this?

transferring Data.fs is the simplest and most solid aproach.
Followed by export/import.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Form Variables

2005-06-15 Thread Tino Wildenhain
Am Mittwoch, den 15.06.2005, 11:27 -0400 schrieb David Ayres:
> I've been working around this issue for literally years and finally have the
> time to seek a real solution. :) I can't find much information, so I'm
> assuming I'm just taking the wrong approach.
> 
> Whenever a form is posted, the text fields always show up in the
> request.form, however any other type of form element that has not been given
> a value does not show up. None of the fields have the ignore_empty
> attribute. Besides using the missing= attribute, what other options are
> there?
> 
> Most of my forms have optional fields and this is especially painful when
> trying to use ZSQL Methods or when creating  multipage forms that refer to
> earlier form values.
> 
> Any suggestions would be greatly appreciated!!

Zope has along with nice type converters, also a workaround
for the checkbox-problem:

http://www.zope.org/Members/Zen/howto/FormVariableTypes

However, working with request.form.get('value',default)
is often more robust.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Objects access

2005-06-16 Thread Tino Wildenhain
Am Donnerstag, den 16.06.2005, 11:24 +0100 schrieb Hugo Ramos:
> Yellow ppl,
> 
> Is there a way to know how many times an object has been accessed
> during current Zope's uptime?
> Something like the activity tab in /Control_Panel/Database/main but
> specific to each object in ZODB.

You can enable profiling (see ZMI in Control_Panel)
(You need to create a file for the log in the filesystem,
change config and restart zope) where you get refcounts on
all object but it will also cause substantial slowdown.
E.g. nothing you use in production environment.

Next best be it to just analyze the logfiles, for example
Z2.log - which gives you numbers based on URL
(Not that in a publishing process not only the object
on the specific URL is used but also a lot parent objects,
user, etc.

I guess it highly depends on what you really want to do.
-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread Tino Wildenhain
Am Donnerstag, den 16.06.2005, 22:33 +0100 schrieb John Poltorak:
> On Thu, Jun 16, 2005 at 08:30:15PM +0200, Andreas Jung wrote:
> > 
> > 
> > --On 16. Juni 2005 19:15:58 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:
> > 
> > >
> > > I've just put together a simple Zope website, but whilst it renders
> > > properly under Firefox, it looks dreadful using IE.
> > >
> > > Can anyone explain why? Could it be the CSS?
> > 
> > It could be your IE? It could be your HTML? It could be your CSS?
> 
> I was advised to change 
> 
>  
> 
> to 
> 
> http://www.mysite.org/"; /> 
> 
> and that seemed to sort out most of the problems.
> 
> Do I really need to hard code the site name like this, or is there some 
> variable I can use?

request has a lot URL variables you can use.
However zope usually does the right thing [tm]
here - you should just design your links
carefully. E.g. use root-relative, that means
links that start with / all the time.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Passing parameters using DTML

2005-06-17 Thread Tino Wildenhain
Am Freitag, den 17.06.2005, 09:44 +0100 schrieb John Poltorak:
> Can someone provide an example of passing parameters using DTML?
> 
> I'm sure this must be doable, but don't see an example in the Zope Book.
> 
> I assume it would go something like
> 
> 
> 
> but how would var1 pick up parm1 parm2?

Not at all. You could either have tried
it out ;) Or looked at the DTML documentation
in the Zope book *wink* ;)



If you are learning anyway, why not skip the DTML
part for now and go strait python-scripts and ZPT?

-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Passing parameters using DTML

2005-06-17 Thread Tino Wildenhain
Am Freitag, den 17.06.2005, 19:09 +0200 schrieb Dieter Maurer:
> Tino Wildenhain wrote at 2005-6-17 10:57 +0200:
> > ...
> >Not at all. You could either have tried
> >it out ;) Or looked at the DTML documentation
> >in the Zope book *wink* ;)
> >
> >
> 
> Be warned: this is likely to cause loss of the namespace.
> Do not forget to pass the two positional arguments (usually
> as "None, _"). They are essential.
> 
> For more details, read "Calling DTML Objects" of
> 
>   <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
> 
Thanks Dieter, I must confess I was just too lazy to show
all the pitfalls, assuming John takes the hint and reads
the docs again *wink* ;)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml sessions

2005-06-18 Thread Tino Wildenhain
Am Samstag, den 18.06.2005, 18:16 +0200 schrieb Andy Kim:
> Hi,
> I'm a beginner.
> I'd like allow a dtml method call e.g.  for one session 
> only.
> how do I do this with dtml?
> could anyone help me?

How often are you going to ask this? :)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml sessions

2005-06-18 Thread Tino Wildenhain
Am Samstag, den 18.06.2005, 18:43 +0200 schrieb Andy Kim:
> No, not just only once but rather for one browser session.
> If the page is reloaded again the method shouldnt be called.
> Only if the user comes for a next visit, the method should be called again.
> It actually should be easy, I'm just not familiar with dtml programming yet.
> However I'd like to have it with dtml since I have the dtml-call
> method already using..

I mixed you with Sungmook Kim, similar email address and
identical question on dzug mailinglist...

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml sessions

2005-06-19 Thread Tino Wildenhain
Am Sonntag, den 19.06.2005, 06:08 +0200 schrieb Andy Kim:
> No, I am not using the user system here.
> It is just a simple use.
> All I want is to put a session-conditional call for a dtml method within a
> simple page with this method.
> 

if not REQUEST.SESSION.get("marker",""):
yourcall()
REQUEST.SESSION.set("marker","call done")


transfer this to DTML or use a python script for coding
(since its easier)


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Pass objects from template to template via HTML forms.

2005-07-05 Thread Tino Wildenhain
Am Montag, den 04.07.2005, 22:53 +0200 schrieb Negroup -:
> Is there some way to pass an object from template A to template B via
> HTML forms?
> 
> A
> 
> 
> 
> 
> 
> B
> 
> 
> Template B prints:
> form
> obj   ''
> 
> I need the object itself, not the string representing the object!

You cannot simply pass a ZOPE object in a form like that.
You can handle fairly complex structures (lists and dictionaries
with int, float, string in them) but whole objects would
need to be pickled and then open a huge security hole
(Whatever is in the client can and will be faked)

So best option I see is to not pass the object but rather
pass the reference to the object. You can resolve
it via restrictedTraverse('/path/from/form')

Btw. avoid much code in the Template. Its a maintenance
headache. You can do it esily in a python script and 
call this from template.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Pass objects from template to template via HTML forms.

2005-07-05 Thread Tino Wildenhain
Am Dienstag, den 05.07.2005, 11:05 +0200 schrieb Negroup -:
> 2005/7/5, Tino Wildenhain <[EMAIL PROTECTED]>:
> [cut]
> 
> > So best option I see is to not pass the object but rather
> > pass the reference to the object. You can resolve
> > it via restrictedTraverse('/path/from/form')
> 
> I think I can't apply your solution. restrictedTraverse asks for a
> path, and then it supposes that the object is stored inside ZODB. This
> is not my case. Let me provide a minimanl explaination about how my
> application is structured.
> 
> 1. A user can uploads a zipped file via HTML form in "upload_zip" ZPT.
> The action of the form points to check_zip, an External Method that
> checks for validity of each file inside the archive.
> 
> 2. check_zip returns to upload_zip a tuple containing two elements:
> True or False (based on the correctness of archive) and the object
> itself, via self parameter.
> 
> 3. after the external method has been called, upload_zip shows other 2
> forms that the user will use to abort operation or to continue the
> process. The form to continue will pass the object to another external
> method in order to compute the result. This is the step where I
> encounter the problem, I can't pass object.
> 
> This should explain why I haven't the object stored inside ZODB.
> 
> Probably the solution would be to store the uploaded object inside a
> temporary area of ZODB and then I'll be able to do all the tasks I
> need.
> 
> Any further consideration/hints?

Well yes, thats very easy. Just store your (compressed or not)
HTML data (since its a string after all and not such a complex
object) in a hidden form field (base64 encoded for example) ->

filedata=htmldata.encode("base64")

and the other parts of your form as you wish. Maybe you prepare
the data in a script and call the ZPT from it:

return context.yourZPT(filedata=filedata,somestatus=whatever)

and use:  in your ZPT.

When the request returns, use: htmldata=filedata.decode("base64")

alternatively you can just store the data in REQUEST.SESSION
to keep it on server (but watch the memory usage)

-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Pass objects from template to template via HTML forms.

2005-07-05 Thread Tino Wildenhain
Am Dienstag, den 05.07.2005, 16:47 +0200 schrieb Negroup -:
> 2005/7/4, Negroup - <[EMAIL PROTECTED]>:
> > Is there some way to pass an object from template A to template B via
> > HTML forms?
> [cut]
> 
> 
> Thanks a lot for the replies.
> I have considered all the solutions and at the end I have decided to
> store the uploaded file in a zope file object inside ZODB, passing it
> between zope and external methods in order to process it, and then
> remove the file from ZODB.
> 
> This is the last thing I wanted to do, but considering the traps I
> encountered storing objects inside the session (Error Type: TypeError,
> Error Value: can't pickle function objects), and considering also that
> the file uploaded by the user could be potentially very big in size, I
> have thougt that store it inside ZODB instead of a session object was
> a better solution.
> 
> P.S.
> I just discovered a mail that looks like mine:
> http://mail.zope.org/pipermail/zope/2001-August/098793.html
> Probably in 4 years a lot of people have met the same "problem", but
> still there is no solution to face it in the terms expressed in my
> initial post; so, finally, is it impossible to implement a such thing
> or it simply has never been done?

Well err. You have got all possible solutions: create object in ZODB 
and pass references around, create object in session (which is easy, you
just store the string with the data) or send the data in the form
between client and server. (Your error you mention above indicates you
did not really create an object or used atomic datatypes)

All methods have drawbacks and advantages. Despite of having the user
select the same file again to send (which would be the 4th solution)
there is none left. This isnt genuine to zope but inherent to all 
solutions which work over HTTP.

I'd suggest to skip the 2-phase upload in favour of a one shot
with all the relevant data. E.g. "[ ] check here if you want
this and that" in the same form as the file gadget.
Especially if the files are potentially large.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] String Replacement Function

2005-07-14 Thread Tino Wildenhain
Am Donnerstag, den 14.07.2005, 16:00 -0400 schrieb Asad Habib:
> Is it possible to replace more than 1 type of character in a string
> simultaneously? If so, what is the correct syntax for this? I am currently
> using the following:
> 
> ')">
> 
> For this string, I want to replace both newlines and carriage returns
> (_.chr(13)) with the break tag.
> 
IIRC. you can just use 
to get the same result.
I know of no occurence where you have either \n or \r
but in the same string (and not just \n or \n\r)
But if you want to replace each, either:



or



but beware the quoting.

Even better maybe you just use CSS for your layout:





or with ZPT:


Sampletext




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] XUF and Postgres

2005-07-14 Thread Tino Wildenhain
Am Donnerstag, den 14.07.2005, 12:46 -0300 schrieb David Pratt:
> I am looking at using the ExUserFolder with Postgres.  Any users of 
> this combination that could share feedback (positive or negative) on 
> how this solution is working for them. Many thanks.

I use it but in a very hacked up form because I need inline auth
and I wanted sha1 hash instead of the default crypt.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] XUF and Postgres

2005-07-15 Thread Tino Wildenhain
Am Freitag, den 15.07.2005, 16:25 +1000 schrieb Andrew Milton:
> +---[ Tino Wildenhain ]--
> | Am Donnerstag, den 14.07.2005, 12:46 -0300 schrieb David Pratt:
> | > I am looking at using the ExUserFolder with Postgres.  Any users of 
> | > this combination that could share feedback (positive or negative) on 
> | > how this solution is working for them. Many thanks.
> | 
> | I use it but in a very hacked up form because I need inline auth
> | and I wanted sha1 hash instead of the default crypt.
> 
> BTW, the 0.50.x branch has pluggable crypt types..
> 
> crypt, md5, sha are part of the crypts you can pick.. or you can write your
> own in about 30 seconds if you need something else.
> 
Well this sha1 patch wasnt the real hard work ;-)

Inline auth was the real nut to crack. And the fact XUF returns HTML
instead of using appropriate exceptions add to the complexity :-)

I hope PAS will fill the gap although it isnt yet ready for prime time.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Forcing Zope transaction commit

2005-07-19 Thread Tino Wildenhain
Am Dienstag, den 19.07.2005, 00:35 -0700 schrieb David H:
...
> Your idea is what I thought of at first - but my Interbase Adapter
> doesn't like COMMIT statements (!)  and I didn't test it out.  But it
> seems that would not  solve the problem because both ZSQL methods are
> embedded in the *same* zope transaction stream, e.g.
> 
> .  Submit a page
> .  call ZSQL1 (part of Zope Tran 100)
> . call ZSQL2  (part of Zope Tran 100)  <--- this depends on zSqL1
> being executed but the transaction has not been executed yet, its
> pending.
> .  Display a page
> .  *now* Zope commits (executes all calls - which is too late in this
> case).
> 
> When ZSQL2 is called ZSQL1's results are not yet executed into my RDMS
> and therefore ZSQL2 cannot see whatever ZSQL1 did. (COMMITs not
> with-standing).


Stop. Should Interbase here behave different? Its actually required
that a database makes changes visible to all queries in the _same
transaction_. It depends on Transaction Isolation Level 
if you see further changes, e.g. if your Database supports "read
committed" - this means you would see data changed by _other
transactions_ that started _after your transaction_.

> Its understandable that Zope might wait between page presentations to
> transact all changes until all succeed ( an exception aborts the
> transaction).  Its just in some cases they can't all succeed until
> some are transacted.

Thats weird. I'd like to see the model you are referring to here.
Are you perhaps playing with after-commit triggers? 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Zope Foundation Update

2005-07-21 Thread Tino Wildenhain
Am Mittwoch, den 20.07.2005, 19:17 -0500 schrieb George Donnelly:
> Hadar Pedhazur wrote:
> 
> ZC says: the marks were stolen
> ZEA seems to be saying: the marks were registered defensively.
> 
> My read on this is that there is a serious communication problem going
> on here between the lines. Why doesn't Paul come out and state what the
> ZEA position is? Why are ZC's words so angry?
> 
> ZC saying the marks were stolen seems a little over the top. What if ZEA
> registered them defensively? if that's possible then ZEA should be given
> then  benefit of the doubt and not be called a thief. If there was a
> need to register them to protect "zope", then why didn't ZC do it?
> 
> Everybody needs to calm down, stop insulting each other and stop
> broadcasting this problem to the whole world on zope-announce (for
> example). Its making us all look  childish.
> 
> Making either side into the bad guy is not only innacurate but also
> inappropriate and is not conducive to building a community around the
> software we all love and are grateful to ZC and non-ZC related
> programmers alike for, Zope.
> 
+1 this is also my understanding judging from the messages flowing
around. 

The statement of ZC indicates they want to transfer their trademark
to ZF and now find the european trademark in other hands. OTOH, why
not just transfer/licence what they have (the .us trademark) and
just agree to ZEA transfer/licence the european trademark to ZF
too? 

As I understand, the benefit of a ZF with the source in the hand 
would be to help contributors to defend against patent issues
which you probably cant avoid if you do any development.
So I really like to see ZF founded as soon as possible.

So please ZC and ZEA come together, the community really wants
it. 

May I suggest to create a temp not-public-archived mailinglist
to further discuss this issue? 
-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] store data as long as the user is logged on

2005-07-21 Thread Tino Wildenhain
Am Donnerstag, den 21.07.2005, 16:36 +0200 schrieb gabor:
> hi,
> 
> i need to store some data as long as the user is logged on to zope.
> how can i achieve this?
> 
> using the session is not a good idea, because some parts of the code 
> simply call session.clear()  (i did not write that part).
> 
> if everything fails, i can use a singleton where i put a dictionary 
> based on some-kind-of user-id... but i'd like to avoid that if possible 
> (don't want to think about the multi-user-asking-at-the-same-time 
> problems)..
> 
> is there any place where i could attach my data structure?
> 

Session is still the best thing you can use in this case.
Note that HTTP is stateless, you just dont know when
a user "logs out". - unless she is so friendly to use
a button on your site where you can trigger to delete
the session and auth cookie.

-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Reg Zope Installation Problem

2005-07-22 Thread Tino Wildenhain
Am Freitag, den 22.07.2005, 07:31 +0100 schrieb praba kar:
> --- Florent Guillaume <[EMAIL PROTECTED]> wrote:
> 
> > praba kar  <[EMAIL PROTECTED]> wrote:
> > > I try to install zope 2.7.0.
> > 
> > Stop right here. Zope 2.7.0 is hopelessly outdated.
> > Use Zope 2.7.6.
> > 
> > Florent
> > 
> > -- 
> > Florent Guillaume, Nuxeo (Paris, France)   CTO,
> > Director of R&D
> > +33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
> > 
> Dear All,
> I have same problem in Zope 2.7. 6
> installation also. kinldy help me. I have installed
> successfully  but I don't know how to start zope
> properly. Actully now I am starting zope service using
> runzope from bin directory of  instance.
> I don't know how to use zopectl command.


runzope or zopectl fg 
are good for testing if the installation works
because you get all the messages on screen (like you show below)

zopectl start 

should be used in production because it detaches zope 
from the shell. I think the INSTALL.txt section
needs some clarify on this - although zopectl
gets mentioned there:

"""
Starting Zope

  Once an instance home has been created, the Zope server can now be
  started using this command:

/location/of/zope/instance/bin/runzope

  If you get errors indicating that addresses are in use, then you
  will have to supply arguments to runzope to change the ports used
  for HTTP or FTP. The default HTTP and FTP ports used by Zope are
  8080 and 8021 respectively. You can change the ports used by
  specifying the "port-base" parameter to runzope.  For example, to
  run Zope on ports 9080 and 9021::

./bin/runzope -X port-base=1000

  There is also an interactive Zope command shell named 'zopectl' that
  may be invoked by running 'bin/zopectl'.  By default, 'zopectl
  start' will start a background process that manages Zope and
  'zopectl stop' will stop the background process.

"""


> 
> --
> 2005-07-22T11:48:07 INFO(0) ZServer HTTP server
> started at Fri Jul 22 11:48:07 2005
> Hostname: localhost.localdomain
> Port: 8080
> --
> 2005-07-22T11:48:07 INFO(0) ZServer FTP server started
> at Fri Jul 22 11:48:07 2005
> Hostname: prabahar
> Port: 8021
> Traceback (most recent call last):
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/Startup/run.py",
> line 50, in ?
> run()
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/Startup/run.py",
> line 19, in run
> start_zope(opts.configroot)
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/Startup/__init__.py",
> line 52, in start_zope
> starter.startZope()
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/Startup/__init__.py",
> line 231, in startZope
> Zope.startup()
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/__init__.py",
> line 46, in startup
> from Zope.App.startup import startup as _startup
>   File
> "/Programs/Zope/2.7.6/lib/python/Zope/App/startup.py",
> line 30, in ?
> import OFS.Application
>   File
> "/Programs/Zope/2.7.6/lib/python/OFS/Application.py",
> line 17, in ?
> import Globals,Folder,os,sys,App.Product,
> App.ProductRegistry, misc_
>   File
> "/Programs/Zope/2.7.6/lib/python/App/Product.py", line
> 44, in ?
> from HelpSys.HelpSys import ProductHelp
>   File
> "/Programs/Zope/2.7.6/lib/python/HelpSys/__init__.py",
> line 15, in ?
> import HelpSys
>   File
> "/Programs/Zope/2.7.6/lib/python/HelpSys/HelpSys.py",
> line 18, in ?
> from Products.ZCatalog.ZCatalog import ZCatalog
>   File
> "/Programs/Zope/2.7.6/lib/python/Products/ZCatalog/__init__.py",
> line 16, in ?
> import ZCatalog, Catalog, CatalogAwareness,
> CatalogPathAwareness, ZClasses
>   File
> "/Programs/Zope/2.7.6/lib/python/Products/ZCatalog/ZCatalog.py",
> line 40, in ?
> from IZCatalog import IZCatalog
>   File
> "/Programs/Zope/2.7.6/lib/python/Products/ZCatalog/IZCatalog.py",
> line 236, in ?
> __doc__ = IZCatalog.__doc__ + __doc__
> TypeError: unsupported operand type(s) for +:
> 'NoneType' and 'NoneType'
> 

this is faszinating. I have no Idea why on your installation
are the docstrings None. 

Yan you please quote the code lines around line 236 in 
/Programs/Zope/2.7.6/lib/python/Products/ZCatalog/IZCatalog.py 
?


-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how do I check if an object have being recently updated??

2005-07-24 Thread Tino Wildenhain
Am Samstag, den 23.07.2005, 19:17 -0700 schrieb Allen Huang:
> I want to post a update date that will change when any of the objects
> in a folder has been updated.
>  
> So far, I only know the command bobobase_modification_time, but it
> only works again the object I I enter the command with.. 

This is not a command. This is a method!
Methods are called "on" an object.

so if o is your object,

o.bobobase_modification_time()

returns the internal storage time of that object.

Maybe its a good start if you read the python
tutorial (www.python.org) to get an idea on all
that object, method, attribute stuff.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: ZTUtils.Iterator value in ZPT

2005-07-25 Thread Tino Wildenhain
Am Sonntag, den 24.07.2005, 19:50 -0300 schrieb David Pratt:
> Hi Chris. I believe the purpose of ZTUtils are utility functions for 
> page templating. That said, the Iterator class could be more useful by 
> exposing its values based on its state -  the point I had made.  
> Versatility is the beautiful thing about python  - it rarely matters to 
> me what intention there is or may have been for a class so long as it 
> supplies the methods I am after.  In the end, there's really nothing 
> here that can't be solved with a simple tool and a bit of flexibility 
> on my part. Many thanks.
> 
> Regards,
> David
> 
> On Friday, July 22, 2005, at 02:08 PM, Chris Withers wrote:
> 
> > David Pratt wrote:
> >>> Ah, I see what you're after, something akin to an SQL sequence, 
> >>> right?
> >>> Well, Iterator ain't that ;-)
> >> I guess something like that but that is what an iterator does.
> >
> > Why makes you think ZTUtils Iterators were designed for this?
> >
> >> Well, by hand is not the solution either.  It is not as simple as 
> >> that since I am using portlets in CMF
> >
> > You meean portlets in Plone, right? ;-)
> >
> >> You can't just number them like 1,2,3 etc because you end up with 
> >> conflicts in tabindex values when your templates are rendered.
> >
> > So give them each their own numbers based on the worst case of all 
> > portlets being present on one page...
> >
> >> your ZPT (that doesn't require you to write one with all the security 
> >> bypasses to make it work).
> >
> > They are not "security bypasses", they are appropriate security 
> > declarations based on the work the ZTUtils code does when executing...
> >
> > Looks like you're on your own...

It looks like this part of the Iterator is just misdesigned:

def next(self):
if not (hasattr(self, '_next') or self._prep_next(self)):
return 0
self.index = i = self.nextIndex
self.nextIndex = i+1
self._advance(self)
return 1

IIRC, ZTUtils were written long before the python iterators became
standard. So the method name next was used and now clashes with
the standard iterator protocol.

It could be fixed but only if there is no product in the world using
it or all must be fixed before.

I propose: has_next() or something in place of it.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] from REQUEST not shown in tag if it has spaces??

2005-08-04 Thread Tino Wildenhain
Am Donnerstag, den 04.08.2005, 11:33 +0100 schrieb Thomas Apostolou:
> Hello everybody,
> 
> Im using Zope 2.7.0 on Windows XP Pro.
> I pass some parameters from a form to a DTML method.
> Inside that method i try to get the parameters with
>  ( sSQL is the "name" of the submiting
> form's field).
> When i just use it as  everything is
> ok.
> When i use it like :  value=>, i get everything until the
> first space. For example from "select * from mytable"
> i get "select".
> 
> Is it something wrong with what i am doing?

Yes, you should write HTML when you want HTML ;)
This means, attribute values in HTML are supposed
to be in " "
(See the HTML source in your Browser when you display
the page and you will know what I mean :)

So, if you really want DTML here, use:



or 



which is a bit nicer because you dont write a tag inside
a tag.

OR use ZPT:





___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Cannot pass parameters to Externa Method From inside a DTML Method

2005-08-04 Thread Tino Wildenhain
Am Donnerstag, den 04.08.2005, 11:31 +0100 schrieb Thomas Apostolou:
> I have in my "Extensions" folder the file
> "TestODBCEM.py" witch contains the following code to
> select and return 40 rows by 8 columns of a query:
> 
> 
> def TestODBCEM(self, sysDSN="defDSN", usr="defUsr",
> mypass="defPass", sSQL="SELECT * FROM defTable",
> xx=40, yy=8):
>id = self.id
>import dbi
>import odbc
>connection=odbc.odbc(sysDSN+'/'+usr+'/'+mypass)
>cur=connection.cursor()
>cur.execute(sSQL)
>data=cur.fetchall()
>a=""
>for x in range(0,int(xx)):
>   for y in range(0,int(yy)):
>  if data[x][y]=="":
> a=a+"Null"+"---"
>  else:
> a=a+str(data[x][y])+" --- "
>   a=a+"\n"
>return data


This is not a good idea anyway.
1) it lets every user knowing the external method
   connect to every database on your host (depending 
   on credentials if any)

2) even worser it enables the user to issue any
   raw SQL string to the database, including but not
   limited to DROP table; DROP database; etc.

3) by not using ZOPEs infrastructure (read: Z(yourdb)DA,
   ZSQL-Methods), you have the expensive connect operation
   every time, loose the ability to easily work with zopes
   transactions, have to quote and unquote values and so on.

So get a ZODBCDa or something like that and use it.
> 
> 
> I have used it and created an External Method in my
> Zope name "TestODBCEM"
> 
> 
> 
> next i created a DTML Method named
> "GetQueryParamsDTML" with the following :
> 
> 
> 
> 
>   I will connect using : "" System DSN
>   Type the query to execute...
>method="POST">
>  value=>
> The SQL Query to be executed against the above
> DSN connection
>   
>   value=>
>   value=>
>   
>
> 
> 
> 
> and everything is ok as it returns something like this
> :
> [(1, 1054, 1001, '\xc1\xd0\xcf\xd3\xc2', 1001, 101,
> '\xc1\xd0\xcf\xd3\xc2\xc5\xd3\xc5\xc9\xd3
> \xd7\xd1\xc7\xd3\xc7\xd3', None, 1, None, None, None,
> None, None, 1, 1, 0, None, None, None, None, None,
> 1054, 1054, 1, 0, 0, 0, None, None, None, 0, None,
> None, None, 0, None, None, None, 0, 0, 0, None, None,
> None, 0, 0), (1, 1054, 9001, '\xc1\xd0\xcf\xd.
> 
> Now i want to format the results to show them
> so i change my "GetQueryParamsDTML" as follows:
> 
> 
> 
> 
>   I will connect using : "" System DSN
>   Type the query to execute...
>method="POST">
>  value=>
> The SQL Query to be executed against the above
> DSN connection
>   
>   value=>
>   value=>
>   
>
>  
> 
> Now it calls another DTML Method named "ShowResults"
> witch reads like this:
> 
> 
> 
> 

here you would write:



because your external Method does not magically 
read the REQUEST object. (You could do that there
by using self.REQUEST.get('sysDSN','default') )


>   
> 
>   
> 
>   
>   
> 
>   
>   
> 
> 
> 
> 
> The problem know is that, althought the params of the
> GetQueryParamsDTML is passed to ShowResults through
> the REQUEST, the TestODBCEM does not use them. Instead
> the code is always using the defValues of its def
> line.
> When i was calling ./TestODBC from GetQueryParamsDTML 
> it was using the parameters i was submiting.
> 
> I tried to change the follong line of ShowResults :
> 
> to:
> 
> 
> but this one gives me an AttributeError ('str' object
> has no attribute 'id').
> 
> 
> 
> Does anyone know what am i doing wrong?
> I would apreciate it if you could help me.

See also:

http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx



-- 
Tino Wildenhain <[EMAIL PROTECTED]>

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Benchmark ZOBD compared to RDBMS

2005-08-09 Thread Tino Wildenhain

Simon ALEXANDRE schrieb:

Hi,

 

I’m searching for benchmark comparing ZODB to some RDBMS like Mysql. I 
know that both technologies are different but I’d like to know if we 
should expect some performance problem with ZODB used to store millions 
of objects.


I'd suggest to actually store your objects to find out.
But storing is only half the work. Retrival and update,
as well as schema extension, concurrency etc. are more
interesting. Just storing means a plain mmapped file will
sure outperform any RDBMS :-)

And also see if you compare the actual interface speed, meaning
if you plan a web application on top of your data, do the measurement
on the resulting web app and not the bare storage.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] VHM Problem HELP!!!

2005-08-13 Thread Tino Wildenhain
Am Samstag, den 13.08.2005, 22:34 -0400 schrieb beno:
> Hi;
> It's been years since I've posted here. I've been spoiled by having a 
> full-time programmer :) But he's on vacation and I'm screwed :(
> I need to get this site posting to the web but I'm having trouble with 
> VHM. I copied, pasted and edited an entry in our httpd.conf file thus:
> 
> RewriteRule ^/(.*) 
> http://127.0.0.1:8080/VirtualHostBase/http/www.centurionsecurityvi.com:80/centurionsecurityvi.com/VirtualHostRoot/$1
>  
> [L,P]
> SetEnvIf Referer "^$" dontlog
> SetEnvIf Referer "^http://centurionsecurityvi\.com.*$"; dontlog
> SetEnvIf Referer "^http://www\.centurionsecurityvi\.com.*$"; dontlog
> ErrorLog /var/log/apache/vhosts/centurionsecurityvi.com-error_log
> CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-access_log combined
> CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-referer_log 
> referer env=!dontlog
> 
> Then I went to VHM through the Zope interface and followed the direction:
> First box: centurionsecurityvi.com
> Second box: /centurionsecurityvi.com
> and yes, that's the folder. But it tells me "The path 
> /centurionsecurityvi.com was not found"
> What gives? Please help. Waah!
> beno

Copy the output of the complete  directive.
I dont know if its missing or you forgot to copy but
from above there is no RewriteEngine on statement for example.

Also output of apachectl -S or httpd -S (depending on the version
of apache you use) would be helpful.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] VHM Problem HELP!!!

2005-08-14 Thread Tino Wildenhain
Am Sonntag, den 14.08.2005, 06:32 -0400 schrieb beno:
> Tino Wildenhain wrote:
> 
> >Am Samstag, den 13.08.2005, 22:34 -0400 schrieb beno:
> >  
...
> >
> 
> ServerAdmin [EMAIL PROTECTED]
> ServerName centurionsecurityvi.com
> ServerAlias *.centurionsecurityvi.com
> ErrorDocument 401 /errors/401.html
> ErrorDocument 403 /errors/403.html
> ErrorDocument 500 /errors/500.html
> ErrorDocument 404 /errors/403.html
> Alias /icons/ /usr/local/apache/icons/
> RewriteEngine On
>  
> # Webalizer
> RewriteRule ^/usage(.*) /usage/centurionsecurityvi.com$1 [L]
> 
> RewriteRule ^/(.*) 
> http://127.0.0.1:8080/VirtualHostBase/http/www.centurionsecurityvi.com:80/centurionsecurityvi.com/VirtualHostRoot/$1
>  
> [L,P]
> SetEnvIf Referer "^$" dontlog
> SetEnvIf Referer "^http://centurionsecurityvi\.com.*$"; dontlog
> SetEnvIf Referer "^http://www\.centurionsecurityvi\.com.*$"; dontlog
> ErrorLog /var/log/apache/vhosts/centurionsecurityvi.com-error_log
> CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-access_log combined
> CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-referer_log 
> referer env=!dontlog
> 

Looks OK for me. A bit more complex then you need for just the VHost in 
Zope due to your logging rules but it should work.

> 
> >Also output of apachectl -S 
> >
> printed out the help menu
> 
> >or httpd -S 
> >
> command not found

It depends on your installation, httpd is the binary which is
the apache usually. Where it is you have to find out yourself.
(/usr/sbin, /usr/pkg/sbin, ... whatever)

In any case you should make sure you reload the config in 
apache. usually this is done via apachectl.

-S should print out the virtual hosts as seen by apache.

HTH
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] VHM Problem HELP!!!

2005-08-14 Thread Tino Wildenhain
Am Sonntag, den 14.08.2005, 10:05 -0400 schrieb beno:
> Tino Wildenhain wrote:
> 
> >Am Sonntag, den 14.08.2005, 06:32 -0400 schrieb beno:
> >  
> >
> >>Tino Wildenhain wrote:
> >>
> >>
> >>
> >>>Am Samstag, den 13.08.2005, 22:34 -0400 schrieb beno:
> >>> 
> >>>  
> >>>
> >...
> >  
> >
> >>
> >>ServerAdmin [EMAIL PROTECTED]
> >>ServerName centurionsecurityvi.com
> >>ServerAlias *.centurionsecurityvi.com
> >>ErrorDocument 401 /errors/401.html
> >>ErrorDocument 403 /errors/403.html
> >>ErrorDocument 500 /errors/500.html
> >>ErrorDocument 404 /errors/403.html
> >>Alias /icons/ /usr/local/apache/icons/
> >>RewriteEngine On
> >> 
> >># Webalizer
> >>RewriteRule ^/usage(.*) /usage/centurionsecurityvi.com$1 [L]
> >>
> >>RewriteRule ^/(.*) 
> >>http://127.0.0.1:8080/VirtualHostBase/http/www.centurionsecurityvi.com:80/centurionsecurityvi.com/VirtualHostRoot/$1
> >> 
> >>[L,P]
> >>SetEnvIf Referer "^$" dontlog
> >>SetEnvIf Referer "^http://centurionsecurityvi\.com.*$"; dontlog
> >>SetEnvIf Referer "^http://www\.centurionsecurityvi\.com.*$"; dontlog
> >>ErrorLog /var/log/apache/vhosts/centurionsecurityvi.com-error_log
> >>CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-access_log combined
> >>CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-referer_log 
> >>referer env=!dontlog
> >>
> >>
> >>
> >
> >Looks OK for me. A bit more complex then you need for just the VHost in 
> >Zope due to your logging rules but it should work.
> >
> >  
> >
> >>>Also output of apachectl -S 
> >>>
> >>>  
> >>>
> >>printed out the help menu
> >>
> >>
> >>
> >>>or httpd -S 
> >>>
> >>>  
> >>>
> >>command not found
> >>
> >>
> >
> >It depends on your installation, httpd is the binary which is
> >the apache usually. Where it is you have to find out yourself.
> >(/usr/sbin, /usr/pkg/sbin, ... whatever)
> >  
> >
> Well, tried those dirs, then ran
> find / -name "httpd*"
> which gave me lots of files but not a binary that I could see.
> 
> >In any case you should make sure you reload the config in 
> >apache. usually this is done via apachectl.
> >  
> >
> I rebooted the entire machine! No luck!

Argh. You are on unix. Nobody reboots a unix box :)
You did not tell us which OS (linux? And which distribution
you are using. Its hard to guess from here. It looks
like its Apache 1.3. Often the binary was called httpd.
It could as well be just apache. I really dont know what it
is on your site :) Chances are your config is just not
included. Are you faced with one single config file?
Or are there many single snipplets?


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] PLEASE HELP with VHM Problem!!

2005-08-15 Thread Tino Wildenhain

beno schrieb:
I still do not have a solution to get my VHM working. My programmer is 
on vacation and I don't know how he's got things configured. I copied, 
pasted and edited an entry in our httpd.conf file thus:



ServerAdmin [EMAIL PROTECTED] 
ServerName centurionsecurityvi.com
ServerAlias *.centurionsecurityvi.com
ErrorDocument 401 /errors/401.html
ErrorDocument 403 /errors/403.html
ErrorDocument 500 /errors/500.html
ErrorDocument 404 /errors/403.html
Alias icons// usr/local/apache/icons//
RewriteEngine On

# Webalizer
RewriteRule ^/usage(.*) /usage/centurionsecurityvi.com$1 [L]

RewriteRule ^/(.*) 
http://127.0.0.1:8080/VirtualHostBase/http/www.centurionsecurityvi.com:80/centurionsecurityvi.com/VirtualHostRoot/$1 
[L,P]

SetEnvIf Referer "^$" dontlog
SetEnvIf Referer "^http://centurionsecurityvi\.com.*$ 
" dontlog
SetEnvIf Referer "^http://www\.centurionsecurityvi\.com.*$ 
" dontlog

ErrorLog /var/log/apache/vhosts/centurionsecurityvi.com-error_log
CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-access_log 
combined
CustomLog /var/log/apache/vhosts/centurionsecurityvi.com-referer_log 
referer env=!dontlog



rebooted our FreeBSD machine, and then followed the instructions in our 
VHM by entering these fields:

centurionsecurityvi.com
/centurionsecurityvi.com
(Yes, that's the dir.) VHM tells me this dir can't be found. Wazzup?! 
I'm looking at the darn thing! Don't tell me it can't be found! Waah!

Please help.


Nono! You dont configure anything in the VHM object!
All its needs is done by your RewriteRule above.

When it works, you are already inside the "folder"
/conturionsecurityvi.com

(if you are using excatly this folder name - check
by visiting your zope instance directly)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope.org site and limited search results

2005-08-16 Thread Tino Wildenhain

Jaroslav Lukesh schrieb:

Dear zopistas,

few times ago I was few times wrote to ZC webmaster about limited query to 
Zope Products search results (see attached picture) - in any case it does not 
find more than 200 results. Nothing to do. If somebody has enough power to 
initiate zope.org webmaster, please tell him about change number of results 
from database at "advanced" tab of appropriate ZSQL method (if it is not 
defined somewhere else).



afaic there is no SQL involved in this search. It should be a full
ZCatalog query.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Startup hook

2005-08-17 Thread Tino Wildenhain
Am Mittwoch, den 17.08.2005, 22:09 +0200 schrieb Dieter Maurer:
> Gabriel Genellina wrote at 2005-8-17 11:34 -0300:
> >I need to execute something each time Zope starts, is there any place where 
> >i could put such things? (apart from modifying Zope.Startup.__init__.py)
> 
> An incredibly long time ago, there was a (third party) product
> that did this. I forgot its name...
> 

cd Products
mkdir FancyThirtPartyStartupDieterForgotTheName
cd Fancy*
echo "import mymoduleineedtostart" >__init__.py
echo "mymoduleineedtostart.run()" >>__init__.py

maybe? ;)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Failure to install PIL on a Linux server

2005-08-23 Thread Tino Wildenhain

Dominik Wezel schrieb:

Hi all

I'm aware that PIL is not easy to install, primarily due to the
prerequisites.  I've studied and applied as well as possible
http://mail.zope.org/pipermail/zope/2002-December/128364.html and
http://www.zope.org/Members/regebro/PIL_zope/, both of which seem
slightly medieval: the setup and test processes are very different
today.  I didn't find any other information pertaining to my problem, so
I considered this posting.  I hope I'm on the right list here.



Setup
=
- debian 3.1 (sarge) on a UML (user mode linux) dedicated ZOPE instance


apt-get install python2.3-imaging

ready.



- /usr/src/Imaging-1.1.5 (from Imaging-1.1.5.tar.gz, 2005-03-28)
- /usr/src/freetype-2.1.10 (from freetype-2.1.10.tar.bz2, 2005-06-12)
- /usr/src/jpeg-6b (from jpegsrc.v6b.tar.gz, 2005-03-28)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Failure to install PIL on a Linux server

2005-08-23 Thread Tino Wildenhain

Dominik Wezel schrieb:

Tino,


apt-get install python2.3-imaging

ready.



Thanks anyway, but you probably didn't read the last section of my mail. 
 Unfortunately, I *have* to find a way to do it manually.
FYI: It has to do with the way I set up Zope and various other stuff 
around it.  Unfortunately, back then I needed a very upfront version of 
Zope as yet unavailable through the debian package system, so I chose to 
set it up manually; this led to the need for a particular python version 
not available through the debian package system, so I set it up 
manually.  Now the customer needs PIL on this manual setup.  Albeit I 
tried to apt-get it, it didn't integrate at all with the other stuff. 
Needlesds to say I don't want to setup another python version on the 
same server, as mass storage capacity *is* an issue here).


Hm. You can perfectly run a source build of Zope on package-python
from debian. Testing has 2.3.5-6, which is perfectly usable.

Thats why I'm using debian too - to save me from all the hassle with
source depencies while using source where I really want it :-)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Failure to install PIL on a Linux server

2005-08-23 Thread Tino Wildenhain

Tino Wildenhain schrieb:

Dominik Wezel schrieb:


Tino,


apt-get install python2.3-imaging

ready.




Thanks anyway, but you probably didn't read the last section of my 
mail.  Unfortunately, I *have* to find a way to do it manually.
FYI: It has to do with the way I set up Zope and various other stuff 
around it.  Unfortunately, back then I needed a very upfront version 
of Zope as yet unavailable through the debian package system, so I 
chose to set it up manually; this led to the need for a particular 
python version not available through the debian package system, so I 
set it up manually.  Now the customer needs PIL on this manual setup.  
Albeit I tried to apt-get it, it didn't integrate at all with the 
other stuff. Needlesds to say I don't want to setup another python 
version on the same server, as mass storage capacity *is* an issue here).



Hm. You can perfectly run a source build of Zope on package-python
from debian. Testing has 2.3.5-6, which is perfectly usable.


Ah and stable has 2.3.5 too. Btw.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml-if

2005-08-28 Thread Tino Wildenhain
Am Montag, den 29.08.2005, 14:08 +1000 schrieb michael:
> Thanks thats it!  Why is it like that?
> 
...
> >>>
> >>> On 8/28/05, michael <[EMAIL PROTECTED]> wrote:
> >>>
>  What am I doing wrong here?
> 
>   -- this prints out the variable sent from last
>  (referring) page fine
>   -- this prints out the id of the current item fine
> 
> 
>    this one!  
> 
>  i want this to output "this one!" when the current item is the one
>  requested by the last page but they are never seen as == even when the
>  two dtml-var are the same
> 
>  they are never equal!

You will see this in the list archives several times in the past.
Depending on the object, id is a method and not an simple attribute.

To be on the save side (instead of figuring out what it is actually)
always use: getId()

Btw.  does not use the id the same way like 
. Try  and you will see
the method signature (view document source in the browser)

I'd recommend doing that all in a python script and then
use the prepared data in your DTML - oder later ZPT.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HELP!! Data.fs corrupted

2005-08-31 Thread Tino Wildenhain

Paul Sue schrieb:

Hi,
 
Our server crashed and wouldn't boot up.  Fortunately, we had backups of of Data.fs on another server .. so I installed Zope 2./7.4/Plone 2.0.5 on another server and used repozo to try to restore Data.fs:
 
./repozo.py -Rv -r /temp/recover -o Data.fs


However, when I start up Zope, I get:
 
2005-08-31T01:20:21 PANIC(300) ZODB FS FS21 ERROR: /home/zope/ssoi/var/Data.fs data record exceeds transaction record at 54956706



ZODB.FileStorage.CorruptedTransactionError: /home/zope/ssoi/var/Data.fs data 
record exceeds transaction record at 54956706

I've tried restoring from a few days ago using the "-D" option, but I get the 
same problem.

Am I totally hooped or is there some way to recover???


Err. I dont think you need repozo to use your backup Data.fs.
You should just be able to put (a regular file copy) of
your backed up Data.fs in place.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't get ZEO running with zeoctl start

2005-09-07 Thread Tino Wildenhain
Am Donnerstag, den 08.09.2005, 08:40 +0300 schrieb Mikko Koivunen:
> Hello all,
> 
> I'm trying to install a ZEO server. I already have Zope working, the
> ZEO-clients installed and testing ZEO with "zeoctl fg" actually works fine -
> but "zeoctl start" gives me this error:
> 
> ...

> opensocket
> sock.bind(tempname)
>   File "", line 1, in bind
> socket.error: (13, 'Permission denied')
> 
> 
> I tested it with users root and zope. The file permissions as far as I know
> are right.
> 
> This is annoying because I would want to put zeoctl in init.d and use it
> with service/chkconfig. Zope 2.7.6, Python 2.3.5, running on RHEL4. Any
   ~
  /
> ideas? /
/
I'd say check your SELINUX settings ---/

HTH
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Virtual Host Monster

2005-09-12 Thread Tino Wildenhain
Am Montag, den 12.09.2005, 17:08 +0200 schrieb Nicholas Wieland:
> I'm trying to use VHM to rewrite a pair of urls.
> What I want is to have a "normal" Zope on localhost:8080/, and an
> instance of a Product on localhost:8080/myProduct.
> The problem I'm having is that VHM locks me out from the root
> folder :(
>  
> My mappings line is:
> localhost:8080/my_container/VirtualHostRoot/myProduct
>  
> How do I exclude localhost:8080 to behave normally, as without Virtual
> Host Monster ?

Use http://127.0.0.1:8080/ instead to access your zope.

Now you know why right above the mappings window
there is this line:

"If you place the hostname that you use to manage your Zope in this list
you are likely to regret it, and will probably need to manage Zope using
its raw IP address to fix things."

with "you are likely to regret it" emphasized :-)

If you want to try real world mappings, put some
names in your hosts file and use them for experiment
instead.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] need help moving zope instance home data to new one w/ new python version

2005-09-12 Thread Tino Wildenhain
Am Montag, den 12.09.2005, 21:52 -0700 schrieb [EMAIL PROTECTED]:
> To move old zope instance home to new one can i just
> 
> 1. make new zope instance home
> 2. copy over Data.fs?
> 
> zope & plone barfed on python2.4...
> 
> must i downgrade to 2.3?

Yes. See doc/INSTALL.txt :-)
One of the points is you compiled your
extensions for python 2.3, and therefore
you need 2.3 to run it.




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Captcha

2005-09-14 Thread Tino Wildenhain
Am Mittwoch, den 14.09.2005, 13:37 -0700 schrieb akonsu:
> thank you. my question was how to do it from zope. namely, how to set
> request headers/contents, etc. from another list i found this link
> that has some image generating code:
> http://cvs.bluedynamics.org/viewcvs/BlueTexima/. hope this will help
> others.

You could just have written you are looking for an image-button
generator. And I would point you to the (sometimes) wonderful
world of CSS as a better alternative to this :-)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Captcha

2005-09-14 Thread Tino Wildenhain
Am Mittwoch, den 14.09.2005, 13:48 -0700 schrieb akonsu:
> could you explain how one can use CSS to generate images during
> request processing? or am i missing something?

No it cant - you cannot use it to obfuscate text
like your captcha product seems to do.

But some people are using text-to-image products
to render buttons and this is where you can
use CSS instead.

Btw. Text-to-image obfuscation makes it harder for
machines to automatically fill out forms but not
impossible.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] securing webdav

2005-09-23 Thread Tino Wildenhain
Am Freitag, den 23.09.2005, 16:08 -0700 schrieb David Bear:
> I run zope in back of apache, and let apache handle tls/ssl.
> 
> In all the searching on zope.org though I haven't found any documents
> on how to let apache handle securing webdav for zope as well.
> 
> Anyone see/written such?

webdav works over http - yes, the same http your browser uses.
Apache handles this fine. Nothing to do.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] securing webdav

2005-09-24 Thread Tino Wildenhain
Am Samstag, den 24.09.2005, 00:29 -0300 schrieb David Pratt:
> Hi Tino. Over HTTP is not the problem. It is more on normally https you 
> are rewriting your requests to port 443 with apache proxy and your 
> usual webdav server is port 1980 that is not secure.

Ah so. I use webdav over the standard port and not unsing the separate
webdav only server.

ZServer handles webdav just fine. 

Regards
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] securing webdav

2005-09-24 Thread Tino Wildenhain
Am Samstag, den 24.09.2005, 13:39 +0200 schrieb Sascha Ottolski:
> Am Samstag, 24. September 2005 01:08 schrieb David Bear:
> > I run zope in back of apache, and let apache handle tls/ssl.
> >
> > In all the searching on zope.org  though I haven't found
> > any documents on how to let apache handle securing webdav for zope as well.
> >
> > Anyone see/written such?
> 
> depending on your situation, a ssh tunnel might be feasible; works perfectly. 
> small drawback is, you obviously have to open a ssh session first (ssh-agent 
> is your friend).

Oh, its not that hard either, you can use apache as proxy for
any host:port combination. That means if you really want to
use the separate zope webdav daemon, you can use another
hostname, say https://dav.yourdomain.com/ to
proxy to zopeserver:webdavport
or https://yourdomain.com:8443/ - which works
too (and has the advantage of keeping the ssl-certificate
valid)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Output only the first or a particular record using TAL

2005-09-27 Thread Tino Wildenhain
Am Mittwoch, den 28.09.2005, 16:32 +1000 schrieb Julian Yap:
> --- Chris Withers <[EMAIL PROTECTED]> wrote:
...
> > Now, if you really can't stop your sql returning more than one
> > row 
> > (LIMIT 1 anyone?) then how about:
> > 
> >  >  tal:condition="customer">
> >   
> >Customer:
> >
> >   
> > 
> 
> To have my SQL returning only just 1 row would require another Z
> SQL Method, in which case it may as well be something like
> getCustomer.
> 
> I'm still getting my head around TAL and how it works so I'm not
> sure how the "python:customers and customers[0]" code works.
> 
> Ideally, I want to use just the one Z SQL method (done) but I
> guess it would be better coding to just reference the Z SQL
> method once.  Currently the page template makes two calls to the
> Z SQL method.  Once for the customer header and another to
> retrieve the customer license details.  Can you suggest how this
> would be done?

You could just wrap it in a simple python script:

results=context.yourZSQLMethod()

h=results[:1] # see python slice
b=results[1:]

return context.yourPageTemplate(header=h,body=b)


And in your ZPT use tal:repeat="chead options/header"
and options/body

But maybe you can rething and rephrase your problem :-)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZOPE and DEBIAN INSTALLTION

2005-09-28 Thread Tino Wildenhain
Am Mittwoch, den 28.09.2005, 19:43 +0200 schrieb Benmania Guin:
...
> I distinguish them by ports - the "normal" 80 PORT for Zope (for all HTTP 
> requests) and Apache using all other ports (using it as a mailserver and 
> stuff). 

You use Apache as mailserver? Now thats interesting :-)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] SiteAccess (Enh. VHM) still needed, or merged to Zope?

2005-09-28 Thread Tino Wildenhain
Am Mittwoch, den 28.09.2005, 20:49 -0400 schrieb Jeff Kowalczyk:
> Most references I find (google, The Plone Book - McKay, Building Websites
> W/ Plone - Cooper) on virtual hosting Zope behind Apache recommend
> starting with sfm's SiteAccess enhanced Virtual Host Monster product:
> http://www.zope.org/Members/sfm/SiteAccessEnhanced/view
> 
> Reportedly last updated 2001-08-19, is SAE really so mature that it has
> not subsequently needed updates or merited a merge into Zope's own VHM?
> 
> I need to map the incoming URL "http://(*.)foo.com/new/*" to a Plone
> instance at "http://localhost:8080/foo/*"; , and later change the
> inbound mapping to "http://(*.)foo.com/*" after customer acceptance.
> 
> I'm guessing that this is the most vanilla virtual hosting requirement
> possible, and I want to use the simplest configuration to accomplish it.
> If the old SEH 2.1.0 is the recommended tool with Zope-2.8.1, I'm sure the
> existing docs will be enough to figure it out. Thanks.

I believe Zopes VHM is the very SEH but updated since it became part
of zope. In recent zope versions there is in fact nothing to do to
use it because an instance is automatically created.

You only do the usual apache rewrite dance and be ready :)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZOPE and DEBIAN INSTALLTION

2005-10-01 Thread Tino Wildenhain
Am Samstag, den 01.10.2005, 15:15 +0200 schrieb [EMAIL PROTECTED]:
> Hi 
> 
> Yes, I actually try to deinstall the latter "apt-get version" that I 
> installed via source. But your solution does not work. After "reading the 
> pakets", it is always said that the system could not find the paket 
> "zope_2.6.4-1_i386.deb". The weird thing is that this paket is actually on 
> system; I can even see it in my root directory! Do you know what problem is?

Not reading the whole thread, but the / isnt the place for packages 
anyway.  Try to mv it to /var/cache/apt/archives
otoh, you dont need it for deinstall.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Tino Wildenhain

Greg Fischer schrieb:
This is totally unimportant, but I was just curious to know if anyone is 
running Mysql 5 on Zope right now.


why should one? :)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Write log file from script

2005-10-07 Thread Tino Wildenhain
Am Freitag, den 07.10.2005, 09:03 -0700 schrieb Dennis Allison:
> Depends upon what you want to do and how much access  you have.  For 
> debugging purposes I often use an external procedure
> 
> def debugWindow( data ):
>fd = open('/tmp/debugWindow",'a')
>fd.write( str(data))
>fd.close()


Actually this is a bit dangerous if you dont lock
the file.

import zLOG

def log(self,message):
zLOG.LOG("PythonScript", zLOG.INFO, message)


as external method should be enough.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Ann] Zope Hotfix 2005-10-09

2005-10-10 Thread Tino Wildenhain

Andreas Jung schrieb:

Hello,

a security issue with the Docutils package coming with Zope 2.6 or 
higher has been discovered. Sites that expose reStructuredText 
functionality to
untrusted users (typically portal sites allowing registered users to 
edit content) are possibly affected.


Download location and installation are available from

  http://www.zope.org/Products/Zope/Hotfix_2005-10-09/security_alert

The hotfix is supposed to work with any Zope 2.7 and 2.8 version.
It might work for Zope 2.6 and Python 2.1 but we can not give a 
guarantee since Zope 2.6 is no longer maintained. Plone sites do not 
seem to be affected (there seems to be some additional code on top of 
Zope's

reST implementation avoiding the failure) however this not a guarantee.
The upcoming Zope 2.8.2 and 2.7.8 releases will also ship with the hotfix.



Where are the details on the nature of the security problem?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to create a file and send it by e-mail ?

2005-10-11 Thread Tino Wildenhain

Nicolas Georgakopoulos schrieb:
Hello all, I'm developing using ZPT and I need to create a file (CSV 
format) but I'm having some problems:


* 1. *I only know how to create files with python but I get an
*Error Type: NameError*
*Error Value: global name 'file' is not defined.


While I wonder how do you create a file in python using file?

* I think ZOPE doe's not allow python to create files for security 
reasons. Can I change this security policy or it will make my 
application unsafe? Is there another way to create a file using ZOPE API 
calls ?


You dont need a real (filesystem-) file if all you want is sending it
over the net. Usually you just build a string - for example in python
scripts via print/return printed or as a list which you join.

* 2.*When I create my file how can I send it as an attachment by mail ? 
(I already have setup my mail host object and I can send mail's 
successfully.)


This is a bit more difficult, there are examples to send mails
with attachments per DTML, but if you want to avoid you either
open the python email package for python scripts or use
ChrisWs product (but I did not have the time to test it - so
try it :-)

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Tino Wildenhain

Fred Drake schrieb:

On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:


I discovered this a couple of years ago wondering why RedHat's up2date
XML-RPC client didn't wrap download files in base64 tags.  They've
actually done some strange stuff in this client to use normal http calls
to download RPM packages.



Silly RedHat.  Imagine using HTTP to transfer files...


Err. Whats wrong with HTTP to transfer files?
(Provided its not XML-RPC ;)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] selected in select lists

2005-10-14 Thread Tino Wildenhain
Am Freitag, den 14.10.2005, 20:03 +0100 schrieb Garry Saddington:
> Chris Withers wrote:
> 
> > Garry Saddington wrote:
> >
> >> DTML:
> >> 
> >> 
> >>  >> expr="groupabbrev==_.str(thisgroupabbrev)"> selected 
> >>  >
> >> 
> >> 
> >
> >
> > And just for comparison, here's the ZPT:
> >
> >  > tal:define="abbrev context/groupabbrev">
> >>>   tal:attributes="value thisAbbrev;
> >   selected python:abbrev==thisAbbrev"
> >   tal:content="thisAbbrev"/>
> > 
> >
> > Stop using DTML ;-)
> >
> > Chris
> >
> This code does not work;-). If I always work in the ZMI and do not 
> collaborate with designers on database web applications where the data
> is more important than the presentation, can you give me a good reason 
> for not using DTML. I find DTML more intuitive than ZPT and once you get 
> the hang of
> the namespace magic thing it is not that bad. The ZPT code above seems 
> to me more complex and it has defined two new variables, whereas the 
> DTML only has two variables
> and a string conversion.
> Regards
> Garry
> ps. I would use ZPT if I could see a valid reason to do so.

The example above is unfortunatly a bit bad from app design view.
You should either do the comparison in your ZSQL Method
or wrap the call to the ZSQL method in a simple python script.

Then all your ZPT reduces to:


  Example 


Which is imho much better to read then the code above.
All you need to do is to deliver True/False, None/Something
for the "selected" field. 

Not doing the comparison in your Template (no matter if DTML
or ZPT) really makes live easier.

You should try to get your Application right independend of
any HTML output. (e.g. you can call the scripts/ZPTs directly
to find out whats going on)

HTH
Tino Wildenhain

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-17 Thread Tino Wildenhain

Thomas G. Apostolou schrieb:

Αρχικό μήνυμα από  Chris Withers <[EMAIL PROTECTED]>:



Thomas Apostolou wrote:


i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.


I don't think so...



Well, you are right. I do not directly call the modules's function from
the file system.
I call an External Method that "wraps" the module's function and then i
call that External Method from my DTML Method. Here is the example:


  

  

  
  
 
  
  



GetData is the name of the External Method i call with the parameters of
the module's function as you can see.



Dont do that. Use a Database adaptor instead - any maybe issue
the query there if you dont want the ZSQL-Resultset-wrapping.
The reason is, ZDAs take care of pooling and so on and you avoid
a per thread reconnection.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] database connections from external method

2005-10-19 Thread Tino Wildenhain

Vangelis Mihalopoulos schrieb:


Hi,

I want an external method to access a mysql database on each call. For 
now, i open up a new connection on every call, but this probably won't 
scale much either on performance (new connection on each call is quite 
an overhead) or availability (the number of open connections is 
restricted).


I am thinking of using a Z Database Connection (mysql) from within an 
external method, without using Z SQL Methods, but can't figure out how i 
can "safely" do it... It crossed my mind to take a peek to the Z SQL 
Method source, but i don't know if such an approach would be thread safe...




The threading is handled by the ZDA, so you can use query() or what
the method actually is. Otoh, what do you think you gain from
circumventing ZSQL Methods?

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Pass as parameter to External Method

2005-10-19 Thread Tino Wildenhain

Thomas G. Apostolou schrieb:

I have an External Method "CharSetConv" that get a
String_To_Be_Converted, its encoding and the encoding to convert it
to.

I call it like this:

 
  
but in the place of 'String_To_Be_Converted' i want to pass , and i can not find the way to do so.
i have tried to write it like:

 
  
but does not work
Can anyone help please?


Well, DTML sux for a reason ;)

but  makes no sense unless you have list in list.

You dont need an external method to convert between charsets:



HTH
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Pass as parameter to External Method

2005-10-19 Thread Tino Wildenhain

Thomas G. Apostolou schrieb:

Αρχικό μήνυμα από  Tino Wildenhain <[EMAIL PROTECTED]>:



Thomas G. Apostolou schrieb:


I have an External Method "CharSetConv" that get a
String_To_Be_Converted, its encoding and the encoding to convert


it


to.

I call it like this:

   

'String_To_Be_Converted',


'ISO-8859-7', 'UTF-8')"> 
 
but in the place of 'String_To_Be_Converted' i want to pass



sequence-item>, and i can not find the way to do so.
i have tried to write it like:

   

sequence-item>',


'ISO-8859-7', 'UTF-8')"> 
 
but does not work
Can anyone help please?


Well, DTML sux for a reason ;)

but  makes no sense unless you have list in
list.

You dont need an external method to convert between charsets:



HTH
Tino



Dear friend thanks alot fro your reply.
I do have a lists in list
your sugestion return an error

Site error This site encountered an error trying to fulfill your
request. The errors were: 
Error Type 
AttributeError 
Error Value 
'NoneType' object has no attribute 'decode' 
Request made at 
2005/10/19 17:17:03.485 GMT+3 


what is wrong?


Looks like you have a None object among your strings in the list.
If so, you can either do:

  
expr="_['sequence-item'].decode('iso-8859-7').encode('utf-8')" >



which is the quick & dirty variant, or:



Which uses a "boolean trick".

HTH
Tino

PS: get used to python scripts where this is a lot better
to write



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Pass as parameter to External Method

2005-10-19 Thread Tino Wildenhain

...

which is the quick & dirty variant, or:



Which uses a "boolean trick".

HTH
Tino

PS: get used to python scripts where this is a lot better
to write



I agree with you and i would write this in python script (if this was
not an emegerncy and i was not a niewbie)
There one more thing to solve. Not all my elements in the list are
strings. If i was writing python i would use
for i,elem in enumerate(data):
for j,ele in enumerate(elem):
if isinstance(ele,(str,unicode)):
print unicode(ele,'iso-8859-7').encode('utf-8')
what is the corresponding dtml-if to check if sequence-item is a
string?


there is same_type to check. But you could just do:




basically turn everything into a string.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] database connections from external method

2005-10-24 Thread Tino Wildenhain

...
i don't want him to be able to directly access (read/write) the 
database i am using. *AFAIK*, ZSQLMethods won't do for this.



Then put constraints in on your database, or make the whole connection 
read-only.



I want to have full access rights on the database through the external 
methods.


Usually you dont want that. Sane security constrains on database save
you a lot mistakes if done right. You can also use views and stored
functions to further tighten your security.

Bad done external methods are more likely to open security holes.

You're really buying nothing with all this other than wasting a lot of 
your time...



I really hope i don't! :-)   As Dieter said, my application is not a 
conventional Zope application.


What is it instead? :)


I could say that, for this project, i am using Zope:
- as a much safer alternative to CGI


but not if compromized :)


- for its templating machinery
- because it is built on Python and the project is based on Python
- i like Zope :-)


Greets
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] REQUEST.form variables order

2005-10-24 Thread Tino Wildenhain

Krzysztof Kubacki schrieb:

On 24 Oct 2005, at 14:03, Krzysztof Kubacki wrote:


How to change it?
I would like to have variables in the same order as I put them into
internet form.



You can't. REQUEST.form is a dictionary. They are, by definition,
unordered.

Why do you need them ordered? What is the use case?



In my "Send script" I collect all data from internet form and send
to email.
I want to have that data in the email in the same order it was
placed in the
internet form.


Please keep this on the list!

You'll have to add code to your script to order the form items yourself.



 But the thing is that I don't have guarantee that user will not replace
fields in the internet form(there is a possibility).


And how exactly would that help if your script isnt expecting the new
fields anyway?

I'd use the :list and :records modifier accordingly for keeping
ordering where that matters.

HTH
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] FileUpload get_size() method?

2005-10-25 Thread Tino Wildenhain
Am Dienstag, den 25.10.2005, 14:43 -0400 schrieb Jonathan Cyr:
> Hello,
> 
> Does a FileUpload object have a get_size() method?
> 
> I'd like to limit the size of an uploaded file before commiting it to 
> the ZODB.  I've been Googling for a while.  Is it handled differently on 
> a FileUpload object.
> 
> I'm planning to process with a Python Script.
> 
> Could someone point me in the right direction?

The fileupload object is simply a file. (can be cStringIO, 
can be tempfile - depending on size)

Best is to do so:

maxsize=1<<20 # 1MB

fu=context.REQUEST.get('fileupload') 
fu.seek(maxsize)

if fu.read(1):
raise OverflowError("File too big!") # or something like that

fu.seek(0) # rewind to start

filefolder.manage_addFile(...)


This avoids loading the whole file into memory to find out.

HTH
Tino


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] FileUpload get_size() method?

2005-10-25 Thread Tino Wildenhain
Am Dienstag, den 25.10.2005, 16:42 -0400 schrieb Jonathan Cyr:
> I think I get it, except...
> 
> What's the meaning of 1<<20, I'm not familar with that operator.  How
> would I adjust it for different sizes?  

Well, you could (and should!) study the python documentation.
But this one is only an example. You can write the maximum
however you want, as literal value: 100 or
1e+6 or 1000*1000 or 10**6 ...

If you have an imagination of what value you want, just write it
there :-)



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] REQUEST.form variables order

2005-10-26 Thread Tino Wildenhain

...

And how exactly would that help if your script isnt expecting the new
fields anyway?

I'd use the :list and :records modifier accordingly for keeping
ordering where that matters.




The thing is that there is possibility to change fields order by the mean of
WYSIWYG editor by the user. If he change order I would expect to get the
same order in REQUEST object.


You cant. If you need to maintain order of fields, use :list or :records

e.g.



and so on.

Then you get a list for field and the elements are in the expected order.

You might read on that matter a bit:

http://zopewiki.org/ZPublisher

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem after upgrade zope from 2.6.0 -> 2.8.4

2005-10-27 Thread Tino Wildenhain
Am Donnerstag, den 27.10.2005, 20:25 -0700 schrieb Zhi-Wei Lu:
> Hi Zope Gurus,
> 
> After I upgraded the zope from 2.6.0 -> 2.8.4 on a Redhat EL3 server,
> with python 2.4.2 (and I also tested with python 2.3.5),  the gif  
> pictures are
> now slightly misaligned a little bit, these graphics are in a TABLE with
> BORDER=0, CELLPADDING=0, and CELLSPACING=0.  The graphics
> looked fine with Zope 2.6.0.
> 
> Does anyone see similar behavior with Zope 2.8.4?
> 
> Thank you for help.

I fail to see how the zope could possibly influence the rendering
of the very same HTML in a browser. 

Probably best would be to check both HTML sources as they are
delivered to the browser - as well as maybe mime-type and charset
in the header (via headersniffer-plugin in firefox or tcpflow or
similar)

Maybe you changed something with the update? Are you using
some framework on top of zope?

Tino.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: Problem after upgrade zope from 2.6.0 -> 2.8.4

2005-10-28 Thread Tino Wildenhain
Am Donnerstag, den 27.10.2005, 23:55 -0700 schrieb Alexander Limi:
> On Thu, 27 Oct 2005 23:27:22 -0700, Tino Wildenhain  
> <[EMAIL PROTECTED]> wrote:
> 
> > I fail to see how the zope could possibly influence the rendering
> > of the very same HTML in a browser.
> 
> Zope used to specify border=0 on images, put the title of the object in  
> the alt tags of the image and other bad behaviour. Now it doesn't anymore.

Ah yes, well, zope2.6 it was. Otoh, if he would inspect the source
it should show up :)

> Most likely he needs to add the CSS:
> 
> img { border: none; }
> 
> to his site, depending on what browser he uses to test it.

Would not affect lynx but should otherwise work :)

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] marshall zsql results

2005-10-30 Thread Tino Wildenhain
Am Sonntag, den 30.10.2005, 17:11 -0700 schrieb Christopher Rivard:
> Hello,
> 
> I am having a little difficulty with a result object from ZSQL.
> The MySQL form input is a series of checkboxes that are creating a 
> "mapping table".
> 
> I have gone round and round and landed here:
> 
> The checkboxes are marshalled as:
> list_map_dir_id:list:int
> 
> SQL like this:
> 
> 
> insert into listing_map (list_map_dir_id, list_map_list_id) values
> (,
> 
> )
> 
> 

This isnt that bad - you just get a bounch of insert statements
which should work.

> MySQL data type is int for this column.
> 
> All of this works fine, but ideally I would like to manipulate the id's 
> as a list.

SQL knows no list, so the above is probably best you can do.
Otoh, you could manipulate the values as ARRAY and use the
database functions to select from array to table - depending
on your database.

> I have tried a few variations and regularly run into "len of unsized 
> object" if I try to insert as a varchar or insert the full list as 
> [0,1,2,3,4]
> I have tried a few different MySQL data types, but no luck.
> 
> Retrieving the results like this:
> select * from listing_map where list_map_list_id = 

You should get into the habit of specifying the column names
literally to avoid changes of order and case of your columns
as they come from the database. Also you dont retrieve columns
you might not need (if you extend the table later).

> And mapping them back to the directory table like this:
> 
> select t1.*
> from directory as t1
> left join listing_map as t2
> on t1.dir_id = t2.list_map_dir_id
> where t1.dir_id = t2.list_map_dir_id && t2.list_map_list_id =  list_id>

Write AND instead of && - && isnt SQL standard and makes it harder for
you to change the database.

> Is there a way to marshall the results of this ZSQL object back into a list?

ZSQL objects is a bit confusing. You probably mean the DTML elements of
the ZSQL Methods. As I said, there is no list in SQL and Array
is a bit specific to databases. For example you could do something
like



would render '{1,3,4,5,6}' to the database which in Postgres would
be an array.

> I am branching the subsequent forms based on the above query results.  
> The difficulty I am running into are exclusion situations
> 
> A and B not C
> 
> Seems like it would be easier if I could loop through and pull id's from 
> a list.  Maybe I'm asking the wrong question.

You should be able to optimize this by means of stored functions in your
database.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] URL Rewriting chaos

2005-11-02 Thread Tino Wildenhain
Am Dienstag, den 01.11.2005, 08:38 + schrieb [EMAIL PROTECTED]:
> Hi,
> I've tried everything in both the Zope and Plone books and read the Apache 
> URL Rewrite guide also, but I just can't seem to get the silly thing 
> working!
> I'm sure that it does ;-) but for some reason it is beyond me.
> Let me tell you what I've tried, and tell me which one should work:
> I am using apache to rewrite the urls. 
> 
> 1. Host monsters, both one in the zope root folder, and multiple in each 
> plone site's folders.  I have tried both with the mappings and without (even 
> though the books say they're not needed with apache). 

Maybe this can screw things even more. I think we should remove the 
ability to add more VHM instances once one is there (and with recent
zopes you already have it on install in the root)

> 2. apache rewrite rules, this is how (the current attempt looks)
> please assume that the big url is all on one line, email programs may have 
> changed that. 
> 
> 
>ServerName example.net
>RewriteEngine On
>RewriteRule ^/(.*) 
> http://example.net:8080/plone_site/VirtualHostBase/http/example.net:80/Virtu 
> alHostRoot/$1 [L,P]
>  
> 
> I have tried all combinations of things in the 'example.net' places above, 
> including the fqdn, local ip number and local host name. 

The VHM management tab has all the info you need. In fact, the example
there is:

http://localhost:8080/VirtualHostBase/http/www.buystuff.com:80/buystuff.com/VirtualHostRoot/$1

Which would translate to:

http://server-your-zope-runs:8080/VirtualHostBase/http/example.net:80/plone_site/VirtualHostRoot/$1

Make sure you have only one VHM object and it in your site root.

> Is there a shortcoming in the documentation here?  Have I accidentally 
> skipped over a word somewhere that was more important than I realised? 

I suspect there is a bit confusing documentation out there which isnt in
sync with the current implementation. In case of the VHM its quite good
documented in its management tab. Maybe we should uinify the places 
where one can find up to date documentation.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: URL Rewriting chaos

2005-11-02 Thread Tino Wildenhain
Am Mittwoch, den 02.11.2005, 01:30 + schrieb [EMAIL PROTECTED]:
> i've managed to get it closer to working, when you type in 'example.net' 
> into the browser the desired page comes up (yay) but the links are all still 
> 'myserver:8080/plone' and of course they don't resolve anyway.  What's up 
> here? 
> 
> I've been mucking around with this for many days now, perhaps the newer 
> releases will make this work 'out of the box' please :-) 

Yes they do - unless you muck around with it ;)
Are you sure you dont have a ghost virtual host
monster somewhere in the path left?
If you dont yet have content, try with a fresh
Data.fs, dont install/change anything in/with
VHM and use your Apache config as we had
last time. It should just work.

HTH
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] useradd command in Zope

2005-11-03 Thread Tino Wildenhain

ajit mote schrieb:

 >  useradd ...

On 11/3/05, *Andreas Jung* <[EMAIL PROTECTED] 
> wrote:


Look at the sudo command (man sudo). This is basically a non-Zope
question.

 > i don't think this is non-zope question bca'z...

   i am using python script to add user to system which works fine 
when run outside of zope ...
  but when i run it through zope as external script (with all 
permission) it's not working and returning 256 without giving any error...




as root, su zopeuser first and then try your script.
Zopeuser meaning the user account your zope runs.

Again, double and tripple check if you secured this
application in any way before opening it to the web.


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Reading GIS files(.shp, .dbx, .) into ZopeDatabase

2005-11-06 Thread Tino Wildenhain
Am Sonntag, den 06.11.2005, 17:10 -0800 schrieb Allen Huang:
> I want to Reading GIS files(.shp, .dbx, .iforget) into ZopeDatabase.
> Does anyone have any ideas how I could accomplish this? any existing
> modules? Mailing list?

Modules for python to work with GIS are usually integrated with
specialized backends, such as ArcView and friends.

I've never heard of anybody trying GIS with zope.

Its seems you are the first here :-)

I'm not saying its impossible, but you might have a lot of
work, as learning the fileformats, build parsers, create
transforming objects maybe using PIL, create specialized
index for ZCatalog and so on.

Good luck!
--Tino.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Reading GIS files(.shp, .dbx, .) into ZopeDatabase

2005-11-06 Thread Tino Wildenhain
Am Sonntag, den 06.11.2005, 17:10 -0800 schrieb Allen Huang:
> I want to Reading GIS files(.shp, .dbx, .iforget) into ZopeDatabase.
> Does anyone have any ideas how I could accomplish this? any existing
> modules? Mailing list?

PS:
Maybe 

http://pyogclib.sourceforge.net/

is something you can use too.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] useradd command in Zope

2005-11-06 Thread Tino Wildenhain
Am Montag, den 07.11.2005, 09:32 +0530 schrieb ajit mote:
> i did the same but still not working.
> 
> On 11/3/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> ajit mote schrieb:
> >  >  useradd ...
> >
> > On 11/3/05, *Andreas Jung* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > Look at the sudo command (man sudo). This is basically a
> non-Zope
> > question.
> >
> >  > i don't think this is non-zope question bca'z...
> >
> >i am using python script to add user to system which
> works fine 
> > when run outside of zope ...
> >   but when i run it through zope as external script
> (with all
> > permission) it's not working and returning 256 without
> giving any error...
> >
> 
> as root, su zopeuser first and then try your script. 
> Zopeuser meaning the user account your zope runs.
> 
> Again, double and tripple check if you secured this
> application in any way before opening it to the web.

Try harder :-)

Seriously, what should we do to help you? If something isn't
working as expected, give us the code you try, the
environment and exact error messages, preferably tracebacks.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] useradd command in Zope

2005-11-07 Thread Tino Wildenhain

ajit mote schrieb:

this is what i tried 

#External script addUser.py (stored in instance/Extensions folder)
import crypt
import os
def addUser(userName,password):
password=crypt.crypt(password,"5Ag5zoM9")
command="/usr/sbin/adduser -p "+password+" "+ userName
return os.system(command)



Heaven! Is this external method available via web? If so
be prepared for massive attack :-)
That aside you may consider md5 instead of crypt to make
it not too easy to crack (otoh, its not really important
as your script really allows for any command)


///
 attaching the application 
 exported from zope2.8.1 ,python-2.3.4-11,mysql-3.23.58-13 and   
Linux  2.6.9-1.667 


now i hope that , problem defination is very clear and open..
///


Well no, at least not your "it does not work" problem you told us.

Still missing: the call to the script as "User which runs zope"
which might be zope or nobody or something, depending on your
configuration and the way you start zope.

Add the following lines to your external method and you can
run it as script too:

if __name__=='__main__':
   import sys
   try:
user=sys.argv[1]
pass=sys.argv[2]
   except IndexError:
sys.stderr.write("Please start me with %s  
\n" % sys.argv[0])

sys.exit(20)

addUser(user,pass)



and try it like this:

su zope (or whoever your zope runs)
./yourmethod.py someuser somepass

You will see it fail (apart from the fact you need
the #!/path/to/python.bin and set the execution bit
with chmod a+x before you try)

Because you did not use sudo as adviced.

Please try to copy the way mails are cited from other
mails in this list. Dont put all your text on the
top of a full quote. Thank you.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Serve large files efficiently from a pipe

2005-11-08 Thread Tino Wildenhain

Roman Suzi schrieb:


Hi!

Newer Zope versions have an interesting ability to serve large files
efficiently given the file name ( 
http://plope.com/Members/chrism/ploneconf2004/2004pres.txt ).


What about serving large files given file(-like) handler? It could be
very beneficial sometimes, especially with dynamically generated
content...

Does Zope has anything for this?

Thank you for any ideas on this topic!


Have a look at:

http://www.dataflake.org/software/filecachemanager

it implements what you are asking for.

HTH
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


<    1   2   3   4   5   >