[Zope-dev] Zope Tests: 5 OK

2007-12-14 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Dec 13 12:00:00 2007 UTC to Fri Dec 14 12:00:00 2007 UTC.
There were 5 messages: 5 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Dec 13 20:53:01 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-December/008791.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Dec 13 20:54:32 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-December/008792.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Dec 13 20:56:02 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-December/008793.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Dec 13 20:57:32 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-December/008794.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Dec 13 20:59:02 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-December/008795.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 )


[Zope-dev] Re: zopeproject and external apidocs

2007-12-14 Thread Philipp von Weitershausen

Christophe Combelles wrote:

Hi,

When creating a buildout with zopeproject, the site.zcml puts the package
registration before the apidoc registration:


  include package=${package} /

  !-- Remove this reference to disable the APIDoc tool.
   You should do this for production --
  include file=apidoc.zcml /


This means that the bookchapters of some added packages (such as z3c.*) 
will
never show up in the apidoc, because the meta:provides feature=apidoc 
/ will

be located **after** all the  zcml:condition=have apidoc

I suggest to move the include file=apidoc.zcml / on the top of the 
site.zcml

by default.


Thanks for the suggestion. Can you please file a bug report at 
https://launchpad.net/zopeproject. Thanks.

___
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] Runaway processes

2007-12-14 Thread Chris Withers

Andreas Jung wrote:





About 6 months to 1 year ago, I have read reports about
experiments on using Zope directly from mod_python in the Zope mailing
list.


Since Zope provides a WSGI interface you can run Zope within almost all
WSGI-enabled enviroment.


Am I right in thinking this is exactly the kind of use case for Repoze?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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] zopeproject and external apidocs

2007-12-14 Thread Christophe Combelles

Hi,

When creating a buildout with zopeproject, the site.zcml puts the package
registration before the apidoc registration:


  include package=${package} /

  !-- Remove this reference to disable the APIDoc tool.
   You should do this for production --
  include file=apidoc.zcml /


This means that the bookchapters of some added packages (such as z3c.*) will
never show up in the apidoc, because the meta:provides feature=apidoc / will
be located **after** all the  zcml:condition=have apidoc

I suggest to move the include file=apidoc.zcml / on the top of the site.zcml
by default.


Christophe

___
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] Configuring PAU - Should it be this hard?

2007-12-14 Thread kevin gill
I spent approximately a weeks work (spread over a month) to get the PAU
configured with my PostgreSQL database.

When I look at what I am doing now, it seems very complicated. Please have
a look at the following and let me know if I am doing it the hard way.

This may also be helpful for anyone trying to achieve the same result.

Here is my notes:




Notes on Setting up an external authentication system for Zope3
===

I use an external database to store my data.


1.  My Security Model
=

I have three types of users (principal), members, casting directors and
administrators. The login information (login name, password and roles) are
stored in a relational database. I am migrating a Zope 2 system
exUserFolder based solution.

The Zope3 concept of a role is different from the Zope2 concept. In Zope3,
roles are bundles of permissions only. The user (principal) side of the
functionality is provided by groups.

I configure my security rules in the code using permissions, and I bundle
these permissions for logical users using role ZCML statements.

In the Zope ZMI I configure a PAU with three groups. I map my users
(principals) to the groups from the database. In the Zope ZMI I use the
grant tab in the [top] folder to map the roles to permissions.

Thus my relationships are:

principals - grouped mapped to groups in database
groups - mapped to roles in grant at root (ZMI)
roles - mapped to permissions in ZCML

2.  Configuring PAU
===

I wrote three plugins for the PAU to get this configuration to work.

1.  I wrote a PrincipalFolder. The PrincipalFolder provides authentication
for the principals. It also provides lists of principals for Rotterdam
UI.

2.  I wrote a Group. The Group maps a single group to the members of that
group.

3.  I wrote a GroupFolder. The default GroupFolder caches the data in the
Group. To update the default GroupFolder you have to trigger events.
The external database updates do not trigger events so this model has
to be replaced.

I have to do the following configurations:

1.  In the manage site - default folder create a PAU.

2.  Configure the credentials plugin. For now I use :
'Zope Realm Basic-Auth (a utility)' and
'No Challenge if Authenticated (a utility)'

3.  I select the PAU Plugins tab.
I create my principal Folder
I go back to the PAU Configure Tab and add my Principal Folder to
the Authenicator Plugins

5.  I select the PAU Plugins tab
I create my group folder
I select the new group folder
I add three new group objects. The object name maps to the 'role' on
my database

6.  I go back to the PAU Configure Tab
I add the new group folder to my Authenticator Plugins

7.  I select the registration tab.
I register the PAU

8.  I go the the [top]
I select the grant tab
I use this to grant the configured roles to the new groups

9.  I edit the page template and add in the following to print out the
logged in person information:

bDeveloper Info:/bbr
Context: span tal:replace=nocall: context/span br
Logged in user: span tal:replace=request/principal/id/span br
Groups: span tal:replace=request/principal/groups/span br

10. I login with the user from the database. The groups should be
displayed in the developer info block.

Issues
==

This solution requires a second database call to get the group after the
Principal has been configured. I may have to cache when I tune the system.

I have a prefix on the user. The user ids map to prefix + the database
user id. The principal prefix is hard coded in the group folder to
generate compatible zope principal ids.

___
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] new FAQ entry: please review before I add it

2007-12-14 Thread Christophe Combelles

how do I automatically create some needed object at application startup?

Do it by subscribing to IDatabaseOpenedWithRootEvent (from zope.app.appsetup)

Example code:

@adapter(IDatabaseOpenedWithRootEvent)
def CreateMyContainer(event):
conn = event.database.open()
root = conn.root()['Application']
if 'mycontainer' not in root:
root['mycontainer'] = MyContainer()
transaction.commit()
conn.close()

Then register this subscriber in your configure.zcml:
subscriber handler=myapp.CreateMyContainer /
___
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] new FAQ entry: please review before I add it

2007-12-14 Thread Marius Gedminas
On Fri, Dec 14, 2007 at 07:29:59PM +0100, Christophe Combelles wrote:
 how do I automatically create some needed object at application startup?

 Do it by subscribing to IDatabaseOpenedWithRootEvent (from 
 zope.app.appsetup)

 Example code:

 @adapter(IDatabaseOpenedWithRootEvent)
 def CreateMyContainer(event):
 conn = event.database.open()
 root = conn.root()['Application']

I would use ZopePublication.root_name instead of hardcoding
'Application' here.  Or maybe reuse getInformationFromEvent from
zope.app.appsetup.bootstrap, although it smells like an internal
function.

 if 'mycontainer' not in root:
 root['mycontainer'] = MyContainer()
 transaction.commit()
 conn.close()

 Then register this subscriber in your configure.zcml:
 subscriber handler=myapp.CreateMyContainer /

Marius Gedminas
-- 
niemeyer I'm wondering why we have defineChecker() defined twice with exactly
   the same implementation under zope.security.checker...
niemeyer Is it some kind of high-availability system? :-)
-- #zope3-dev


signature.asc
Description: Digital signature
___
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] new FAQ entry: please review before I add it

2007-12-14 Thread Christophe Combelles

Fred Drake a écrit :

On Dec 14, 2007 3:48 PM, Marius Gedminas [EMAIL PROTECTED] wrote:

Or maybe reuse getInformationFromEvent from
zope.app.appsetup.bootstrap, although it smells like an internal
function.


It does, but you wouldn't be the first to use it outside it's module.  :-)


Actually, wouldn't it be nice (and logical) to transmit the root folder along 
with the event?


It would be easier:

def CreateMyContainer(event):
root = event.root
(...)

Though it would require to add an attribute to IDatabaseOpenedWithRootEvent
But that wouldn't hurt a lot...




  -Fred



___
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] new FAQ entry: please review before I add it

2007-12-14 Thread Fred Drake
On Dec 14, 2007 3:48 PM, Marius Gedminas [EMAIL PROTECTED] wrote:
 Or maybe reuse getInformationFromEvent from
 zope.app.appsetup.bootstrap, although it smells like an internal
 function.

It does, but you wouldn't be the first to use it outside it's module.  :-)


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
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] new FAQ entry: please review before I add it

2007-12-14 Thread Benji York

Christophe Combelles wrote:
Actually, wouldn't it be nice (and logical) to transmit the root folder along 
with the event?


+1
--
Benji York
Senior Software Engineer
Zope Corporation
___
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] Appending to a file via manage_edit?

2007-12-14 Thread Chris Withers

Andreas Jung wrote:



Sorry, but that's a pretty uncommon usecase. If you upload a file you're 
basically interested to store/replace it as a whole. That's how OFS.File

is implemented.


Although it probably would be *that* hard to hack an external method or 
some such that *did* update the PData chain in the right way ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   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] Using zoperoot.misc_.MyProduct

2007-12-14 Thread Peter Bengtsson
As far as I can see, an advantage with attaching static stuff to
OFS.misc_.MyInstalledProduct is that it becomes available globally
which makes sense to avoid loading a different icon URL for each www
icon in the ZMI of a product. Makes sense also for example if you have
one Zope with 10 different instances because then there's just one on
/misc_/MyProduct/screen.css to cache and download for the browser if
you've placed a static file there called that.

A drawback seems to be that errors happening in
/misc_/MyProduct/static-content isn't reported in the error_log. This
makes it hard to spot bugs in objects in there and, more commonly,
NotFound errors.

Is there anything I can do about that or should I not expect so much
and instead use the instance?

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] urlparse equivalent

2007-12-14 Thread David Bear
I wanted to use urlparse to handle manage some url rewrites but it's
not importable.. Is there any zope functional equivelent that I can
use to parse urls?

-- 
David Bear
phone:  602-496-0424
fax:602-496-0955
College of Public Programs/ASU
University Center Rm 622
411 N Central
Phoenix, AZ 85007-0685
 Beware the IP portfolio, everyone will be suspect of trespassing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] urlparse equivalent

2007-12-14 Thread peter
there isn't but you can write an External Method in pure python.

On 14/12/2007, David Bear [EMAIL PROTECTED] wrote:
 I wanted to use urlparse to handle manage some url rewrites but it's
 not importable.. Is there any zope functional equivelent that I can
 use to parse urls?

 --
 David Bear
 phone:602-496-0424
 fax:  602-496-0955
 College of Public Programs/ASU
 University Center Rm 622
 411 N Central
 Phoenix, AZ 85007-0685
  Beware the IP portfolio, everyone will be suspect of trespassing
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )



-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] urlparse equivalent

2007-12-14 Thread David Bear
On Fri, Dec 14, 2007 at 09:16:54PM +, [EMAIL PROTECTED] wrote:
 there isn't but you can write an External Method in pure python.
 
 On 14/12/2007, David Bear [EMAIL PROTECTED] wrote:
  I wanted to use urlparse to handle manage some url rewrites but it's
  not importable.. Is there any zope functional equivelent that I can
  use to parse urls?

Thanks for all the responses.

I'm a little suprised that there isn't anything like urlparse
functionaly in zope. I would think parsing urls would be a fairly
common chore. Which leads me to think that I may be thinking
completely wrong about what I want to accomplish.

Perhaps I can get closer to what I want if I better understand the
names 'here' and 'context'.  I am writing a python script and I want
to get the path to where the script lives -- not from where it was
called. But I don't see that 'here' is a name available to script.
Yet, 'context' doesn't seem to do what I want.

what is the easiest way to get the path to where a script lives?


-- 
David Bear
phone:  602-496-0424
fax:602-496-0955
College of Public Programs/ASU
University Center Rm 622
411 N Central
Phoenix, AZ 85007-0685
 Beware the IP portfolio, everyone will be suspect of trespassing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] urlparse equivalent

2007-12-14 Thread Jonathan
If you print out the contents of 'container.REQUEST' you will find a lot of 
helpful pre-set url-related vars.


Jonathan

- Original Message - 
From: David Bear [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Cc: zope Zope@zope.org
Sent: Friday, December 14, 2007 6:06 PM
Subject: Re: [Zope] urlparse equivalent



On Fri, Dec 14, 2007 at 09:16:54PM +, [EMAIL PROTECTED] wrote:

there isn't but you can write an External Method in pure python.

On 14/12/2007, David Bear [EMAIL PROTECTED] wrote:
 I wanted to use urlparse to handle manage some url rewrites but it's
 not importable.. Is there any zope functional equivelent that I can
 use to parse urls?


Thanks for all the responses.

I'm a little suprised that there isn't anything like urlparse
functionaly in zope. I would think parsing urls would be a fairly
common chore. Which leads me to think that I may be thinking
completely wrong about what I want to accomplish.

Perhaps I can get closer to what I want if I better understand the
names 'here' and 'context'.  I am writing a python script and I want
to get the path to where the script lives -- not from where it was
called. But I don't see that 'here' is a name available to script.
Yet, 'context' doesn't seem to do what I want.

what is the easiest way to get the path to where a script lives?


--
David Bear
phone: 602-496-0424
fax: 602-496-0955
College of Public Programs/ASU
University Center Rm 622
411 N Central
Phoenix, AZ 85007-0685
Beware the IP portfolio, everyone will be suspect of trespassing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.17.2/1184 - Release Date: 
12/14/2007 11:29 AM




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   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: urlparse equivalent

2007-12-14 Thread Sean Fulmer

David Bear wrote:

what is the easiest way to get the path to where a script lives?


script.absolute_url()

or

script.absolute_url_path()

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

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