[Zope] Full-text search in Office/PDF

2005-04-12 Thread Robert Sösemann
Hello,

I am using a ZOPE-based application on top of the ZOPE APE 
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of 
binary storage). So the binaries are in the normal unix file system. I now need 
to extend my application to allow full-text search inside binaries document of 
the Office Word/Excel/PPT and PDF format.

In the first step, I would be happy to find a tool/python/zope module that just 
tells me that a certain string is in a document, without telling me the exact 
place of that occurence. 

Do you have solved a similar problem or know any tool to implement this 
functionality? I am looking forward to your questions.

Robert
PS: I have seen similar questions on other ZOPE lists, but they never had 
meaningful answers.
Konzeption


Gölz & Schwarz GmbH 
Waltherstr. 29, 80337 München, Germany 
phone: + 49 - (0)89 / 54 46 70 - 0 
fax: +49 - (0)89 / 54 46 70 - 10 
e-mail: [EMAIL PROTECTED] 
web: http://www.goelz.com 

Sie suchen den aktiven Dialog mit Ihren Kunden? Sie möchten neue Wege gehen, um
Ihre Zielgruppen online zu motivieren und zu binden? Dann haben wir genau das 
Richtige
für Sie: Marketing Suite - die Komplett-Lösung für intelligentes Online 
Marketing!
Informationen zur Marketing Suite erhalten Sie unter 
http://www.goelz.com/marketingsuite.
___
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] Full-text search in Office/PDF

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 9:16 Uhr +0200 Robert Sösemann 
<[EMAIL PROTECTED]> wrote:

Hello,
I am using a ZOPE-based application on top of the ZOPE APE
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of
binary storage). So the binaries are in the normal unix file system. I
now need to extend my application to allow full-text search inside
binaries document of the Office Word/Excel/PPT and PDF format.
Look at TextIIndexNG 2.
-aj


pgpu3xcc7MsCs.pgp
Description: PGP signature
___
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] Full-text search in Office/PDF

2005-04-12 Thread Marco Bizzarri
You could do that using the excellent TextIndexNG inside a ZCatalog. 
This will allow you to index all your documents inside the TextIndexNG, 
and then search them using ZCatalog.

TextIndexNG includes support for a number of plugins in order to convert 
from MS Office/PDF to text and then index them.

We're using the tool inside our project (PAFlow) and we think it is an 
excellent product.

Regards
Marco
Robert Sösemann wrote:
Hello,
I am using a ZOPE-based application on top of the ZOPE APE 
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of 
binary storage). So the binaries are in the normal unix file system. I now need 
to extend my application to allow full-text search inside binaries document of 
the Office Word/Excel/PPT and PDF format.
In the first step, I would be happy to find a tool/python/zope module that just tells me that a certain string is in a document, without telling me the exact place of that occurence. 

Do you have solved a similar problem or know any tool to implement this 
functionality? I am looking forward to your questions.
Robert
PS: I have seen similar questions on other ZOPE lists, but they never had 
meaningful answers.
Konzeption

Gölz & Schwarz GmbH 
Waltherstr. 29, 80337 München, Germany 
phone: + 49 - (0)89 / 54 46 70 - 0 
fax: +49 - (0)89 / 54 46 70 - 10 
e-mail: [EMAIL PROTECTED] 
web: http://www.goelz.com 

Sie suchen den aktiven Dialog mit Ihren Kunden? Sie möchten neue Wege gehen, um
Ihre Zielgruppen online zu motivieren und zu binden? Dann haben wir genau das Richtige
für Sie: Marketing Suite - die Komplett-Lösung für intelligentes Online Marketing!
Informationen zur Marketing Suite erhalten Sie unter http://www.goelz.com/marketingsuite.
___
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 )
 

___
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] "The Zope Book"

2005-04-12 Thread Dario Lopez-Kästen
Chris McDonough wrote:
I don't think anyone has given much thought to actually documenting all
these nice nifty features in 2.9.  Which is no change from the norm, and
it will be a fairly organic process again.  I hate it, but whatever.
- C
Speaking of which, and being one of the people that promised to deliver 
but has not done so 100% yet, is it possible to checkout the Zope Book 
from cvs or svn?

That'd help a lot in terms of incrementally adding stuff, at least for me.
Thanks,
/dario
--
-- ---
Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech.
"...and click? damn, I need to kill -9 Word again..." - b using macosx
___
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 namespace problem (was: dtml-tree issue)

2005-04-12 Thread Vangelis Mihalopoulos
Just added__allow_access_to_unprotected_subobjects__=1as an 
attribute of my class defined in an external python script and it works 
fine.

Thanks Tino!
Tino Wildenhain wrote:
Hi,
Am Montag, den 11.04.2005, 14:08 +0300 schrieb Vangelis Mihalopoulos:
 

Andreas Jung wrote:
   

You should *not* define classes inside PythonScripts. PythonScripts 
are stricted
and don't provide the full functionality. Either use filesystem based 
code (Zope
Product) or use simple Python datatypes as dictionaries in this case.
 

An External Method behaves exactly the same. I have not yet involved in 
writting even the simpler Product and i will not do it now for such a 
trivial issue.

I tried to return a dictionary,
-  return {'a':1, 'b':2, 'c':3}  --
but it the DTML Doc fails with a KeyError.
   

Use a dict and if you really need DTML... see the keyword
"mapping" for  and  tags.
If you want to return custom class objects into untrusted
code (e.g. from external methods) you need to set security
declarations on them - at least add the attribute:
__allow_access_to_unprotected_subobjects=1 

(from top of head - just grep -r zopes source
for the actual name)
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 )


[Zope] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:


RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect dont work.

where am i wrong.
-- 
Share the vision of difference with ME
___
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 )


[Zope] developer docs

2005-04-12 Thread Milos Prudek
What are the best documents for creating Zope products?
I know Zope Book very well and I write TTW scripts. I need to convert a 
bunch of ZClasses into Products.

ZDG seems very outdated. Should I start with mxmEasyProduct and then 
read ZDG? Is there a book available in bookshops that is better than ZDG 
and contains all required information for building products?

--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 13:46 Uhr +0200 Milos Prudek <[EMAIL PROTECTED]> 
wrote:
ZDG seems very outdated. Should I start with mxmEasyProduct and then read
ZDG? Is there a book available in bookshops that is better than ZDG and
contains all required information for building products?
Why is it out-dated? Most things are still valid. If not, point them out to 
be
corrected or even better: help producing a never version of the ZDG.

-aj


pgpqlq85nAKML.pgp
Description: PGP signature
___
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] "The Zope Book"

2005-04-12 Thread Chris McDonough
No, sorry.  THe canonical version is on the web.

- C

On Tue, 2005-04-12 at 04:10, Dario Lopez-KÃsten wrote:
> Chris McDonough wrote:
> > I don't think anyone has given much thought to actually documenting all
> > these nice nifty features in 2.9.  Which is no change from the norm, and
> > it will be a fairly organic process again.  I hate it, but whatever.
> > 
> > - C
> > 
> 
> Speaking of which, and being one of the people that promised to deliver 
> but has not done so 100% yet, is it possible to checkout the Zope Book 
> from cvs or svn?
> 
> That'd help a lot in terms of incrementally adding stuff, at least for me.
> 
> Thanks,
> 
> /dario

___
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] developer docs

2005-04-12 Thread Milos Prudek
> Why is it out-dated? Most things are still valid. If not, point them out
> to be
> corrected or even better: help producing a never version of the ZDG.
Hello Andreas,
This kind of response is so common that it deserves a shortcut of its 
own. Such as RTFM. You essentially told me to f*k off. But I did not 
attack ZDG.

ZDG has some outdated parts. You admit that. By following it, I will 
create incorrect code or use obsolete constructs. At least that is what 
reader comments say in ZDG. Well, I do not want to create obsolete 
constructs.

I am looking for a book that will help me. That is all.
--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Andreas Jung
--On Dienstag, 12. April 2005 15:02 Uhr +0200 Milos Prudek <[EMAIL PROTECTED]> 
wrote:

 > Why is it out-dated? Most things are still valid. If not, point them
out
 > to be
 > corrected or even better: help producing a never version of the ZDG.
Hello Andreas,
This kind of response is so common that it deserves a shortcut of its
own. Such as RTFM. You essentially told me to f*k off. But I did not
attack ZDG.
I never said that - neither directly nor between the lines.
ZDG has some outdated parts. You admit that.
I haven't had the ZDG in my hands lately. But from that what  I have in 
memory
most things are still true because the basic haven't changed. If yes, point
them out instead of make such comments.

By following it, I will
create incorrect code or use obsolete constructs. At least that is what
reader comments say in ZDG. Well, I do not want to create obsolete
constructs.
It is your good right to expect documentation but documentation has to be 
written
and maintained. Means: someone has to volunteer and take over *some* 
responsibilities.
Complaining about missing, out-dated docs or whatever is one side of the 
medal, helping
to improve thing is the other side *wink*

And don't be pissed off when I try to point out that "the community" also 
has to take over
some tasks instead of only having expectations.

-aj


pgpJyb5lG9Uuy.pgp
Description: PGP signature
___
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] developer docs

2005-04-12 Thread Cliff Ford
Milos Prudek wrote:
What are the best documents for creating Zope products?
I know Zope Book very well and I write TTW scripts. I need to convert a 
bunch of ZClasses into Products.

ZDG seems very outdated. Should I start with mxmEasyProduct and then 
read ZDG? Is there a book available in bookshops that is better than ZDG 
and contains all required information for building products?

I don't know about best documents! There is a minimal Product How To:
http://www.zope.org/Members/maxm/HowTo/minimal_01/
Faced with the same problem (conversion of ZClasses to file system 
Products), I decided to have a look at Zope3X. There are a couple of 
good new books with worked examples - but as soon as I stepped off the 
guided path I found myself struggling. Still, I think I can see how to 
go from 2.7 to 3 and not bother with ZClasses.

Cliff
___
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] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 09:47, Cliff Ford wrote:
> Faced with the same problem (conversion of ZClasses to file system
> Products), I decided to have a look at Zope3X. There are a couple of
> good new books with worked examples - but as soon as I stepped off the
> guided path I found myself struggling. Still, I think I can see how to
> go from 2.7 to 3 and not bother with ZClasses.

I'll note that we *try* to answer questions on the zope3-users mailing list in 
a timely fashion. If noone response to your question there, it is usually 
because it is a harder problem. ;-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] developer docs

2005-04-12 Thread Milos Prudek
> It is your good right to expect documentation but documentation has to
> be written
I've written about 50 pages of rather detailed documentation for Zope 
Page Templates and it is available online at www.root.cz. But not in 
English. So I know, understand and follow the concept you mentioned.

I do not feel I can contribute to ZDG at this time. Is there any other 
resource you can recommend, please?

--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Milos Prudek

I'll note that we *try* to answer questions on the zope3-users mailing list in 
a timely fashion. If noone response to your question there, it is usually 
because it is a harder problem. ;-)
I found out that you wrote a book about Zope 3 that gather raving 
reviews on Amazon. Does the book contain all info required to develop 
products (or whatever are they called in Zope 3) for Zope 3?

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 11:01, Milos Prudek wrote:
> > I'll note that we *try* to answer questions on the zope3-users mailing
> > list in a timely fashion. If noone response to your question there, it is
> > usually because it is a harder problem. ;-);-)
>
> I found out that you wrote a book about Zope 3 that gather raving
> reviews on Amazon. Does the book contain all info required to develop
> products (or whatever are they called in Zope 3) for Zope 3?

Yes. In Zope X3.0 you can only develop filesystem-based Python packages, so in 
fact this is all the book covers. Section C has a fairly complex example of a 
message board application, complete with simple and containerish content 
objects. Other sections of the book cover the development of different 
components using filesystem-based development.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] developer docs

2005-04-12 Thread Milos Prudek
I don't know about best documents! There is a minimal Product How To:
http://www.zope.org/Members/maxm/HowTo/minimal_01/
That's exactly what I was looking for. Thanks!
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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 )


[Zope] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Hi,

I'm trying to import and use the email.Message.Message class in a zope
'Script (Python)'.

I have the following security assertions in my product code::

  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo

  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  allow_class(Message)

As a result, I can successfully import like::

  from email.Message import Message

I can even create an instance and call most methods on it::

  m = Message()
  m.set_payload('read that')

However, when I try to use the mapping interface, I get an error.  For
example, the following::

  m['from'] = '[EMAIL PROTECTED]'

produces a traceback like::

  Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 323, in _exec
Module None, line 6, in AAA
 - 
 - Line 6
Module RestrictedPython.Guards, line 96, in handler
  TypeError: object does not support item or slice assignment

Does anyone have any idea what the problem is?


Tim

ps Not subscribed here, so please do cc me with replies.
___
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] Security on email.Message.Message

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 16:18 Uhr +0100 Tim Hicks 
<[EMAIL PROTECTED]> wrote:

Hi,
I'm trying to import and use the email.Message.Message class in a zope
'Script (Python)'.
I have the following security assertions in my product code::
  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo
  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  allow_class(Message)
As a result, I can successfully import like::
  from email.Message import Message
I can even create an instance and call most methods on it::
  m = Message()
  m.set_payload('read that')
However, when I try to use the mapping interface, I get an error.  For
example, the following::
  m['from'] = '[EMAIL PROTECTED]'
produces a traceback like::
  Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 323, in _exec
Module None, line 6, in AAA
 - 
 - Line 6
Module RestrictedPython.Guards, line 96, in handler
  TypeError: object does not support item or slice assignment
Does anyone have any idea what the problem is?
Move your code into an external method which is less painful than dealing
with module security issues. As an alternative: look at TrustedExecutables.
-aj

pgpIV267dYumO.pgp
Description: PGP signature
___
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] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Andreas Jung said:

>> Module RestrictedPython.Guards, line 96, in handler
>>   TypeError: object does not support item or slice assignment
>>
>> Does anyone have any idea what the problem is?
>
> Move your code into an external method which is less painful than dealing
> with module security issues. As an alternative: look at
> TrustedExecutables.

Thanks Andreas.

I suppose I could move the code to a product (which I would prefer over an
external method), but it seems a little heavy-weight for my requirements.

In fact, generally, I think I would like to be able to use
email.Message.Message instances in TTW code, so if anyone does know what's
going wrong here, I'd be most pleased to hear.

Tim

ps Is it me or is the traceback I'm seeing not particularly helpful?  I
mean, I know that these objects *do* support the dictionary interface!
___
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] developer docs

2005-04-12 Thread Milos Prudek
Yes. In Zope X3.0 you can only develop filesystem-based Python packages, so in 
Well, then your book debuted at number 1 on my book shopping list.
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 11:47, Milos Prudek wrote:
> > Yes. In Zope X3.0 you can only develop filesystem-based Python packages,
> > so in
>
> Well, then your book debuted at number 1 on my book shopping list.

Cool. :-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
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] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Andreas Jung said:

>> Module RestrictedPython.Guards, line 96, in handler
>>   TypeError: object does not support item or slice assignment
>>
>> Does anyone have any idea what the problem is?

Digging further...

I made the TypeError a little more revealing on line 96 of
RestrictedPython/Guards.py so it now shows the 'secattr' (method) being
accessed, and its args::

def handler(self, *args):
try:
f = getattr(self.ob, secattr)
except AttributeError:
raise TypeError, '%s | %s | %s' % (error_msg, secattr,
str(args))

The value of 'secattr' is apparently '__guarded_setitem__' in my case. 
So, it seems that the email.Message.Message class does not have a
__guarded_setitem__ on it.  This is unsurprising.  I assume that it is
supposed to get added during zope initialisation somewhere, right?  Can
anybody point out where?

Tim
___
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] developer docs

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:37:58PM +0200, Milos Prudek wrote:
> I do not feel I can contribute to ZDG at this time. Is there any other 
> resource you can recommend, please?

ZDG is really it.  It could use some cleanup to fold in the
comments and errata that are posted to the online version.
For now, just read the ZDG and heed the comments.

I personally do not use mxmEasyProduct. I did at one point, but I found
that while it's a timesaver for trivial things, I ended up having to
understand plain old Product development anyway, anytime I wanted to do
something different, plus I had to figure out how mxmMinimal worked.
That's typical of frameworks that hide details from you...
great until you want the details back ;-)

Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
used the "old-style" security declarations.  Instead
of an __ac_permissions__ attribute, you should use
ClassSecurityInfo as shown in, well, just about any Product
you have lying around.)

I know, this all screams for an organized, updated effort :-(

-- 

Paul Winkler
http://www.slinkp.com
___
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] developer docs

2005-04-12 Thread Milos Prudek
Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
Oh yes, I will look at those. Thanks for the supporting documentation in 
your post.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Tim Hicks said:
> Andreas Jung said:
>
>>> Module RestrictedPython.Guards, line 96, in handler
>>>   TypeError: object does not support item or slice assignment
>>>
>>> Does anyone have any idea what the problem is?
>
> Digging further...
>
> I made the TypeError a little more revealing on line 96 of
> RestrictedPython/Guards.py so it now shows the 'secattr' (method) being
> accessed, and its args::
>
> def handler(self, *args):
> try:
> f = getattr(self.ob, secattr)
> except AttributeError:
> raise TypeError, '%s | %s | %s' % (error_msg, secattr,
> str(args))
>
> The value of 'secattr' is apparently '__guarded_setitem__' in my case.
> So, it seems that the email.Message.Message class does not have a
> __guarded_setitem__ on it.  This is unsurprising.  I assume that it is
> supposed to get added during zope initialisation somewhere, right?  Can
> anybody point out where?

Well, I've fixed this with an awful hack.  My security assertions now look
like::

  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo

  def _secure_mapping(klass):
  """XXX Awful hack!!
  """
  klass.__guarded_getitem__ = klass.__getitem__
  klass.__guarded_setitem__ = klass.__setitem__
  klass.__guarded_delitem__ = klass.__delitem__

  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  _secure_mapping(Message)
  allow_class(Message)

That gets me to where I want (for now).  I'd still love the 'correct'
answer though.


Tim

___
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] Session without cookies.

2005-04-12 Thread Fernando Lujan
Jens Vagelpohl wrote:
On Apr 12, 2005, at 1:02, Fernando Lujan wrote:
The URL "test1" in the form tag is obviously *not* generated by 
Zope. You put it in there manually. So it cannot work as you expect.

Hum, I see. Just web pages that aren't dinamically generated by Zope. 
For instance, other DTML document will not keep the Session. Is this 
correct?

No, you misunderstand what Chris said earlier. You need to let Zope 
generate the URL. In this case, instead of just saying...


you could do
">
of course that's ugly because it looks like putting a tag inside a 
tag, ZPT is much nicer that way:



Thanks, jens... Now I acquire my goal! ;)
Fernando Lujan

___
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 )


[Zope] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Hi again people,
I've just read the article about SESSIONS in the upcoming ZOPE Book 2.7.
Here, we have ZEO running, and I need to use SESSION and ZEO. I read the 
article http://www.zope.org/Members/randy/ZEO-Sessions.

Isn't there a easy way to do this? I was wondering if I couldn just 
createa new filestorage entry in the zeo.conf, and add some lines in my 
zope.conf file.

Thanks.
Fernando Lujan
___
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] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
Yes.

All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until "At this time you should be able to navigate to the
/session_storage folder..." in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a "ZODB Mount
Point" from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)

- C


___
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 )


[Zope] Q: Embedding documentation in Page Templates?

2005-04-12 Thread Stephen Nesbitt
All:

Does anyone know of a way of embedding documentation directly into a page 
template without using ? In other words is there some construct which 
tells the rendering engine to simply ignore some content.?

Thanks,

-steve
-- 


Stephen Nesbitt
Senior Configuration Management Engineer
The Cobalt Group
[EMAIL PROTECTED]
x8271
___
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] Q: Embedding documentation in Page Templates?

2005-04-12 Thread J Cameron Cooper
Stephen Nesbitt wrote:
All:
Does anyone know of a way of embedding documentation directly into a page 
template without using ? In other words is there some construct which 
tells the rendering engine to simply ignore some content.?
I usually use
 
  comment in here
 
There are other constructs, but I think this is most reasonable.
The tag can be anything, of course::
 
  comment in here
 
Come to think of it, that's a few less keystrokes. This is even shorter::
 
  comment in here
 
	--jcc
___
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] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Chris McDonough wrote:
Yes.
All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until "At this time you should be able to navigate to the
/session_storage folder..." in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a "ZODB Mount
Point" from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)
 

Please, take a look in what I've done! Is that right? It works pretty 
fine here! :-)

If this is right, are there a desire for a how-to? I think I can write 
one, once it's pretty simple as you said.

zope.conf

 mount-point /temp_folder
 container-class Products.TemporaryFolder.TemporaryContainer
 # ZODB cache, in number of objects
 cache-size 5000
 
   server localhost:8100
  storage 1
   name zeostorage
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 


 mount-point /
 # ZODB cache, in number of objects
 cache-size 5000
 
   server localhost:8100
  storage 2
   name zeotemporary
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 


zeo.conf
# ZEO configuration file
%define INSTANCE /home/flujan/tmp/zeo

 address 8100
 read-only false
 invalidation-queue-size 100
 # monitor-address PORT
 # transaction-timeout SECONDS


 path $INSTANCE/var/Data.fs


 path $INSTANCE/var/SessionData.fs


 level info
 
   path $INSTANCE/log/zeo.log
 


 program $INSTANCE/bin/runzeo
 socket-name $INSTANCE/etc/zeo.zdsock
 daemon true
 forever false
 backoff-limit 10
 exit-codes 0, 2
 directory $INSTANCE
 default-to-interactive true
 # user zope
 python /usr/bin/python2.3
 zdrun /usr/local/zope-2.7.5/lib/python/zdaemon/zdrun.py
 # This logfile should match the one in the zeo.conf file.
 # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it.
 logfile $INSTANCE/log/zeo.log

___
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] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 18:23, Fernando Lujan wrote:
> Please, take a look in what I've done! Is that right? It works pretty 
> fine here! :-)

If it works for you, it's right. ;-)

> 
> If this is right, are there a desire for a how-to? I think I can write 
> one, once it's pretty simple as you said.

Sure, if you'd like... we could point to it from that chapter...

- C


___
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] Q: Embedding documentation in Page Templates?

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:49:26PM -0500, J Cameron Cooper wrote:
> Stephen Nesbitt wrote:
> >All:
> >
> >Does anyone know of a way of embedding documentation directly into a page 
> >template without using ? In other words is there some construct 
> >which tells the rendering engine to simply ignore some content.?
> 
> I usually use
> 
>  
>   comment in here
>  
> 
> There are other constructs, but I think this is most reasonable.
> 
> The tag can be anything, of course::
> 
>  
>   comment in here
>  
> 
> Come to think of it, that's a few less keystrokes. This is even shorter::
> 
>  
>   comment in here
>  

Of those, I like your first: it explicitly says "comment".
Even somebody unfamiliar with ZPT can probably figure out
what that means.
 
-- 

Paul Winkler
http://www.slinkp.com
___
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] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 05:47 am, Fernando Lujan wrote:
> Isn't there a easy way to do this? I was wondering if I couldn just
> createa new filestorage entry in the zeo.conf, and add some lines in my
> zope.conf file.

Is there a viable non-versioned alternative to the filestorage approach? My 
sessions database grows ridiculously quickly. I'm also fairly sure it's 
causing problems when my site gets ~5 requests a second (yes, that low)

Maybe one of these days I'll have time to look into SQLSession, but I'm not 
sure how well it will be able to replace the core session handling (and it 
does need to seamlessly replace it). I wonder how hard it'd be to write a new 
Session Data Manager using an RDBMS as the backend, or even just a filesystem 
approach that didn't use versioning. *shrug*. Mmm. Transactions.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXFUJrGisBEHG6TARAphlAJ4hp/D6u0l/7G1MEhuEsLgykYASfACeNDm0
2CngEMS5lvja4vf2lSuCP5U=
=+7Se
-END PGP SIGNATURE-
___
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 )


[Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Gautam Saha
Hi:
I am getting a METALError when I try to do use-macro in ZPT.
Here is my code  in main_template.pt
.
..
 
 
 
 


The first  use-macro works (as I put the full macro path), But the 2nd 
call does not work
and giving the error.
I am basically returning  'here/subtab/macros/tools_sub' from the 
getSubTab() py
script. ( my script has one line for testing - return  
'here/subtab/macros/tools_sub'

Any help to resolve this is greatly appreciated.
Thanks,
Gautam
---
Zope/Plone spec:
Zope Version: (Zope 2.7.3-0, python 2.3.4, freebsd5)
Python Version: 2.3.4 (#2, Oct 21 2004, 17:49:27) [GCC 3.3.3 [FreeBSD] 
20031106]
Plone 2.0.4

===
Site Error
An error was encountered while publishing this resource.
METALError
Sorry, a site error occurred.
Traceback (innermost last):
   * Module ZPublisher.Publish, line 175, in publish_module_standard
   * Module Products.PlacelessTranslationService.PatchStringIO, line 
51, in new_publish
   * Module ZPublisher.Publish, line 132, in publish
   * Module Zope.App.startup, line 204, in zpublisher_exception_hook
   * Module ZPublisher.Publish, line 101, in publish
   * Module ZPublisher.mapply, line 88, in mapply
   * Module ZPublisher.Publish, line 39, in call_object
   * Module Products.CMFCore.PortalContent, line 116, in __call__
   * Module Shared.DC.Scripts.Bindings, line 306, in __call__
   * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   * Module Products.CMFCore.FSPageTemplate, line 191, in _exec
   * Module Products.CMFCore.FSPageTemplate, line 124, in pt_render
   * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
 
   * Module TAL.TALInterpreter, line 190, in __call__
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 664, in do_useMacro

METALError: macro 'python:here.getSubTab()' has incompatible version 
None, at line 88, column 4 (Also, an error occurred while attempting to 
render the standard error message.)

___
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] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Andrew Milton
+---[ Gautam Saha ]--
| Hi:
| 
| I am getting a METALError when I try to do use-macro in ZPT.
| 
| Here is my code  in main_template.pt
| .
| ..

[snip]

|  
|  
| 
| 
| 

[snip]

| I am basically returning  'here/subtab/macros/tools_sub' from the 
| getSubTab() py
| script. ( my script has one line for testing - return  
| 'here/subtab/macros/tools_sub'
| 
| Any help to resolve this is greatly appreciated.

You actually have to return a macro, not a string representing the path to the
macro. Your script will have to return here.subtab.macros['tools_sub']
I think that's the right format.

-- 
Andrew Milton
[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] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 09:44 am, you wrote:
> On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
> > Is there a viable non-versioned alternative to the filestorage approach?
> > My sessions database grows ridiculously quickly. I'm also fairly sure
> > it's causing problems when my site gets ~5 requests a second (yes, that
> > low)
>
> You could use temporarystorage on the ZEO server if you don't really
> need your session data to be persistent across ZEO server restarts.
> This is what Fernando appeared to do in the end.

Having sessions persist across ZEO restarts is a handy thing.

Also, I never figured how to configure a temp storage in a ZEO server. I 
started looking once, but either ran into a dead end or got distracted (or 
both ;)


> There are no well-maintained nonundoing storages that I know of other
> than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
> to work, but its gone the way of the dinosaurs apparently.

And I distrust anything related to Berkely DB :)


> I think any sessioning setup that uses a ZEO-backed storage will be more
> conflict-prone than one that doesn't use ZEO, just because the
> transaction commit time is typically longer.  I'm not sure if this is
> the problem you mention.

Could be.


> Probably not hard.  You could write a "session data manager"
> implementation that used a relational database.  The interface for those
> things is in Products/Sessions/SessionInterfaces.py

Yeah, I remember poking around that code way back, and it seemed reasonable. 
Its interactions with transactions are the bits that scare me. Using a 
standard RDBMS connection would probably solve that though.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXGFkrGisBEHG6TARAkp7AJ9xavG5iY4wQjGLkdjGmvqxn/mDoACfRXsh
5vLa0EwojCSZlBAi7e1Vuqo=
=WTon
-END PGP SIGNATURE-
___
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] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
> Is there a viable non-versioned alternative to the filestorage approach? My 
> sessions database grows ridiculously quickly. I'm also fairly sure it's 
> causing problems when my site gets ~5 requests a second (yes, that low)

You could use temporarystorage on the ZEO server if you don't really
need your session data to be persistent across ZEO server restarts. 
This is what Fernando appeared to do in the end.

There are no well-maintained nonundoing storages that I know of other
than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
to work, but its gone the way of the dinosaurs apparently.

I think any sessioning setup that uses a ZEO-backed storage will be more
conflict-prone than one that doesn't use ZEO, just because the
transaction commit time is typically longer.  I'm not sure if this is
the problem you mention.

> Maybe one of these days I'll have time to look into SQLSession, but I'm not 
> sure how well it will be able to replace the core session handling (and it 
> does need to seamlessly replace it). I wonder how hard it'd be to write a new 
> Session Data Manager using an RDBMS as the backend, or even just a filesystem 
> approach that didn't use versioning. *shrug*. Mmm. Transactions.

Probably not hard.  You could write a "session data manager"
implementation that used a relational database.  The interface for those
things is in Products/Sessions/SessionInterfaces.py

- C


___
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 )


[Zope] Re: ZEO and Sessions.

2005-04-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Richard Jones wrote:
> On Wed, 13 Apr 2005 09:44 am, Chris McDonough wrote:

>>>Probably not hard.  You could write a "session data manager"
>>>implementation that used a relational database.  The interface for those
>>>things is in Products/Sessions/SessionInterfaces.py
> 
> 
> Yeah, I remember poking around that code way back, and it seemed reasonable. 
> Its interactions with transactions are the bits that scare me. Using a 
> standard RDBMS connection would probably solve that though.


I revisited the SQLSession product a year ago for a consuling customer,
making their hacked version a drop-in replacement for the transient
storage.  I can't release their code, but I maybe learned enough then to
redo the task as a "PluggableSessions" product, using the
"PluginRegistry" product to manage the different requried bits.


Tres.
- --
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  "Zope Dealers"   http://www.zope.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCXGYNGqWXf00rNCgRAqgqAJ9YjRNE1yqZKOXrl4nWlLCNaa/LvwCffVLH
nqNZzuOutIv9hMTkIWfPu1w=
=rrHr
-END PGP SIGNATURE-
___
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] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 20:01, Richard Jones wrote:
> On Wed, 13 Apr 2005 09:44 am, you wrote:
> > On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
> > > Is there a viable non-versioned alternative to the filestorage approach?
> > > My sessions database grows ridiculously quickly. I'm also fairly sure
> > > it's causing problems when my site gets ~5 requests a second (yes, that
> > > low)
> >
> > You could use temporarystorage on the ZEO server if you don't really
> > need your session data to be persistent across ZEO server restarts.
> > This is what Fernando appeared to do in the end.
> 
> Having sessions persist across ZEO restarts is a handy thing.

Yup.  I've not really needed it so far, but if you need it, you need
it...

> Also, I never figured how to configure a temp storage in a ZEO server. I 
> started looking once, but either ran into a dead end or got distracted (or 
> both ;)

Probably something like what Fernando had on the client:


  mount-point /foo/bar
  # ZODB cache, in number of objects
  cache-size 5000
  
server localhost:8999
storage temp
name zeotemporary
var $INSTANCE/var
# ZEO client cache, in bytes
cache-size 20MB
# Uncomment to have a persistent disk cache
#client zeo1
  


And in the ZEO server's zeo.conf file:

%import tempstorage

   name sessions


This resource is useful too:

http://longsleep.org/howto/sharesessionwithzeo

> > There are no well-maintained nonundoing storages that I know of other
> > than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
> > to work, but its gone the way of the dinosaurs apparently.
> 
> And I distrust anything related to Berkely DB :)

I hear ya! ;-)

> > I think any sessioning setup that uses a ZEO-backed storage will be more
> > conflict-prone than one that doesn't use ZEO, just because the
> > transaction commit time is typically longer.  I'm not sure if this is
> > the problem you mention.
> 
> Could be.

It'd be pretty obvious with an inordinate number of conflict errors in
the event log.  "inordinate" is relative, though, so I'm not sure what
to name as a number per minute for your app.  You can get a sense of
what's normal under contrived load by reading:

http://www.plope.com/Members/dunny/conflicts/view

> > Probably not hard.  You could write a "session data manager"
> > implementation that used a relational database.  The interface for those
> > things is in Products/Sessions/SessionInterfaces.py
> 
> Yeah, I remember poking around that code way back, and it seemed reasonable. 
> Its interactions with transactions are the bits that scare me. Using a 
> standard RDBMS connection would probably solve that though.

Yeah.  Probably OK to use a ZRDB connection, those are controlled
automatically.

- C


___
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 )


[Zope] too big data.fs

2005-04-12 Thread Jianping Zhu
I have redhat 9.0 with zope on it. the size data.fs is 3.2 GB. my
question is
1. how can find to size of folder and file inside data.fs, So i can ask
the idiot who upload large file to zope to delete it.

2, Recentlt i often get troulble of  losing network connection of my
redhat server, is there any relation between the large data.fs and the
disconnetion?

Thanks
___
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] too big data.fs

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 22:06 Uhr -0400 Jianping Zhu 
<[EMAIL PROTECTED]> wrote:

I have redhat 9.0 with zope on it. the size data.fs is 3.2 GB. my
question is
3.2 GB is nothing I would call *large* or *big*.

1. how can find to size of folder and file inside data.fs, So i can ask
the idiot who upload large file to zope to delete it.
There are some tools in the Zope distro (utitlites/zodbtools I think) to 
dump
a Data.fs file and to figure out details.

2, Recentlt i often get troulble of  losing network connection of my
redhat server, is there any relation between the large data.fs and the
disconnetion?
Unlikely.
-aj


pgpieA9sOcJpV.pgp
Description: PGP signature
___
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 )


[Zope] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:

RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect didn't work. where am i wrong?
all the files are in same folder

-- 
Share the vision of difference with ME
___
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 )