[Zope-Annce] Zope 3 Boot Camp early bird registration deadline near

2007-02-13 Thread Chris Calloway
The early bird registration deadline for Camp 5 and the BBQ Sprint is 
Wednesday, February 14:


http://trizpug.org/boot-camp/camp5/

You can save $50 by registering early. Registration ends Friday March 2.

--
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
___
Zope-Announce maillist  -  Zope-Announce@zope.org
http://mail.zope.org/mailman/listinfo/zope-announce

 Zope-Announce for Announcements only - no discussions

(Related lists - 
Users: http://mail.zope.org/mailman/listinfo/zope

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


[Zope-dev] Re: Interest in AdvancedQuery and/or ManagableIndex?

2007-02-13 Thread whit

Philipp von Weitershausen wrote:

Dieter Maurer wrote:

yuppie wrote at 2007-2-3 11:44 +0100:

...
Unfortunately integrating a product into the Zope core means more 
than just adjusting the coding style:


- As already mentioned in this thread, monkey patches and code like 
fixPluginIndexes.py have to be resolved. AdvancedQuery contains a 
monkey patch for CMF - that should not be shipped with Zope core.


fixPluginIndexes fixed (maybe meanwhile resolved) bugs in
Products.PluginIndexes.common.util.parseIndexRequest.

The mentioned CMF monkey patch gives the CatalogTool the new method
evalAdvancedQuery, provided CMFCore is installed.
I do not see why this monkey patch should not be applied.

I am sure that I want to be able to use AdvancedQuery even
with a CatalogTool, if both are installed.


Monkey patches should be avoided when they can. I think that's something 
we don't need to discuss. Integrating a product into Zope is the perfect 
opportunity to get rid of monkey patches and consolidate the fixes into 
the main product lines. Therefore, the CMF should rather grow that 
method itself than having it patched in by Zope.


Either way, I think this point is mute since all the Plone community 
really wants is a public subversion repository with access to the code 
and control over the code, which I would think is asking for a lot 
(you've indicated that reformatting the code would mean you wouldn't be 
available for maintenance anymore).


Whoever is asking for AdvancedQuery and other things to be in 
svn.zope.org or even Zope 2 itself ought to weigh the amount of 
maintenance work against the little potential (not actual!) benefits. I 
think we can leave everything as it is and if Plone needs it in an svn 
repo, heck, why not do vendor imports? (not in svn.zope.org, of course, 
since the contributor agreement forbids that)




I'm not sure this warranted this much discussion or getting panties in a 
bunch, but maybe something was learned here.  As phrased early on, it 
would be *nice* for those of us using svn:externals to manage certain 
build processes to have AdvancedQuery in svn somewhere(not life or death).


did we reach some sort of conclusion in all this?  Having a AQ egg would 
be the same difference imho.


I would be happy to help maintain AdvancedQuery(though I hardly feel 
qualified), though I would prefer to leave it in a form that Dieter 
would actually want to work on it.


What might be more worthwile is to package AQ up to be an egg(I 
volunteer for this).  That way we could manage the dependency that 
way(zope could too if it chose to ship with AQ), dieter could continue 
maintaining AQ, and everything would be peachy.


one last point re: Zope: From a marketing perspective(to parrot slinkp), 
I would think Zope 2 would want to include AdvancedQuery since it is a 
go-to answer for lots of how do I do sqlish query X in the ZODB type 
questions.  Granted, hurry.query and the z3 catalogs have similar 
capabilities, but AQ works right now with existing z2 catalogs.


-w


--

-- d. whit morriss --
- senior engineer, opencore -
- http://www.openplans.org  -
- m: 415-710-8975   -

If you don't know where you are,
 you don't know anything at all 



Dr. Edgar Spencer, Ph.D., 1995

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

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


Re: [Zope-dev] Extrenal method unable to run the os.popen() or os.system() commands

2007-02-13 Thread Dieter Maurer
Ridzwan Aminuddin wrote at 2007-2-9 17:53 -0800:
Oh yes, i forgot to mention that in my code i did use the absolute paths to my 
java .jar file as you can see i my code below, the absolute path to the 
Extensions directory is in the variable homedir. I also set my classpath to 
point to the folder just in case..

Relative paths do work -- but, they are (as always) relative to
the current working directory.
And unless you (or some buggy extension) have changed it, the
current working directory will be Zope's instance home.

 ...
homedir = os.getcwd()
homedir = homedir + /Extensions

command = cd +homedir
os.popen(command)

The popen above still has no effect. You should remove
code without effect as it clutters the source.

command = java -jar + '' + homedir + / + ActiveLearningTools.jar + ' ' 
+
prepArticles  test.txt
os.popen(command)

This will look for ActiveLearningTools.jar in
instancehome/Extensions. But the output file test.txt
will be put into instancehome (as this name is still relative).


Have you already told us in what way your ExternalMethod fails?
Do you get an exception? Or is simply the output file not produced?
Or does the output file remain empty?



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


Re: [Zope-dev] Extrenal method unable to run the os.popen() or os.system() commands

2007-02-13 Thread Ridzwan Aminuddin
Hi!

Thanks for your reply. Honestly, I'm not sure why the external method is 
skipped. I've tried several methods to debug and changed my python code to see 
the effects.


I wrote another Java Jar. called test.jar that when executed prints out a line 
to stdout and creates a text file to the same directory that the jar is placed 
in. I placed this jar file as well as the external method python file in the 
Extensions directory /var/lib/zope2.8/instance/plone-site/Extensions 

This is how the external method looks like:

def runYahooSearch2(self):

import os

homedir = os.getcwd()
# on my machine homedir is /var/lib/zope2.8/instance/plone-site
command = java -jar + homedir + /Extensions/test.jar
whatisread = os.popen(command).read()
print whatisread

This external method is triggered in my DTML code. I've created other external 
methods
before so i know i've done it right.. but the os.system() command for java -jar 
just
doesn't seem to work. I've tried to use other commands such as ls which works 
perfectly:

command = ls
whatisread = os.popen(command).read()
print whatisread

This will sucessfully list out all the files/folders in the working directory.

Its just this java -jar which does not execute at all... I know it doesn't 
execute at all
cos it doesn't output a file or print the string. If i manually type out into 
the terminal
:

 java -jar /var/lib/zope2.8/instance/plone-site/Extensions/test.jar

it works perfectly, it prints out the string as well as outputs a text file 
into the directory the jar file is in.
But using the external method given above just gives me a blank output.

I've also tried popen2:

from popen2 import popen2
outputTGT, inputTGT = popen2(command)
print outputTGT.readline()

and still the jar is simply skipped and not executed.

Is there any other method i can use instead of os.popen os.popen2 and os.system 
to run this command line
statement?... or any way i can catch the exception which is being thrown when 
the java
-jar is attempting to run ( if there is any in the firt place) ? Maybe this 
would help  in the debugging process.

Thanks in advance!

Cheers

Wan



 -Original Message-
 From: [EMAIL PROTECTED]
 Sent: Mon, 12 Feb 2007 21:24:24 +0100
 To: [EMAIL PROTECTED]
 Subject: Re: [Zope-dev] Extrenal method unable to run the os.popen() or
 os.system() commands
 
 Ridzwan Aminuddin wrote at 2007-2-9 17:53 -0800:
 Oh yes, i forgot to mention that in my code i did use the absolute paths
 to my java .jar file as you can see i my code below, the absolute path to
 the Extensions directory is in the variable homedir. I also set my
 classpath to point to the folder just in case..
 
 Relative paths do work -- but, they are (as always) relative to
 the current working directory.
 And unless you (or some buggy extension) have changed it, the
 current working directory will be Zope's instance home.
 
 ...
 homedir = os.getcwd()
 homedir = homedir + /Extensions
 
 command = cd +homedir
 os.popen(command)
 
 The popen above still has no effect. You should remove
 code without effect as it clutters the source.
 
 command = java -jar + '' + homedir + / + ActiveLearningTools.jar
 + ' ' +
 prepArticles  test.txt
 os.popen(command)
 
 This will look for ActiveLearningTools.jar in
 instancehome/Extensions. But the output file test.txt
 will be put into instancehome (as this name is still relative).
 
 
 Have you already told us in what way your ExternalMethod fails?
 Do you get an exception? Or is simply the output file not produced?
 Or does the output file remain empty?
 
 
 
 --
 Dieter


KEEP SPYWARE OFF YOUR COMPUTER - Protect your computer with Spyware Terminator!
Visit http://www.spywareterminator.com/install and find out more!
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 7 OK

2007-02-13 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Mon Feb 12 12:00:00 2007 UTC to Tue Feb 13 12:00:00 2007 UTC.
There were 7 messages: 7 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.6 Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:03:38 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007244.html

Subject: OK : Zope-2.6 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:05:09 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007245.html

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:06:39 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007246.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:08:09 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007247.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:09:39 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007248.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:11:09 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007249.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Feb 12 21:12:39 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-February/007250.html

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


Re: [Zope-dev] Extrenal method unable to run the os.popen() oros.system() commands

2007-02-13 Thread Jonathan


- Original Message - 
From: Ridzwan Aminuddin [EMAIL PROTECTED]

To: Dieter Maurer [EMAIL PROTECTED]; zope-dev@zope.org
Cc: zope-dev@zope.org
Sent: Monday, February 12, 2007 10:41 PM
Subject: Re: [Zope-dev] Extrenal method unable to run the os.popen() 
oros.system() commands




Hi!

Thanks for your reply. Honestly, I'm not sure why the external method is 
skipped. I've tried several methods to debug and changed my python code to 
see the effects.



I wrote another Java Jar. called test.jar that when executed prints out a 
line to stdout and creates a text file to the same directory that the jar 
is placed in. I placed this jar file as well as the external method python 
file in the Extensions directory 
/var/lib/zope2.8/instance/plone-site/Extensions


This is how the external method looks like:

def runYahooSearch2(self):

import os

homedir = os.getcwd()
   # on my machine homedir is /var/lib/zope2.8/instance/plone-site
command = java -jar + homedir + /Extensions/test.jar
whatisread = os.popen(command).read()
print whatisread

This external method is triggered in my DTML code. I've created other 
external methods
before so i know i've done it right.. but the os.system() command for 
java -jar just
doesn't seem to work. I've tried to use other commands such as ls which 
works perfectly:


command = ls
whatisread = os.popen(command).read()
print whatisread

This will sucessfully list out all the files/folders in the working 
directory.


Its just this java -jar which does not execute at all... I know it doesn't 
execute at all
cos it doesn't output a file or print the string. If i manually type out 
into the terminal

:

java -jar /var/lib/zope2.8/instance/plone-site/Extensions/test.jar

it works perfectly, it prints out the string as well as outputs a text 
file into the directory the jar file is in.

But using the external method given above just gives me a blank output.

I've also tried popen2:


For executing system commands I have used  commands.getstatusoutput(...) 
in external methods with no problems.



Jonathan

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

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


Re: [Zope-dev] Extrenal method unable to run the os.popen() or os.system() commands

2007-02-13 Thread Dieter Maurer
Ridzwan Aminuddin wrote at 2007-2-12 19:41 -0800:
 ...
This external method is triggered in my DTML code. I've created other external 
methods
before so i know i've done it right.. but the os.system() command for java 
-jar just
doesn't seem to work. I've tried to use other commands such as ls which 
works perfectly:

   command = ls
   whatisread = os.popen(command).read()
   print whatisread

Thus, you have found out that the problem is not with ExternalMethod
or popen in principle but with java calls done this way.

I would expect that java cannot be executed (maybe, because the
PATH variable is different when run from Zope and java is not
on this PATH) or that java is executed but dislikes something
in the environment.

In both cases, I would expect some problem message on stderr.

Thus, I (in your place) would check how I could capture the stderr of
the popen process and carefully look at it.

One possibility would be to redirect stderr in the popen command
itself (...  /tmp/java.stderr).


In principle, it is possible to start java from an ExternalMethod
with os.system and friends.
We do this all the time.



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


Re: [Zope-dev] Re: Interest in AdvancedQuery and/or ManagableIndex?

2007-02-13 Thread Wichert Akkerman
Previously Dieter Maurer wrote:
 You fetch it from my Zope page and put it into a subversion
 repository (perferably on a vendor branch) of your choice.

Hanno imported it at http://svn.plone.org/svn/collective/AdvancedQuery
two days ago. We'll try to keep that synchronised with your work.

Wichert.

-- 
Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-PAS] merge r70450 to 1.4 branch?

2007-02-13 Thread Rob Miller

hi all,

i made a very small fix on the trunk some while ago to allow PAS to support 
image type properties on UserPropertySheets 
(http://svn.zope.org/PluggableAuthService/trunk/UserPropertySheet.py?rev=70450view=rev).


i forgot, however, to merge it onto the 1.4 branch at the time.  is this 
change minimal enough to make it onto the maintenance branch?


-r

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


[Zope-PAS] merge r70450 to 1.4 branch?

2007-02-13 Thread Rob Miller

gmane appears to be lagging... apologies if this comes through twice...

hi all,

i made a very small fix on the trunk some while ago to allow PAS to support
image type properties on UserPropertySheets
(http://svn.zope.org/PluggableAuthService/trunk/UserPropertySheet.py?rev=70450view=rev).

i forgot, however, to merge it onto the 1.4 branch at the time.  is this
change minimal enough to make it onto the maintenance branch?

-r

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


[Zope-PAS] Failure authorizing with PlonePAS and pubcookie

2007-02-13 Thread Michael Gilbert

Hello,

We are currently having problems trying to get authorization working 
with Plone 2.5.2, Zope 2.9.6, and Python 2.4.3 using pubcookie and a 
multi-plugin to communicate with pubcookie.  We've verified that 
pubcookie is working properly and that user names are getting passed on 
to Zope, but the right roles are not assigned to the deserving users.  
Below are the steps to repro the problem:


- Setup Zope instance for pubcookie plugin by following the steps listed 
under http://www.washington.edu/webinfo/case/zope/
- Setup two users, one of whom will need Manager privileges under the 
root acl_users ([ZopeSiteRoot]/acl_users/roles/manage_workspace), the 
second will need Manager privileges under a Plone site 
([ZopeSiteRoot]/plone/acl_users/portal_role_manager/manage_workspace).  
Users should not be listed under both the root acl_users and the Plone 
site acl_users.


* Scenario 1
 - Install the PubcookiePAS multiplugin by going to the root 
acl_users and clicking Pubcookie PAS Multiplugin from the dropdown menu 
and clicking Add.

 - Enter in a vaild id and name, along with the valid login page
 - Under the acl_users plugins 
(acl_users/plugins/manage_workspace), add the PubcookiePAS multiplugin 
to each of the Authentication, Challenge, Reset Credentials, and 
Extraction plugins.

* Expected behavior:
   When the plugin is functioning properly, users should be able to 
authenticate via pubcookie, zope admins should be able to modify all 
sites, and site admins should be able to modify the sites that they are 
have Manager priveleges for.

* Actual behavior:
   Zope admins are still able to modify all sites, but site admins 
lose all admin privileges for the sites they should be able to edit.


* Scenario 2**
- Instead of adding PubcookiePAS to the root acl_users, go to a 
site's acl_users folder and add it there.
- As above, enter in a valid id, name, and login page, and enable 
the plugin for Authentication, Challenge, Reset Credentials, and 
Extraction plugins.

* Expected behavior:
   Same as above - that both site admins and zope admins have full 
access to the sites under their control according to the roles given

* Actual behavior:
   Site admins are still able to modify their sites and access 
[SiteName]/manage, but zope administrators are no longer able to affect 
change in the site the PubcookiePAS plugin was installed under.  
(**Note: after this is done you'll need to remove the plugin from the 
site's acl_users with a manager under this site, since your zope admin 
will no longer be able to access it via the zmi.  Make sure you have a 
site administrator that you have access to before installing the plugin).


We feel that the proper way to install the plugin would be to follow the 
steps in scenario 1 - and in fact this at one point worked properly.


We've done some debugging of the issue but have been unable to come up 
with a definitive solution, and at the moment I seem to have hit a dead 
end in the code...  Traversal seems to follow

PluggableAuthService.validate( self, request, auth, roles=_noroles )
 - PluggableAuthService._findUser( plugins, user_id, login, request )
- ZODBRoleManager.getRolesForPrincipal( user, request )
   - ZODBRoleManager._principal_roles.get( principal.getId(), () )

The final call is on line 95 of ZODBRoleManager and returns an empty 
array instead of the Manager role as expected and hoped for.  That line is


 result = list( self._principal_roles.get( principal.getId(), () ) )

_principal_roles would seem to contain the roles for all users, but 
roles are only given for the context the PubcookiePAS is installed in 
(the root level acl_users folder).  For example, calling


 self._principal_roles.get('ValidRootManagerUser')

returns ('Manager', 'Owner').  However, calling

self._principal_roles.get('ValidSiteManagerUser')

returns () - an empty array.  The problem would seem to be that when 
self._principal_roles is populated it only adds users and roles from the 
zope root level acl_users folder, not from any of the nested Plone site 
acl_users folders.  Unfortunately, I seem to lose the trail about here 
and can't find where _principal_roles is definitively set.
I believe the solution should be that 
self._principal_roles.get('ValidSiteManagerUser') returns at the very 
least ('Manager') - any ideas on how to achieve this?



Thanks,
Michael Gilbert
Software Support Group, University of Washington

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


[Zope-PAS] Re: Failure authorizing with PlonePAS and pubcookie

2007-02-13 Thread Michael Gilbert

Thanks for responding.

The multi-plugin was written by Cris (cc'd above) here at UW.  The 
plugin isn't incredibly invasive, and in fact at one point it seemed to 
be working so I tend to assume that it may be a 
configuration/installation/human error.  If you'd like to take a look at 
it, I've copied a tarball and the extracted contents out to 
http://staff.washington.edu/mdgilb/ for perusal.  We've done a fair 
amount of debugging to the plugin and haven't found a blaring error yet, 
but it is possible we missed something.


The main problem that we seem to be having seems related to the context 
of the installation - if the plugin is installed at the zope root 
acl_users folder, only users listed in that folder with the manager role 
will have their permission reflected on all plone sites underneath.  If 
the plugin is installed under a plone site's acl_users folder, users 
with the manager role in that site have the proper permissions, but root 
level managers (ie zope admins) will have a limited set of rights - once 
the plugin is enabled for the final plugin type, trying to view all 
available plugin types again (/SiteName/acl_users/plugins) will result 
in a list of Undo options instead of the expected Plugin Types.


Thanks again,
Michael

Tres Seaver wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael Gilbert wrote:

 

We are currently having problems trying to get authorization working 
with Plone 2.5.2, Zope 2.9.6, and Python 2.4.3 using pubcookie and a 
multi-plugin to communicate with pubcookie.  We've verified that 
pubcookie is working properly and that user names are getting passed on 
to Zope, but the right roles are not assigned to the deserving users.  
Below are the steps to repro the problem:
   



Where is the multi-plugin coming from?  It is likely the source of your
problem.


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

iD8DBQFF0f5p+gerLs4ltQ4RAkFTAKCyC8Gfw2wR0FyxTzTJQQ+E/LqvqgCguzRC
hIDlyuokBOdb8F88yKkbJSM=
=iUx8
-END PGP SIGNATURE-
 



___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


[Zope-PAS] Re: Failure authorizing with PlonePAS and pubcookie

2007-02-13 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael Gilbert wrote:
 Thanks for responding.
 
 The multi-plugin was written by Cris (cc'd above) here at UW.  The 
 plugin isn't incredibly invasive, and in fact at one point it seemed to 
 be working so I tend to assume that it may be a 
 configuration/installation/human error.  If you'd like to take a look at 
 it, I've copied a tarball and the extracted contents out to 
 http://staff.washington.edu/mdgilb/ for perusal.  We've done a fair 
 amount of debugging to the plugin and haven't found a blaring error yet, 
 but it is possible we missed something.
 
 The main problem that we seem to be having seems related to the context 
 of the installation - if the plugin is installed at the zope root 
 acl_users folder, only users listed in that folder with the manager role 
 will have their permission reflected on all plone sites underneath.  If 
 the plugin is installed under a plone site's acl_users folder, users 
 with the manager role in that site have the proper permissions, but root 
 level managers (ie zope admins) will have a limited set of rights - once 
 the plugin is enabled for the final plugin type, trying to view all 
 available plugin types again (/SiteName/acl_users/plugins) will result 
 in a list of Undo options instead of the expected Plugin Types.

The plugin likely needs to check with the parent user folder, if any,
for role assignments, as well as looking in its own map.  Likewise for
group membership, if your roles are assigned to groups, rather than
directly to users.

In general, I would break apart the idea of group membership, which is
typically done globally (within the entire scope of the user folder),
from role assignment.  Mostly, I avoid doing global role assignment,
preferrning instead to grant roles to the groups as local roles.

I'm also pretty convinced that you don't really want or need more than
one user folder, in general at the root of the Zope database:  the
complexity caused by nesting user folders outweighs any benefit I've
ever identified.


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

iD8DBQFF0jyv+gerLs4ltQ4RAiFaAKCKJf897RMLV39yKlZoV0rlW/ANcACfYTUx
T34/GSvf/Olx+61okMeAA8k=
=/uRC
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


[Zope] user attributes

2007-02-13 Thread Alan

Dears,

I have in a external method

user = REQUEST.AUTHENTICATED_USER

And so I can get user.getUserName(), user.getAllGroupNames() but I
cannot find how to get user's full name and user's e-mail. Any idea?

Many thanks in advance.

Cheers,
Alan

--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] External Method unable to run Java jar executable using os.system()

2007-02-13 Thread Ridzwan Aminuddin
Hi,

I'm trying to run an external method that has a line that runs an os.system 
command to execute a Java .jar executable that simply outputs a text file as 
well as prints out a string.

I've saved the python script as well as the Java .jar executable in my 
Extensions folder:

/var/lib/zope2.8/instance/plone-site/Extensions/


Here is my Python script:

def runYahooSearch2(self):

import os

homedir = os.getcwd() 
# on my machine homedir is /var/lib/zope2.8/instance/plone-site
command = java -jar + homedir + /Extensions/test.jar  
whatisread = os.popen(command).read()
print whatisread

This external method is triggered in my DTML code. I've created other external 
methods before so i know i've done it right.. but the os.system() command for 
java -jar just doesn't seem to work. I've tried to use other commands such as:

os.popen(ls) and it works perfectly

Its just this java -jar which does not execute at all... I know it doesn't 
execute at all cos it doesn't output a file or print the string. If i manually 
type out into the terminal :

 java -jar /var/lib/zope2.8/instance/plone-site/Extensions/test.jar

it works perfectly
But using the external method given above just gives me a blank output.

I've also tried popen2:
 
from popen2 import popen2
outputTGT, inputTGT = popen2(command)
print outputTGT.readline()

and still the jar is simply skipped and not executed.

Does anyone know whats the cause and cure for this problem?... Or anynone knows 
any other method i can use instead of os.popen os.popen2 and os.system to run 
this command line statement?... or any way i can catch the exception which is 
being thrown when the java -jar is attempting to run ( if there is any in the 
firt place) ?

Anything would be highly appreciated!... Kinda in a fix right now!...

Thanks in advance!

Cheers

Wan
___
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] cpu load 99 percent a lot in plone evinironment

2007-02-13 Thread Robert (Jamie) Munro
Jens Vagelpohl wrote:
 
 On 9 Feb 2007, at 09:29, Marko Kruijer wrote:
 I do notice that my suspected page is slow, but that's a page
 template, and there is not very much out of the ordinary going on
 there. Just a loop in tal over a sql result set.
 
 Just a loop in tal over a sql result set can be extremely slow,
 depending on the size of your result set. You may not realize that every
 time you touch one of those resultset record objects the security
 machinery gets in the game to ensure the executing user is allowed to
 see the rendered result. This is true for every single field you're
 trying to show on the page.

I've been having similar speed problems with a page that loops through a
lot of SQL records. From what I can tell from the profiler, it is the
security machinery that is at fault.

 Workarounds I have used in this situation (eons ago) involved retrieving
 the resultset in trusted code (inside a filesystem product or an
 External Method) and converting it to a sequence of simple types, like a
 sequence of dictionaries, before handing it back to the page template.
 Those simple types don't cause security assertions and the rendering is
 sped up immensely.

There seems to be a built in method - .dictionaries() that does exactly
this. Unfortunatley, neither it, nor a simple external method I wrote to
 call my ZSQL methods seemed to help me.

Robert (Jamie) Munro

___
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] Migrating the OpenFlow project from Zope 2.7.x to 2.9.x (and 2.10.x)

2007-02-13 Thread Dieter Maurer
Marco Bizzarri wrote at 2007-2-10 21:33 +0100:
 ...
cb = self.zope.manage_copyObjects([self.of.id])
 ...
self.zope.manage_pasteObjects(cb)
new_of = getattr(self.zope, 'copy_of_'+self.of.id)
self.assertEquals(len(new_of.Catalog()),cataloged_items)
/code

Just for a little of further knowledge: OpenFlow creates a Catalog,
which is used to access all the data of the Workflow (processes,
instancess, workitems, etc.)

The assertion failing is the last one, because I get a length of 0 as
a result of the query of the catalog.

Can someone point me to differences between 2.7 and 2.9 in the
handling of the paste action?

I do not yet use Zope 2.9. Therefore, my answer is very hypothetical:

  In earlier versions, copying a catalog contained a bug:

The catalogued objects were twice in the catalog.
A first time because they have been copied with the catalog
itself and a second time due to the manage_afterAdd call
for the true object copy.

Maybe, OpenFlow contains some code to avoid this
catalog copying problem -- and maybe, the buggy behaviour
was fixed in Zope itself. Then, the correcting actions
of OpenFlow might do too much.



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


[Zope] session

2007-02-13 Thread javi lopez

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?
Thanks for your help!!!
___
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] External Method unable to run Java jar executable using os.system()

2007-02-13 Thread Andreas Jung



--On 12. Februar 2007 07:34:09 -0800 Ridzwan Aminuddin [EMAIL PROTECTED] 
wrote:



 java -jar
/var/lib/zope2.8/instance/plone-site/Extensions/test.jar

it works perfectly
But using the external method given above just gives me a blank output.

I've also tried popen2:

from popen2 import popen2
outputTGT, inputTGT = popen2(command)
print outputTGT.readline()

and still the jar is simply skipped and not executed.




You should see error messages on the console. Ensure
you are running Zope in the foreground (zopectl fg).

-aj

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


Re: [Zope] 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] cpu load 99 percent a lot in plone evinironment

2007-02-13 Thread Philip Kilner
Hi Robert (Jamie?),

Robert (Jamie) Munro wrote:
 I've been having similar speed problems with a page that loops through a
 lot of SQL records. From what I can tell from the profiler, it is the
 security machinery that is at fault.
 

I'm doing the same sort of stuff, and routinely have the same sorts of
problems.

Two other things that I've done that help are: -

- Use the database to handle pagination, such that a single page of data
is returned - Plone/Zope batching can be very slow with huge data sets
(which to be fair it was never designed for). This is easy with
PostgreSQL and there is a work around for SQL Server.

- Instead of simply embedding my dataset (sometimes multiple datasets)
in the page, use AHAH to pull in a panel of data into the existing page
as a pure Zope transaction. This makes the UI a lot more fluid by
avoiding multiple redundant Plone page loads (e.g. during pagination, or
when doing drill-down type navigation).

AHAH does not seem to be much discussed here - it's worth reading: -

http://microformats.org/wiki/rest/ahah

http://www.gizax.it/ahahsection/

(I have based my work on the script in the second link)

Short version: uses AJAX-like technique of rewriting the HTML using
JavaScript, but returns pure HTML as opposed to XML or JSON, so trivial
to implement, and can degrade gracefully.

HTH


-- 

Regards,

PhilK

'let's hear it for the vague blur'
___
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 javi lopez

2007/2/13, Maciej Wisniowski [EMAIL PROTECTED]:


 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



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


[Zope] Zope 3 Boot Camp early bird registration deadline near

2007-02-13 Thread Chris Calloway
The early bird registration deadline for Camp 5 and the BBQ Sprint is 
Wednesday, February 14:


http://trizpug.org/boot-camp/camp5/

You can save $50 by registering early. Registration ends Friday March 2.

--
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
___
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 javi lopez

i did it, but it don´t work,

def extractCredentials(self, request):
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 = self.REQUEST.SESSION
   session.set('_key', credentials)
   creds = session.get('_key', None)
   if creds is not None:
   return  creds

   return None

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


[Zope] strange image error

2007-02-13 Thread Oliver Petznick

aloha zopers.

i have a zope2.9 instance installed on a freebsd box - zope is  
installed out of the ports - python2.4 also. if i request a image  
bigger than about 100kb from the server it stops loading after some  
bytes and fires this error (it makes no difference if i use firefox2  
or wget..):


2007-02-13T12:12:28 ERROR ZServer uncaptured python exception,  
closing channel ZServer.HTTPServer.zhttp_channel connected  
80.190.201.39:63877 at 0xdc96bec channel#: 28 requests:  
(socket.error:(1, 'Operation not permitted') [/usr/local/lib/ 
python2.4/asynchat.py|initiate_send|219] [/usr/local/www/Zope29/lib/ 
python/ZServer/medusa/http_server.py|send|417] [/usr/local/lib/ 
python2.4/asyncore.py|send|332])


some hints would be cool

thanks in advance, oli

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


[Zope] External Method importing modules

2007-02-13 Thread Alan

Dear List,

I have an external method and now I developed I new module in a
separated file and then I am trying to make my external method to
import it but I am failing here. Where should place my module file in
order to be found by my external method?
I tried to place it in the same folder of my external method, but no success.

Any help would be very appreciated. Many thanks in advance.

Cheers,
Alan

--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] External Method importing modules

2007-02-13 Thread Andreas Jung



--On 13. Februar 2007 12:53:25 + Alan [EMAIL PROTECTED] wrote:


Dear List,

I have an external method and now I developed I new module in a
separated file and then I am trying to make my external method to
import it but I am failing here. Where should place my module file in
order to be found by my external method?
I tried to place it in the same folder of my external method, but no
success.


Since the module must be importable, it must be available in some location
as defined through sys.path or $PYTHONPATH. Check the Python docs for 
additional info on that topic.


-aj

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


Re: [Zope] External Method importing modules

2007-02-13 Thread Alan

Thanks Andreas, I am trying with:

if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)

where myPath should be '[Zope installation folder]/instance/import'.
So my question now is: is there a variable inside Zope which can
returns the 'import' path?

Many thanks in advance.

Cheers,
Alan

On 13/02/07, Andreas Jung [EMAIL PROTECTED] wrote:



--On 13. Februar 2007 12:53:25 + Alan [EMAIL PROTECTED] wrote:

 Dear List,

 I have an external method and now I developed I new module in a
 separated file and then I am trying to make my external method to
 import it but I am failing here. Where should place my module file in
 order to be found by my external method?
 I tried to place it in the same folder of my external method, but no
 success.

Since the module must be importable, it must be available in some location
as defined through sys.path or $PYTHONPATH. Check the Python docs for
additional info on that topic.

-aj




--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] External Method importing modules

2007-02-13 Thread Andreas Jung



--On 13. Februar 2007 13:10:17 + Alan [EMAIL PROTECTED] wrote:


Thanks Andreas, I am trying with:

if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)


What's the sense of this code? sys.path is usually *never* empty.
You should really look at the Python docs and learn where Python is looking 
by default for modules. Is is perfectly documented - python.org - 
documentation.


In addition you would like to check for the existence of an item in 
sys.path using


if myPath in sys.path:



-aj

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


Re: [Zope] External Method importing modules

2007-02-13 Thread Jonathan


- Original Message - 
From: Alan [EMAIL PROTECTED]

To: Andreas Jung [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Tuesday, February 13, 2007 8:10 AM
Subject: Re: [Zope] External Method importing modules



Thanks Andreas, I am trying with:

if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)

where myPath should be '[Zope installation folder]/instance/import'.
So my question now is: is there a variable inside Zope which can
returns the 'import' path?


You can easily check what's in your sys.path by having your external method 
return it.


Typically, the Extensions directory (where your external methods live) are 
not in the default path and need to be added to sys.path.(warning: be 
careful on how you do this or everytime your external method gets called it 
will add to the sys.path and will eventually cause you grief!).



Jonathan 


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


[Zope] Zope 3 Boot Camp early bird registration deadline near

2007-02-13 Thread Chris Calloway

The early bird registration deadline for Camp 5 and the BBQ Sprint is
Wednesday, February 14:

http://trizpug.org/boot-camp/camp5/

You can save $50 by registering early. Registration ends Friday March 2.

--
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599

___
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] External Method importing modules

2007-02-13 Thread Alan

Well, I did it:

from App.config import getConfiguration
extPath = getConfiguration().instancehome+'/Extensions'
if sys.path.count(extPath) == 0: sys.path.insert(0, extPath)

And it worked for what I wanted.

On 13/02/07, Alan [EMAIL PROTECTED] wrote:

On 13/02/07, Andreas Jung [EMAIL PROTECTED] wrote:
 What's the sense of this code? sys.path is usually *never* empty.
 You should really look at the Python docs and learn where Python is looking
 by default for modules. Is is perfectly documented - python.org -
 documentation.

 In addition you would like to check for the existence of an item in
 sys.path using

  if myPath in sys.path:

Dear Andreas and Jonathan, first a mistake: I want to access
'Extensions' folder as you mentioned Jonathan, not 'import'.

Andreas, I've done that, I can see several path there like
.../instance/Products/Sprout/src, .../lib/python/Zope2/Startup etc.,
but none for .../instance/Extensions.

I was hoping that I could get the path where 'Extensions' is because I
work with several zope installations in several platforms and I would
like to make my module independent of a variable inside its code that
should be manually adjusted for every situation.

And yes, I am aware about adding the path only once (that's why
there's a 'if') and then I avoid recursive insertions.

Cheers,
Alan

--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
http://www.bio.cam.ac.uk/~awd28




--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28

___
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] Z SQL Method properties

2007-02-13 Thread David VanKirk

Does anyone know of a way that I can write a script to traverse
through a folder of Z SQL Methods and find out the connection ID for
each?

Reason being, I have two connections objects for my ZSQL Methods to
use.  I'm trying to phase out the one and I'd like to write a script
to tell me which ZSQL Methods need to have their connection IDs switch
to the new connection object.  I'd hate to have to go through each one
by hand to find out.

Thank you.

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

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


Re: [Zope] Z SQL Method properties

2007-02-13 Thread Andrew Milton
+---[ David VanKirk ]--
| Does anyone know of a way that I can write a script to traverse
| through a folder of Z SQL Methods and find out the connection ID for
| each?

for o in container.objectValues(['Z SQL Method',]):
print o.id, o.connection_id

return printed

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


[Zope] Re: user attributes

2007-02-13 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alan wrote:
 Dears,
 
 I have in a external method
 
 user = REQUEST.AUTHENTICATED_USER
 
 And so I can get user.getUserName(), user.getAllGroupNames() but I
 cannot find how to get user's full name and user's e-mail. Any idea?
 
 Many thanks in advance.

Depends.  In a classic Zope user folder, there are no such properties at
all.  In a CMF / Plone site built against such a user folder, those
properties are normally kept in a separate store, the
'portal_memberdata' tool, and wrapped around the user folder's user
object.  In this case, you get the wrapped object via:

  from Products.CMFCore.utils import getToolByName
  mtool = getToolByName(self, 'portal_membership')
  if not mtool.isAnonymousUser():
  member = mtool.getAuthenticatedMember()
  email = member.email

In a PAS-driven site, the user object may have the properties you want
already, based on the configured plugins.


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

iD8DBQFF0ft1+gerLs4ltQ4RAg8wAJ4uz3Nr+mnJ88zUixHYibApdEFeHQCgsr58
chfGPI6fxhddDh0cm6DG2Qg=
=la6y
-END PGP SIGNATURE-

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


Re: [Zope] 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 )


[Zope] Re: External Method importing modules

2007-02-13 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alan wrote:
 Dear Andreas and Jonathan, first a mistake: I want to access
 'Extensions' folder as you mentioned Jonathan, not 'import'.
 
 Andreas, I've done that, I can see several path there like
 .../instance/Products/Sprout/src, .../lib/python/Zope2/Startup etc.,
 but none for .../instance/Extensions.
 
 I was hoping that I could get the path where 'Extensions' is because I
 work with several zope installations in several platforms and I would
 like to make my module independent of a variable inside its code that
 should be manually adjusted for every situation.
 
 And yes, I am aware about adding the path only once (that's why
 there's a 'if') and then I avoid recursive insertions.

I don't know if it helps, but $INSTANCE_HOME/lib/python is going to be
on your path by default.  Personally, I would put the
module-to-be-imported there, rather than trying to hack sys.path.


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

iD8DBQFF0fxD+gerLs4ltQ4RAhTVAKC6UCFmX/WPv1B2snREMTeoGEET4gCfaPIZ
O+ErLeWJIDZ5YIMkF7dtIF8=
=zSoJ
-END PGP SIGNATURE-

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


[Zope] Extract Files from ZODB

2007-02-13 Thread Carlosfocker
I have a ZODB that was being used by Plone to store files(Word documents,
Images, etc.).  Plone is no longer working. I want to extract (retrieve) the
files from the ZODB. Is this possible? If so, how is this accomplished. Note: I
cannot access Plone or anything in Plone because it is not working. I am looking
for a solution that involves working only with ZODB through Zope, not a
procedure that attempts to troubleshoot Plone.

___
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 Files from ZODB

2007-02-13 Thread Jonathan


- Original Message - 
From: Carlosfocker [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, February 13, 2007 1:25 PM
Subject: [Zope] Extract Files from ZODB



I have a ZODB that was being used by Plone to store files(Word documents,
Images, etc.).  Plone is no longer working. I want to extract (retrieve) 
the
files from the ZODB. Is this possible? If so, how is this accomplished. 
Note: I
cannot access Plone or anything in Plone because it is not working. I am 
looking

for a solution that involves working only with ZODB through Zope, not a
procedure that attempts to troubleshoot Plone.


If the documents were stored as 'Files' then you can do a search by 
meta-type:


for fileObj in container.objectValues('File'):
  do something with the file

You would need to recurse through your directory (folder) structure to get 
every file (unless they were stored in known folders).



Jonathan 


___
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] adding value to the path

2007-02-13 Thread Kate Legere

When I submit this: 

input name=branch/manage_editProperties:method type=submit
class=form-element value=Save Changes / 




It works very nicely.
I'd like the user to choose the page to amend so I have a select option to
choose the page (in this case the one named 'branch'

select size=3 width=100 name=pageName
dtml-in getParentNode().objectItems('DTML Document')  
dtml-if id() != 'index_html'
  dtml-if id() != 'editProperties'
 option value=dtml-var id dtml-var title_or_id/option
  /dtml-if
/dtml-if
 /dtml-in
   /select


And I think this ought to work.. but it doesn't...


input name=document.propForm.pageName.value+/manage_editProperties:method
type=submit class=form-element value=Save Changes / 

It does absolutely nothing.

How do I pass it the value to the input name?

Katie

___
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] adding value to the path

2007-02-13 Thread Jonathan


- Original Message - 
From: Kate Legere [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, February 13, 2007 3:38 PM
Subject: [Zope] adding value to the path




When I submit this:

input name=branch/manage_editProperties:method type=submit
class=form-element value=Save Changes / 




It works very nicely.
I'd like the user to choose the page to amend so I have a select option to
choose the page (in this case the one named 'branch'

select size=3 width=100 name=pageName
   dtml-in getParentNode().objectItems('DTML Document') 
   dtml-if id() != 'index_html'
 dtml-if id() != 'editProperties'
option value=dtml-var id dtml-var title_or_id/option
 /dtml-if
   /dtml-if
/dtml-in
  /select


And I think this ought to work.. but it doesn't...


input 
name=document.propForm.pageName.value+/manage_editProperties:method

type=submit class=form-element value=Save Changes / 

It does absolutely nothing.

How do I pass it the value to the input name?


You create a separate html input tag that gets the information you require 
from the user, eg


Enter Id:  input type=text name=id:UTF-8:string size=30 value=/


If you already have some information that you want to pass along to the 
receiving method (ie. this information does not come from user input) then 
use a hidden input:


input type=text name=id:UTF-8:string size=30 value=dtml-var 
someIdvar/



P.S.  i just couldn't let this go:


   dtml-if id() != 'index_html'
 dtml-if id() != 'editProperties'
option value=dtml-var id dtml-var title_or_id/option
 /dtml-if
   /dtml-if


is simpler as:


 dtml-if id() != 'editProperties' and id() !=index_html
option value=dtml-var id dtml-var title_or_id/option
 /dtml-if




Jonathan 


___
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: Extract Files from ZODB

2007-02-13 Thread Carlosfocker
Is that Python? Where should I be executing this code. Do I create a python
script? I'm not a python programmer.  If you can help guide help I would be
grateful.


___
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: Extract Files from ZODB

2007-02-13 Thread Jonathan


- Original Message - 
From: Carlosfocker [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, February 13, 2007 3:57 PM
Subject: [Zope] Re: Extract Files from ZODB


Is that Python? Where should I be executing this code. Do I create a 
python
script? I'm not a python programmer.  If you can help guide help I would 
be

grateful.


This code (from previous msg):

for fileObj in container.objectValues('File'):
  do something with the file

is python and can be executed in either a python script or an external 
method (depends on what you want to do with the file object once you have 
it).


You are going to have learn some python!


Jonathan


___
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] strange image error

2007-02-13 Thread Dieter Maurer
Oliver Petznick wrote at 2007-2-13 13:16 +0100:
aloha zopers.

i have a zope2.9 instance installed on a freebsd box - zope is  
installed out of the ports - python2.4 also. if i request a image  
bigger than about 100kb from the server it stops loading after some  
bytes and fires this error (it makes no difference if i use firefox2  
or wget..):

2007-02-13T12:12:28 ERROR ZServer uncaptured python exception,  
closing channel ZServer.HTTPServer.zhttp_channel connected  
80.190.201.39:63877 at 0xdc96bec channel#: 28 requests:  
(socket.error:(1, 'Operation not permitted') [/usr/local/lib/ 
python2.4/asynchat.py|initiate_send|219] [/usr/local/www/Zope29/lib/ 
python/ZServer/medusa/http_server.py|send|417] [/usr/local/lib/ 
python2.4/asyncore.py|send|332])

some hints would be cool

Maybe, your operating system log files contain some hints.

  Apparently, the socket (to be written to) was in a
  really strange state.



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


Re: [Zope] Re: Extract Files from ZODB

2007-02-13 Thread Jonathan


- Original Message - 
From: Jonathan [EMAIL PROTECTED]

To: zope@zope.org; Carlosfocker [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2007 4:05 PM
Subject: Re: [Zope] Re: Extract Files from ZODB




- Original Message - 
From: Carlosfocker [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, February 13, 2007 3:57 PM
Subject: [Zope] Re: Extract Files from ZODB


Is that Python? Where should I be executing this code. Do I create a 
python
script? I'm not a python programmer.  If you can help guide help I would 
be

grateful.


This code (from previous msg):

for fileObj in container.objectValues('File'):
  do something with the file

is python and can be executed in either a python script or an external 
method (depends on what you want to do with the file object once you have 
it).


You are going to have learn some python!


P.S.  you are also going to have to learn some Zope!


Jonathan 


___
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] External Method importing modules

2007-02-13 Thread Dieter Maurer
Alan wrote at 2007-2-13 13:10 +:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)

where myPath should be '[Zope installation folder]/instance/import'.
So my question now is: is there a variable inside Zope which can
returns the 'import' path?

Formerly, the ExternalMethod documentation suggested to
put such modules into SOFTWARE_HOME/Shared/your_company/

Nowadays (since Zope 2.7, I think), INSTANCE_HOME/lib/python
is a better place (with any structure you would like to use).
This folder is put on PYTHONPATH automatically. No need to fiddle
with it (I have already searched hours for problems caused by
runtime sys.path manipulations).



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


RE: [Zope] adding value to the path

2007-02-13 Thread Kate Legere
Thanks for the clean-up - I was trying  and not getting anywhere. 

That said, using the text field as an input method and then passing it on
doesn't work either.

 input name=id+/manage_editProperties:method type=submit
class=form-element value=Save Changes / 

If it helps - I'd like the user to be able to modify the properties of a
DTML Document that they choose from a single edit form. I'm fine if I
specify the path but I need them to add the page name to the path, hence the
addition before the /manage_editProperties:method

Katie

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 13, 2007 3:49 PM
To: Kate Legere; zope@zope.org
Subject: Re: [Zope] adding value to the path


- Original Message - 
From: Kate Legere [EMAIL PROTECTED]
To: zope@zope.org
Sent: Tuesday, February 13, 2007 3:38 PM
Subject: [Zope] adding value to the path



 When I submit this:

 input name=branch/manage_editProperties:method type=submit
 class=form-element value=Save Changes / 




 It works very nicely.
 I'd like the user to choose the page to amend so I have a select option to
 choose the page (in this case the one named 'branch'

 select size=3 width=100 name=pageName
dtml-in getParentNode().objectItems('DTML Document') 
dtml-if id() != 'index_html'
  dtml-if id() != 'editProperties'
 option value=dtml-var id dtml-var title_or_id/option
  /dtml-if
/dtml-if
 /dtml-in
   /select


 And I think this ought to work.. but it doesn't...


 input 
 name=document.propForm.pageName.value+/manage_editProperties:method
 type=submit class=form-element value=Save Changes / 

 It does absolutely nothing.

 How do I pass it the value to the input name?

You create a separate html input tag that gets the information you require 
from the user, eg

Enter Id:  input type=text name=id:UTF-8:string size=30 value=/


If you already have some information that you want to pass along to the 
receiving method (ie. this information does not come from user input) then 
use a hidden input:

input type=text name=id:UTF-8:string size=30 value=dtml-var 
someIdvar/


P.S.  i just couldn't let this go:

dtml-if id() != 'index_html'
  dtml-if id() != 'editProperties'
 option value=dtml-var id dtml-var title_or_id/option
  /dtml-if
/dtml-if

is simpler as:

  dtml-if id() != 'editProperties' and id() !=index_html
 option value=dtml-var id dtml-var title_or_id/option
  /dtml-if



Jonathan 


___
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] adding value to the path

2007-02-13 Thread Jonathan


- Original Message - 
From: Kate Legere [EMAIL PROTECTED]

To: 'Jonathan' [EMAIL PROTECTED]; zope@zope.org
Sent: Tuesday, February 13, 2007 4:51 PM
Subject: RE: [Zope] adding value to the path



Thanks for the clean-up - I was trying  and not getting anywhere.

That said, using the text field as an input method and then passing it on
doesn't work either.

input name=id+/manage_editProperties:method type=submit
class=form-element value=Save Changes / 

If it helps - I'd like the user to be able to modify the properties of a
DTML Document that they choose from a single edit form. I'm fine if I
specify the path but I need them to add the page name to the path, hence 
the

addition before the /manage_editProperties:method


If I was doing this I would have an html form that prompted the user to 
enter the property field data and prompted the user for the document to be 
modified (perhaps from a select list) and then passed all of this info to a 
python script (python script name is specified in the 'action' attribute of 
the html form stmt) which accessed the target DTML Document using 
restrictedTraverse and then modified the property fields using 
manage_changeProperties.



Jonathan


___
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-DB] Extract Files from ZODB

2007-02-13 Thread Carlosfocker
This seems like an easy question but I have been unable to find the answer.  How
do you extract files that have been uploaded into a ZODB. I have a problem with
the db and just want to pull out existing files.

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] Extract Files from ZODB

2007-02-13 Thread Maciej Wisniowski
 This seems like an easy question but I have been unable to find the answer.  
 How
 do you extract files that have been uploaded into a ZODB. I have a problem 
 with
 the db and just want to pull out existing files.
Doesn't 'Extract' option work? What is 'uploaded' and 'files' for you?
ZODB stores objects...

BTW. This list is for relational database connectivity and zope not for
ZODB issues.

-- 
Maciej Wisniowski
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db