Re: [Zope] (also) ConflictError from Products.Transience.Transience.Increaser

2010-08-04 Thread Maciej Wisniowski
Chris Withers pisze:
> Maciej Wisniowski wrote:
>> You may try to incerase session_resolution_seconds (eg. to 300) at 
>> your zope.conf to get rid of these conflict errors.
>
> Is that a root zope.conf setting or does it live in some special section?
>
It is a root setting in zope.conf.

Example from my zope conf (written with dash):

session-resolution-seconds 300

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


Re: [Zope] (also) ConflictError from Products.Transience.Transience.Increaser

2010-08-04 Thread Maciej Wisniowski
Chris Withers wrote:
>> To my knowledge, the request that throws this isn't touching the session 
>> or temp_folder, but I guess something is.
>>
>> How can I find out what code is actually touch this and so causing this 
>> conflict?
>> 
This might be something with timeslices and buckets that are core 
concepts in Transience.
Take a look at HowTransienceWorks.stx document or at my old post about 
this issue:
http://www.mail-archive.com/zope-...@zope.org/msg22620.html

AFAIR you don't even have to touch session objects in order to make 
transience machinery work.

You may try to incerase session_resolution_seconds (eg. to 300) at your 
zope.conf to get rid of these conflict errors.

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


[Zope] Zope 2.8.4 - ZEO ClientStorage cache problem

2010-04-07 Thread Maciej Wisniowski
Hi!

I have a problem with my instances of Zope 2.8.4: recently they started 
to run slowly. Restarting doesn't help much.
After observing Zope threads with DeadlockDebugger we found that very 
often threads are stuck while trying to access to ZEO cache file.

We have ZEO server and 2 ZEO clients. Each client has 10 threads. 
Example output from DeadlockDebugger (attached at the end of this 
message) shows that a lot of threads is executing self._lock.release() 
in loadEx function. Attached dump is from ZEO Client instance.
I wonder how it is possible that so much threads in this dump are 
releasing lock in the same time? Shouldn't they stay on acquire?


We did more dumps from DeadlockDebugger. Almost every time dump shows 
that there are some threads that are doing something in loadEx, like:
(...)
File "/opt/Zope/2.8.4/lib/python/ZEO/ClientStorage.py", line 755, in loadEx
self._lock.release()
  File "/opt/Zope/2.8.4/lib/python/ZEO/cache.py", line 194, in load
return o.data, tid, o.version
  File "/opt/Zope/2.8.4/lib/python/ZEO/cache.py", line 1010, in access
return Object.fromFile(self.f, key)

Seems to me that access to ZEO cache is a deadlock there, but I don't 
know why. Why it is so often and so slow(?) that I can see it in 
DeadlockDebugger almost every time? I don't remember seeing loadEx on 
output from DeadlockDebugger before.

I've checked disk I/O and it is ok. Event log shows:

2010-04-07T13:48:03 WARNING ZODB.DB DB.open() has 13 open connections 
with a pool_size of 7

which is our bad, as we have 10 threads and too small pool_size=7, but 
I'm not sure if this matters. I wonder that maybe, under heavy load, 
when sometimes all 10 threads are used, Zope has to continuosly create 
and destroy Connection objects and this causes "filling/flushing" their 
caches - I have no idea if this works that way?

Any ideas what might be wrong, or what can I check?


Threads traceback dump at 2010-04-07 12:08:06

Thread -179496032 (GET /VirtualHostBase/https/(...)/index_html):
  File "/opt/Zope/2.8.4/lib/python/ZServer/PubCore/ZServerPublisher.py", 
line 23, in __init__
response=response)
  File 
"/opt/Zope/instancje/xyz_app/Products/ZopeProfiler/MonkeyPatcher.py", 
line 35, in __call__
return self._function(*args,**kw)
  File 
"/opt/Zope/instancje/xyz_app/Products/ZopeProfiler/ZopeProfiler.py", 
line 357, in _profilePublishModule
request=request, response=response)
  File "/opt/Zope/2.8.4/lib/python/ZPublisher/Publish.py", line 386, in 
publish_module
environ, debug, request, response)
  File "/opt/Zope/2.8.4/lib/python/ZPublisher/Publish.py", line 187, in 
publish_module_standard
response = publish(request, module_name, after_list, debug=debug)
  File "/opt/Zope/2.8.4/lib/python/ZPublisher/Publish.py", line 113, in 
publish
request, bind=1)
  File "/opt/Zope/2.8.4/lib/python/ZPublisher/mapply.py", line 88, in mapply
if debug is not None: return debug(object,args,context)
  File "/opt/Zope/2.8.4/lib/python/ZPublisher/Publish.py", line 40, in 
call_object
result=apply(object,args) # Type s to step into published object.
  File 
"/opt/Zope/instancje/xyz_app/Products/App/MainController/MainController.py", 
line 248, in index_html
return context.index_html_( *l, **d )
  File "/opt/Zope/2.8.4/lib/python/Shared/DC/Scripts/Bindings.py", line 
311, in __call__
return self._bindAndExec(args, kw, None)
  File "/opt/Zope/2.8.4/lib/python/Shared/DC/Scripts/Bindings.py", line 
348, in _bindAndExec
return self._exec(bound_data, args, kw)
  File 
"/opt/Zope/2.8.4/lib/python/Products/PythonScripts/PythonScript.py", 
line 323, in _exec
result = f(*args, **kw)
  File "Script (Python)", line 99, in index_html_
  File "/opt/Zope/2.8.4/lib/python/Shared/DC/Scripts/Bindings.py", line 
311, in __call__
return self._bindAndExec(args, kw, None)
  File "/opt/Zope/2.8.4/lib/python/Shared/DC/Scripts/Bindings.py", line 
348, in _bindAndExec
return self._exec(bound_data, args, kw)
  File 
"/opt/Zope/2.8.4/lib/python/Products/PageTemplates/ZopePageTemplate.py", 
line 256, in _exec
result = self.pt_render(extra_context=bound_names)
  File 
"/opt/Zope/2.8.4/lib/python/Products/PageTemplates/PageTemplate.py", 
line 104, in pt_render
tal=not source, strictinsert=0)()
  File "/opt/Zope/2.8.4/lib/python/TAL/TALInterpreter.py", line 206, in 
__call__
self.interpret(self.program)
  File "/opt/Zope/2.8.4/lib/python/TAL/TALInterpreter.py", line 250, in 
interpret
handlers[opcode](self, args)
  File "/opt/Zope/2.8.4/lib/python/TAL/TALInterpreter.py", line 609, in 
do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
  File "/opt/Zope/2.8.4/lib/python/Products/PageTemplates/TALES.py", 
line 221, in evaluate
return expression(self)
  File 
"/opt/Zope/2.8.4/lib/python/Products/PageTemplates/ZRPythonExpr.py", 
line 47, in __call__
return eval(code, g, {})
  File "Python expression "v['bodyDefinition']( 
index_html=v['index_html'])"", line 1

Re: [Zope] Weird hangs on zope/plone.

2007-10-09 Thread Maciej Wisniowski
> When i google it i find a post somewhere saying about increase the
> number of threads and the number of the pool, but nothing about this
> limitation! :(
What kind of limitation? Instead of raising number of threads on one
zope instance you should just use few Zope instances with smaller number
of threads. AFAIK it's more effective.

> I will test DeadlockDebugger, but the main problem is only happen in
> the morning (around 8:00am-10:00am.
So install deadlockdebugger and look at it's output between 8:00-10:00.
It may be safely used on production instances.

Also check if some external resources like LDAP are not restarted/backed
up or sth. like that at this time, or before (eg. there is a backup at
night that causes 'something' wrong for connections from your zope and
your users start working since 8:00 - thats when you see 'hangup').

-- 
Maciej Wisniowski
___
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] Weird hangs on zope/plone.

2007-10-09 Thread Maciej Wisniowski
> I set the number of threads:
> zserver-threads 25
> I set:
> pool-size 27
> on 
I think you should rather use ZEO than raise number of threads to such a
big value. Also there are some rules about pool-size. I don't remember
exactly but seems to me that it is too small, but
in general I suppose it has nothing to do with your problem...


Situation you're seeing may appear if there is something that blocks
all your threads, like all threads are waiting for RDBMS response...


> How can i run some kind of debug on zope (debug-mode on dont log
> anything more) to check this next time happen?
Use DeadlockDebugger and if this doesn't help try:
http://www.zopelabs.com/cookbook/1073504990

-- 
Maciej Wisniowski
___
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 upgrade Python in older Zope?

2007-09-11 Thread Maciej Wisniowski
> I desperately need support for large filesystem so the data.fs file can 
> exceed 2 GB.
Have you tried to simply pack ZODB? I'm not sure how it goes in Zope 2.5
but in more recent releases, under Control Panel/Database Management
there is a Pack button. Pack should remove historical entries from ZODB
and make it smaller.

Of course create a backup before ;)

-- 
Maciej Wisniowski
___
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] UTF encoding problem w/ ZPT's (No, not the usual :)

2007-08-30 Thread Maciej Wisniowski

> As for subversion, I took great care to make sure everything was utf-8
> on the FS, during development, and I know Subersion uses utf-8
> internally, so I'm not sure what it would change it to.  Once checked
> back out, it still looks like utf-8 ... I'm saying all this based on the
> assumption that the string -> unicode difference might come from the
> encoding of the PT itself?
>   
Which Zope version do you have and are you sure your
versions are same in both environments?

-- 
Maciej Wisniowski
___
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 start Zope

2007-08-28 Thread Maciej Wisniowski
> try: result = render_blocks(self._v_blocks, md)
> Unauthorized: You are not allowed to access 'admin' in this context
> 
> Any ideas?
This is not connected with previous error, but seems that your
Zope worked before (-08-20T15:12:21). If so then what chages
did you do? ;)

As Andreas said previous error is possibly due to
broken installation. Check if you have AccessControl.Role
and if so, then check if your python/site-packages doesn't
contain another one eg. from Zope3.

-- 
Maciej Wisniowski
___
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] Conflict errors

2007-07-27 Thread Maciej Wisniowski
> Could anyone suggest whats happening here that cause this error.
Look at list archives.

You may try to incerase session-resolution-seconds to 300 in your
instances zope.conf and see if there is less of these errors.

BTW. Zope-DB is about Zope and relational databases only.

-- 
Maciej Wisniowski
___
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] Extracting all files from Zope DB

2007-07-26 Thread Maciej Wisniowski
> In order to migrate from Zope to "..." (I don't know yet), we are trying to 
> extract all the information located inside the Zope database.
What do you mean by information? Code?

> I've found the FTP interface to the Zope database, I can browse inside the 
> subfolder but, I can see any files !? 
> If I post a new file via the web page, a folder is created (I see it via FTP) 
> but the folder is empty ?!
What do you mean by 'post a new file via web page'? What is 'web page'?
Your application? ZMI? (Zope Management Interface)? How do you 'post' a
file?

> Could you please tell me if there is a way to do that ?
> Could you please give me some hints ?
Zope database is object database, what means it stores objects, not
files, so you shouldn't expect files to be there. These are all objects.
Even 'File' is instance of class 'File'.
Some of these objects have methods that allow them to 'answer' to FTP
requests, and you can see them in your FTP client. If some objects are
not 'FTP enabled' you will not be able to use them via FTP.

Take a look at group archives. AFAIR there were similiar questions
some time ago.

-- 
Maciej Wisniowski
___
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] Site Error page

2007-07-22 Thread Maciej Wisniowski
> BlankIs there any way to update the Zope's error page that appears during any 
> Site error with a different content?
> Any help is appreciated in advance.
Change standard_error_message object (located at root folder - visible
via ZMI)

-- 
Maciej Wisniowski
___
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] UnicodeDecodeError in Zope 2.10.4 (upgrade from 2.8.4)

2007-07-17 Thread Maciej Wisniowski

> Both
> template id.
> and
> template id
> is like playing with fire. Don't do it.
>
> What you've got there is unicode characters written down without any
> encoding information.
This is legacy code from zope 2.8.4 that I have to
deal with during migration. All new code is supposed to use
u'' strings.
In fact, above is only an example but in real case we
have properties set for folders, eg. 'title' that
contains national characters.

You can easily check it yourself if you want.
Just create a Folder and set it's 'title' property
to one that contains some unicode characters.
You'll not be even able to add ZPT object into
that folder I think (at last it is not possible for me).

>
> It will work if you set the internal ZPT encoding to be the same as it
> was entered into the template which I can see is not ASCII which is
> what your system defaults to.
What do you mean by internal ZPT encoding? Docs says:
"Starting Zope 2.10.2 the ZPT implementation uses unicode as internal
representation"
so there should be no encoding at this level, I think.

>
> This is internally what happens:
> >>> x="\xc5"
> >>> unicode(x)
> Traceback (most recent call last):
>   File "", line 1, in 
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
> 0: ordinal not in range(128)
> >>> import sys; sys.getdefaultencoding()
> 'ascii'
I already realized same thing and used sitecustomize.py
with sys.setdefaultencoding('utf-8') as a quick fix. This works
but is not nice solution. I rather expected Zope 2.10 resolver to
deal with this.

-- 
Maciej Wisniowski
___
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] UnicodeDecodeError in Zope 2.10.4 (upgrade from 2.8.4)

2007-07-17 Thread Maciej Wisniowski

> If the documented hints don't work, please submit a bugreport
> with a reproducable testcase in form of a unittest.
Bug submitted with tests attached at:
http://www.zope.org/Collectors/Zope/2339

-- 
Maciej Wisniowski
___
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] UnicodeDecodeError in Zope 2.10.4 (upgrade from 2.8.4)

2007-07-17 Thread Maciej Wisniowski

>
> Did you read
>
> <http://www.zope.org/Products/Zope/2.10.4/Zope-2.10.4-released>
Yes.

> The migration code should auto-detect ISO-8859-15 and UTF-8
> encoded page templates. For other encodings you must set
> the environment variable ZPT_PREFERRED_ENCODING.
> The migration code applies to ZopePageTemplate instances only.
I have utf-8 encoded ZPTs so I didn't used ZPT_PREFERRED_ENCODING

> When you download ZPT content through FTP or WebDAV the
> content is converted using the output_encoding property of
> the corresponding ZopePageTemplate instance.
So far I didn't even try ftp or webdav with 2.10.4. The problems are with
TTW.

> The encoding of a rendered ZPT (through HTTP) is determined through
> charset= within the content-type HTTP response header
> etc/zope.conf: default-zpublisher-encoding
> default: iso-8859-15
default-zpublisher-encoding is set to utf-8

> In order to deal with UnicodeDecodeErrors in a reasonable way,
> we added a configurable Unicode conflict resolver.
As I said before resolver is not even called when using 'structure' keyword.

-- 
Maciej Wisniowski
___
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] UnicodeDecodeError in Zope 2.10.4 (upgrade from 2.8.4)

2007-07-17 Thread Maciej Wisniowski
I've upgraded my installation from Zope2.8.4 to Zope 2.10.4
(by copying data.fs, Products/ etc.). I have publisher encoding
and management_page_charset set to utf-8. Also system
default encoding is utf-8.

Zope 2.10 is said to have better Unicode support with
UnicodeEncodeConflictResolver. It is but unfortunatelly in
some cases this is not enough. Seems that
code that is 'protected' by Resolver is not the only code
that may be affected by non unicode strings.
Simple example is with 'structure' keyword.

eg:
This works (resolver resolves conflict):
template id.

This doesn't work:
template id.

Also if you have Folder instance and set it's Title
to the string that contains some i18n characters
you're not able to even add page template
inside it.

Error traceback in both cases is same:

Error Type: UnicodeDecodeError
Error Value: 'ascii' codec can't decode byte 0xc5 in position 200:
ordinal not in range(128)

Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
Module Products.PageTemplates.PageTemplate, line 89, in pt_render
Module zope.pagetemplate.pagetemplate, line 117, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 534, in do_optTag_tal
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 754, in do_insertStructure_tal
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
200: ordinal not in range(128)

problem is with:
  text = unicode(structure)
at
Module zope.tal.talinterpreter, line 754, in do_insertStructure_tal

sitecustomize.py with setdefaultencoding('utf-8') solves this
but it is not nice solution. I wonder whether this should be
submitted as a bug, or maybe there is different solution that
I've missed?

For the record: one more thing that was wrong
for me during migration was 'expand' attribute of ZPT
that in case of few ZPT objects was set to true in
2.10.4 while oryginally in 2.8.4 it was false.
This caused that tales expressions disappeared
from ZPTs under 2.10.4. I've written a script that
explicitly set expand=0 to all ZPT instances in
Zope 2.8.4 and then, after migration, everything is OK.

-- 
Maciej Wisniowski
___
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 w/ ZMySQLDA

2007-07-16 Thread Maciej Wisniowski

>
>
> Furthermore, mytop shows the user is hanging:
>  30 mysqluser   localhost mrtableclo   473  Sleep
>
> What should I do next to troubleshoot this?
Try deadlockdebugger to see what is happening

-- 
Maciej Wisniowski
___
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] Logon process

2007-07-06 Thread Maciej Wisniowski

> Hi, Maciej!
> The same problem as with CookieCrumbler or ExUserFolder: I don't understand
> the process to setup the product in order to use it
> 
> Do you know any url o similar about how to setup and use PAS?
docs/ folder in PAS product :)

I don't remember exaclty how PAS looks so following
description is from memory and for older PAS version
that I've used some time ago but should be suitable
in general:

You have to crate a folder you want to be secured.
Then you should set View permission for authenticated users
only (or something like that). This is typical Zope security
machinery.

Then you add PAS object into secured folder - this
will create new 'acl_users' object.

In 'acl_users' you need to add two plugins from the list:
1. Cookie (don't remember the name)
2. ZODB UserFolder

Then you have to Activate added plugins (you'll find activation
at properties or at 'plugins' object).

Thats all. Now, at ZODB UserFolder object you may add users
just like with default acl_users.

If you take a look at interfaces.py or docs/ you'll find that
there are few kinds of plugins for extraction, authentication etc.
You may exchange some of them to suit your needs and write your own ones.

-- 
Maciej Wisniowski
___
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] Logon process

2007-07-05 Thread Maciej Wisniowski
> Thanks, I try to use a more easy solution but it's ok
> 
> I check this and ExUserFolder but in both cases I don't understand the
> product's setup process
> 
> Do you know where I can found a tutorial about how to setup and use Cookie
> Crumbler product?
I think you should rather take a look at PAS - PluggableAuthService and
possibly just write your own plugin. There is Zope-PAS mailing list too.
You may take a look at docs/ and interfaces in this package.
Default PAS plugins include ZODB users storage and cookie
authentication.

-- 
Maciej Wisniowski
___
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] KeyErrors in Zope using ZEO

2007-07-03 Thread Maciej Wisniowski
> However, I'm still experiencing intermittent KeyErrors with the session
> stuff.  The line of code that always breaks is "session =
> REQUEST.SESSION"  and it has happened everywhere in my code that I use
> that.  Is there a better way to access the session that I should be
> using?  
I think there is no better way although there are different ways.
Maybe you should think again if you really have to use sessions shared
between zeo clients. If so then you should possibly try Faster (another
session implementation) that is said to be better especially in such
setup with ZEO.

-- 
Maciej Wisniowski
___
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: [Zope3-Users] z3c.form 1.3.0, z3c.formui 1.0.1, and z3c.formdemo 1.1.0 released!

2007-06-28 Thread Maciej Wisniowski

> Again for the curious and impatient ...
> ---
>
> We have added two more demos:
>
> * An "Address Book" implements a non-trivial example of an address book,
>   including multiple addresses and E-mails. It demonstrates the use of
>   sub-forms, writing custom widgets and composite content.
>   
This demo is really impressive!

> * An "SQL Message" demo reimplemnets the simple "Hello World!" demo only using
>   queries to the Gadfly database. The example adds to the original demo by 
>   also providing a message overview screen, since the ZMI is not helpful for 
>   pure SQL data.
>   
Thanks for this one :)

-- 
Maciej Wisniowski
___
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] A question on pool-size

2007-06-26 Thread Maciej Wisniowski

> The thing that is bugging me is that it seems my configuration is not being
> taken into account. Is there an absolute limit for pool_size?
>   
Go to lib/python/ZODB/DB.py file
There is a DB class with __init__ method.
Put some print statements here to display
pool_size and start zope with ./runzope or
./zopectl fg to see your prints.

You may also take a look at 'push' method
of _ConnectionPool in the same file. This is
the place where warning messages came from.
If you look closer then you'll see that there is no
absolute limit for pool_size. Only warnings are printed.

-- 
Maciej Wisniowski
___
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] A question on pool-size

2007-06-26 Thread Maciej Wisniowski
Hello

First, which Zope version do you have?

> Sometimes it reported pool-size of 10, and sometimes it reported 7!
> What could this be?
Maybe you're seeing warnings from few storages? but I'm not sure how
this works an I have no idea why you're seeing pool sizes as 7 and 10
if you set this to 20

> Another question: My expect a load of 50 concurrent requests, so I set
> zserver-threads to 25 on both zeo-clients, and a pool-size of 20 (but
> behaving as explained above). Do this conf make any sense? Where should I
> read to get more info about this matter?
I think it is better to use more Zeo clients than bump number of
threads. There were some benchmarks (or sth like that) showing
that bigger number of threads doesn't help too much to performance,
and it may be even worse.

In your setup, if you have 25 threads you should have pool size
bigger than 25 - every thread will possibly use ZODB so it should
have connection to use. In fact connection is created as needed, even if
pool_size is too small. That is why number of connections in your logs
is bigger than pool_size.

-- 
Maciej Wisniowski
___
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 restore a copied instance.

2007-06-26 Thread Maciej Wisniowski

> hi, i needed to reinstall my zope site on another computer so i
> installed (in debian) plone-site using aptitude ... it automatically
> makes a new instance and starts the server.
Is this the same Zope version that you have on another computer?


>
> after that i
> stopped the server ... and copied my site (instance folder) from the other 
> computer over this one.
>
>
> when i start /etc/init.d/zope2.9 start ... it doesn't complain , but i
> can't open the site. (same instance names, same port number )
What does this mean that you can't open the site? Errors?

>
> i tryied another aproach ... copied back the default installed
> instance ... and only overwritten the var folder with the data from
> the original site.
You also need Products/ from previous instance and files from
Extensions/ folder

>
> this way i hoped that Data.fs which contained all my objects ... will
> automatically become visible.
>
> it doesn't work this way either, it only sees the default objects, i
> can access the site ... but all my objects are not visible.
Check ControlPanel->Product Management if your products are installed
correctly


-- 
Maciej Wisniowski
___
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 stopped working suddenly

2007-06-18 Thread Maciej Wisniowski

> I tried to change effective-user from the zope.conf.in
> <http://zope.conf.in> file and saved it as zope.conf, I used the command
>  
> effective-user tleis , as stated in the example of that file, but no
> thing changed. if anyone knows why please tell me (just curousity)
Maybe user tleis had no permissions to folders you've created as root.
> I created a new user as Maciej said, and there i tried to create an
> instance, but I got a denied permission message. 
If you tried to override existing instance created
by root then it is correct behaviour I think.

> What I did finally is that I deleted the folders in both /tmp/zope and
> /opt/Zope-2.10 folders, and installed Zope Again and everything is
> working fine right
:)

-- 
Maciej Wisniowski
___
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 stopped working suddenly

2007-06-15 Thread Maciej Wisniowski

>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/__init__.py", line
> 234, in dropPrivileges
> return dropPrivileges(self.cfg)
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/__init__.py", line
> 403, in dropPrivileges
> raise ZConfig.ConfigurationError(msg)
> ZConfig.ConfigurationError: A user was not specified to setuid to; fix
> this to start as root (change the effective-user directive in zope.conf)
> /** END **/
You have answer above. To run as root you have
to change effective-user at zope.conf file

>
> When everything was ok in the past I was able to run zope through
> ./zopectl start (as a root)
> but now the stop command displays that  the daemon manager is not open.
Strange that it worked. In general I think you shouldn't
run zope as root.

-- 
Maciej Wisniowski
___
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 stopped working suddenly

2007-06-15 Thread Maciej Wisniowski

> Greetings
> thank you for your help.
> first i want to ask if i should reply to you like what i am doing now,
> or send the message to zope@zope.org <mailto:zope@zope.org>? I am new
> to mailing lists and don't know the rules.
You should always stay on the list. It is common to just use 'Reply all'
option when replying.

> In my zope/log folder there is no event.log file, just a simple line
> readme.txt file.
> running the zopectl fg displayed the following:
>
> /** OUTPUT **/
> /tmp/zope/bin/runzope -X debug-mode=on
> 2007-06-15 09:33:41 INFO ZServer HTTP server started at Fri Jun 15
> 09:33:41 2007
> Hostname: 0.0.0.0 <http://0.0.0.0>
> Port: 8080
> 2007-06-15 09:33:51 INFO Zope Ready to handle requests
> Traceback (most recent call last):
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/run.py", line 56, in ?
> run()
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/run.py", line 21, in run
> starter.prepare()
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/__init__.py", line
> 111, in prepare
> self.setupFinalLogging()
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/__init__.py", line
> 372, in setupFinalLogging
> self.setupConfiguredLoggers()
>   File "/opt/Zope-2.10/lib/python/Zope2/Startup/__init__.py", line
> 254, in setupConfiguredLoggers
> self.cfg.eventlog()
>   File
> "/opt/Zope-2.10/lib/python/ZConfig/components/logger/factory.py", line
> 32, in __call__
> self.instance = self.create()
>   File
> "/opt/Zope-2.10/lib/python/ZConfig/components/logger/logger.py", line
> 42, in create
> handler = handler_factory()
>   File
> "/opt/Zope-2.10/lib/python/ZConfig/components/logger/factory.py", line
> 32, in __call__
> self.instance = self.create()
>   File
> "/opt/Zope-2.10/lib/python/ZConfig/components/logger/handlers.py",
> line 69, in create
> logger = self.create_loghandler()
>   File
> "/opt/Zope-2.10/lib/python/ZConfig/components/logger/handlers.py",
> line 87, in create_loghandler
> handler = loghandler.FileHandler(path)
>   File "/opt/Zope-
> 2.10/lib/python/ZConfig/components/logger/loghandler.py", line 34, in
> __init__
> StreamHandler.__init__(self, open(filename, mode))
> IOError: [Errno 13] Permission denied: '/tmp/zope/log/event.log'
> /** END **/
So seems  that you have incorrect permissions
set for /tmp/zope/log/event.log and
you need to change them or start zope as different user.
BTW you've chosen strange place (/tmp) to install your zope ;)

-- 
Maciej Wisniowski



___
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] a warning message before performing an action

2007-06-14 Thread Maciej Wisniowski
> I have a web page with some buttons ( action (by calling a python script). However, some actions (like
> 'delete' a picture for example) I would like to warn user before
> performing it. I recall from php how to pop up a window (or a drop
> down in Mac OSX) with a warning message prompting a 'Yes' or 'No'
> confirmation and I was wondering how would I do it with Zope, with an
> example if possible.
If you've opened pop up window "with php" then in fact it had to be
JavaScript. Possibly you're looking form something like:

if (confirm("Do you really want to remove this picture"))
return true
return false

which may be used with onsubmit event of form object. Of course
this is javascript code not python.

-- 
Maciej Wisniowski
___
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 stopped working suddenly

2007-06-13 Thread Maciej Wisniowski
> Greetings
> First , I am glad to join you at this list. I installed Zope on Fedora Core
> 6, and started to learn how to use it. for a few days i was able to access
> the management interface (ZMI) through http://127.0.0.1:8080 after starting
> zope through .../zopectl start. but as a sudden I found myself unable to
> enter to the ZMI anymore. The browser displays  an error as if zope is not
> started at all.
> I am a newbie in both Linux and Zope, so please can anyone pass me some
> tips
> on how to check what is causing the problem and how to solve it?
> I searched the internet for two weeks now, but there is no hint about the
> problem!!
Possibly your Zope doesn't start because of some errors.
Take a look at log/event.log to see if there are any errors at the
end of this file.

Also try to run: .../zopectl fg
This command starts zope but stays attached to the console and displays
startup errors etc.

If you find any errors post full traceback here.

-- 
Maciej Wisniowski

___
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 2.7 - sporadic service hangup

2007-06-05 Thread Maciej Wisniowski
>   In the trace.log (after turning this on) we can see entries for
> the last requests that completes and three requests that begins,
> but never finish (see below).
This is typical behaviour when all your threads are busy. Zope
accepts requests and AFAIR they're even written into z2.log but
doesn't serve them because all it's threads are busy.

Solution is to use DeadlockDebugger to see what your threads are doing
while Zope seems to be 'hang'.

-- 
Maciej Wisniowski
___
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-DB] blobs and dtml-sqlvar

2007-06-02 Thread Maciej Wisniowski
>> I'm using MySQLDBA, and I've got a Z SQL Method like this:
>>
>> select * from myTable where someValue=
>>
>> The issue being that 'myValue' is actually a Hex value in a Blob
>> column. The only types possible for dtml-sqlvar seem to be string and
>> int (as far as I can tell).
>>
>> I noticed that when I use 'type=string' the value is always placed in
>> inverted commas (and so MySQL thinks it is a string and rejects
>> it) and when I put 'type=int' the Hex value is rejected by Zope.
>>
>> Is it possible that MySQLDBA can not handle blobs / Hex values at all?
>> I'm confused that dtml-sqlvar only sees 2 types of data.
I have no idea how this works with mysql but in postgres I've used:

ZSQL:
update company
   set logo=::bytea
 where companyid=

Python Script:
from psycopg2 import Binary
picture = container['logo.gif'].data  # Image object
container.set_logo(companyid=companyid, logo = Binary( obraz ))

Maybe there is something similiar in MySQLDB.

-- 
Maciej Wisniowski
___
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.7 - sporadic service hangup

2007-06-01 Thread Maciej Wisniowski

> Hi,
> we notice two or three times a day some kind of hangup of the zope service. 
> After hangup there is no response requesting urls/manage interface cannot be 
> accessed, too. Restarting the zope service resolves all problems until the 
> next hangup.
>
> No errors in zope logs! Seems to work everything fine ...
>
> We use Zope 2.7.5-final, python 2.3.5 on Debian, to access LDAP 
> LDAPUserFolder, ZOracleDA for Oracle Connection.
>
> I know about problems with ZOracleDA - but not resulting in hangups. What 
> could be the reason? What can I do?
Have you tried DeadlockDebugger to see what are
your threads doing? I'm not sure if this works with Zope 2.7

-- 
Maciej Wisniowski
___
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] Uncaptured python exception

2007-05-31 Thread Maciej Wisniowski
> Var1 = var2
> 
> Where var2 is undefined (i.e. has never been assigned anything)
> 
> Just silent failure.  No error.
So how do you know there is a failure then?
There is really nothing in event.log and nothing in error_log?

-- 
Maciej Wisniowski
___
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: Function reindexObject()

2007-05-31 Thread Maciej Wisniowski

> The import script run very well, I transform each line of the text
> file to a correspondant product as zope2.7. But I want put each new
> product in the same repertory as zope 2.7. So how say to each product
> in my import script where it must be copy.
Why don't you just export object path along
with it's data? use |getPhysicalPath() for example.
Take a look at http://plope.com/Books/2_7Edition/AppendixB.stx#2-396 for
description.
Also consider use of restrictedTraverse to get access to object that you
will
add newly created objects to (during import).

Sth like:
container = self.|restrictedTraverse('/SITES/plone_mySite/repertory1/")
container.invokeFactory

Or something like that.
> My subject is reindexObject because I think it's this function that
> put the new Object (product) in ZMI. I don't know :s
AFAIK reindexObject is used to reindex object in Catalog.
invokeFactory puts new object of the specific type to ZMI.

-- 
Maciej Wisniowski
___
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] Function reindexObject()

2007-05-30 Thread Maciej Wisniowski

> I have made some python scripts to export data of some zope2.7 products
> in text file, and I have made some scripts to import theses data to
> rebuild products in zope2.9. Theses scripts run very well.
> 
> But my problem is that all product that is rebuilt are in
> /SITES/plone_mySite/
> I want rebuil all product in zope2.9 in the same directory as zope 2.7.
> I have the same structure for zope 2.7 and zope 2.9.
But where is the problem? What are 'products' for you and what do you
mean by rebuild? Where are folders like /SITES/plone_mySite/? Is this
filesystem path or path in your ZODB? What are your scripts? External
methods?

-- 
Maciej Wisniowski
___
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] extract page title

2007-04-24 Thread Maciej Wisniowski

> Hi Andreas,
>
> Thanks - i know the title does not belong in a script tag, i just want
> the text within the title tag appended within the javascript, not the
> tags themselves. Sorry its my explanations for help that are unclear.
>
>
I'm not sure if I understand you but...
Where  tag content came from? If this is from typical title_or_id
function then
you may use something like:

 

you may then also do:

http://domain/xxx/xxx/s?websitename.%s' % (here.title_or_id())"
width="1" height="1" alt="">

-- 
Maciej Wisniowski
___
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] nested queries and zpt

2007-04-12 Thread Maciej Wisniowski

> url: "ServerList?CustomerID=123456"
>
> 
> servername
> server ID number
> list of software
> goes here
> ...
> The problem is that the ServerSoftwareList needs the "server/ID"
> passed to it for the query, which will return the software on file for
> that server... any ideas?
list of software goes here

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


Re: [Zope] [Ann] "analyseObjects": analyse live objects

2007-04-10 Thread Maciej Wisniowski

> Hi Dieter,
> 
> am I missing something, or the code is not on the web?
I'm able to get the code from here:
http://www.dieter.handshake.de/pyprojects/zope/analyseObjects.py

-- 
Maciej Wisniowski
___
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] ImportError: No module named cPersistence when creating new instance

2007-04-04 Thread Maciej Wisniowski

> ImportError: No module named cPersistence
Check zope list archives.

-- 
Maciej Wisniowski
___
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] IOError: [Errno 11] Resource temporarily unavailable for ./zopectl adduser...?

2007-04-03 Thread Maciej Wisniowski

>
> ZopeXMLConfigurationError: File "/opt/Plone-
> 2.5/dvplone/Products/Five/skel/site.zcml", line 7.2-7.37
> ZopeXMLConfigurationError: File
> "/opt/Plone-2.5/dvplone/Products/Five/configure.zcml", line 12.2-12.32
> ZopeXMLConfigurationError: File "/opt/Plone-
> 2.5/dvplone/Products/Five/formlib/configure.zcml", line 15.2-18.8
> ConfigurationError: ('Invalid value for', 'factory', "ImportError:
> Couldn't import zope.formlib.errors, No module named errors in
> .errors.InvalidErrorView")
Maybe you have Five that is not compatible with your zope version.
Check compatibility table at codespeak.net.

-- 
Maciej Wisniowski
___
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] IOError: [Errno 11] Resource temporarily unavailable for ./zopectl adduser...?

2007-04-03 Thread Maciej Wisniowski

> IOError: [Errno 11] Resource temporarily unavailable
Try:
./zopectl stop
./zopectl adduser
./zopectl start


-- 
Maciej Wisniowski
___
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] Making pythonscript changes to formulator fields persistent

2007-04-02 Thread Maciej Wisniowski
> EM gives you no security restrictions in comparision to Script Python.
I should rather say that it gives you less restrictions: access to
all python modules etc.

-- 
Maciej Wisniowski
___
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] Making pythonscript changes to formulator fields persistent

2007-04-02 Thread Maciej Wisniowski
> I was thinking of that...
> How would you do that? Do you know formulator enough to say?
I don't know your use case good enough. Is this just changing
attributes of formulator fields?

> Put the whole thing in the EM, or something simpler?
> An EM I could just hand off the field object to, to get "persisted"?
I don't understand what you mean. Field objects already are persistent.
EM gives you no security restrictions in comparision to Script Python.

In general to simply change field.values['required'] to false I'd write
function to traverse through ZODB to find all FormulatorForm objects
and it's fields.

> (I find it a bit cumbersome to develop in EMs, reloading and all, so I tend 
> to 
> avoid it.)
With ExternalMethod you only have to hit save button again to refresh
it.

Simple external method code that you may use to traverse through ZODB:

def checkFolder(self, fld):
for obj_name, obj in fld.objectItems( 'FormulatorForm' ):
# get form fields here etc

for fld_name,fld_obj in fld.objectItems( 'Folder' ):
checkFolder( fld_obj )
for fld_name,fld_obj in fld.objectItems( 'Folder (Ordered)' ):
checkFolder( fld_obj )

I'm not sure about 'FormulatorForm', this may be 'Formulator Form' or
something like that.

-- 
Maciej Wisniowski
___
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] Making pythonscript changes to formulator fields persistent

2007-04-02 Thread Maciej Wisniowski
> What to do?
> 
> I guess some developer has worked hard to prevent me from doing just this at 
> some point, but why? Do I need to write a product  to do it?
> Is anyone at all using this crazy development model where "semi trusted 
> users" 
> do stuff in the ZMI??? 
> But I digress..
> 
> If anyone knows how to solve this I would be less frustrated for a while ;-)
Use ExternalMethod - easy just like python scripts and it's code is
trusted.

-- 
Maciej Wisniowski
___
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] ZSQL, call for early beta testers

2007-04-01 Thread Maciej Wisniowski
> It works something like this::
(...)
> If in the folder 'sql/Userstuff' you have a file called
> 'select_users.sql' you will the be able to just run:
> 
>  # select users:
>  print SQLUser.select_users()
>  # same but first printed the final SQL used
>  print SQLUser.select_users(debug__=True)
>  # save time for the next call
>  print SQLUser.select_users(memcache__=True)
Few questions :)
sql/Userstuff is a filesystem folder or a folder in ZODB?

How does select_users.sql look? is this dtml with parameters
like in ZSQLMethods? Can I just pass parameters like:
SQLUser.select_users(param1='p1', param2='p2')?

Have you compared zsql + memcache performace with eg. CCZSQLMethods
from Dieter Maurer?

> Is anybody interested in a being early beta testers before I release it
> as Open Source? It works quite well here for me but I fear I'm getitng a
> bit home blind based on just my needs. I'm pretty sure it works but some
> early feedback would be appreciated.
I'm interested, although I can't guarantee quick response :)

-- 
Maciej Wisniowski
___
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] include?

2007-03-28 Thread Maciej Wisniowski
Katie napisał(a):
> We're almost finished getting the new site done completely in zope using css
> and mySql. We have an older portion of the old site done in php thought that
> we don't really want to re-write. We'd like to include it in the dtml
> document page that has all the common elements of every page but I'm at a
> loss of a way to do it other than using an inline frame. Is there a dtml
> include that takes a url string the way the  tag renders the
> associated file?
There is a product to embed php pages in zope:
http://zope.org/Members/hewei/PHParser

but I don't know if and how this works.

-- 
Maciej Wisniowski
___
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 Import Base has_attr

2007-03-27 Thread Maciej Wisniowski

> Hi;
> I had this problem on another server I recently built...and it went away
> all by itself! I'm now rebuilding my home server, and it's cropped up
> again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt
> and type in "import Products.CMFPlone", but apparently that doesn't work
> on Zope 2.7.8/Plone 2.1.4. Here is the traceback.
Go to file "/usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py",
and before line 27: from Products.CMFPlone.utils import base_hasattr
write:

import Products.CMFPlone
print 'HERE:', Products.CMFPlone

and see what is displayed on the console after 'HERE:'

-- 
Maciej Wisniowski
___
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] Attribute error

2007-03-23 Thread Maciej Wisniowski

> Hi,
> 
> I'm pretty new to Zope; I inherited the system when I started my new job.
> We use it to manage a college web site.  I noticed yesterday that several
> pages in our "Student Services" section will no longer load.  Every time I
> try, I get this:
> 
> Error Type: AttributeError
> Error Value: visible
> 
> And I have no idea what it means or how to fix it.  Any suggestions would be
> much appreciated.
You have to start learning about python and zope :)

Take a look at site error log (via ZMI) or at event.log in the
filesystem to see full error traceback.

-- 
Maciej Wisniowski
___
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] open image in a fitted new window

2007-03-22 Thread Maciej Wisniowski

> I was wondering how to once clicking on a image (thumbnail) I would
> get the full-size image in a fitted new window, without buttons,
> address field etc. I can realise how to do it with javascript but I
> don't know, if it's the only way, how to integrate javascript in a
> zpt. A example/tutorial would be very welcome so.
What you're asking for? How to insert javascript code into html page?

-- 
Maciej Wisniowski
___
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 Z SQL doubt

2007-03-22 Thread Maciej Wisniowski

> Hi all,
>
> I need to insert a row to mysql table if the corresponding  data not
> exist, if it exist i need to update the row.
>
> Can we do it using a single Z SQL method.
Yes, if your ZSQL will call stored procedure that will handle this logic.
Otherwise, I think you can't (but I might be wrong).

-- 
Maciej Wisniowski
___
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: losing random session data

2007-03-19 Thread Maciej Wisniowski
> This does the trick:
> 
> order = []
> new_order={}
> prev_order=req.SESSION.get('order')
> 
> if prev_order != None:
>  for orders in prev_order:
>for item in orders.keys():
> new_order[item]=orders[item]
>order.append(new_order)
>new_order ={}
This seems to be hardcore ;) I mean that it should not
be necessary to do such rewrite of all keys and values
for dictionaries or lists taken from session.
I never had to do something like that...

Isn't it working without these assignments? Just:

order=req.SESSION.get('order', []) # if there is no 'order' in session
   # you'll simply get empty list here
new_order = {}
for val in req.form.keys():
new_order[val]=req.form[val]
order.append(new_order)
req.SESSION['order'] = order


BTW. req.SESSION.set(..., ...) method is also persistence aware
(according to zope book)

-- 
Maciej Wisniowski
___
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] losing random session data

2007-03-18 Thread Maciej Wisniowski
> my data ends up looking like this:
> 
> order [{}, {}, {'foo': '1', 'bar': 'a'}, {}, {'foo': '2', 'bar': 'b'},
> {'foo': '6', 'bar': 'z'}, {'foo': '1', 'bar': 'a'}]
What is wrong here? I mean what output is expected?

> I've seen  http://mail.zope.org/pipermail/zope-dev/2006-July/027890.html
> and am aware that related bug existed prior to 2.7.1.
There is 'faster' that is alternative sessioning machinery but I don't know
if it works with 2.7

> I've used sessions without problems before, this is the first time I
> attempt to store variables in containers. What am I doing wrong?
Maybe it is because of req.form assignment. Try to create copy of
its values and append this to 'order' list like:

session = context.REQUEST.SESSION
order = session.get('order', [])
order.append({'foo':req.form['foo'],
  'bar':req.form['bar']})
session.set('order',order)

and see what happens now.

-- 
Maciej Wisniowski
___
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] accessing the user search using mxODBC adapter

2007-03-14 Thread Maciej Wisniowski
 
> No, no error tracebacks at all. Simply that the search for a user
> returns no results. However the user can login fine.
AFAIR in PAS there are plugins that are responsible for listing users
but I have no idea how this works in PlonePAS and if this plugin is used by
'default users search form'. So far you didn't even
tell us if you use PlonePAS and if so what kind of authentication plugin.

I still think this is a Plone related problem/question :)

-- 
Maciej Wisniowski
___
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] accessing the user search using mxODBC adapter

2007-03-13 Thread Maciej Wisniowski

> We're having issues getting a user listing back from a SQL server
> database using the default Plone user search. We have the mxODBC
> adapter all working for login but not for the user search. Does anyone
> have experience of issues here? Is it an issue with the user folder or
> is a ZSQL required?
For me, mxODBC can't be a problem here.
Do you have error tracebacks?

This issue can be better answered on Plone-users
list I think.

-- 
Maciej Wisniowski
___
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] 'int' object has no attribute 'objectValues'

2007-03-12 Thread Maciej Wisniowski
> 
> 
> 
Check what here/quotes is evaluating to. Seems that it is int.

-- 
Maciej Wisniowski
___
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] have problem with managing objects within a external product

2007-03-11 Thread Maciej Wisniowski
>
>  
> I found out what my problem is.
> in my code I please baseclass Item before Folder
>  class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
> when I change the order, it worked normally
>  class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):
> but I don't understand why? could someone explain this to me?
Possibly you'll have to read about multiple
inheritance in python. In fact I think instead of 

class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):

you may use:

class ShpProjectClass(Folder, CatalogAware):

Item, Persistent and Implicit already are base clases of Folder.

-- 
Maciej Wisniowski
___
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 run multiple query in an Z sql method

2007-03-09 Thread Maciej Wisniowski
>> If I understood you're telling me that begin and commit statements are
>> "redundant".
> 
> No in this case they would be an error.
> 
>> Sometimes conflicts are not correctly managed by ZTM (no rollbacks in db)
> 
> Examples? Which bug reports?
Stored procedures implementation in DCOracle2 (original implementation)
under some conditins may cause that behaviour (no rollback). I've
written about this on Zope-db
(http://permalink.gmane.org/gmane.comp.web.zope.general/56435).

But this is very specific thing possibly
connected with a bit strange (at last for me) Stored procedures
implementation in DCOracle2 (they're resource managers itself) and
AFAIR they're using other resource managers. I've solved this by
changing ZOracleDA Stored Procedures to behave similarly to
ZSQLMethods.

Another thing is that Zope database adapters usually use volatile
attributes and as Dieter Maurer told me (on zope-db) under
some (very specific) conditions (AFAIR subtransaction commit or
something like that) this may cause connection object stored in
volatile attribute to disappear during request.

-- 
Maciej Wisniowski
___
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] No space left on device

2007-03-09 Thread Maciej Wisniowski
 
> Where? I added this line to zopectl and rebooted:
> TMPDIR="/usr/local/zope/tmp"
> (usr has plenty of space) but it didn't help.

TMPDIR="/usr/local/zope/tmp"
export TMPDIR

also there is df -h command that shows free space
on devices, you may use this to observe how it
changes while importing etc.

-- 
Maciej Wisniowski
___
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 not install ZMySQLDA

2007-03-08 Thread Maciej Wisniowski

> I already change the permission.
> 8 drwxrwxrwx   4 zope zope  4096 Mar  7 22:13 .python-eggs
>
> The result is the same. I completely lost?
And what with /home/zope permissions?

You may also try to set PYTHON_EGG_CACHE variable to a 
different folder. 
I've never had such problems so I can't help too much.
Try to search the web for this problem, you'll possibly
find something.

-- 
Maciej Wisniowski

___
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 not install ZMySQLDA

2007-03-08 Thread Maciej Wisniowski
Send your emails also to the zope list, please.

There were questions about this recently (not sure if it was here
or on Zope3s list.

Message says that you have to set proper permissions to the .pyton-eggs
folder, so just do it (give write access to everybody or something like
that).

-- 
Maciej Wisniowski

> Hi,
> 
> The contorl panel showed as following:
>  Zope Version
> (Zope 2.9.6-final, python 2.4.4, linux2)
> Python Version
> 2.4.4 (#1, Mar 5 2007, 20:29:49) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)]
> System Platform
> linux2
> SOFTWARE_HOME
> /opt/Plone-2.5.2/lib/python
> ZOPE_HOME
> /opt/Plone-2.5.2
> INSTANCE_HOME
> /opt/Plone-2.5.2/zeocluster/client1
> CLIENT_HOME
> /opt/Plone-2.5.2/zeocluster/client1/var
> Network Services
> ZServer.HTTPServer.zhttp_server (Port: 8080)
> 
> Process Id
> 4060 (-1277957200)
> Running For
> 14 hours 44 min 36 sec
> 
> 
> Path of my installed ZMySQLDA is:
> 
> client1]# ls -las /opt/Plone-2.5.2/zeocluster/client1/Products/ZMySQLDA
> total 196
> 8 drwxr-xr-x   4 plone wheel  4096 Mar  7 22:28 .
> 8 drwxrwxr-x  50 plone root   4096 Mar  7 15:01 ..
> 8 -rw-r--r--   1 plone wheel   397 Mar  7 15:01 browse.dtml
> 8 -rw-r--r--   1 plone wheel  1756 Mar  7 15:01 CHANGES.txt
> 8 -rw-r--r--   1 plone wheel  2451 Mar  7 15:01 connectionAdd.dtml
> 8 -rw-r--r--   1 plone wheel  1310 Mar  7 15:01 connectionEdit.dtml
> 16 -rwxr-xr-x   1 plone wheel  8804 Mar  7 15:01 DABase.py
> 12 -rw-r--r--   1 root  root   6643 Mar  7 22:28 DABase.pyc
> 12 -rw-r--r--   1 plone wheel  6090 Mar  7 15:01 DA.py
> 8 -rw-r--r--   1 plone plone  3169 Mar  7 15:03 DA.pyc
> 16 -rw-r--r--   1 plone wheel 11946 Mar  7 15:01 db.py
> 16 -rw-r--r--   1 plone plone  8640 Mar  7 15:03 db.pyc
> 8 -rw-r--r--   1 plone wheel45 Mar  7 15:01 DEPENDENCIES.txt
> 8 drwxr-xr-x   2 plone wheel  4096 Mar  7 15:01 help
> 8 drwxr-xr-x   2 plone wheel  4096 Mar  7 15:01 icons
> 12 -rw-r--r--   1 plone wheel  4351 Mar  7 15:01 __init__.py
> 8 -rw-r--r--   1 plone plone   906 Mar  7 15:03 __init__.pyc
> 8 -rw-r--r--   1 plone wheel  1220 Mar  7 15:01 README.txt
> 8 -rw-r--r--   1 plone wheel   202 Mar  7 15:01 table_info.dtml
> 8 -rw-r--r--   1 plone wheel15 Mar  7 15:01 VERSION.txt
> [EMAIL PROTECTED] client1]#
> 
> 
> The event.log has an erro :
> 
> 2007-03-08T13:40:57 ERROR Zope Couldn't install ZMySQLDA
> Traceback (most recent call last):
>  File "/opt/Plone-2.5.2/lib/python/OFS/Application.py", line 755, in
> install_product
>global_dict, global_dict, silly)
>  File "/opt/Plone-2.5.2/zeocluster/client1/Products/ZMySQLDA/__init__.py",
> line 91, in ?
>import DA
>  File "/opt/Plone-2.5.2/zeocluster/client1/Products/ZMySQLDA/DA.py", line
> 92, in ?
>from db import DB
>  File "/opt/Plone-2.5.2/zeocluster/client1/Products/ZMySQLDA/db.py", line
> 89, in ?
>import _mysql
>  File "build/bdist.linux-i686/egg/_mysql.py", line 7, in ?
>  File "build/bdist.linux-i686/egg/_mysql.py", line 4, in __bootstrap__
>  File "/opt/Plone-2.5.2/Python-2.4.4
> /lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py",
> line 799, in resource_filename
>return get_provider(package_or_requirement).get_resource_filename(
>  File "/opt/Plone-2.5.2/Python-2.4.4
> /lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py",
> line 1228, in get_resource_filename
>self._extract_resource(manager, self._eager_to_zip(name))
>  File "/opt/Plone-2.5.2/Python-2.4.4
> /lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py",
> line 1249, in _extract_resource
>real_path = manager.get_cache_path(
>  File "/opt/Plone-2.5.2/Python-2.4.4
> /lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py",
> line 880, in get_cache_path
>self.extraction_error()
>  File "/opt/Plone-2.5.2/Python-2.4.4
> /lib/python2.4/site-packages/setuptools-0.6c5-py2.4.egg/pkg_resources.py",
> line 846, in extraction_error
>raise err
> ExtractionError: Can't extract file(s) to egg cache
> 
> The following error occurred while trying to extract file(s) to the Python
> egg
> cache:
> 
>  [Errno 13] Permission denied: '/home/zope/.python-eggs'
> 
> The Python egg cache directory is currently set to:
> 
>  /home/zope/.python-eggs
> 
> Perhaps your account does not have write access to this directory?  You can
> change the cache directory by setting the PYTHON_EGG_CACHE environment
> 
> How can I correct it ? Thanks.
> 
> - J
___
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] Iteration Over Non-sequence

2007-03-08 Thread Maciej Wisniowski
> but it throws this error which ends with "Iteration over non-sequence".
> Well, the folder from which it's supposed to select a
> quote holds nothing but a sequential number
> of page templates (named 1, 2, 3...).
> What am I doing wrong?
Possibly you're reading your error traceback wrong way.
It says about:
Expression: standard:'here/en-us/quotes/?number/macros/quote'

and there is nothing about
global number here/quotes/randomNumber

So check first if you're looking in the right place.

-- 
Maciej Wisniowski
___
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 not install ZMySQLDA

2007-03-08 Thread Maciej Wisniowski
> Any suggestion?
What is /opt/Plone-2.5.2/zeocluster? Is this zeo server or zeo client in
your installation?
You should copy your ZMySQLDA to Products/ folder of your zope instance
(zeo client). I suppose you've copied this to zeo server.
To see your's instance path go to Control Panel in Zope Management
Interface.

After copying restart Zope and in ZMI go to ControlPanel/Products and
see if your product is there and if it is not broken. You may also check
event.log of your instance if something goes wrong.

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-07 Thread Maciej Wisniowski

> Sorry, I push the wrong button when I reply
>
> I'll try your configuration, but
> - where are files stored? (I dont't see server B in your post)
Read http://www.infrae.com/products/tramline
There is description where files are stored

> - it seems I'll lose Zope User Restrictions
Possibly not. This is application server that decides if user
is allowed to upload/download file (by setting proper headers).

-- 
Maciej Wisniowski

___
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 connection in script

2007-03-07 Thread Maciej Wisniowski
> how to create a database connection in a script python
This is your third (or more) thread about this during few hours!
Ask a specific questions and be patient please.

In general seems that you have no idea how it all works.

So my advice is:
1. Read abour basics of relational database connectivity in zope
2. Go to your portal folder via ZMI and create database
connection to your RDBMS
3. Still in ZMI create ZSQLMethods you need
4. In your product just call these ZSQLMethods via their id's like
result = self.mymethod1()


If this works then you may:
1. Change addform of your product to be able
to select specific database connection from the list
of available connections. Your product won't have
hardcoded connection id.
2. Create ZSQLMethods in your product as typical objects.

Instead of using ZSQLMethods you may use:

context.db_conn_id.db.query('YOUR QUERY HERE')

as Robert Rottermann suggested.

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-07 Thread Maciej Wisniowski
>
> I don't understand your paste.
> I'll try to describe better my situation
>
> - server A with Apache(80) and a rewrite rule to Zope(8080)
> - server B with a shared folder "storage" - *without any webserver*
> - server C with MS SQL Server - *without any webserver* - connected
> with ZODBC
> - firewall that send any incoming connection for www.mydomain.it to
> server A when protocol is http or https
> - in every server is active a ZOPEUSER (local administrator) with the
> same password.
>
> An incoming request to download will cause:
> - server A ask server C for filename
> - server A ask server B for file (using LocalFS object that stay in
> ZODB linked to server B's shared folder)
>
> I really can't understand how implement the same process using Apache
> for file storage.
Please stay on zope list too!

I've never used tramline, but after reading
short description on their page seems that you'll have simpler
configuration:
 - server A with Apache(and tramline) and a rewrite rule to Zope(8080)
 - server C with MS SQL Server - *without any webserver* - connected
with ZODBC
 - firewall that send any incoming connection for www.mydomain.it to
server A when protocol is http or https

In general seems that instead of real, large files, app server receives
only small
files that contain only unique identifiers of these real ones. Real
files are handled
by tramline and stored in specific filesystem folders.

When someone requests a file for download, application server sets
special header that
contains unique file identifier and this causes that tramline will
return real, big file to the
browser.

Upload similarly uses headers to allow or disallow uploading.

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-07 Thread Maciej Wisniowski
>
> I want to use localfs instead of Apache becouse:
> 1) upload is done by web too
tramline supports uploads and downloads

> 2) upload/download operations cause db operation (files names and
> descriptions are stored in sql server)
With tramline: "The only thing the appserver sees is a unique identifier
of the uploaded file".
I don't know whether it is a file name, but seems that while
uploading/downloading you
may do some writes into db.

Good luck!

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-07 Thread Maciej Wisniowski

> Looking LocalFS specs I find the issue:
>
> This version of LocalFS takes advantanges of Zope 2.7.1
> <http://www.zope.org/Members/hewei/zoperpms/zope2.7> 's new
> /filestream_iterator/ feature and is believed to server large files
> better than before. However, my initial testing showed that *it still
> doesn't prevent the whole file being loaded into memory*. When I
> opened a URL pointing to a mpg file served by LocalFS, the file was
> loaded into memory and then immediately freeed twice.
>
> I think that's the problem... load 300Mb into memory Maybe I look
> for other fs products.
AFAIK it uses tempfile for serving such files. This allows
Zope resources to be not blocked while returning big
amounts of data. Although creation of tempfile or something
like that (I'm not sure how this works in details) may still be slow.

In general serving static files is best done by servers like Apache and
I think this shouldn't be done by application server like Zope (possibly
until it has blobs support).

I don't understand why you can't use tramline. It may be connected
with zope easily. It gives you very fast filesystem storage. Even more,
seems for me that it is designed to do exacly what you're asking for.
You say that tramline may help you after resolving zope issues, but I don't
get it... By using tramline you will have no files in Zope (ZODB or LocalFS)
so you will have no problem to eliminate. But maybe I missed something
in your's use case.

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-07 Thread Maciej Wisniowski

> Large files aren't store in ZODB but in a shared folder connected with
> LOCALFS. Maybe Zope load a file in zodb before begin the download?
> (Are there other storage product that work only in zope - without plone?)
> Tramline is an Apache add-on but my problem still remain without
> Apache so this product can help me after  I resolved the Zope issue.
I think that if you'll use tramline you'll have no 'Zope issue' anymore.

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-06 Thread Maciej Wisniowski
> What about railorad: http://www.infrae.com/products/railroad
I meant tramline: http://www.infrae.com/products/tramline

-- 
Maciej Wisniowski
___
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] Download Large Files in Zope

2007-03-06 Thread Maciej Wisniowski
> I've just installed Zope 2.8 with Apache 2 and I made a download library (a 
> CMS site is too much for me and I can't find a simple "download area" 
> product, so I've done it!)
What about railorad: http://www.infrae.com/products/railroad

> How can i manage downloads & uploads?
In general it is bad idea to hold and serve large files directly from
ZODB. This should be done by Apache etc.

-- 
Maciej Wisniowski
___
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] Resizing Images In Page Templates

2007-03-04 Thread Maciej Wisniowski

>> Hmm. I have it working on the server from which 
>> I am moving to another server. I didn't build the code.
>> But it sure does work just fine.
>> Sorry. Not nonsense. Anyone else have any ideas?
> Ehm... but this code is a nonsense or rather, you made
> a mistake when you've written previous e-mail
> 
> 
OK, I thinked again about this. This may work :)
You may have object with id 'myimage.jpg' with resize
method, and it may be referenced this 'hardcoced' way.


-- 
Maciej Wisniowski
___
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: ImportError: cannot import name base_hasattr

2007-03-04 Thread Maciej Wisniowski
>> Take a look at pathes in your traceback:
>>
>> /usr/local/www/zope/278/lib/python
>> /usr/local/zope/278/lib/python
>>
>> /usr/local/zope/instance1/Products
>>
>> Why there are two different(!) lib/python/ folders?
> I see the problem! And I know what caused it. So I rebuilt Zope from source 
> and tried again. Unfortunately, I got the same_darn_error, just without the 
> "www" dir:
In general it still seems to me that you have two
"...Products/CMFPlone/utils.py" in your system.
Try to search your filesystem for utils.py.

Have you tried debugging via zopectl like
I suggested in previous email?

-- 
Maciej Wisniowski
___
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] Resizing Images In Page Templates

2007-03-04 Thread Maciej Wisniowski

> Hmm. I have it working on the server from which 
> I am moving to another server. I didn't build the code.
> But it sure does work just fine.
> Sorry. Not nonsense. Anyone else have any ideas?
Ehm... but this code is a nonsense or rather, you made
a mistake when you've written previous e-mail



It is plain html.

something like:



may do something 'dynamic'.

-- 
Maciej Wisniowski

___
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: ImportError: cannot import name base_hasattr

2007-02-28 Thread Maciej Wisniowski
> from Products.CMFPlone.utils import base_hasattr
> ImportError: cannot import name base_hasattr
> 
> CMFPlone/utils.py has a class named base_hasattr, so what's the problem?
You might try this (I'm not sure if this works with Zope 2.7):

run /usr/local/zope/instance1/bin/zopectl

on zopectl prompt enter:

zopectl> debug

and when you'll see python prompt write:

>>> import Products.CMFPlone
>>> print Products.CMFPlone


and check what path you have there.

-- 
Maciej Wisniowski
___
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: ImportError: cannot import name base_hasattr

2007-02-28 Thread Maciej Wisniowski
> Maciej Wisniowski recently responded something to the effect of that I should 
> take a look at my PYTHONPATH and gave me the address for subscribing to Plone.
> Thank you. I subscribed and posted to Plone, but after a day have received no 
> response :(
> I looked at my PYTHONPATH, as per your suggestion, but it seemed to be in 
> order. Furthermore, if it were not correct, how could I pull up Zope in any 
> case? I can launch Zope, I just have a problem with the below-mentioned 
> product installation (and maybe others after it).
I'm not sure but seems that you have some mess in your directories (or
this is because of hardcoded paths in your .pyc files).

Take a look at pathes in your traceback:

/usr/local/www/zope/278/lib/python
/usr/local/zope/278/lib/python

/usr/local/zope/instance1/Products

Why there are two different(!) lib/python/ folders?

-- 
Maciej Wisniowski
___
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: Exporting portal member data to csv

2007-02-27 Thread Maciej Wisniowski

> * Module ZPublisher.Publish, line 115, in publish
> * Module ZPublisher.mapply, line 88, in mapply
> * Module ZPublisher.Publish, line 41, in call_object
> * Module Products.ExternalMethod.ExternalMethod, line 225, in __call__
>   __traceback_info__: ((,), {}, None)
> * Module C:\Program Files\Plone 2\Data\Extensions\export.py, line
>   15, in createcsv
>
What code do you have in export.py, especially what is in line 15?

-- 
Maciej Wisniowski
___
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] ImportError: cannot import name base_hasattr

2007-02-27 Thread Maciej Wisniowski
> This really should go to the Plone list, but seeing as how I can't hit 
> their site from either of my browsers, how can I subscribe to
> the list?
plone.org works fine for me.
You can subscribe to plone-users list at:
https://lists.sourceforge.net/lists/listinfo/plone-users

Maybe you have something wrong with your PYTHONPATH.

-- 
Maciej Wisniowski
___
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] Large jumps of memory use increase, and seeking overall understanding of memory use

2007-02-25 Thread Maciej Wisniowski
> This is a bit like clutching at straws. You're doctoring the symptoms,
> hoping that some things may not be loaded into memory. It's not a real
> solution. Memory-hungry applications will remain memory-hungry, cached
> or not.
I'm just trying to do something, just like Jean does. You're convincing
us that we have to live with Plone's memory appetite and that only
reasonable optimization is to buy more memory? Sometimes this is not
a solution, but maybe your'e right. I don't know this side of Plone
(yet :) ).

One more thing. There is a setting in zope.conf that says about
cache size. It is used with ZEO setups. Maybe it is worth looking at
how big value it is set to.

-- 
Maciej Wisniowski
___
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] Large jumps of memory use increase, and seeking overall understanding of memory use

2007-02-25 Thread Maciej Wisniowski
> Now I will again admit to some overall experience, with even HTTP, so
> correct me if I'm wrong: Without squid, I can either cache objects in
> a Zope memory cache or in browser caches using headers (that's part of
> what CacheFu helps to configure). However, neither of those prevents
> Zope from entirely stopping to get requests for cached content. For
> memory cached content, it will just be served faster and without
> requiring to access the ZODB, but it will look the same in the access
> log, and for browser cached content, everything will still have to be
> loaded every time a browser is opened anew or when a force reload is
> requested.
> 
> Once Squid is up, then I do expect to see a lot fewer requests to Zope.
> 
> Am I missing something major here?
For me, you're absolutely right.
I didn't mean to stop Zope from getting any requests. I just wonder
if repeadetly touching a big amount of objects (css, js, images)
may cause consuming a big amount of memory.

> P.S. Just so you guys don't think that I am a complete newby, I did
> realize for example that I needed to add some templates by hand to a
> CacheFu rule, to what was being cached by default, to account for the
> "Composite Page" Plone product I am using (the templates for the
> "slots" were not being cached and caused significant performance
> issues).
I said sorry if I'm telling something obvious :)

-- 
Maciej Wisniowski
___
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] Large jumps of memory use increase, and seeking overall understanding of memory use

2007-02-25 Thread Maciej Wisniowski
> Serving from cache still means they need to be touched at least once to
> get them into the cache, and (in case of normal caching behavior) they
> will be touched again once the cached record expires. 
Yes, right. I tried to write this with 'always':
"not served (always) directly by Zope/Plone instance" :)

> Caching will not
> make any difference to memory behavior I'd say.
I'm not expert here, so I might be wrong but AFAIK
Zope instance loads 'touched' objects from ZODB into cache.
Each ZODB connection has its own cache, so having object
touched more than once may cause it is loaded to more than one
cache.

The same will possibly be with multiple ZEO clients. External
cache will save them from being touched (sometimes even once).

ZODB connections cache is cleaned sometimes, so it should
flush objects that are old and possibly save some memory then.

I don't know whether amount of memory used because of above is huge
enough to cause described problem. It's just a though.

Feel free to correct me if I'm wrong.

-- 
Maciej Wisniowski



___
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] Large jumps of memory use increase, and seeking overall understanding of memory use

2007-02-25 Thread Maciej Wisniowski
I've not seen whole thread so sorry if I missed something.

> there were requests for our
> front page and apparently everything that accompanies it in Plone,
> i.e. the Plone scripts.jss, the style sheets, bunch of icon gifs,
> image thumbs the logo.jpg, etc. 
Maybe this is your specific configuration for tests, or something that
you are aware of (if so then sorry for telling you something obvious)
but in general things like css, js, images should be cached and not
served (always) directly by Zope/Plone instance. Properly
set up caching is a incredible performance boost. If you have no
caching then serving all this stuff from zope may also cause bigger RAM
usage as all these objects are read into memory by Zope when they're
'touched'.

-- 
Maciej Wisniowski
___
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] Moodle and Zope SSO.

2007-02-19 Thread Maciej Wisniowski
>> I'm trying to implement a script like the one shown below but it seems 
>> too tricky and it does not work. Has anybody implemented this kind of 
>> sso with zope and moodle or whatever?
We're using Zope and PHP apps with SSO build with use of CAS. Works
good. For zope you'll find CAS4PAS authentication plugin for PHP
I don't remember how it is called. CAS itself is java based application.

-- 
Maciej Wisniowski
___
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

2007-02-13 Thread Maciej Wisniowski
javi, please, STAY on the mailing list!

> i put this in a new extractCredentials but it don´t work:
Again... what 'don't work' means? Raises exception?

Have you tried to debug your code? Maybe try to use pdb?
AFAIR there is a nice tutorial about using pdb with plone.
I think this should help you a lot in understanding what
happens in PAS and your plugin.

And one more thing. I'm not aware of plone issues here
so there may be something different because of this.

-- 
Maciej Wisniowski


___
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

2007-02-13 Thread Maciej Wisniowski

> this is my plugin. i want to authenticatedCredentials take credentials
> and validate these credentials if user exists in acl_users .
> ExtractCredentials take login and password from Form and it send that
> information to authenticatedCredentials, so i start like a Member.
> Now, it don´t work fine. I want to sustitute methods
> extractCredentials from  credentials_cookie_auth and
> authentificatedCredentials from source_users.
> i don´t know what to do in this sense
>
OK, this is more sensible now, but why do you need your own
plugin for this? Standard CookieAuthHelper and ZODBUserManager
plugins are not enough for your use case?


Seems that your problem (that you start like a Member
but after clicking somewhere else you're unauthenticated) is
because of code in extract credentials.
What happens there? Credentials are extracted from request.
So, if you have __ac_name  and __ac_password in the request you're
authentictated. When you're visiting another url, there is no __ac_name
and __ac_password in request anymore, so you become unauthenticated.
Right? So you have to store somewhere information about sucessful login.
Solution might be the code I've sent you in previous mail.
After authentication with __ac_name and __ac_password from
the request it stores data in session. Then, on another pages
session is checked for credentials and... you should be still
authenticated. Another solution is to just use CookieAuthHelper
which stores data in cookies.

This is first part. You have credentials. Second thing is to
compare them with users stored in ZODB (that what ZODBUserManager
is doing...)

-- 
Maciej Wisniowski


___
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

2007-02-13 Thread Maciej Wisniowski

> i did it, but it don´t work,
Because this code has no sense this way.
You're just storing and retrieving data from session.
What do you suppose this will do...

Try something like:

def extractCredentials(self, request):
creds = {} 
   
session = self.REQUEST.SESSION
creds = session.get('_key', None)

if creds:
return creds

login = request.get('__ac_name', '')
if login:
   # Look in the request for the names coming from the login form
   login = request.get('__ac_name', '')
   password = request.get('__ac_password', '')
   if login:
   creds['login'] = login
   creds['password'] = password
   if creds:
   creds['remote_host'] = request.get('REMOTE_HOST', '')
   try:
   creds['remote_address'] = request.getClientAddr()
   except AttributeError:
   creds['remote_address'] = request.get('REMOTE_ADDR', '')
   session.set('_key', creds)
   return  creds
   return None

You should use protected class (like in CAS4PAS) to store credentials
in session. Also you should think how it is supposed to work and what
should be done in extractCredentials and what in authenticateCredentials
functions, etc.

So far this code checks if there is object in session and if so then it
extracts
credentials from this object, if no, then it tries to extract credentials
from request.
You should now validate these credentials with something (eg. RDBMS),
possibly in authenticateCredentials function.

-- 
Maciej Wisniowski
___
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

2007-02-13 Thread Maciej Wisniowski

> In session object, but i don´t know how to do it.
> Can you help me please
Please stay on list.

Something like:

session = self.REQUEST.SESSION
session.set('_key', credentials)

to retrieve data:

creds = session.get('_key', None)

So after proper authentication you may store object with
user name etc. in session and later just check if it is there.
If so, then user is authenticated...
In general this is how CAS4PAS plugin works.

-- 
Maciej Wisniowski

___
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

2007-02-13 Thread Maciej Wisniowski

> Sorry my english, I am spanish boy
> When i put a user and password in login form, my user become Member,
> but when my user want to go somewhere in portal, user session
> dissapear and I go like Anonymous user.
> Can i fixed that??
Maybe store credentials in session object or in cookies?

-- 
Maciej Wisniowski

___
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

2007-02-13 Thread Maciej Wisniowski

> i did a plugin for authenticated and extractCredentials, but it don´t
> save session so it is how if user isn´t validate.
> Can i save session for user authenticated?
What do you mean by 'save session'?

-- 
Maciej Wisniowski

___
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 access via ZEO

2007-02-07 Thread Maciej Wisniowski

> Well, the home attribute cannot be changed using the manage_changeProperty
> since it is not exactly a property of the object.
> I tried that bt did not work..
Isn't this possible to set this attribute with extenal method for
example?

> Any way of putting an object back in ZODB?
What do you mean by 'back in zodb'? back from where?

> As to causing the pain the script would be useful if users can take a copies 
> of
> the main dbs and use copies of their own products.
I have no idea what you're talking about. You say that you want to
copy data.fs between few zope intantces with different set of products?

Which class(?) has 'home' attribute? What do you mean by changing
location of products and what are products for you?

-- 
Maciej Wisniowski

___
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] Limiting access to a Zope Site

2007-02-03 Thread Maciej Wisniowski
> You're still expressing an opinion about what's "preferrable" as a
> statement of fact.
Your'e right. I was wrong about 'preferred way'. Someone may find
copying data.fs good and workable for his use case.

-- 
Maciej Wisniowski
___
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] Limiting access to a Zope Site

2007-02-03 Thread Maciej Wisniowski
> So where is your *real* problem? Export/import works fine,
> we have tools like ZSyncer, we have ZEO...something you're missing?
It is not my problem. I just pointed that copying data.fs between
instances is not only and not preferrable way to distribute application
versions among zope instances.

-- 
Maciej Wisniowski
___
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] Limiting access to a Zope Site

2007-02-03 Thread Maciej Wisniowski
>> I'm not sure how it is in Plone but I don't believe in moving data.fs :)
> 
> (Un)fortunately the age of inquisition is over and you must somehow live
> with your misbelief :-)
But this sentence was about application lifecycle...
I meant that I don't believe that it is typical to
distribute new version of application between
Zope instances by copying data.fs. Is this misbelief?

In general OP asked about securing Zope sites. One way is
to create proper environment with few Zope instances e.g.
developement, test, production and more if someone needs
(for example I have internal and external test instances).
To move application between these environments I'm using
copying (via SVN) zope products and exported .zexp files.

-- 
Maciej Wisniowski

___
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] Limiting access to a Zope Site

2007-02-02 Thread Maciej Wisniowski

> There should be no problems copying/moving a Data.fs file from one
> zope instance to another, especially if both instances are running the
> same version of Zope!
Technically no but it is really strange and I believe bad (if not
impossible)
way to distribute application among dev, test, production environments...

For me there should of course be another developement Zope instance
(and test instance and more), but application should be moved between
instances by 'copying' changed Products or exporting changed files/folders
from ZODB (.zexp files), or something like that.

I'm not sure how it is in Plone but I don't believe in moving data.fs :)

-- 
Maciej Wisniowski


>
> Jonathan [the other]
> ___
> 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 )


[Zope] Re: UserFolder

2007-02-01 Thread Maciej Wisniowski
> I want to sustitute authentificateCredentials for this plugin i made.
> It take users from ZODB and validate if user exists and so user can
> login in Plone.
Isn't this default functionality??

I've looked at plone and I see it uses PlonePas. I have only some
experiences with plain PAS and I'm not sure how PlonePas works.

You may want to ask about this on Plone mailing list, and (before)
look at this list archives.

I've found two links for you:

http://plone.org/documentation/tutorial/borg/writing-a-custom-pas-plug-in/view?searchterm=plonepas
http://plone.org/events/conferences/seattle-2006/presentations/presentation.pdf/view

I haven't read this but I hope this will help you.


-- 
Maciej Wisniowski

___
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] User Folder

2007-02-01 Thread Maciej Wisniowski

>security.declarePrivate('authenticateCredentials')
>def authenticateCredentials(self, credentials):
>""" Authentication Part """
>login = credentials.get('login', '')
>password = credentials.get('password', '')
>return login, login
>
> it work bad, it start with everything i put on username and password,
> it don´t validate if user exist. How can i do it???
I don't understand what you're doing.
Can describe your use case, please?

So far I know that you want to 'validate if user exists',
but where are your users defined? RDBMS? ZODB?
You should have plugin that implements:
IUserAdderPlugin interface. What plugin is this
in your environment?

Take a look at plugins/ZODBUserManager.

This plugin has three attributes:
self._user_passwords = OOBTree()
self._login_to_userid = OOBTree()
self._userid_to_login = OOBTree()

and it stores user data there.

Then it's authenticateCredentials is able to
check if user with specific login and password
exists there.

-- 
Maciej Wisniowski
___
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] User Folder

2007-01-31 Thread Maciej Wisniowski
Please, stay on list :)

--repost
start
> hello and thanks for answer me.
> My  plugin don´t work. I try put a user and password in plone, but it
> say me Error.
> I put the same than CAS but it don´t work too.
> Any idea?Thanks
--repost
end
> My  plugin don´t work. I try put a user and password in plone, but it
> say me Error.
And the 'Error' is ... !?

I'm not sure but isn't plone using modified version of PAS (Plone PAS)?
Maybe it is something because of that.

I've found plugin for plone that you may want to analyze:
http://plone.org/products/ip-range-pas-plugin.

In general what is your plugin supposed to do??

-- 
Maciej Wisniowski

___
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] User Folder

2007-01-31 Thread Maciej Wisniowski

>acl = self.getUserFolder() // Is this ok?
I think no.

Do you have any error tracebacks or what do you
mean by 'not working'?

Take a look at CAS4PAS plugin. It may
give you some clues.

-- 
Maciej Wisniowski
___
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] Referencing authenticated user

2007-01-30 Thread Maciej Wisniowski
> I need to  modify a Zope product to record the authenticated user
> executing a method.
>  
> How do I refer to the authenticated user ?
You may try:
self.REQUEST.AUTHENTICATED_USER

-- 
Maciej Wisniowski
___
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 Timeout Troubles

2007-01-25 Thread Maciej Wisniowski
> I'm guessing that yes, Zope is using session cookies in this setup.
> Unfortunately, the people who did the original configuration and setup
> are no longer with my company, so I can't ask directly. How would I be
> able to tell if it's set one way or another? I certainly see nothing
> about cookie auth in the zope.conf file. 
This is done by your acl_users. I don't know what kind of User folder
you're using. You may see this by going to acl_users folder in ZMI and
on the top you should see something like:
'Pluggable User Folder at /path/to/acl_users'

where 'pluggable user folder' is name of your acl_users product.

Depending of what UserFolder (acl_users) you use it may be (or may not
be) possible to configure it to not to use cookies.

Another solution might be to use session hooks (script that is called
when user session expires) to logout the user or you may use different
UserFolder, eg. PAS.

-- 
Maciej Wisniowski
___
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 Image For Form Verification

2007-01-25 Thread Maciej Wisniowski
> Does anyone if there is a product (specifically for zope) for creating a
> "captcha" image to verify that an actual human is submitting a form?
> 
> I am using zope 2.8.1 with python 2.3.5 on a windows server.  I am
> currently looking into this:
> 
> http://captchas.net/sample/python/
AFAIK there is such product for Plone, you may want to take a look at
this.

-- 
Maciej Wisniowski
___
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 Timeout Troubles

2007-01-25 Thread Maciej Wisniowski
> I've looked at the debugging page in the control panel, but it doesn't
> tell me anything I recognize as useful.
Are you sure that your authentication uses session? Maybe it uses
cookies? Try to set variable in the session on one page and display this
on the other one. Then wait for 15-20 minutes and see what happens.

Another thing that may cause this is session-resolution-seconds setting
in your zope.conf - this affect session timeout value.

-- 
Maciej Wisniowski
___
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   >