[Zope] z3c.dav issues

2008-09-18 Thread Jayarajan Jn
Hi friends,
i am doing some prototypes to try webDAV with zope3. I am using z3c.extfile
to store files.

I tried the zope.app.dav that is coming along with z3 distribution. it works
fine for zope.app.file and zope.app.folder. it partialy works with
z3c.extfile too. ie, i can download extfiles

Anyways i saw in http://pypi.python.org/pypi/zope.app.dav/3.4.1 that z3c.dav
is advanced than zope.app.dav. So i tries z3c.dav also. But i got error
while accessing the / folder  through webDAV.

I have been using debian's(Gnome) local filesystem browser to do this

but i get the following error on my weDAV client
"""
cannot open '/'

The filename "/" indicates that this file is of type "x-directory/webdav".
The contents of the file indicate that the file is of type "HTML document".
If you open this file, the file might present a security risk to your
system.

Do not open the file unless you created the file yourself, or received the
file from a trusted source. To open the file, rename the file to the correct
extension for "HTML document", then open the file normally. Alternatively,
use the Open With menu to choose a specific application for the file.
"""


May be i am missing something :?

This is  how i proceeded
1) started the zopeserver
2) connected to it via webDAV with server:localhost, port:8080, user:admin.
3) it works fine and displays the content of root folder. I can view,add,
delete download etc..But its done by zope.app.dav

now same thing with z3c.dav
1) (easy_install -N)ed z3c.dav, z3c.etree, z3c.conditionalviews
2) included the z3c.dav package and disabled zope.app.dav . (inside
package-include)
3) try to access server through webDAV (exactly same as before)
now it fires above said error.

can any one tell me where i am missing?
i have seen the z3c.davapp.* packages. Is there any work going to support
extfile like this? i have adapted the z3c.davapp.zopeappfile codes to write
a similar package for z3c.extfile too. But i cant test it properly if
z3c.dav itself is not working for me :/


Note: i am using zope3.3.1+py2.4 setup

And like many others demand i also would like to see a HOWTO for z3c.dav.

Thanks to all in advance.
jayaraj.
___
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 error getting Plone running on HP UX

2008-09-18 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

sjcurt02 wrote:
> sjcurt02 wrote:
> import distutils
> distutils.sysconfig.get_config_vars()['CONFIG_ARGS']
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> AttributeError: 'module' object has no attribute 'sysconfig'
>>
> 
> 
> I finally understand what was meant.  This worked for me:
> 
 from distutils import sysconfig
 sysconfig.get_config_vars()['CONFIG_ARGS']
> 
> but it produced no output because I configured python without specifying any
> arguments using default values instead.  I grepped through the Makefile and
> config.log and didn't see anything about specifying a value for the stack
> size.  What configure options affect the python stack size?

I don't know:  I *do* know that the "standard" Python build on FreeBSD
some years back routinely caused bus errors / segfaults when running
Zope:  they would come at seemingly arbitrary points, and were solely
due to the stack size.



Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI0xh9+gerLs4ltQ4RAkOdAKDYYekNcpFwVOpqymKf5BDa7bNs8ACgjVJg
V9vM2Yqq0ncG/tzz67NzFQk=
=aD0g
-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] Zope error getting Plone running on HP UX

2008-09-18 Thread sjcurt02

sjcurt02 wrote:
 import distutils
 distutils.sysconfig.get_config_vars()['CONFIG_ARGS']
> Traceback (most recent call last):
>   File "", line 1, in ?
> AttributeError: 'module' object has no attribute 'sysconfig'
> 


I finally understand what was meant.  This worked for me:

>>> from distutils import sysconfig
>>> sysconfig.get_config_vars()['CONFIG_ARGS']

but it produced no output because I configured python without specifying any
arguments using default values instead.  I grepped through the Makefile and
config.log and didn't see anything about specifying a value for the stack
size.  What configure options affect the python stack size?


-- 
View this message in context: 
http://www.nabble.com/Zope-error-getting-Plone-running-on-HP-UX-tp19464280p19564772.html
Sent from the Zope - General mailing list archive at Nabble.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] [ZODB-Dev] Zope memory usage

2008-09-18 Thread Dieter Maurer
Manuel Vazquez Acosta wrote at 2008-9-17 20:05 -0400:
>Alan,
>
>I'm replying to the Zope list also, because this issue is perhaps
>related to other components there.
>
>I'm running into the same situation: The python process running my Plone
>site is steadyly growing.
>
>I'm using Zope2.9.8-final (the one which works with Plone 2.5.5).
>
>What is the plan for Zope include such feature?

I expect the feature will land in ZODB 3.9 and then probably in Zope 2.12.
>
>Best regards,
>Manuel.
>
>Alan Runyan wrote:
>> There was a recent modification to limit the ZODB cache to a set size.  i.e.
>> Limit the size of memory usage to 128MB.
>> 
>> The original feature was implemented here:
>>   http://svn.zope.org/ZODB/branches/dm-memory_size_limited-cache/
>> 
>> You can get the feature+3.8 branch of the ZODB from:
>>   http://svn.zope.org/ZODB/branches/zcZODB-3.8/
>> 
>> The changes are also on trunk (will be ZODB 3.9).



-- 
Dieter
___
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 access the content of a file in a test suite in a portable way

2008-09-18 Thread Israel Saeta PĂ©rez
On Thu, Sep 18, 2008 at 4:16 AM, Marco Bizzarri
<[EMAIL PROTECTED]> wrote:
> Thanks, Peter; but that does not work inside a test case run as:
>
> python tests/testMyTestSuite.py
>
>
> I'm using at the moment:
>
>
>def product_prefix(self):
>return sys.modules['Products.MyProduct'].__path__[0]
>
>
> but I'm not sure if it is an horrible hack or now.


What about yourmodule.__file__ ?

-- Israel
___
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 suppress http based authentication window of zope

2008-09-18 Thread Josef Meile
>  Yes you are  correct it reset the authenticate cookies but from 
> logout from  zope it
> call zmi_logout  beacuse of that  again login window prompt I just 
> want to redirect to the login page  and also i want user must be logut .
>  As per my knowledge It not possible because  session is maintaind by 
> client browser.
> If you have any information Pleaase help me.
Ah, you are log in into the zmi. I thoght that you were talking about
non manager users accessing a protected zope content. For this case the
CookieCrumbler logout form will work. Well, then I guess you will have
to close the browser. I don't know any other solution.
___
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 suppress http based authentication window of zope

2008-09-18 Thread vaibhav pol
On Thu, Sep 18, 2008 at 1:59 PM, Josef Meile <[EMAIL PROTECTED]> wrote:

> Hi,
>
> > Thank you for replay . yes I know that product is using cookie
> > based authentication.I want to know that is any work go around to
> > support zope cookie based or form based authentication.
> >Well, I think it won't be included to zope source code. Why to do it?
> >There is already two products for that: CookieCrubmbler and
> >SessionCrubmbler.
>
> >   I also I used CookieCrubmbler for Cookie based authentication.
> >   It Modify the request and server response and edit the header but
> > because by using that we can suppress login window of browser but at the
> > time logout it not modify the server response server send the Basic
> > Authentication with 401 code .
> > By seeing that browser kill user session I want is any other way to
> > kill user session.
> >  means by sending any response or can i kill user session
> >I just don't know if this is correct, but as I understand, at the logout
> >time, what the CookieCrumbler does is to reset the authentication
> >cookies. I used it on the past and it worked. I don't know what problem
> >are you having.


 Yes you are  correct it reset the authenticate cookies but from logout
from  zope it
call zmi_logout  beacuse of that  again login window prompt I just want
to redirect to the login page  and also i want user must be logut .
 As per my knowledge It not possible because  session is maintaind by client
browser.
If you have any information Pleaase help me.

Thanks
vaibhi




>
> ___
> 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] how suppress http based authentication window of zope

2008-09-18 Thread Josef Meile
Hi,

> Thank you for replay . yes I know that product is using cookie 
> based authentication.I want to know that is any work go around to 
> support zope cookie based or form based authentication.
Well, I think it won't be included to zope source code. Why to do it?
There is already two products for that: CookieCrubmbler and
SessionCrubmbler.

>   I also I used CookieCrubmbler for Cookie based authentication.
>   It Modify the request and server response and edit the header but 
> because by using that we can suppress login window of browser but at the 
> time logout it not modify the server response server send the Basic 
> Authentication with 401 code .
> By seeing that browser kill user session I want is any other way to 
> kill user session.
>  means by sending any response or can i kill user session
I just don't know if this is correct, but as I understand, at the logout
time, what the CookieCrumbler does is to reset the authentication
cookies. I used it on the past and it worked. I don't know what problem
are you having.
___
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 suppress http based authentication window of zope

2008-09-18 Thread Josef Meile
Hi,

CookieCrumbler worked fine for me on the past. The only thing that's
up-to-you is to customize the login form if it doesn't fit your needs.

Perhaps the only issues I see on CookieCrumbler are:

1) Even if you redirect your login_form to https, the came_from
variable, which is set when you arrive to the login_form page, will
redirect you to http. In order to fix this, you have either:

a) Change the came_from variable to https. I did some patch on the past,
however, since I personally don't like cookies, I'm not using it nor
having tested it recently. See this post:

SSL Redirect for CookieCrumbler
http://mail.zope.org/pipermail/zope/2006-June/166799.html

Please note that you need an apache rule to redirect all http requests
to your login_form to https.

b) Force that zope authentication is always done in ssl. I also did a
product, but I have only tested it with http authentication. I think
it may also work with the CookieCrumbler:

JMSSLBasicAuth
http://www.zope.org/Members/jmeile/JMSSLBasicAuth

With this product, no apache rule to redirect to ssl is needed.
Nevertheless you still need the apache ssl module to define your https
virtual host.

3) Cookies are somehow stored on the hardisk. I don't know how
CookieCrumbler manages this. That's why I forget about them and keep
using http based authentication through ssl. Anyway, an alternative
would be the SessionCrumbler product; It also stores a Session Cookie,
but it will be ramdom and expire at sometime. However it depends on
Plone, but I guess it won't be difficult to port to plain zope:

http://plone.org/products/sessioncrumbler

Best regards
Josef

vaibhav pol schrieb:
> Dear All,
>   As per my information zope  provide http based 
> authentication and not support cookies based authentication . I used  
> CookieCrumbler,exUserFolder,fcForum  Products but it not so useful and 
> robust . I want to suppress login wnidow of the zope which  genarated by 
> browser and replace to that I want to show  user  login form. Is any way 
> to do that if you have any information  or any one who working on zope 
> devlopment to make zope support for cookies based  authentication.
> please help me!
> 
>  
> 
> thanks and regards,
> vaibhi
> 
> 
> 
> 
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> 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] Displaying PIL Images in Zope Templates

2008-09-18 Thread Nico Grubert
> Instead of generating the image on the call to your ZPT you form an  src="/some/url/that/makes/my/image?foo=bar&baz=bat"> e.g. in order to
> generate the right image.

Got it. The magic is not to call the external method by 
container.createThumbnail() but use absolute URL to the external method. 
In the page template I have to use:




Thanks for pointing me in the right direction.


Regards
Nico


___
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] Displaying PIL Images in Zope Templates

2008-09-18 Thread Nico Grubert
> You can't do this
> 
> What you need to do is associate the image with a URL so it gets
> generated when the browser processes the  tag.. UNLESS it's very small
> in which case you can use the src="..." attribute to contain the data.
> 
> So a PIL image should be returned by a script or external method that
> you can browse to. Headers such as Content-Type should be set to set the
> image type.
> 
> Instead of generating the image on the call to your ZPT you form an  src="/some/url/that/makes/my/image?foo=bar&baz=bat"> e.g. in order to
> generate the right image.

Hi Andrew

thank you for your answer.
I tried this but calling the page template only shows the image and the 
other content is not shown. I guess, it has something to do with the 
REQUEST.RESPONSE.setHeader('Content-Type', WEB_FORMAT) I set in the 
external method.

Here is the code I use:

External method "createThumbnail":
--
def createThumbnail(self, photo):
 """ create PIL image
 """
 
 thumb_data = StringIO()
 # 'thumb' is a PIL.Image.Image instance
 thumb.save(thumb_data, 'JPEG')

 REQUEST = self.REQUEST
 REQUEST.RESPONSE.setHeader('Content-Type', 'JPEG')
 return REQUEST.RESPONSE.write(thumb_data.getvalue())


Page Template "thumbnails.html":

Thumbnails
some other content...

  

  

some other content...


In the page templates I iterate over a list of image objects ("photos") 
and pass a single image object to external method.
As I mentioned above, this only shows the first image and not the other 
content nor the other images.

Did I miss something?

Regards
Nico
___
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 suppress http based authentication window of zope

2008-09-18 Thread vaibhav pol
Hi ,

Thank you for replay . yes I know that product is using cookie based
authentication.I want to know that is any work go around to support zope
cookie based or form based authentication.
  I also I used CookieCrubmbler for Cookie based authentication.
  It Modify the request and server response and edit the header but
because by using that we can suppress login window of browser but at the
time logout it not modify the server response server send the Basic
Authentication with 401 code .
By seeing that browser kill user session I want is any other way to kill
user session.
 means by sending any response or can i kill user session







On Wed, Sep 17, 2008 at 6:35 PM, Andrew Milton <[EMAIL PROTECTED]>wrote:

> +---[ vaibhav pol ]--
> | Dear All,
> |   As per my information zope  provide http based
> authentication and
> | not support cookies based authentication . I used
> | CookieCrumbler,exUserFolder,fcForum  Products but it not so useful and
> robust .
> | I want to suppress login wnidow of the zope which  genarated by browser
> and
> | replace to that I want to show  user  login form. Is any way to do that
> if you
> | have any information  or any one who working on zope devlopment to make
> zope
> | support for cookies based  authentication.
> | please help me!
>
> I'm not quite sure what you're asking for here. The products you've
> mentioned do support cookie authentication.
>
> What circumstances are you getting the Basic Auth popup that you want to
> suppress?
>
> --
> 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 )